Resource access method and device, equipment and storage medium

By intercepting and reassembling the resource access requests of WebView components, QUIC protocol transmission is solved, and the resource access rate and page loading speed are improved.

CN118890345APending Publication Date: 2024-11-01CTRIP BUSINESS TRAVEL INFORMATION SERVICE (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411089608.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

Older versions of WebView components cannot support the QUIC protocol, resulting in low resource access rates for H5 pages, which cannot meet the current requirements for improving network performance and user experience.

Method used

By intercepting resource access requests initiated by WebView components, parsing request parameter information, and reassembling request parameters based on the QUIC protocol, QUIC protocol support for old versions of WebView components is realized to ensure that resource access requests are transmitted through the QUIC protocol.

Benefits of technology

Implement QUIC protocol support for older versions of WebView components, improve resource access rate, reduce costs, and avoid compatibility issues, significantly improve page loading speed and link success rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118890345A_ABST
    Figure CN118890345A_ABST
Patent Text Reader

Abstract

The invention provides a resource access method and device, equipment and a storage medium, the resource access method is applied to terminal equipment, the terminal equipment comprises an application program and a WebView component of the application program, and the resource access method comprises the following steps: obtaining a resource access request initiated based on the WebView component of the application program; intercepting the resource access request, and analyzing the resource access request to obtain request parameter information; and based on a QUIC protocol, reassembling the request parameter information, and sending an assembled resource access request to a target server. The assembled resource access request supports QUIC communication transmission, so that the reassembled resource access request can be quickly accessed, the implementation cost is low, no compatibility problem exists, and a relatively high resource access rate can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] WebView is an operating system component that can be used to provide web page display and web page interaction capabilities for applications (App, full name Application). Based on the WebView component, hybrid mobile applications (HybridApp) can be developed. The WebView component in the hybrid mobile application can execute remote html / JavaScript code on the network side, just like a normal browser.

[0003] Using WebView components in APP to load and display H5 (HTML5) pages is widely used in the field of mobile Internet technology, and the requirements for WebView loading performance are getting higher and higher.

[0004] Currently, the QUIC (Quick UDP Internet Connections) communication transmission protocol based on UDP (User Datagram Protocol) achieves faster connection establishment time and better network congestion control capabilities while ensuring reliability, thereby speeding up the access speed of H5 pages and improving the link success rate, achieving better network performance and user experience.

[0005] However, in the current H5 front-end development, the old version of the WebView component cannot support the QUIC protocol. Therefore, how to implement the old version's support for the QUIC protocol to obtain a higher resource access rate is a topic that the industry needs to consider.

[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0007] In view of the problems in the prior art, the purpose of the present invention is to provide a resource access method, system, device and storage medium, which overcome the difficulties of the prior art and can improve the resource access rate.

[0008] The present disclosure provides a resource access method, which is applied to a terminal device, wherein the terminal device includes an application and a WebView component of the application, and the resource access method includes:

[0009] Obtaining a resource access request initiated by a WebView component based on the application;

[0010] Intercepting the resource access request, and parsing the resource access request to obtain request parameter information;

[0011] Based on the QUIC protocol, the request parameter information is reassembled and the assembled resource access request is sent to the target server.

[0012] Optionally, intercepting the resource access request includes:

[0013] In the case that the WebView component does not support the QUIC protocol, the resource access request is intercepted.

[0014] Optionally, intercepting the resource access request includes:

[0015] When the WebView component is initialized, a WebView request interceptor is constructed through the shouldInterceptRequest callback method in the WebViewClient interface;

[0016] The resource access request is intercepted by the WebView request interceptor.

[0017] Optionally, if the request type of the resource access request is a GET request, the parsing of the resource access request to obtain request parameter information includes:

[0018] The resource access request is parsed to obtain uniform resource locator information.

[0019] Optionally, if the request type of the resource access request is a POST request, the parsing of the resource access request to obtain request parameter information includes:

[0020] Parsing the resource access request to obtain uniform resource locator information, and extracting a current request identification parameter from the uniform resource locator information;

[0021] The current request parameter body corresponding to the current request identification parameter is obtained through the native layer in the terminal device, and the uniform resource locator information and the current request parameter body together constitute the request parameter information.

