CN111339461A - Page access method of application program and related product - Google Patents
Page access method of application program and related product Download PDFInfo
- Publication number
- CN111339461A CN111339461A CN202010097984.5A CN202010097984A CN111339461A CN 111339461 A CN111339461 A CN 111339461A CN 202010097984 A CN202010097984 A CN 202010097984A CN 111339461 A CN111339461 A CN 111339461A
- Authority
- CN
- China
- Prior art keywords
- webpage
- access request
- electronic equipment
- application program
- user interface
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application relates to business process optimization of pedestal operation and maintenance, and particularly discloses a page access method of an application program and a related product, wherein the application program is applied to electronic equipment, the application program is any application in the electronic equipment, and the application program calls a browser control which is built in the electronic equipment through an interface, and the method comprises the following steps: when a thread for accessing a webpage is established, the electronic equipment calls a user interface network view through an interface of the application program to generate a webpage access request; the electronic equipment intercepts the webpage access request through the user interface network view, and searches for local webpage resources corresponding to the webpage access request so as to preload the local webpage resources; the electronic equipment sends the webpage access request to a global wide area network server through the application program; and the electronic equipment receives the online webpage resources corresponding to the webpage access request returned by the global wide area network server. The method and the device for optimizing the page access process are beneficial to optimizing the page access process.
Description
Technical Field
The application relates to the technical field of internet, in particular to a page access method of an application program and a related product.
Background
With the popularization of terminals, people can browse various news information and query contents through a browser. Currently, the mainstream operating systems of mobile display terminals include android and IOS, which is a mobile operating system developed by apple inc. When I0S was developed using the API and HTML5.0 hybrid, there are two ways to access the H5 page under the iOS system: the first method is that an H5 page is accessed through UIWebView, and an application program can intercept the request of H5 through the request of UIWebView access, so that the H5 page and the logic of resource preloading can be written, and the optimization effect of page quick opening is realized, however, the http protocol version of the request is 1.1 through the request sent by UIWebView, and the http2.0 is not supported. Therefore, when the background server already supports http2.0, if the UIWebView access is continuously used, the performance improvement caused by http2.0 cannot be enjoyed. The second method is that H5 pages are accessed through WKWebView, and the http protocol version of the request supports both http1.1 and http2.0 through a request sent by UIWebView, so that when a background server supports http2.0, the performance improvement brought by http2.0 can be enjoyed by accessing H5 in the way of WKWebView. However, the disadvantage of WKWebView is that the app cannot intercept requests issued by webView, so developers cannot perform load optimization of pages by intercepting requests and then immediately returning resources to h 5.
Therefore, in order to experience performance improvement caused by http2.0, in the existing scheme, a wkbwebview is usually built in a terminal, so that an H5 page is accessed through the wkbwebview to support http2.0, and since an H5 page is accessed through the wkbwebview, a web access request cannot be intercepted, a web page cannot be previewed, further, loading of an optimized page cannot be realized, and user experience is reduced.
Disclosure of Invention
The embodiment of the application provides a page access method of an application program, a webpage access request is intercepted through UIWebView, the access request is sent through the application program, and page preview and http2.0 support are achieved when the webpage is accessed.
In a first aspect, an embodiment of the present application provides a page access method for an application program, where the application program is applied to an electronic device, the application program is any one application in the electronic device, and the application program calls a browser control built in the electronic device through an interface, and the method includes:
when a thread for accessing a webpage is established, the electronic equipment calls a user interface network view through the application program and initiates a webpage access request to a global wide area network (WWAN) web server;
the electronic equipment intercepts the webpage access request through the user interface network view, and searches webpage resources corresponding to the webpage access request in a cache so as to preload the webpage resources;
the electronic equipment sends the webpage access request to the web server through the application program;
and the electronic equipment receives the webpage resources of the webpage access request returned by the web server.
In a second aspect, an embodiment of the present application provides an application page access apparatus, where the access apparatus is applied to an electronic apparatus, the application is applied to an electronic device, the application is any application in the access apparatus, and the application calls a browser control built in the access apparatus through an interface, where the application includes:
the generating unit is used for calling a user interface network view through an interface of the application program to generate a webpage access request when a thread for accessing the webpage is established;
the intercepting unit is used for intercepting the webpage access request through the user interface network view and searching local webpage resources corresponding to the webpage access request so as to preload the local webpage resources;
a sending unit, configured to send the web page access request to a global wide area network web server through the application program;
and the receiving unit is used for receiving the online webpage resources which are returned by the web server and correspond to the webpage access request.
In a third aspect, embodiments of the present application provide an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for performing the steps in the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, which stores a computer program, where the computer program makes a computer execute the method according to the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product comprising a non-transitory computer-readable storage medium storing a computer program, the computer being operable to cause a computer to perform the method according to the first aspect.
The embodiment of the application has the following beneficial effects:
it can be seen that, in the embodiment of the application, when a webpage access request is generated in an application program, the webpage access request is intercepted by UIWebView, and the webpage resource corresponding to the webpage access request is preloaded; then, the webpage access request is sent to a web server through an application program so as to download the webpage resource from the server; the http2.0 is supported by the webpage access request sent by the application program. Therefore, the webpage access request is intercepted, preloading is achieved, http2.0 is supported, and webpage loading is achieved quickly.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a page access method for an application according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another page access method for an application according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another page access method for an application according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an access device according to an embodiment of the present application;
fig. 5 is a block diagram illustrating functional units of an access device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, result, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The access device in the present application may include a smart phone (such as an Android phone, an iOS phone, a windows phone, etc.), a tablet computer, a palm computer, a notebook computer, a Mobile internet device MID (MID for short), or a wearable device. The above access means are merely examples, not exhaustive, and include, but are not limited to, the above electronic devices. In practical applications, the access device may further include: intelligent vehicle-mounted terminal, computer equipment and the like.
In order to understand the embodiments of the present application, some terms are explained first.
UIWebView is a common control tool in an apple operating system IoS SDK (Software Development Kit), is a built-in browser control, and can be used for browsing a webpage, opening a document, and the like, and can realize the function of a browser.
WKWebView is an improvement on UIWebView, and compared with UIWebView, the performance, stability and memory occupation are greatly improved; allowing a Nitro library of JavaScript to load and increasing a loading progress attribute estimatedProgress by using (limitation in UIWebView) without loading a progress bar; more attributes of the HTML web page are supported.
When the UIWebView accesses the H5 page, a logic of the H5 page and resource preloading can be written, so that the optimization effect of quick page opening is achieved, however, the http protocol version of the request is 1.1 and the http2.0 is not supported through the request sent by the UIWebView.
When the page H5 is accessed through WKWebView, the request is sent through UIWebView, and the http protocol version of the request supports both http1.1 and http 2.0.
Referring to fig. 1, fig. 1 is a schematic flowchart of a page access method of an application according to an embodiment of the present application. The application program is applied to the electronic equipment, the application program is any application in the electronic equipment, and the application program calls a browser control which is built in the electronic equipment through an interface. The method of the embodiment comprises the following steps:
101: when a thread for accessing the webpage is established, the electronic equipment calls a user interface web view UIWebView through an interface of the application program to generate a webpage access request.
Optionally, the thread for accessing the web page is another thread established in the start thread of the application program when the application program is started.
Specifically, when a jump instruction is received on the basis of establishing the starting thread, the jump thread corresponding to the jump instruction is established in parallel, for example, if a link or an advertisement is clicked on a display interface of the application program, a page access thread for accessing the link or the advertisement is generated; or, when a refresh instruction is received on the basis of establishing the starting thread, establishing a page access thread corresponding to the refresh instruction, and the like.
Therefore, when a page access thread is established, the UIWebView control is called through the interface of the application program, a Uniform Resource Locator (URL) corresponding to the page access thread is extracted, and a webpage access request is generated based on the URL.
Specifically, a web page access request may be generated by generating an httpress object, and assigning the extracted uniform resource locator URL as a target address to the httpress object.
102: and the electronic equipment intercepts the webpage access request through the UIWebView, and searches webpage resources corresponding to the webpage access request in a cache so as to preload the webpage resources.
Optionally, after the webpage access request is generated, the webpage access request is intercepted through UIWebView, and a webpage resource corresponding to the webpage access request is searched in a cache to preload the webpage resource.
Optionally, before intercepting the web page access request, the electronic device first parses a header file of the web page access request, and when it is determined that the header file represents that the web page access request needs to be subjected to page preloading, searches for a local web page resource corresponding to the web page access request from local resources.
Specifically, for a request sent by UIWebView, app can be intercepted through nsUrl protocol, that is, a nsUrl protocol subclass is customized and registered in a URL loading system, and UIWebView is intercepted by the customized nsUrl protocol subclass when sending a webpage request. Therefore, when judging that the webpage resource corresponding to the webpage request is the preloaded resource, intercepting, searching the local webpage resource corresponding to the webpage access request in the cache, reading the local webpage resource into the memory, constructing a response NSHTTPUrl response of the HTTP request, and returning the response NSHTTPUrl response to the UIWebView through a callback mechanism provided by NSUrl protocol to realize webpage preloading.
103: and the electronic equipment sends the webpage access request to a global wide area network web server through the application program.
Optionally, the electronic device calls a request sending function of the system in the application program, and sends the web page request to a server through the request sending function, where the web server is a web server corresponding to the uniform resource locator. And when the electronic equipment sends a webpage access request through the application program, the webpage is obtained. Different controls of the electronic equipment send webpage access requests, and http protocol versions in the sent requests support both http1.1 and http2.0, so that the advantage of fast page loading of http2.0 is used while page preloading is achieved.
104: and the electronic equipment receives the webpage resources of the webpage access request returned by the web server.
It can be seen that, in the embodiment of the application, when a web access request is generated in an application program, the web access request is intercepted by UIWebView, so as to preload a web resource corresponding to the web access request; then, the webpage access request is sent to a web server through an application program so as to download the webpage resource from the server; the http2.0 is supported by the webpage access request sent by the application program. Therefore, the webpage access request is intercepted, preloading is achieved, http2.0 is supported, and webpage loading is achieved quickly.
In some possible embodiments, before the electronic device sends the web page access request to a global wide area network web server through the application program, the method further includes:
the electronic equipment inquires whether a historical Transmission Control Protocol (TCP) connection corresponding to the webpage request can exist in a target resource pool, if yes, the webpage resource corresponding to the webpage access request is obtained through the historical TCP connection, the webpage access request does not need to be sent to the web server, and the target resource pool is established by the electronic equipment based on the historical TCP connection.
Specifically, TCP connections of which connections have been established in the application are managed in a unified manner to obtain a resource pool, and when the electronic device sends a web page access request to the web server, historical TCP connections corresponding to the web page request are inquired in the resource pool, and web page resources are obtained through the TCP connections. Therefore, after web access requests of UIWebview are uniformly transmitted through the application program, the web access requests transmitted by the application program are http 2.0. Because the http2.0 has the characteristic of a multiplexing mechanism, the established connection can be directly multiplexed, because the UIWebview and the webpage requests sent by the application program have the same domain name (the connection with the same domain name can be directly multiplexed), when the application program uniformly sends the webpage access requests, the historical TCP connection can be multiplexed for webpage access, the requests can be sent without re-establishing the TCP connection, and the page access speed is improved.
In some possible embodiments, the method further comprises:
and the electronic equipment analyzes the data size of the online webpage resource, acquires the downloading speed of the online webpage resource, and displays the data size and/or the downloading speed through the UIwebview.
In the implementation mode, the data size and/or the downloading speed are displayed in real time, so that a user can know webpage loading information in time, and the user experience is improved.
In some possible embodiments, the method further comprises:
the electronic equipment analyzes the data type of the online webpage resource;
when the data type is image data, the electronic equipment selects a target display block matched with the data size from the distributed display blocks;
the electronic equipment caches the webpage resources to the target display block, and renders the webpage resources from the target display block through the UIwebview so as to display images corresponding to the webpage resources.
In some possible embodiments, after caching the online web page resource, the method further includes:
and acquiring the residual cache space and displaying the residual cache space.
In some possible embodiments, the method further comprises:
the electronic equipment acquires a preset display rule, wherein the display rule comprises at least one of the following rules: zooming web pages, adjusting display fonts or bolding titles;
and the electronic equipment displays the webpage resources according to the display rule.
Referring to fig. 2, fig. 2 is a schematic flowchart of another page access method for an application according to an embodiment of the present application. The same contents in this embodiment as those in the embodiment shown in fig. 1 will not be repeated here. The application program is applied to the electronic equipment. The method of the embodiment comprises the following steps:
201: when a thread for accessing the webpage is established, the electronic equipment calls a user interface web view UIWebView through an interface of the application program to generate a webpage access request.
202: and the electronic equipment analyzes a header file of the webpage access request, and intercepts the webpage access request through the UIWebView when the header file represents that the webpage access request needs to be subjected to page preloading.
203: and the electronic equipment searches for local webpage resources corresponding to the webpage access request so as to pre-load the local webpage resources.
204: and the electronic equipment sends the webpage access request to a global wide area network web server through the application program.
205: and the electronic equipment receives the online webpage resources corresponding to the webpage access request returned by the web server.
206: and the electronic equipment analyzes the data size of the online webpage resource, acquires the downloading speed of the online webpage resource, and displays the data size and/or the downloading speed through the UIwebview.
It should be noted that, the specific implementation of the steps of the method shown in fig. 2 can refer to the specific implementation of the method described in fig. 1, and will not be described here.
It can be seen that, in the embodiment of the application, when a web access request is generated in an application program, the web access request is intercepted by UIWebView, so as to preload a web resource corresponding to the web access request; then, the webpage access request is sent to a web server through an application program so as to download the webpage resource from the server; the http2.0 is supported by the webpage access request sent by the application program. Therefore, the webpage access request is intercepted, preloading is realized, http2.0 is supported, and webpage quick loading is realized; and whether interception is needed or not is judged before interception, so that the flexibility of webpage access is improved.
Referring to fig. 3, fig. 3 is a schematic flowchart of another page access method for an application according to an embodiment of the present application. The same contents in this embodiment as those in the embodiment shown in fig. 1 and 2 will not be repeated here. The application program is applied to the electronic equipment. The method of the embodiment comprises the following steps:
301: when a thread for accessing the webpage is established, the electronic equipment calls a user interface web view UIWebView through an interface of the application program to generate a webpage access request.
302: and the electronic equipment analyzes a header file of the webpage access request, and intercepts the webpage access request through the UIWebView when the header file represents that the webpage access request needs to be subjected to page preloading.
303: and the electronic equipment searches for local webpage resources corresponding to the webpage access request so as to pre-load the local webpage resources.
304: the electronic equipment determines whether historical Transmission Control Protocol (TCP) connection corresponding to the webpage request exists in a target resource pool or not;
if so, go to step 305;
if not, step 306 is performed.
305: and the electronic equipment reuses the historical TCP connection to obtain the online webpage resources corresponding to the webpage access request.
306: and the electronic equipment sends the webpage access request to a global wide area network web server through the application program.
307: and the electronic equipment receives the online webpage resources corresponding to the webpage access request returned by the web server.
308: and the electronic equipment analyzes the data size of the online webpage resource, acquires the downloading speed of the online webpage resource, and displays the data size and/or the downloading speed through the UIwebview.
It should be noted that, for the specific implementation of the steps of the method shown in fig. 3, reference may be made to the specific implementation of the method described in fig. 1, and a description thereof is omitted here.
It can be seen that, in the embodiment of the application, when a web access request is generated in an application program, the web access request is intercepted by UIWebView, so as to preload a web resource corresponding to the web access request; then, the webpage access request is sent to a web server through an application program so as to download the webpage resource from the server; the http2.0 is supported by the webpage access request sent by the application program. Therefore, the webpage access request is intercepted, preloading is realized, http2.0 is supported, and webpage quick loading is realized; and moreover, a target resource pool is established, the webpage connection can be obtained by multiplexing the historical TCP connection, and the page loading speed is further improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an access device 400 according to an embodiment of the present disclosure, consistent with the embodiments shown in fig. 1, fig. 2, and fig. 3. As shown in fig. 4, the access device 400 includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are different from the one or more application programs, and the one or more programs are stored in the memory and configured to be executed by the processor, the programs including instructions for performing the steps of:
when a thread for accessing a webpage is established, calling a user interface web view (UIWebView) through an interface of an application program to generate a webpage access request, wherein the application program is applied to an access device 400, the application program is any application in electronic equipment, and the application program calls a browser control built in the electronic equipment through the interface;
intercepting the webpage access request through the UIWebView, and searching local webpage resources corresponding to the webpage access request to preload the local webpage resources;
sending the web page access request to a global wide area network web server through the application program;
and receiving online webpage resources corresponding to the webpage access request returned by the web server.
In some possible embodiments, before the device intercepts the web page access request through the UIWebView, the program further includes instructions for performing the following steps:
analyzing a header file of the webpage access request;
and intercepting the webpage access request through the UIWebView when the header file represents that the webpage access request needs to be subjected to page preloading.
In some possible embodiments, in intercepting the web page access request through the UIWebView, the program is specifically configured to execute the following steps:
and intercepting the webpage access request through the NSUrl Protocol subclass pre-registered to the URL loading system.
In some possible embodiments, before sending the web page access request to a ww an web server by the application, the application is further configured to execute the following steps:
and inquiring whether historical Transmission Control Protocol (TCP) connection corresponding to the webpage request exists in a target resource pool, if so, multiplexing the historical TCP connection to obtain an online webpage resource corresponding to the webpage access request without sending the webpage access request to the web server, wherein the target resource pool is established by the electronic equipment based on the historical TCP connection.
In some possible embodiments, the program is further for executing the instructions of:
analyzing the data size of the online webpage resource, acquiring the downloading speed of the online webpage resource, and displaying the data size and/or the downloading speed through the UIwebview.
In some possible embodiments, the program is further for executing the instructions of:
analyzing the data type of the online webpage resource;
when the data type is image data, selecting a target display memory block matched with the data size from the distributed display memory blocks;
caching the webpage resources to the target display block, and rendering the webpage resources from the target display block through the UIwebview to display the image corresponding to the webpage resources.
In some possible embodiments, the program is further for executing the instructions of:
acquiring a preset display rule, wherein the display rule comprises at least one of the following: zooming web pages, adjusting display fonts or bolding titles;
and displaying the webpage resources according to the display rule.
Referring to fig. 5, fig. 5 shows a block diagram of a possible functional unit of the access device 500 according to the above embodiment, and the access device 500 includes: a generating unit 510, an intercepting unit 520, a transmitting unit 530 and a receiving unit 540, wherein:
the generating unit 510 is configured to invoke a user interface web view UIWebView through an interface of the application program to generate a web page access request when a thread for accessing a web page is established;
an intercepting unit 520, configured to intercept the web page access request through the UIWebView, and search a local web page resource corresponding to the web page access request, so as to preload the local web page resource;
a sending unit 530, configured to send the web page access request to a global wide area network web server through the application program;
a receiving unit 540, configured to receive the online web page resource corresponding to the web page access request returned by the web server.
In some possible embodiments, before the web page access request is intercepted by the UIWebView, the intercepting unit 520 is further configured to parse a header file of the web page access request, and intercept the web page access request by the UIWebView when it is determined that the header file represents that the web page access request needs to be subjected to page preloading.
In some possible embodiments, in terms of intercepting the web page access request by the UIWebView, the intercepting unit 520 is specifically configured to:
and intercepting the webpage access request through the NSUrl Protocol subclass pre-registered to the URL loading system.
In some possible embodiments, the accessing apparatus 500 further includes a searching unit 550, before sending the web page access request to the ww an web server through the application program,
a searching unit 550, configured to query whether a historical TCP connection corresponding to the web page request exists in a target resource pool, and if so, reuse the historical TCP connection to obtain an online web page resource corresponding to the web page access request without sending the web page access request to the web server, where the target resource pool is established by the electronic device based on the historical TCP connection.
In some possible embodiments, the access device 500 further comprises a display unit 560;
and the display unit 560 is configured to analyze the data size of the online webpage resource, acquire a download speed of the online webpage resource, and display the data size and/or the download speed through the UIwebview.
In some possible embodiments, the access device 500 further comprises a display unit 560;
a display unit 560, configured to parse the data type of the online web page resource;
when the data type is image data, selecting a target display memory block matched with the data size from the distributed display memory blocks;
caching the webpage resources to the target display block, and rendering the webpage resources from the target display block through the UIwebview to display the image corresponding to the webpage resources.
In some possible embodiments, the access device 500 further comprises a display unit 560;
the display unit 560 is configured to obtain a preset display rule, where the display rule includes at least one of the following: zooming web pages, adjusting display fonts or bolding titles;
and displaying the webpage resources according to the display rule.
The present application further provides a computer storage medium, which stores a computer program, where the computer program is executed by a processor to implement part or all of the steps of the page access method of any one of the application programs as described in the above method embodiments.
Embodiments of the present application also provide a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps of the page access method of any one of the application programs as described in the above method embodiments.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may be implemented in the form of a software program module.
The integrated units, if implemented in the form of software program modules and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (10)
1. A page access method of an application program is applied to an electronic device, the application program is any application in the electronic device, and the application program calls a browser control built in the electronic device through an interface, and the method comprises the following steps:
when a thread for accessing a webpage is established, the electronic equipment calls a user interface network view through an interface of the application program to generate a webpage access request;
the electronic equipment intercepts the webpage access request through the user interface network view, and searches local webpage resources corresponding to the webpage access request so as to preload the local webpage resources;
the electronic equipment sends the webpage access request to a global wide area network server through the application program;
and the electronic equipment receives online webpage resources corresponding to the webpage access request returned by the global wide area network server.
2. The method of claim 1, wherein before the electronic device intercepts the web page access request through the user interface web view, the method further comprises:
the electronic equipment analyzes a header file of the webpage access request;
and when determining that the header file represents that the webpage access request needs to be subjected to page preloading, triggering the electronic equipment to intercept the webpage access request through the user interface network view.
3. The method of claim 1 or 2, wherein the electronic device intercepts the web page access request through the user interface web view, and comprises:
and the electronic equipment intercepts the webpage access request through NSUrlProtocol subclass which is registered in a URLloading system in advance.
4. The method of claim 3, wherein before the electronic device sends the web page access request to a WWAN server through the application, the method further comprises:
and the electronic equipment inquires whether historical Transmission Control Protocol (TCP) connection corresponding to the webpage request exists in a target resource pool, if so, the historical TCP connection is reused to obtain online webpage resources corresponding to the webpage access request, and the target resource pool is established by the electronic equipment based on the historical TCP connection.
5. The method of claim 4, further comprising:
and the electronic equipment analyzes the data size of the online webpage resource, acquires the downloading speed of the online webpage resource, and displays the data size and/or the downloading speed through the user interface network view.
6. The method of claim 5, further comprising:
the electronic equipment analyzes the data type of the online webpage resource;
when the data type is image data, the electronic equipment selects a target display block matched with the data size from the distributed display blocks;
the electronic equipment caches the webpage resources to the target display and storage block, and renders the webpage resources from the target display and storage block through the user interface network view so as to display images corresponding to the webpage resources.
7. The method of claim 6, further comprising:
the electronic equipment acquires a preset display rule, wherein the display rule comprises at least one of the following rules: zooming web pages, adjusting display fonts or bolding titles;
and the electronic equipment displays the webpage resources according to the display rule.
8. A page access device of an application program, wherein the access device is applied to an electronic device, the application program is any application in the access device, and the application program calls a browser control built in the access device through an interface, comprising:
the generating unit is used for calling a user interface network view through an interface of the application program to generate a webpage access request when a thread for accessing the webpage is established;
the intercepting unit is used for intercepting the webpage access request through the user interface network view and searching local webpage resources corresponding to the webpage access request so as to preload the local webpage resources;
a sending unit, configured to send the web page access request to a global wide area network server through the application program;
and the receiving unit is used for receiving the online webpage resources corresponding to the webpage access request returned by the global wide area network server.
9. An electronic device comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps of the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010097984.5A CN111339461A (en) | 2020-02-17 | 2020-02-17 | Page access method of application program and related product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010097984.5A CN111339461A (en) | 2020-02-17 | 2020-02-17 | Page access method of application program and related product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111339461A true CN111339461A (en) | 2020-06-26 |
Family
ID=71181586
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010097984.5A Pending CN111339461A (en) | 2020-02-17 | 2020-02-17 | Page access method of application program and related product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111339461A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113094607A (en) * | 2021-04-08 | 2021-07-09 | 百度在线网络技术(北京)有限公司 | Method and device for acquiring local resources |
CN114065082A (en) * | 2021-11-30 | 2022-02-18 | 中国建设银行股份有限公司 | Webpage resource caching method, device and system |
CN115296915A (en) * | 2022-08-08 | 2022-11-04 | 广州华多网络科技有限公司 | Webpage data access method and device, equipment, medium and product thereof |
CN116456021A (en) * | 2023-04-20 | 2023-07-18 | 成都赛力斯科技有限公司 | Page data request method and device, electronic equipment and readable storage medium |
-
2020
- 2020-02-17 CN CN202010097984.5A patent/CN111339461A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113094607A (en) * | 2021-04-08 | 2021-07-09 | 百度在线网络技术(北京)有限公司 | Method and device for acquiring local resources |
CN113094607B (en) * | 2021-04-08 | 2024-04-19 | 百度在线网络技术(北京)有限公司 | Method and device for obtaining local resources |
CN114065082A (en) * | 2021-11-30 | 2022-02-18 | 中国建设银行股份有限公司 | Webpage resource caching method, device and system |
CN115296915A (en) * | 2022-08-08 | 2022-11-04 | 广州华多网络科技有限公司 | Webpage data access method and device, equipment, medium and product thereof |
CN115296915B (en) * | 2022-08-08 | 2023-07-18 | 广州华多网络科技有限公司 | Webpage data access method and device, equipment, medium and product thereof |
CN116456021A (en) * | 2023-04-20 | 2023-07-18 | 成都赛力斯科技有限公司 | Page data request method and device, electronic equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111339461A (en) | Page access method of application program and related product | |
CN104021172B (en) | Advertisement filter method and advertisement filter device | |
WO2020199751A1 (en) | Method and apparatus for loading page picture, and electronic device | |
CN106911693B (en) | Method and device for detecting hijacking of webpage content and terminal equipment | |
CN112115396B (en) | Webpage rendering method, device, equipment and storage medium | |
US10015226B2 (en) | Methods for making AJAX web applications bookmarkable and crawlable and devices thereof | |
CN103412928A (en) | Method and device for realizing browser page intelligent response-type layout on mobile terminal | |
CN112559927B (en) | Webpage loading method and device | |
US20140325323A1 (en) | Online video playing method and apparatus and computer readable medium | |
CN110442815B (en) | Page generation method, system, device and computer readable storage medium | |
CN106331149A (en) | Webpage code adapting method applicable to client environment | |
US9141724B2 (en) | Transcoder hinting | |
CN107040584B (en) | Method and device for downloading picture by client | |
CN111368235A (en) | Page rendering and displaying method, device, server and storage medium | |
CN1996295A (en) | Image forming apparatus and method to search for and print images on network | |
WO2014176906A1 (en) | Online video playing method and apparatus and computer readable medium | |
EP4198773A1 (en) | Image processing method and apparatus, and computer readable storage medium | |
CN111339456B (en) | Preloading method and device | |
CN106202578A (en) | A kind of browser local information synchronization processing method and device | |
CN111259283A (en) | Page resource preloading processing method and device, electronic device and storage device | |
KR20080100597A (en) | System and method for providing service of mobile web data via blocking the specified data | |
CN104811485A (en) | Resource sharing method | |
CN106354792B (en) | Webpage display method and device | |
US20080168229A1 (en) | Method of Caching Data Assets | |
CN106919595B (en) | Cookie mapping method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |