Method and system for accelerating webpage access, gateway equipment and storage medium
The gateway device adaptively sends static resources according to the network quality of the terminal device, and the terminal device pre-caches resources, which solves the problem of low web access efficiency for office-type SaaS applications, and achieves a significant improvement in web page loading speed and improved user experience.
Patent Information
- Application Number
- CN202310190360.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2024-08-23
AI Technical Summary
The web page access efficiency of office-type SaaS applications is low, and there are access rates and delay problems. The existing technology cannot effectively improve web page access efficiency, especially when the network quality of different terminal devices is different.
The gateway device adaptively partitions the network quality requirements of different terminal devices, sends static resources to the terminal device, and the terminal device pre-caches static resources to improve web page access efficiency, avoid terminal devices analyzing user behaviors and increasing processing resource usage, and saves transmission time.
It significantly improves the loading speed of web pages, reduces the loading delay of pages, is suitable for different network environments, and improves user experience, especially in weak network environments, which can effectively accelerate web page loading.
Smart Images

Figure CN118540312A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, gateway device, system and readable storage medium for accelerating web page access. Background Art
[0002] As software as a service (SaaS) applications become increasingly popular, the use of office SaaS applications by users has also exploded. For example, users use office SaaS for remote online coordination or long-distance web access.
[0003] However, the current access experience of office SaaS applications is not satisfactory. When users access web pages through office SaaS applications, such as accessing online documents through office SaaS applications, they encounter problems such as low access speed and high latency.
[0004] How to improve the efficiency of web page access, especially the access efficiency of office SaaS applications, is an issue worthy of attention. Summary of the invention
[0005] The present application provides a method, a gateway device, a system, and a readable storage medium for accelerating web page access. In the solution provided by the embodiment of the present application, the gateway device adaptively distinguishes the specific needs of different end-side devices according to the network quality of the network where the end-side device is located, and sends all or part of the static resources to the end-side device. As a result, the end-side device first receives all or part of the static resources, and can pre-cache all or part of the static resources to improve the efficiency of web page access.
[0006] The first aspect of the embodiment of the present application provides a method for accelerating web page access, including: a gateway device receives an access request from a first end-side device to a first web page. It can be understood that the gateway device is triggered to execute the process of loading the first web page. Among them, the first end-side device initiates an access request to the first web page, which may be expressed in a variety of different ways in different scenarios: for example, in the scenario of accessing an online document, when the first end-side device obtains the file directory where the user opens the online document, it is regarded as the first end-side device initiating an access request to the online document. For another example, in the scenario of accessing a shopping website, the first end-side device obtains that the user will click on a link corresponding to a certain product, which is regarded as the first end-side device initiating an access request to the web page corresponding to the product. The gateway device obtains the network quality of the network where the first end-side device is located. The gateway device obtains the quality of the connection network between the gateway device and the first end-side device. The evaluation indicators of network quality include but are not limited to packet loss rate, delay or bandwidth. The embodiment of the present application does not limit the method used to detect network quality. The existing methods for detecting network quality can be adopted in the embodiments of the present application. Based on the network quality, the gateway device sends all or part of the static resources that constitute the first web page to the first end-side device. The static resources are fixed resources among all the resources that constitute the first web page. The solution provided by the first aspect is a solution that is led by the gateway device to execute web page acceleration. The terminal device does not need to analyze the user's behavior and analyze the links in the web page, and does not occupy additional processing resources of the terminal device. In addition, the solution provided by the embodiment of the present application sends static resources to the end-side device through the gateway device. Since it is not necessary to send the static resources to the end-side device through the server, the transmission time is saved, thereby achieving the purpose of accelerating the loading of the web page. In addition, considering that the network quality of the networks in which different terminals are located is different, in order to be able to adaptively distinguish the specific needs of different users, the solution provided by the embodiment of the present application is that the gateway device sends all or part of the static resources to the terminal device according to the network quality of the network in which the terminal device is located. As a result, the end-side device first receives all or part of the static resources, and can pre-cache all or part of the static resources to improve the efficiency of web page access.
[0007] In a possible implementation of the first aspect, before the gateway device receives the access request of the first end-side device to the first webpage, the method further includes: the gateway device receives the reply content of the server based on the access request of the second end-side device to the first webpage, and the reply content includes static resources. The gateway device stores the static resources. All the static resources constituting the first webpage may be sent by the server to the gateway device, or may be pre-configured on the gateway device, which increases the diversity of the solutions.
[0008] In a possible implementation manner of the first aspect, the first terminal side device and the second terminal side device are different terminal side devices. The first terminal side device and the second terminal side device may also be the same terminal side device.
[0009] In a possible implementation of the first aspect, the method further includes: the gateway device forwards the access request of the first end-side device to the first webpage to the server. The gateway device receives a dynamic resource, which is a reply content of the server based on the access request of the first end-side device to the first webpage, and the dynamic resource is other resources other than static resources in all resources constituting the first webpage. The gateway device transparently transmits the second dynamic resource to the first end-side device.
[0010] In a possible implementation of the first aspect, the gateway device receives the dynamic resource, including: the gateway device receives the dynamic resource sent by the server through the websocket protocol. The server sends the dynamic resource to the gateway device through the websocket protocol, which helps to speed up the sending rate of the dynamic resource, reduce the number of connections on the server side, and save wide area bandwidth.
[0011] In a possible implementation of the first aspect, the gateway device sends all or part of the static resources constituting the first webpage to the first end-side device based on the network quality, including: the gateway device sends all or part of the static resources constituting the first webpage to the first end-side device through a push request in the Hypertext Transfer Protocol HTTP2.0 protocol based on the network quality. In this way, a specific way is provided for the gateway device to send all or part of the static resources constituting the first webpage to the first end-side device, so that the solution provided in the embodiment of the present application can be applied to more scenarios.
[0012] In a possible implementation of the first aspect, the gateway device sends all or part of the static resources constituting the first web page to the first end-side device based on network quality, including: the gateway device receives a hypertext markup language HTML file. Based on the network quality, the gateway device writes all or part of the static resources constituting the first web page into the HTML file through the preload attribute included in the HTML file to obtain an updated HTML file. The gateway device sends the updated HTML file to the first end-side device. In response to a request initiated by the first terminal device based on the updated HTML file, the gateway device sends all or part of the static resources constituting the first web page to the first end-side device. In this way, a specific way is given for the gateway device to send all or part of the static resources constituting the first web page to the first end-side device, so that the solution provided in the embodiment of the present application can be applied to more scenarios.
[0013] In a possible implementation of the first aspect, the static resource is a resource that is allowed to be cached as indicated in the cache control field in the access request of the first webpage. In this way, a specific way of determining the static resource is given, which increases the diversity of the solutions.
[0014] In a possible implementation of the first aspect, the first webpage is an online document in a software as a service (SaaS) application. In this implementation, a specific scenario in which the solution provided in the embodiment of the present application can be applied is provided.
[0015] In a possible implementation of the first aspect, the gateway device receives a reply content of the server based on the access request of the second end-side device to the first webpage, including: the gateway device receives a first message sent by the server. The gateway device parses the first message to obtain the reply content of the server based on the access request of the second end-side device to the first webpage.
[0016] A second aspect of the embodiment of the present application provides a system for accelerating web page access, the system comprising a gateway device and a first end-side device, the gateway device being used to receive an access request from the first end-side device to a first web page, the gateway device being further used to obtain the network quality of the network where the first end-side device is located. The gateway device is further used to send all or part of the static resources constituting the first web page to the first end-side device based on the network quality, wherein the static resources are fixed resources among all the resources constituting the first web page.
[0017] In a possible implementation of the second aspect, the system further includes a second end-side device and a server, and the network device is further configured to receive a reply content of the server based on the access request of the second end-side device to the first webpage, wherein the reply content includes the first dynamic resource and the static resource. The gateway device stores the static resource.
[0018] In a possible implementation manner of the second aspect, the first end-side device and the second end-side device are different end-side devices.
[0019] In a possible implementation of the second aspect, the gateway device forwards the access request of the first end-side device to the first webpage to the server. The server sends a dynamic resource to the gateway device based on the reply content of the first end-side device to the access request of the first webpage, and the dynamic resource is other resources except static resources in all resources constituting the first webpage. The gateway device transparently transmits the dynamic resource to the first end-side device.
[0020] In a possible implementation of the second aspect, the server sends the dynamic resource to the gateway device through the websocket protocol based on the reply content of the first end-side device to the access request of the first webpage.
[0021] In a possible implementation of the second aspect, the gateway device is specifically used to: based on network quality, send all or part of the static resources constituting the first web page to the first end-side device through a push request in the Hypertext Transfer Protocol HTTP2.0 protocol.
[0022] In a possible implementation of the second aspect, the server is used to send a hypertext markup language HTML file to a gateway device. The gateway device is specifically used to: based on network quality, write all or part of the static resources constituting the first web page into the HTML file through the preload attribute included in the HTML file to obtain an updated HTML file. The updated HTML file is sent to the first end-side device. The first terminal device is used to request the gateway device to send static resources based on the updated HTML file. The gateway device is specifically used to send all or part of the static resources constituting the first web page to the first end-side device in response to a request initiated by the first terminal device based on the updated HTML file.
[0023] In a possible implementation manner of the second aspect, the static resource is a resource that is allowed to be cached and is indicated in a cache control field in an access request of the first webpage.
[0024] In a possible implementation of the second aspect, the first webpage is an online document in a software as a service (SaaS) application.
[0025] In a possible implementation of the second aspect, the gateway device is specifically used to receive a first message sent by the server, and parse the first message to obtain a reply content of the server based on the access request of the second terminal device to the first webpage.
[0026] A third aspect of an embodiment of the present application provides a method for accelerating web page access, wherein a server receives an access request for a first web page from a first end-side device forwarded by a gateway device, and the server sends static resources constituting the first web page obtained based on the access request for the first web page from the first end-side device to the gateway device through a websocket protocol.
[0027] In a possible implementation of the third aspect, the server sends the dynamic resources constituting the first webpage obtained based on the access request of the first end-side device to the first webpage to the gateway device through the websocket protocol.
[0028] A fourth aspect of the embodiments of the present application provides a gateway device, which has the function of implementing the method for accelerating web page access in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0029] In a possible implementation of the fourth aspect, a gateway device includes: a transceiver module, configured to receive an access request from a first end-side device to a first webpage. A processing module, configured to obtain a network quality of a network where the first end-side device is located. The transceiver module is further configured to send all or part of the static resources constituting the first webpage to the first end-side device based on the network quality, where the static resources are fixed resources among all the resources constituting the first webpage.
[0030] In a possible implementation of the fourth aspect, the device further includes a storage module and a transceiver module, and is further configured to:
[0031] Before receiving the access request for the first webpage from the first end-side device, a reply content of the server based on the access request for the first webpage from the second end-side device is received, and the reply content includes static resources.
[0032] Storage module, used to store static resources.
[0033] In a possible implementation manner of the fourth aspect, the first end-side device and the second end-side device are different end-side devices.
[0034] In a possible implementation manner of the fourth aspect, the transceiver module is further configured to:
[0035] Forwarding the access request of the first terminal device to the first webpage to the server. Receive dynamic resources, which are the reply content of the server based on the access request of the first terminal device to the first webpage. Transparently transmit the second dynamic resource to the first terminal device.
[0036] In a possible implementation of the fourth aspect, the transceiver module is specifically used to: receive the second dynamic resource sent by the server through the websocket protocol. In a possible implementation of the fourth aspect, the transceiver module is specifically used to: send all or part of the static resources constituting the first webpage to the first end-side device through a push request in the hypertext transfer protocol HTTP2.0 protocol based on network quality.
[0037] In a possible implementation of the fourth aspect, the transceiver module is specifically used for: the gateway device receives a hypertext markup language HTML file. The processing module is also used to write all or part of the static resources constituting the first web page into the HTML file through the preload attribute included in the HTML file based on network quality to obtain an updated HTML file. The transceiver module is also used to: send the updated HTML file to the first end-side device. In response to a request initiated by the first terminal device based on the updated HTML file, all or part of the static resources constituting the first web page are sent to the first end-side device.
[0038] In a possible implementation manner of the fourth aspect, the static resource is a resource that is allowed to be cached and is indicated in a cache control field in the access request of the first webpage.
[0039] In a possible implementation of the fourth aspect, the first web page is an online document in a software as a service (SaaS) application.
[0040] In a possible implementation of the fourth aspect, the transceiver module is specifically configured to: receive a first message sent by the server. The processing module is specifically configured to parse the first message to obtain a reply content of the server based on the access request of the second terminal device to the first webpage.
[0041] The fifth aspect of the embodiment of the present application provides a server, which has the function of implementing the method for accelerating web page access in the third aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0042] A sixth aspect of an embodiment of the present application provides a gateway device, including a processor, the processor and a memory are coupled, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the method described in the first aspect or any possible implementation manner of the first aspect is implemented.
[0043] A seventh aspect of an embodiment of the present application provides a server, including a processor, wherein the processor is coupled to a memory, and the memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the method described in the third aspect or any possible implementation manner of the third aspect is implemented.
[0044] An eighth aspect of an embodiment of the present application provides a computer-readable storage medium, including a program, which, when executed on a computer, enables the computer to execute the method described in the first aspect or any possible implementation manner of the first aspect.
[0045] A ninth aspect of an embodiment of the present application provides a computer-readable storage medium, including a program, which, when executed on a computer, enables the computer to execute the method described in the third aspect or any possible implementation manner of the third aspect.
[0046] The present application provides a chip in the first aspect, including one or more processors, some or all of which are used to read and execute a computer program stored in a memory to execute the method in any possible implementation of the first aspect or the third aspect.
[0047] In a possible implementation of the eleventh aspect, the chip includes a memory, and the memory is connected to the processor through a circuit or wire. Further optionally, the chip also includes a communication interface, and the processor is connected to the communication interface. The communication interface is used to receive data and / or information to be processed, and the processor obtains the data and / or information from the communication interface, processes the data and / or information, and outputs the processing result through the communication interface. The communication interface can be an input and output interface.
[0048] The method provided in the embodiment of the present application can be implemented by one chip or by multiple chips working together.
[0049] A twelfth aspect of an embodiment of the present application provides a computer program product, which includes computer software instructions, and the computer software instructions can be loaded by a processor to implement a method of any one of the implementation methods of the first aspect or the third aspect above.
[0050] For the specific implementation steps of the second to twelfth aspects of the present application and various possible implementation methods, as well as the beneficial effects brought about by each possible implementation method, please refer to the description of the various possible implementation methods in the first aspect, and will not be repeated here one by one. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A schematic diagram of a process of loading a web page;
[0052] Figure 2 A system architecture diagram for accelerating web page access provided in an embodiment of the present application;
[0053] Figure 3 A flowchart of a method for accelerating web page access provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of static resources in the scenario of accessing online documents;
[0055] Figure 5 A schematic diagram of a process for a second terminal device to apply for access to a first web page for the first time;
[0056] Figure 6 A flowchart of another method for accelerating web page access provided by an embodiment of the present application;
[0057] Figure 7a A flowchart of another method for accelerating web page access provided by an embodiment of the present application;
[0058] Figure 7b A flowchart of another method for accelerating web page access provided by an embodiment of the present application;
[0059] Figure 7c A flowchart of another method for accelerating web page access provided by an embodiment of the present application;
[0060] Figure 8 A comparison chart of the effect of the method for accelerating web page access provided by an embodiment of the present application compared with a traditional solution;
[0061] Fig. 9 A schematic diagram of the structure of a gateway device provided in an embodiment of the present application;
[0062] Fig.10 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0063] Fig.11 A schematic diagram of the structure of another gateway device provided in an embodiment of the present application;
[0064] Fig.12 A schematic diagram of the structure of another server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The following will describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0066] With the popularization of computers and the rapid development of Internet technology, users are increasingly using the Internet to obtain information. For example, using a browser to open a web page to obtain information. Figure 1 , is a schematic diagram of the process of loading a web page. Figure 1As shown, when the terminal device receives the user's touch web page entry operation (for example, for a shopping website, the user clicks on the image of a certain product), it sends a web page access request to the server. The web page access request can be embodied in the form of a uniform resource locator (URL) request. The server receives the URL request, responds to the URL request, and sends all the resources that constitute the web page to the terminal device, wherein all the resources can be embodied in the form of a hypertext markup language (HTML) file. Next, the terminal device renders all the received resources that constitute the web page to display the web page. For example, the terminal device receives and downloads the index.html file, and then, based on the index.html file, applies to the server for all the resources that constitute the web page indicated in the index.html file. It can also be understood that the terminal device reads the index.html file, parses the file, and renders the page. After rendering, the server is accessed in the page to obtain interface data, and the web page is refreshed based on the requested data to complete the display of the web page. In other words, after the terminal device performs the rendering operation, it downloads certain web page content to be loaded in the web page from the server, and dynamically updates the displayed web page. Figure 1 The terminal device described in the present application is sometimes referred to as a terminal device or a terminal in the present application embodiment. They have the same meaning. The above-mentioned terminal devices include but are not limited to devices with communication functions, smart phones, tablet computers, laptop computers, desktop computers, portable digital players, smart bracelets, and smart watches. It should be noted that the present application embodiment does not limit the specific type of terminal device, which can be any electronic device with a web browsing function.
[0067] In order to improve the user's web browsing experience, web preloading technology can be used to accelerate web page loading. In this solution, the terminal device analyzes user behavior and links in the web page and applies to the server for some resources in advance. For example, in the scenario where the user browses a shopping web page, the terminal device analyzes the user's click behavior on the product and the links that exist in the web page that the user is currently browsing (such as the link corresponding to the product). Based on these analysis contents, the client predicts which links the user may be interested in, and then the terminal device applies to the server to send the resources corresponding to these predicted links that the user is interested in in advance. This solution of analyzing user behavior on the terminal side, further predicting the content that the user searches for, and applying in advance to store the predicted content in the user's browser cache to accelerate network transmission has at least the following defects:
[0068] (1) The terminal device analyzes the user's behavior and the links in the web page, which will occupy the processing resources of the terminal device and affect the processing performance of the terminal device.
[0069] (ii) The terminal device needs to request from the server to send resources corresponding to links that are predicted to be of interest to the user, thereby increasing the wide area bandwidth, or in other words, increasing additional transmission resources.
[0070] (III) It is unable to automatically distinguish the specific needs of different users. If the terminal device is in a weak network state, the preloading behavior of the terminal device may increase the network burden and affect the current network transmission. Specifically, since the solution of using web page preloading technology to accelerate web page loading is indiscriminate for different terminal devices. In other words, each terminal device will apply to the server to send the resources corresponding to the links that these users are interested in. If the network environment currently in which some terminal devices are located is very poor, the user may not want the terminal device to perform additional processing (such as performing analysis of user behavior, requesting to send the resources corresponding to the links that the user is interested in and storing them, etc.). Because this will cause the processing performance of the terminal device to be further reduced. However, the above-mentioned solution of using web page preloading technology to accelerate web page loading will not distinguish whether the terminal device is in a weak network state. Any terminal device will apply to the server to send the resources corresponding to the links that these predicted users are interested in. Therefore, if the terminal device is in a weak network state, the solution of using preloading technology to accelerate web page loading by the terminal device may increase the network burden and affect the current network transmission.
[0071] In order to solve the above problems, the present application embodiment provides a method for accelerating web page access, and the specific research ideas are as follows:
[0072] In order to solve defect (I), the solution provided by the embodiment of the present application is that the gateway device takes the lead in executing the solution of web page acceleration, and does not require the terminal device to analyze the user's behavior and analyze the links in the web page, and does not occupy additional processing resources of the terminal device. The gateway device described in the embodiment of the present application can be a switch, a router, an access switch, an access router (AR), etc., which will be described in detail below and will not be described here.
[0073] To solve defect (2), the solution provided in the embodiment of the present application is a solution in which the gateway device takes the lead in executing web page acceleration. The terminal device does not need to apply to the server to send the resources corresponding to the links that are predicted to be of interest to the user, and will not increase the wide area bandwidth, or in other words, will not increase additional transmission resources.
[0074] In order to solve defect (three), the solution provided by the embodiment of the present application divides all the resources that make up the web page into static resources and dynamic resources. Among them, static resources are fixed resources among all the resources that make up the web page, and dynamic resources are non-fixed resources among all the resources that make up the web page. It can also be understood that when different terminal devices access the same web page, the server sends all the resources that make up the web page to each terminal device. The same resources among all the resources that make up the web page obtained by these different terminal devices are static resources, and different resources are dynamic resources. The specific examples will be given below, and will not be introduced here. The solution provided by the embodiment of the present application sends static resources to the end-side device through the gateway device. Since it is not necessary to send static resources to the end-side device through the server, transmission time is saved, thereby achieving the purpose of accelerating web page loading. In addition, considering that the network quality of the networks in which different terminals are located is different, in order to be able to adaptively distinguish the specific needs of different users, the solution provided by the embodiment of the present application is that the gateway device sends all or part of the static resources to the terminal device according to the network quality of the network in which the terminal device is located.
[0075] The solution provided by the embodiment of the present application can be adapted to any scenario where web page loading needs to be accelerated, or in other words, the solution provided by the embodiment of the present application can be applied to any scenario where a web page is accessed. In order to facilitate the description of the solution, based on the above research ideas, the following describes the network architecture applicable to the method provided by the embodiment of the present application by taking the scenario of improving the efficiency of opening / accessing online documents in office SaaS applications as an example.
[0076] SaaS provides a new software delivery model. Specifically, the software and its related data are hosted on cloud servers, and users can use the software by accessing cloud servers without going through the traditional software installation steps. In this delivery model, users usually use a streamlined client, such as a browser, to access the cloud server to use the software online. On the one hand, leasing instead of purchasing reduces the cost of use, and on the other hand, there is no need to download and install, which overcomes the limitations of network performance and hardware performance on software use.
[0077] like Figure 2 As shown in FIG. 1 , a system architecture diagram for accelerating web page access provided by an embodiment of the present application is shown. Figure 2As shown, the terminal device 200 (exemplarily showing the terminal device 200-1, the terminal device 200-2 and the terminal device 200-3) is connected to the gateway device 400 via the network 300, and the network 300 may be a wide area network or a local area network, or a combination of the two. The gateway device 400 is connected to the server 600 via the network 500, and the network 500 may be a wide area network. It should be noted that in an actual system, more or fewer devices may be included, such as the system may also include a database for providing data support to the server 600. In addition, the embodiment of the present application does not limit the number of devices, such as multiple gateway devices or multiple servers or more terminal devices. The embodiment of the present application focuses on the interaction process between the server, the gateway and the terminal device, and the following is a description of the scheme by taking the interaction process between a server, a gateway device and one or more terminal devices as an example. When there are multiple gateway devices or multiple servers in the scene, the interaction process described in the embodiment of the present application can be understood with reference to the interaction process described in the embodiment of the present application, and the embodiment of the present application will not be repeated.
[0078] In the scenario of opening an online document, the terminal device 200 is used to trigger a request to open an online document. When the gateway device 400 obtains a request that the terminal 200 may have to open an online document, in order to speed up the efficiency of opening the online document, the solution provided by the embodiment of the present application can be executed. That is, the gateway device 400 sends all or part of the static resources to the terminal device 200 in advance according to the network quality of the network in which the terminal device 200 is located, such as detecting the network quality of the network 300. In a possible scenario, the operation of opening a file directory by the user can be regarded as a request that the terminal 200 may have to open an online document, thereby triggering the execution of the solution provided by the embodiment of the present application.
[0079] In the scenario of opening an online document, the gateway device 400 is used to receive a request for opening an online document sent by the terminal device 200, and measure the network quality of the network where the terminal device 200 is located, or in other words, measure the network quality of the network 300. When the quality of the network 300 is excellent, all static resources corresponding to the online document can be sent to the terminal device 200, and when the quality of the network 300 is average or poor, part or a small part of the static resources of the online document can be sent to the terminal device 200. There are many ways to evaluate the network quality, such as evaluating the network quality based on the packet loss rate or the delay, which is not limited in the embodiments of the present application.
[0080] In the scenario of opening an online document, the server 600 is connected to the gateway device 400 through a network, and can also be connected to the terminal device 200 through a network. The server 600 is used to receive a request to open an online document sent by the terminal device 200, or to receive a request to open an online document sent by the terminal device 200 forwarded by the gateway device 400. The server 600 can send all the resources of the online document to the gateway device 400 based on the received request to open the online document, or send dynamic resources to the terminal device 200, or transmit dynamic resources to the terminal device 200 through the gateway device 400. The specific execution process of the server 600 can be understood with reference to the embodiments described below, and will not be introduced here. In some embodiments, the server 600 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Specifically, in office SaaS applications, the server may be a SaaS application server. The terminal, gateway device, and server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.
[0081] Based on the system architecture for accelerating web page access described above, the method for accelerating web page access provided in an embodiment of the present application is introduced below.
[0082] like Figure 3 As shown, it is a flow chart of a method for accelerating web page access provided by an embodiment of the present application. Figure 3 As shown, a method for accelerating web page access provided by an embodiment of the present application may include the following steps:
[0083] 301. A gateway device receives an access request from a first terminal device to a first web page.
[0084] The gateway device receives the access request for the first web page from the first end-side device, which can be understood as the gateway device being triggered to execute the process of loading the first web page. Among them, the first end-side device initiates the access request for the first web page, which may be expressed in a variety of different ways in different scenarios: for example, in the scenario of accessing an online document, when the first end-side device obtains the file directory where the user opens the online document, it is regarded as the first end-side device initiating an access request to the online document. For another example, in the scenario of accessing a shopping website, the first end-side device obtains that the user will click on the link corresponding to a certain product, which is regarded as the first end-side device initiating an access request to the web page corresponding to the product.
[0085] 302. The gateway device obtains the network quality of the network where the first end-side device is located.
[0086] In other words, the gateway device obtains the quality of the connection network between the gateway device and the first end-side device.
[0087] Evaluation indicators of network quality include but are not limited to packet loss rate, delay or bandwidth. The embodiment of the present application does not limit the method used to detect network quality. The existing methods for detecting network quality can be adopted in the embodiment of the present application. No further details will be given here.
[0088] 303. The gateway device sends all or part of the static resources constituting the first webpage to the first terminal device based on the network quality.
[0089] Static resources are fixed resources among all resources constituting the first web page.
[0090] All static resources constituting the first web page may be sent by the server to the gateway device, or may be pre-configured on the gateway device. These two situations are respectively introduced below.
[0091] (1) All static resources constituting the first web page are pre-stored in the gateway device.
[0092] In other words, the gateway device pre-stores the static resources required to form the first web page. For example, in the scenario of accessing an online document, the framework structure of the online document can be regarded as a static resource, wherein the types of online documents include but are not limited to PDF documents, word documents, PPT documents, TXT documents, etc., and the embodiments of the present application do not limit the types of online documents. The static resources corresponding to different types of online documents can be pre-stored in the gateway device, and the static resources corresponding to the online documents can be understood as the framework structures corresponding to different types of online documents. For a better understanding, the following is combined with Figure 4 Let's give an example. Figure 4 As shown in Figure 1, it is a schematic diagram of static resources in the scenario of accessing online documents. Figure 4The marked frame is fixed for any terminal device accessing the online document, and the frame will not change with the access of different terminal devices at different times. In this scenario, since the gateway device has stored the static resources required to form the first web page, the gateway device can directly send the static resources to the first terminal device. Therefore, after the web page device receives the access request for the first web page from the first end-side device, it only needs to request the server to send the dynamic resources of the first web page that the first terminal device applies to access to the first terminal device. In the scenario of accessing online documents, resources that change with the access of different terminal devices at different times are dynamic resources. For example, editable text content can be regarded as dynamic resources. For example, user privacy information can be regarded as dynamic resources.
[0093] (ii) All static resources constituting the first web page are sent by the server to the gateway device.
[0094] The first terminal device may be a terminal device that applies for access to the first web page for the first time, and the first terminal device may not be a terminal device that applies for access to the first web page for the first time. When the first terminal device is not a terminal device that applies for access to the first web page for the first time, there are other terminal devices that have accessed the first web page. The server will send all the static resources that constitute the first web page to the gateway device based on the access request of the other terminal device to the first web page. When the first terminal device applies for access to the first web page again, the gateway device has stored all the static resources that constitute the first web page, then the gateway device can directly send all or part of the static resources that constitute the first web page to the first terminal device, without the need for the first end-side device to receive all or part of the static resources that constitute the first web page from the server, thereby improving the rate at which the first end-side device receives all or part of the static resources that constitute the first web page, and improving the rate at which the first end-side device loads the first web page. It should be noted that the other terminal devices here include the first terminal device itself, that is, it is possible that the first terminal device has applied to access the first web page. The following takes the case where a second terminal device has applied to access the first webpage before the first terminal device applies to access the first webpage as an example to introduce this situation. In other words, the following takes the case where the second terminal device is a terminal device that applies to access the first webpage for the first time as an example to introduce this situation:
[0095] See also Figure 5 , is a flow chart of the second terminal device applying for accessing the first web page for the first time, such as Figure 5 As shown, the following steps may be included:
[0096] 501. A gateway device receives an access request from a second terminal device to a first web page.
[0097] For example, the gateway device receives a request from the second end device to access the first online document. For details, please refer to the description of the gateway device receiving the request from the first end device to access the first web page described in step 301, which will not be repeated here.
[0098] 502. The gateway device forwards the access request of the second terminal device to the first webpage to the server.
[0099] In a possible implementation, step 501 and step 502 may not be performed, and instead the second terminal device directly sends an access request to the first webpage to the server, that is, the server directly receives the access request to the first webpage from the second terminal device.
[0100] 503. In response to the access request of the second terminal device to the first webpage, the server sends all resources constituting the first webpage to the gateway device.
[0101] All resources constituting the first web page include static resources and dynamic resources. How to understand static resources and dynamic resources has been introduced above and will not be repeated here. In addition, since dynamic resources change with the access of different terminal devices at different times, in order to distinguish, the dynamic resources included in the reply content generated by the server described in step 501 based on the access request of the second terminal device to the first web page are referred to as first dynamic resources, or the dynamic resources included in all resources constituting the first web page sent by the server to the gateway device in response to the access request of the second terminal device to the first web page are referred to as first dynamic resources. Since static resources do not change with the access of different terminal devices at different times, the name of static resources is no longer distinguished.
[0102] In a possible implementation, the server responds to the access request of the second end-side device to the first webpage by sending the dynamic resources constituting the first webpage to the gateway device through the websocket protocol. Sending dynamic resources to the gateway device through the websocket protocol helps to speed up the sending rate of dynamic resources, reduce the number of connections on the server side, and save wide area bandwidth.
[0103] 504. After caching the static resource, the gateway device sends the static resource to the second end-side device.
[0104] Since the gateway device obtains the static resources constituting the first webpage for the first time, the gateway device caches the static resources. The gateway device caches the mapping relationship between the first webpage and the static resources of the first webpage.
[0105] 505. The gateway device transparently transmits the first dynamic resource.
[0106] The gateway device does not process the first dynamic resource, and directly forwards the first homomorphic resource to the second terminal device.
[0107] 506. The second terminal device loads the first webpage according to the static resource and the first dynamic resource.
[0108] The implementation of this application does not limit the specific method used by the second terminal device to load the first web page based on the acquired static resources and dynamic resources. Any method of loading the web page based on the acquired static resources and dynamic resources by any terminal device can be adopted in the embodiments of this application.
[0109] It should be noted that the second end-side device and the first end-side device can be the same device, which means that the first end-side device can also be the end-side device that applies for access to the first web page for the first time. The second end-side device and the first end-side device can also be different devices, which means that the first end-side device is not the end-side device that applies for access to the first web page for the first time.
[0110] In addition, the gateway device may send all or part of the static resources constituting the first webpage to the first terminal device in different ways, which are described below in combination with two specific implementations:
[0111] In a possible implementation, the gateway device sends all or part of the static resources constituting the first webpage to the first terminal device through a push request in the Hypertext Transport Protocol (HTTP) 2.0 protocol based on network quality.
[0112] In a possible implementation, a gateway device receives a hypertext markup language HTML file sent by a server; based on network quality, the gateway device writes all or part of the static resources constituting the first web page into the HTML file through the preload attribute included in the hypertext markup language (HTML) file to obtain an updated HTML file; the gateway device sends the updated HTML file to the first terminal device. After receiving the updated HTML file, the first terminal device requests the gateway device to send the static resources carried in the HTML file based on the updated HTML file, and the gateway device responds to the request initiated by the first terminal device based on the updated HTML file and sends all or part of the static resources constituting the first web page to the first terminal device.
[0113] The above describes the process of the first terminal side device acquiring static resources. The following describes the process of the first terminal side device acquiring dynamic resources.
[0114] like Figure 6 As shown, it is a flow chart of a method for accelerating web page access provided by an embodiment of the present application. Figure 6 As shown, a method for accelerating web page access provided by an embodiment of the present application may include the following steps:
[0115] 601. A gateway device receives an access request from a first end-side device to a first web page.
[0116] 602. The gateway device obtains the network quality of the network where the first end-side device is located.
[0117] 603. The gateway device sends all or part of the static resources constituting the first webpage to the first terminal device based on the network quality. The static resources are fixed resources among all the resources constituting the first webpage.
[0118] Steps 601 to 603 can refer to Figure 3 Steps 301 to 303 in the corresponding embodiment are understood and will not be repeated here.
[0119] 604. The gateway device forwards the access request of the first end-side device to the first webpage to the server.
[0120] It should be noted that the steps described in the solution provided in the embodiment of the present application may be executed simultaneously or in a reversed order. For example, step 604 and step 602 may be executed simultaneously, or step 604 may be executed before step 602.
[0121] 605. The gateway device receives the second dynamic resource sent by the server.
[0122] Figure 3 The corresponding embodiments introduce two situations, namely, all static resources constituting the first webpage are pre-existing in the gateway device, and all static resources constituting the first webpage are sent by the server to the gateway device.
[0123] For the first case, that is, all static resources constituting the first webpage are pre-existing in the gateway device, regardless of whether the first end-side device is a device applying for access to the first webpage for the first time, the server can only send the second dynamic resource to the gateway device.
[0124] For the second case, that is, all static resources constituting the first webpage are sent by the server to the gateway device. In this case, if the first end-side device is a device that applies to access the first webpage for the first time, the resources sent by the server to the gateway device include both static resources and the second dynamic resources. If the first end-side device is not a device that applies to access the first webpage for the first time, the server can only send the second dynamic resource to the gateway device.
[0125] In addition, in a possible implementation, the gateway device receives the second dynamic resource sent by the server through the websocket protocol. The websocket protocol is a protocol for full-duplex communication on a single transmission control protocol (TCP) connection. The gateway device and the server only need one handshake to establish a link and send data to each other, which has the advantages of real-time and full-duplex. Before the gateway device terminates the websocket protocol established before the server, the server can continuously send the second dynamic resource to the gateway device through the websocket protocol, so this method can increase the rate at which the gateway device receives dynamic resources, or can make the gateway device receive dynamic resources from the server faster. The gateway device can receive dynamic resources faster, and can transmit the acquired dynamic resources to the first end-side device faster, and the first end-side device can obtain dynamic resources faster to increase the rate at which the first end-side device loads the first web page. In addition, the websocket protocol from the gateway device to the server in this implementation can be reused by multiple end-side devices. For example, the server can send the first dynamic resource to the gateway device through the websocket protocol, so this method can also reduce the number of connections on the server side and save wide area bandwidth. Since it takes extra time to upgrade the http protocol to the websocket protocol, in this implementation, in order to save the processing overhead of the end-side device, the end-side device can use the HTTP protocol to receive dynamic resources. In a possible implementation, the end-side device can also receive dynamic resources based on the websocket protocol.
[0126] 606. The gateway device transparently transmits the second dynamic resource to the first end-side device.
[0127] In order to better understand the solution provided by the embodiment of the present application, the solution described in the embodiment of the present application is introduced below by taking a terminal device that visits a first web page for the first time, and all static resources constituting the first web page are sent by a server to a gateway device as an example.
[0128] like Figure 7a and Figure 7b As shown, it is a flow chart of a method for accelerating web page access provided by an embodiment of the present application. Figure 7a As shown, when the first end-side device applies to access the first webpage for the first time, the first end-side device initiates a request to access the first webpage to the server, and the gateway device ( Figure 7aIn the example, the gateway device is AR) receives the first message sent by the server. In one possible implementation, the first message can be received through the websocket protocol. AR parses the first message and determines the static resources based on the resources allowed to be cached indicated in the cache control field in the access request of the first web page. The resources that are not allowed to be cached are dynamic resources. AR accesses the URL, that is, caches the static resources corresponding to the first web page. AR transparently transmits the dynamic resources to the first end-side device. Figure 7b As shown, when the first end-side device applies for access to the first web page again, the gateway device intercepts or receives a second message, which is initiated by the first end-side device and is used to apply for access to the first web page. After parsing the second message, the gateway device performs network measurement on the network where the first end-side device is located. After evaluating the network quality, all or part of the static resources constituting the first web page are sent to the first end-side device through a push request in the HTTP2.0 protocol. For example, when the network quality is excellent, all the static resources constituting the first web page are sent to the first end-side device, and when the network quality is weak, part of the static resources constituting the first web page are sent to the first end-side device. As a result, the first end-side device first receives all or part of the static resources, and can pre-cache all or part of the static resources to accelerate the transmission of the first web page. After the first end-side device forwards the access request for the first web page initiated by the first end-side device to the server, it receives the dynamic resources currently constituting the first web page through the websocket protocol, and transparently transmits the received dynamic resources to the first end-side device. In one possible implementation, as Figure 7c As shown, when the first end-side device applies for access to the first web page again, the gateway device intercepts or receives a second message, which is initiated by the first end-side device and is used to apply for access to the first web page. After receiving the access request for the first web page initiated by the first end-side device, the server sends an HTML file to the gateway device. After parsing the second message, the gateway device performs network measurement on the network where the first end-side device is located. After evaluating the network quality, based on the network quality of the current network where the first end-side device is located, all or part of the static resources constituting the first web page are written into the HTML file through the preload attribute included in the received HTML file to obtain an updated HTML file. The gateway device sends the updated HTML file to the first end-side device. After receiving the updated HTML file, the first end-side device requests the gateway device to send the static resources carried in the HTML file based on the updated HTML file. The gateway device responds to the request initiated by the first end-side device based on the updated HTML file and sends all or part of the static resources constituting the first web page to the first end-side device.
[0129] To verify the optimization performance of this embodiment, the PC uses the Chrome browser to open the online document of the SaaS application and records the loading time, such as Figure 8 As shown, compared with not applying the solution provided by the embodiments of the present application, applying the solution provided by the embodiments of the present application can reduce the page loading delay by up to 40%.
[0130] The above describes a method for accelerating web page access and a system for accelerating web page access provided by an embodiment of the present application. Based on the same inventive concept of the above method embodiment, the embodiment of the present application also provides an apparatus, such as a gateway device and a server. The gateway device and the server can be used to execute the technical solution described in the above method embodiment.
[0131] For details, see Fig. 9 , is a schematic diagram of the structure of a gateway device provided in an embodiment of the present application. Fig. 9 As shown, a gateway device provided in an embodiment of the present application includes a transceiver module 901 and a processing module 902 .
[0132] The transceiver module 901 is used to execute Figure 3 Step 301, step 303, step 302 and Figure 3 In the corresponding embodiment, the gateway device performs other steps related to the sending and receiving actions. The processing module 902 is used to perform Figure 3 Step 302 and Figure 3 Other steps related to the processing action performed by the gateway device in the corresponding embodiment.
[0133] The transceiver module 901 is used to execute Figure 5 Steps 501 to 505 in the corresponding example and Figure 5 In the corresponding embodiment, the gateway device performs other steps related to the sending and receiving actions. The processing module 902 is used to perform Figure 5 Step 502 and Figure 5 In the corresponding embodiment, the gateway device performs other steps related to the processing action. In a possible implementation, the storage module 903 may also be included for executing Figure 5 Step 504 and Figure 5 Other storage-related steps performed by the gateway device in the corresponding embodiment.
[0134] The transceiver module 901 is used to execute Figure 6 Steps 601 to 606 in the corresponding example and Figure 6 In the corresponding embodiment, the gateway device performs other steps related to the sending and receiving actions. The processing module 902 is used to perform Figure 6Step 602, step 603 and Figure 6 Other steps related to the processing action performed by the gateway device in the corresponding embodiment.
[0135] Specifically, in one possible implementation, the transceiver module 901 is used to receive an access request for the first web page from a first end-side device; the processing module 902 is used to obtain the network quality of the network where the first end-side device is located; the transceiver module 901 is also used to send all or part of the static resources that constitute the first web page to the first end-side device based on the network quality, where the static resources are fixed resources among all the resources that constitute the first web page.
[0136] In a possible implementation, the device further includes a storage module 903 and a transceiver module 901, and is further configured to:
[0137] Before receiving the access request of the first end-side device to the first webpage, receiving the reply content of the server based on the access request of the second end-side device to the first webpage, the reply content includes the first dynamic resource and the static resource;
[0138] The storage module 903 is used to store static resources.
[0139] In a possible implementation manner, the first end-side device and the second end-side device are different end-side devices.
[0140] In a possible implementation manner, the transceiver module 901 is further configured to:
[0141] Forwarding the access request of the first end-side device to the first webpage to the server;
[0142] receiving a second dynamic resource, where the second dynamic resource is a reply content of the server based on an access request of the first terminal device to the first webpage;
[0143] The second dynamic resource is transparently transmitted to the first end-side device.
[0144] In a possible implementation manner, the transceiver module 901 is specifically configured to:
[0145] The second dynamic resource sent by the server is received through the websocket protocol.
[0146] In a possible implementation manner, the transceiver module 901 is specifically configured to:
[0147] Based on the network quality, all or part of the static resources constituting the first webpage are sent to the first terminal side device through a push request in the Hypertext Transfer Protocol HTTP2.0 protocol.
[0148] In a possible implementation manner, the transceiver module 901 is specifically configured to:
[0149] The gateway device receives a hypertext markup language HTML document;
[0150] The processing module 902 is further configured to write all or part of the static resources constituting the first webpage into the HTML file through a preload attribute included in the HTML file based on the network quality, so as to obtain an updated HTML file;
[0151] The transceiver module 901 is also used for:
[0152] Sending the updated HTML file to the first end-side device;
[0153] In response to a request initiated by the first terminal device based on the updated HTML file, all or part of the static resources constituting the first webpage are sent to the first terminal-side device.
[0154] In a possible implementation, the static resource is a resource that is allowed to be cached and is indicated in a cache control cachecontrol field in the access request of the first webpage.
[0155] In a possible implementation, the first web page is an online document in a Software as a Service (SaaS) application.
[0156] In a possible implementation manner, the transceiver module 901 is specifically configured to:
[0157] Receiving a first message sent by a server;
[0158] The processing module 902 is specifically configured to parse the first message to obtain the reply content of the server based on the access request of the second terminal device to the first webpage.
[0159] See also Fig.10 , is a schematic diagram of the structure of a server provided in an embodiment of the present application. Fig.10 As shown, a server provided in an embodiment of the present application includes a transceiver module 1001 and a processing module 1002 .
[0160] The transceiver module 1001 is used to execute Figure 3 The processing module 1002 is used to execute the steps related to the sending and receiving actions performed by the server in the corresponding embodiment. Figure 3 The steps related to the processing action performed by the server in the corresponding embodiment.
[0161] The transceiver module 1001 is used to execute Figure 5 Steps 502 to 503 in the corresponding example and Figure 5In the corresponding embodiment, the server performs other steps related to the sending and receiving actions. The processing module 1002 is used to execute Figure 5 Steps 502 to 503 in the corresponding embodiment and Figure 5 Other steps related to the processing action performed by the server in the corresponding embodiment.
[0162] The transceiver module 1001 is used to execute Figure 6 Steps 604 to 605 in the corresponding example and Figure 6 In the corresponding embodiment, the server performs other steps related to the sending and receiving actions. The processing module 1002 is used to execute Figure 6 Steps 604 to 605 in the corresponding embodiment and Figure 6 Other steps related to the processing action performed by the server in the corresponding embodiment.
[0163] Specifically, in a possible implementation,
[0164] The transceiver module 1001 is used to receive an access request for the first web page from the first end-side device forwarded by the gateway device. The transceiver module 1001 is also used to send the static resources constituting the first web page obtained by the processing module 1002 based on the access request for the first web page from the first end-side device to the gateway device through the websocket protocol.
[0165] In a possible implementation, the transceiver module 1001 is used to send the dynamic resources constituting the first webpage obtained by the processing module 1002 based on the access request of the first terminal device to the first webpage to the gateway device through the websocket protocol.
[0166] It should be understood that the division of the modules in the above device is only a division of logical functions, and in actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. In addition, the modules in the device can be implemented in the form of a processor calling software; for example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of the modules of the device, wherein the processor is, for example, a general-purpose processor, such as a central processing unit (CPU) or a microprocessor, and the memory is a memory inside the device or a memory outside the device. Alternatively, the modules in the device can be implemented in the form of hardware circuits, and the functions of some or all modules can be realized by designing the hardware circuits, and the hardware circuits can be understood as one or more processors; for example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC), and the functions of some or all modules above are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be realized by a programmable logic device (PLD), taking a field programmable gate array (FPGA) as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by configuring the configuration file, so as to realize the functions of some or all modules above. All modules of the above devices can be realized in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the rest by hardware circuits.
[0167] In the embodiment of the present application, the processor is a circuit with the ability to process signals. In one implementation, the processor can be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a graphics processing unit (GPU), a digital signal processor (DSP), a neural-network processing unit (NPU), a tensor processing unit (TPU), etc.; in another implementation, the processor can implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above modules.
[0168] It can be seen that each module in the above device can be one or more processors (or processing circuits) configured to implement the above embodiment method, such as: CPU, GPU, NPU, TPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms. In addition, each module in the above device can be fully or partially integrated together, or can be implemented independently, which is not limited.
[0169] Fig.11 A schematic diagram of the structure of another gateway device provided in an embodiment of the present application, such as Fig.11 As shown, the gateway device may include: at least one processor 1101 , a communication line 1102 , a memory 1103 and a communication interface 1104 .
[0170] Processor 1101 can be a general-purpose central processing unit, a microprocessor, a specific application integrated circuit, or one or more integrated circuits for controlling the execution of the program of the present application; processor 1101 can also include a heterogeneous computing architecture of multiple general-purpose processors, for example, it can be a combination of at least two of CPU, GPU, microprocessor, DSP, ASIC, FPGA; as an example, processor 1101 can be CPU+GPU or CPU+ASIC or CPU+FPGA.
[0171] The communication link 1102 may include a pathway to transmit information between the above-mentioned components.
[0172] The communication interface 1104 may use any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc.
[0173] The memory 1103 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory can be independent and connected to the processor via a communication line 1102. The memory can also be integrated with the processor. The memory provided in the embodiment of the present application can generally have non-volatility. Among them, the memory 1103 is used to store the computer execution instructions for executing the scheme of the present application, and is controlled by the processor 1101 to execute. The processor 1101 is used to execute the computer-executable instructions stored in the memory 1103, so as to implement the method provided in the above-mentioned embodiments of the present application; illustratively, each step executed by the gateway device in the above-mentioned method embodiments can be implemented.
[0174] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.
[0175] By way of example, the processor 1101 may include one or more CPUs.
[0176] Exemplarily, the gateway device may include multiple processors, each of which may be a single-CPU processor, a multi-CPU processor, or a heterogeneous computing architecture including multiple general-purpose processors. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0177] Fig.12A schematic diagram of the structure of another server provided in an embodiment of the present application, such as Fig.12 As shown, the server may include: at least one processor 1201 , a communication line 1202 , a memory 1203 and a communication interface 1204 .
[0178] Processor 1201 can be a general-purpose central processing unit, a microprocessor, a specific application integrated circuit, or one or more integrated circuits for controlling the execution of the program of the present application; processor 1201 can also include a heterogeneous computing architecture of multiple general-purpose processors, for example, it can be a combination of at least two of CPU, GPU, microprocessor, DSP, ASIC, FPGA; as an example, processor 1201 can be CPU+GPU or CPU+ASIC or CPU+FPGA.
[0179] The communication link 1202 may include a pathway to transmit information between the above-mentioned components.
[0180] The communication interface 1204 may use any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc.
[0181] The memory 1203 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory can be independent and connected to the processor through a communication line 1202. The memory can also be integrated with the processor. The memory provided in the embodiment of the present application can generally have non-volatility. Among them, the memory 1203 is used to store the computer execution instructions for executing the scheme of the present application, and is controlled by the processor 1201 to execute. The processor 1201 is used to execute the computer-executable instructions stored in the memory 1203, so as to implement the method provided in the above-mentioned embodiments of the present application; illustratively, each step executed by the server in the above-mentioned method embodiments can be implemented.
[0182] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.
[0183] By way of example, the processor 1201 may include one or more CPUs.
[0184] Exemplarily, the server may include multiple processors, each of which may be a single-CPU processor, a multi-CPU processor, or a heterogeneous computing architecture including multiple general-purpose processors. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0185] The embodiment of the present application also provides a digital processing chip. The digital processing chip integrates a circuit and one or more interfaces for implementing the above-mentioned processor, or the function of the processor. When the digital processing chip integrates a memory, the digital processing chip can complete the steps executed by the gateway device or service in the method of any one or more embodiments of the above-mentioned embodiments. When the digital processing chip does not integrate a memory, it can be connected to an external memory through a communication interface. The digital processing chip implements the actions executed by the gateway device or service in the above-mentioned embodiments according to the program code stored in the external memory.
[0186] Optionally, the aforementioned storage module can be a storage unit within the chip, such as a register, a cache, etc., and the storage module can also be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory RAM, etc.
[0187] Specifically, the aforementioned processing module or processor may be a central processing unit, a neural-network processing unit (NPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0188] The present application also provides a computer-readable storage medium in which a program is stored. When the program is run on a computer, the computer executes the following steps: Figures 3 to 8 The method performed by the gateway device described in the embodiment shown, or the method performed by the gateway device described in the embodiment shown Figures 3 to 8 The illustrated embodiment describes a method performed by a server.
[0189] The present application also provides a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the computer executes the following Figures 3 to 8 The method performed by the gateway device described in the embodiment shown, or the method performed by the gateway device described in the embodiment shown Figures 3 to 8The method executed by the server described in the illustrated embodiment. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server, or data center to another website site, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0190] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0191] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
Claims
1. A method for accelerating web page access, characterized in that: include: The gateway device receives a request from the first terminal device to access the first webpage; The gateway device obtains the network quality of the network where the first terminal side device is located; The gateway device sends all or part of the static resources constituting the first webpage to the first terminal-side device based on the network quality, where the static resources are fixed resources among all the resources constituting the first webpage.
2. The method according to claim 1, characterized in that The method further comprises: The gateway device forwards the access request of the first terminal device to the first webpage to the server; The gateway device receives dynamic resources, where the dynamic resources are other resources other than the static resources among all resources constituting the first webpage; The gateway device transparently transmits the dynamic resource to the first terminal side device.
3. The method according to claim 2, characterized in that The gateway device receives a dynamic resource, including: The gateway device receives the dynamic resource sent by the server through the websocket protocol.
4. The method according to any one of claims 1 to 3, characterized in that: Before the gateway device receives the access request of the first terminal device to the first webpage, the method further includes: The gateway device receives a reply content from the server based on the access request of the second terminal device to the first webpage, wherein the reply content includes the static resource; The gateway device stores the static resources.
5. The method according to claim 4, characterized in that The first end-side device and the second end-side device are different end-side devices.
6. The method according to any one of claims 1 to 5, characterized in that: The gateway device sends all or part of the static resources constituting the first webpage to the first terminal device based on the network quality, including: Based on the network quality, the gateway device sends all or part of the static resources constituting the first webpage to the first terminal side device through a push request in the Hypertext Transfer Protocol HTTP2.0 protocol.
7. The method according to any one of claims 1 to 5, characterized in that: The gateway device sends all or part of the static resources constituting the first webpage to the first terminal device based on the network quality, including: The gateway device receives a hypertext markup language HTML file; The gateway device writes all or part of the static resources constituting the first webpage into the HTML file based on the network quality through the preload attribute included in the HTML file to obtain an updated HTML file; The gateway device sends the updated HTML file to the first terminal side device; The gateway device sends all or part of the static resources constituting the first webpage to the first terminal-side device in response to the request initiated by the first terminal device based on the updated HTML file.
8. The method according to any one of claims 1 to 7, characterized in that: The static resource is a resource that is allowed to be cached and is indicated in a cache control field in the access request of the first web page.
9. The method according to any one of claims 1 to 8, characterized in that: The first web page is an online document in a Software as a Service (SaaS) application.
10. The method according to claim 2 or 3, characterized in that: The gateway device receives a reply from the server based on the access request of the second terminal device to the first webpage, including: The gateway device receives a first message sent by the server; The gateway device parses the first message to obtain the reply content of the server based on the access request of the second terminal device to the first webpage.
11. A gateway device, characterized in that: include: Processor and memory; The memory is used to store computer instructions, and the processor is configured to call the computer instructions to enable the gateway device to execute the method according to any one of claims 1 to 10.
12. A system for accelerating web page access, characterized in that: The system includes a gateway device and a first terminal side device. The gateway device is used to receive a request from the first terminal side device to access the first webpage, The gateway device is further used to obtain the network quality of the network where the first terminal side device is located; The gateway device is further configured to send all or part of the static resources constituting the first webpage to the first terminal device based on the network quality, wherein the static resources are fixed resources among all the resources constituting the first webpage.
13. The system according to claim 12, characterized in that The system further comprises a server, The gateway device is used to forward the access request of the first terminal device to the first webpage to the server; The server is used to send a dynamic resource to the gateway device through a websocket protocol, where the dynamic resource is a reply content of the server based on an access request of the first terminal device to the first webpage; The dynamic resource is transparently transmitted to the first terminal side device.
14. The system according to claim 12 or 13, characterized in that The gateway device is specifically used for: Based on the network quality, all or part of the static resources constituting the first webpage are sent to the first terminal side device through a push request in the Hypertext Transfer Protocol HTTP2.0 protocol.
15. The system according to claim 12 or 13, characterized in that The server is used to send a hypertext markup language HTML file to the gateway device; The gateway device is specifically used for: Based on the network quality, writing all or part of the static resources constituting the first webpage into the HTML file through a preload attribute included in the HTML file to obtain an updated HTML file; Sending the updated HTML file to the first end-side device; The first terminal device is used to request the gateway device to send static resources based on the updated HTML file; The gateway device is specifically configured to send all or part of the static resources constituting the first webpage to the first terminal side device in response to a request initiated by the first terminal device based on the updated HTML file.
16. The system according to any one of claims 12 to 15, characterized in that The static resource is a resource that is allowed to be cached and is indicated in a cache control field in the access request of the first web page.
Citation Information
Patent Citations
Method and device for improving accessing speed of network resource
CN103327033A
Router cache method and router
CN105893469A
Static resource preloading method and device
CN113392358A
Method and device for optimizing page loading speed
CN115529243A
Webpage access method and apparatus, and router
WO2016023357A1