[0022] Optionally, before intercepting the resource access request, the resource access method further includes:

[0023] The POST request proxy JS script is injected through the WebView component, and a request identification parameter and a corresponding request parameter body are created based on the POST request proxy JS script, and transmitted to the native layer, so that the native layer maps and binds the request identification parameter and the request parameter body; then,

[0024] The obtaining, through the native layer in the terminal device, a current request parameter body corresponding to the current request identification parameter includes:

[0025] The native layer queries the bound current request parameter body based on the current request identification parameter extracted from the uniform resource locator information.

[0026] Optionally, the resource access method further includes:

[0027] When a response result of the resource access request is received from the target server, the response result is returned to the WebView component.

[0028] The embodiment of the present disclosure further provides a resource access device, which is applied to a terminal device, wherein the terminal device includes an application and a WebView component of the application, including:

[0029] An acquisition module is configured to acquire a resource access request initiated based on the WebView component;

[0030] An interception module is configured to intercept the resource access request and parse the resource access request to obtain request parameter information;

[0031] The assembly module is configured to reassemble the request parameter information based on the QUIC protocol and send the assembled resource access request to the target server.

[0032] An embodiment of the present invention further provides an electronic device, including:

[0033] processor;

[0034] a memory in which executable instructions for the processor are stored;

[0035] The processor is configured to execute the steps of the resource access method by executing executable instructions.

[0036] An embodiment of the present invention further provides a computer-readable storage medium for storing a program, which implements the steps of the above-mentioned resource access method when executed.

[0037] The resource access method, apparatus, device and storage medium of the present invention can intercept resource access requests initiated by WebView components, and reassemble the request parameter information based on the QUIC protocol, so that the assembled resource access requests support QUIC communication transmission, so that the reassembled resource access requests can be quickly accessed, which not only has low implementation cost and no compatibility issues, but also can obtain a higher resource access rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Other features, objectives and advantages of the present invention will become more apparent from a reading of the detailed description of non-limiting embodiments made with reference to the following accompanying drawings.

[0039] Figure 1 A structural diagram showing a resource access system according to an embodiment of the present disclosure.

[0040] Figure 2 A schematic diagram showing the structure of a resource access system according to another embodiment of the present disclosure.

[0041] Figure 3 A flowchart showing a resource access method according to an embodiment of the present disclosure.

[0042] Figure 4 exhibit Figure 3 The flowchart of the resource access method in an application scenario is shown.

[0043] Figure 5 exhibit Figure 3 The flowchart of the resource access method shown in another application scenario.

[0044] Figure 6 A schematic diagram showing the module structure of a resource access device according to an embodiment of the present disclosure.

[0045] Figure 7 is a schematic diagram of the structure of the electronic device of the present invention. and

[0046] Figure 8 It is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION

[0047] To make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0048] The accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware forwarding modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0049] In addition, the processes shown in the drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, some steps may be combined or partially combined, and the actual execution order may be changed according to the actual situation.

[0050] Below, the technical terms involved in the embodiments of the present disclosure are first introduced:

[0051] WebView refers to a web page (Web) view that can be used to use Web content in applications. It can be embedded in the mobile terminal to achieve hybrid development of the front end. Most hybrid development frameworks are based on the WebView mode for secondary development.

[0052] UQIC is a new universal, secure, multiplexed transport layer protocol that provides a large number of enhancements and aims to eventually replace TCP with lower connection and transmission delays. QUIC has been selected as the underlying transport protocol for HTTP / 3, which means that the QUIC protocol will occupy a larger share of Internet traffic.

[0053] HTTP / 3 is the latest version of the Hypertext Transfer Protocol (HTTP), which uses QUIC instead of TCP internally. It aims to provide a more efficient and secure foundation for the modern network. It has all the advantages provided by QUIC.

[0054] In related technologies, the mainstream protocol used in H5 front-end development is still HTTP / 2. This is because HTTP / 3 relies on the support of WebView, and the old version of WebView cannot support HTTP / 3. Even the new version of WebView in some terminal devices does not support HTTP / 3, such as the WKWebView browser of iOS devices. H5 developers cannot decide the terminal device and WebView version used by users, so QUIC compatibility issues arise.

[0055] Figure 1 The structure diagram of the resource access system of the embodiment of the present disclosure is shown, and the resource access system is applied to a terminal device, in which an application and a WebView component of the application are deployed. The terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto.

[0056] Among them, the resource access system includes the above-mentioned WebView component 110, WebView request interceptor 120, request agent 130 and QUIC requester 140.

[0057] In an application scenario, the application deployed on the terminal device receives user input, and the WebView component 110 initiates the resource access request in response to the user input. Exemplarily, the resource access request is a page access request.

[0058] When the WebView component 110 initiates a resource access request, the WebView request interceptor 120 immediately intercepts the resource access request, the request agent 130 parses the request parameter information based on the resource access request, reassembles the request parameter information based on the QUIC protocol, and sends the reassembled resource access request to the target server 150 based on QUIC communication through the QUIC requester 140;

[0059] Afterwards, the response result fed back by the target server 150 is transmitted back to the QUIC requester 140, and the QUIC requester 140 directly transmits the response result to the WebView component 110, which then displays the response result visually.

[0060] In this case, when the terminal device is equipped with an old version of the WebView component, there is no need to do secondary development and adaptation on the terminal device. The request parameter information can be reassembled based on the QUIC protocol, so that the reassembled resource access request can be transmitted through the QUIC protocol. This not only has low implementation costs and no compatibility issues, but also can achieve a higher resource access rate.

[0061] The disclosed embodiment also provides another resource access system, such as Figure 2 As shown, Figure 1 In comparison, the WebView request interceptor 220 is also used to determine the request type of the resource access request;

[0062] If the request type is a GET request, the Uniform Resource Locator (URL) information is obtained by parsing the resource access request, and the URL information is transmitted to the GET request agent 230. The GET request agent 230 reassembles the URL information based on the QUIC protocol and sends the reassembled resource access request to the QUIC requester 240. The reassembled resource access request supports HTTP / 3 transmission, and then the QUIC requester 240 sends the reassembled resource access request to the target server 250 based on QUIC communication.

[0063] If the request type is a POST request, the URL (Uniform ResourceLocator) information is obtained by parsing the resource access request, and the current request identification parameter is extracted according to the URL information. Based on the current request identification parameter, the current request parameter body corresponding to the current request identification parameter is obtained from the native layer (Native) of the terminal device. The URL information and the current request parameter body together constitute the request parameter information and are transmitted to the POST request agent 260. The POST request agent 260 reassembles the URL information and the current request parameter body into a resource access request, and sends the reassembled resource access request to the QUIC requester 240. The subsequent steps refer to the above and will not be repeated here.

[0064] GET request and POST request are the two most commonly used request methods in HTTP protocol. GET request is a request method to request resources from the server. When using GET request, the client sends a URL containing request parameters to the server. The server will parse this URL and then return the corresponding resources. The characteristic of GET request is that the request parameters are appended to the end of the URL.

[0065] POST request is a way to submit data to the server. When using POST request, the client sends an HTTP request containing a request body to the server. The server parses the data in the request body and returns the corresponding response result. The characteristics of POST request are that the request parameters are separated from the URL and will not be exposed in the URL, and a large amount of data can be submitted.

[0066] In this way, after intercepting the resource access request, the request type is first determined, and then the corresponding request parameter information is parsed based on the request type through the corresponding request proxy, and then reassembled. In this way, by setting the WebView interceptor and the above-mentioned GET and POST dual-channel proxy on the App side, the GET and POST requests of the WebView component can use the QUIC protocol to communicate with the server, which speeds up the page loading speed and improves the link success rate.

[0067] As follows, the present disclosure also provides a resource access method, which can be Figure 1 or Figure 2 The resource access system implementation shown may also be implemented through other devices or systems, which is not limited here.

[0068] The resource access method disclosed in the present invention is applied to a terminal device, which includes an application and a WebView component of the application. Specifically, the execution subject of the resource access method is the terminal device or an application running therein, such as Figure 3As shown, the resource access method may include but is not limited to the following steps:

[0069] Step 310: Obtain a resource access request initiated by a WebView component based on the application;

[0070] Step 320: intercepting the resource access request, and parsing the resource access request to obtain request parameter information;

[0071] Step 330: Based on the QUIC protocol, the request parameter information is reassembled and the assembled resource access request is sent to the target server.

[0072] Using this resource access method, the resource access request initiated by the WebView component is intercepted, and the request parameter information is reassembled based on the QUIC protocol. The assembled resource access request supports QUIC communication transmission, so that the reassembled resource access request can be accessed quickly. It not only has low implementation cost and no compatibility issues, but also can achieve a higher resource access rate.

[0073] In the disclosed embodiment, when the WebView component does not support the QUIC protocol, the resource access request is intercepted. In this embodiment, a WebView request interceptor is deployed in an old version of the WebView component or a terminal device that does not support the QUIC protocol. Once the WebView component initiates a resource access request, the WebView request interceptor is triggered to intercept, and then the subsequent steps are executed.

[0074] In the embodiment of the present disclosure, specifically, intercepting the resource access request includes:

[0075] When the WebView component is initialized, a WebView request interceptor is constructed through the shouldInterceptRequest callback method in the WebViewClient interface;

[0076] The resource access request is intercepted by the WebView request interceptor.

[0077] WebViewClient is an abstract class used to handle various events of WebView, such as web page loading start, web page loading completion, resource loading, error handling, etc. In this implementation, the shouldInterceptRequest callback method in the WebViewClient interface is used to automatically construct a WebView request interceptor, and subsequent resource access requests through the WebViewClient interface will be intercepted.

[0078] In the disclosed embodiment, for the intercepted resource access request, it is necessary to parse and obtain the request parameter information before reassembly, and the method of obtaining the request parameter information is different for resource access requests of different request types.

[0079] In an alternative approach, combining Figure 4 As shown, if the request type of the resource access request is a GET request, the parsing of the resource access request to obtain request parameter information includes:

[0080] Parse the resource access request to obtain URL information.

[0081] As mentioned above, for GET requests, specific request parameters are attached to the URL information. At this time, the URL information can be directly reassembled based on the QUIC protocol.

[0082] In one application scenario, when the WebView component initiates an H5 page loading request in response to user input, the H5 page loading request is a type of resource access request. The WebView request interceptor intercepts the GET-type HTML request, parses the URL information, assembles a new native proxy GET request using the URL information, and initiates a new GET-type resource access request through QUIC communication. When the response result returned by the target server is received, the response result is returned to the WebView component, and the GET proxy QUIC request is completed.

[0083] After HTML is loaded, WebView will continue to send GET requests to load js, css and other resources, and will also send POST requests to the server to obtain the data required by the page. These requests will be intercepted by the WebView request interceptor, and it is necessary to determine whether the intercepted request is a GET request or a POST request;

[0084] In another embodiment, if the request type of the resource access request is a POST request, then Figure 5 As shown, the parsing of the resource access request to obtain request parameter information includes:

[0085] Parsing the resource access request to obtain URL information, and extracting a current request identifier requestID parameter from the URL information;

[0086] The current request parameter body requestBody corresponding to the requestID parameter is obtained through the native layer in the terminal device, and the URL information and the current request parameter body requestBody together constitute the request parameter information.

[0087] As mentioned above, a POST request is a request method for submitting data to a server, and the data to be submitted is a request parameter body stored in the native layer. Therefore, after obtaining the URL information by parsing the resource access request, the request parameter body is further obtained from the native layer and reassembled into a POST request.

[0088] In an optional manner, before intercepting the resource access request, the resource access method further includes:

[0089] The POST request proxy JS script is injected through the WebView component, and a request identification parameter and a corresponding request parameter body are created based on the POST request proxy JS script, and transmitted to the native layer, so that the native layer maps and binds the request identification parameter and the request parameter body; then,

[0090] The obtaining, through the native layer in the terminal device, a current request parameter body corresponding to the current request identification parameter includes:

[0091] The native layer queries the bound current request parameter body based on the current request identification parameter extracted from the uniform resource locator information.

[0092] In this embodiment, before intercepting the POST request, the requestId and requestBody with a mapping relationship of the POST request are first passed to the native. The native finds the parameter requestBody of the POST request according to the requestId parameter carried in the URL of the POST request, and then assembles the URL and requestBody of the POST request into a new native-side POST proxy request.

[0093] Specifically, when the WebViewClient interface calls back the doUpdateVisitedHistory (update history) method, a local javascript script is injected through the evaluateJavascript (native layer call) method provided by the WebView component. The script is used to proxy the post request. The specific process is as follows:

[0094] A) Rewrite the native js XMLHttpRequest.prototype.open method and add a parameter named requestId to its URL parameter. The parameter value is the unique id value randomly generated when calling the open method. The rest of the logic remains unchanged.

[0095] B) Rewrite the XMLHttpRequest.prototype.send method of native js, call the javascriptbridge interface agreed with native together with the post request parameter body requestBody passed in by the method and the requestId in a), and pass it to native;

[0096] C) Native maps and binds the received requestId and requestBody in the agreed javascriptbridge interface.

[0097] In this way, when a resource access request is intercepted later, the corresponding current request parameter body can be obtained from native.

[0098] Figure 6 Schematic diagram of the structure of the resource access device of the present invention. Figure 6 As shown, the resource access device 600 of the present invention includes:

[0099] The acquisition module 610 is configured to acquire a resource access request initiated based on the WebView component;

[0100] The interception module 620 is configured to intercept the resource access request and parse the resource access request to obtain request parameter information;

[0101] The assembly module 630 is configured to reassemble the request parameter information based on the QUIC protocol and send the assembled resource access request to the target server.

[0102] In an optional implementation, the interception module 620 is specifically configured to:

[0103] In the case that the WebView component does not support the QUIC protocol, the resource access request is intercepted.

[0104] In an optional implementation, the interception module 620 is specifically configured as follows:

[0105] When the WebView component is initialized, a WebView request interceptor is constructed through the shouldInterceptRequest callback method in the WebViewClient interface;

[0106] The resource access request is intercepted by the WebView request interceptor.

[0107] In an optional implementation manner, if the request type of the resource access request is a GET request, the interception module 620 is specifically configured as follows:

[0108] The resource access request is parsed to obtain uniform resource locator information.

[0109] In an optional implementation manner, if the request type of the resource access request is a POST request, the interception module 620 is specifically configured as follows:

[0110] Parsing the resource access request to obtain uniform resource locator information, and extracting a current request identification parameter from the uniform resource locator information;

[0111] The current request parameter body corresponding to the current request identification parameter is obtained through the native layer in the terminal device, and the uniform resource locator information and the current request parameter body together constitute the request parameter information.

[0112] In an optional implementation, the interception module 620 is further configured to:

[0113] Before intercepting the resource access request, a POST request proxy JS script is injected through the WebView component, a request identification parameter and a corresponding request parameter body are created based on the POST request proxy JS script, and transmitted to the native layer, so that the native layer maps and binds the request identification parameter and the request parameter body; then,

[0114] The native layer queries the bound current request parameter body based on the current request identification parameter extracted from the uniform resource locator information.

[0115] In an optional embodiment, the assembly module 630 is further configured to:

[0116] When a response result of the resource access request is received from the target server, the response result is returned to the WebView component.

[0117] The disclosed embodiment provides a resource access device, which intercepts resource access requests initiated by WebView components, and reassembles request parameter information based on the QUIC protocol, so that the assembled resource access requests support QUIC communication transmission, so that the reassembled resource access requests can be quickly accessed, which not only has low implementation costs and no compatibility issues, but also can obtain a higher resource access rate.

[0118] An embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein executable instructions of the processor are stored, wherein the processor is configured to execute the steps of the resource access method by executing the executable instructions.

[0119] As mentioned above, the electronic device of the present invention intercepts the resource access request initiated by the WebView component, and reassembles the request parameter information based on the QUIC protocol, so that the assembled resource access request supports QUIC communication transmission, so that the reassembled resource access request can be quickly accessed, which not only has low implementation cost and no compatibility issues, but also can obtain a higher resource access rate.

[0120] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "platforms".

[0121] Figure 7 Schematic diagram of the structure of the electronic device of the present invention. Figure 7 An electronic device 700 according to this embodiment of the present invention will be described. Figure 7 The electronic device 700 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0122] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different platform components (including the storage unit 720 and the processing unit 710), a display unit 740, etc.

[0123] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps of various exemplary embodiments of the present invention described in the resource access method section of this specification. For example, the processing unit 710 can perform the following steps: Figure 3 Steps shown.

[0124] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 721 and / or a cache memory unit 722 , and may further include a read-only memory unit (ROM) 723 .

[0125] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0126] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0127] The electronic device 700 may also communicate with one or more external devices 70 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 760. The network adapter 760 may communicate with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.

[0128] The embodiment of the present invention also provides a computer-readable storage medium for storing a program, and the steps of the resource access method are implemented when the program is executed. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the resource access method section above in this specification.

[0129] As shown above, when the program of the computer-readable storage medium of this embodiment is executed, it can intercept the resource access request initiated by the WebView component, and reassemble the request parameter information based on the QUIC protocol, so that the assembled resource access request supports QUIC communication transmission, so that the reassembled resource access request can be quickly accessed, which not only has low implementation cost and no compatibility issues, but also can obtain a higher resource access rate.

[0130] Figure 8 Schematic diagram of the structure of the computer-readable storage medium of the present invention. Figure 8As shown, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0131] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0132] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.

[0133] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0134] In summary, the resource access method, apparatus, device and storage medium of the present invention can intercept resource access requests initiated by the WebView component, and reassemble the request parameter information based on the QUIC protocol, so that the assembled resource access request supports QUIC communication transmission, so that the reassembled resource access request can be quickly accessed, which not only has low implementation cost and no compatibility issues, but also can obtain a higher resource access rate.

[0135] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. A resource access method, It is characterized in that Applied to a terminal device, the terminal device includes an application and a WebView component of the application, and the resource access method includes: Obtaining a resource access request initiated by a WebView component based on the application; Intercepting the resource access request, and parsing the resource access request to obtain request parameter information; Based on the QUIC protocol, the request parameter information is reassembled and the assembled resource access request is sent to the target server.

2. The resource access method according to claim 1, It is characterized in that The intercepting the resource access request comprises: In the case that the WebView component does not support the QUIC protocol, the resource access request is intercepted.

3. The resource access method according to claim 2, It is characterized in that The intercepting the resource access request comprises: When the WebView component is initialized, a WebView request interceptor is constructed through the shouldInterceptRequest callback method in the WebViewClient interface; The resource access request is intercepted by the WebView request interceptor.

4. The resource access method according to claim 1, It is characterized in that If the request type of the resource access request is a GET request, then the parsing of the resource access request to obtain request parameter information includes: The resource access request is parsed to obtain uniform resource locator information.

5. The resource access method according to claim 1, It is characterized in that If the request type of the resource access request is a POST request, the parsing of the resource access request to obtain request parameter information includes: Parsing the resource access request to obtain uniform resource locator information, and extracting a current request identification parameter from the uniform resource locator information; The current request parameter body corresponding to the current request identification parameter is obtained through the native layer in the terminal device, and the uniform resource locator information and the current request parameter body together constitute the request parameter information.

6. The resource access method according to claim 5, It is characterized in that Before intercepting the resource access request, the resource access method further includes: The POST request proxy JS script is injected through the WebView component, and a request identification parameter and a corresponding request parameter body are created based on the POST request proxy JS script, and transmitted to the native layer, so that the native layer maps and binds the request identification parameter and the request parameter body; then, The obtaining, through the native layer in the terminal device, a current request parameter body corresponding to the current request identification parameter includes: The native layer queries the bound current request parameter body based on the current request identification parameter extracted from the uniform resource locator information.

7. The resource access method according to claim 1, It is characterized in that The resource access method further includes: When a response result of the resource access request is received from the target server, the response result is returned to the WebView component.

8. A resource access device, It is characterized in that Applied to a terminal device, the terminal device includes an application and a WebView component of the application, including: An acquisition module is configured to acquire a resource access request initiated based on the WebView component; An interception module is configured to intercept the resource access request and parse the resource access request to obtain request parameter information; The assembly module is configured to reassemble the request parameter information based on the QUIC protocol and send the assembled resource access request to the target server.

9. An electronic device, It is characterized in that include: processor; a memory storing executable instructions of the processor; The processor is configured to execute the steps of the resource access method according to any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium for storing a program, It is characterized in that When the program is executed, the steps of the resource access method according to any one of claims 1 to 7 are implemented.