CN112559172A - Method, system, equipment and storage medium for optimizing memory of web browser - Google Patents
Method, system, equipment and storage medium for optimizing memory of web browser Download PDFInfo
- Publication number
- CN112559172A CN112559172A CN202011424013.3A CN202011424013A CN112559172A CN 112559172 A CN112559172 A CN 112559172A CN 202011424013 A CN202011424013 A CN 202011424013A CN 112559172 A CN112559172 A CN 112559172A
- Authority
- CN
- China
- Prior art keywords
- page
- content
- sub
- container
- web server
- 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
- 238000000034 method Methods 0.000 title claims abstract description 74
- 238000009877 rendering Methods 0.000 claims abstract description 39
- 230000004048 modification Effects 0.000 claims description 11
- 238000012986 modification Methods 0.000 claims description 11
- 230000003247 decreasing effect Effects 0.000 claims description 8
- 230000008569 process Effects 0.000 abstract description 28
- 230000000694 effects Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 238000005457 optimization Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 238000013507 mapping Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- 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/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
-
- 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)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the application discloses a method, a system, equipment and a storage medium for optimizing the memory of a web browser. According to the technical scheme provided by the embodiment of the application, the corresponding URL address configured when the Web server creates the container page content is received, the WebView container page is correspondingly created according to the URL address, the container page content is pulled from the Web server based on the WebView container page and through the URL address, and the sub-page content in the container page content is loaded and displayed in a rotating manner based on the container page content. By adopting the technical means, the creation of the WebView control can be reduced by pulling the content of the container page and alternately loading and displaying the content of each sub-page, the memory pressure of the system is reduced by displaying the content of a plurality of web pages through one WebView container page, the situations that the memory of the system is tense and the application is forcibly closed due to excessive creation of the WebView control and excessive creation of the rendering process are avoided, and the running stability of the application is improved.
Description
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method, a system, equipment and a storage medium for optimizing the memory of a web browser.
Background
Currently, in many mobile phone applications, WebView (web browser component) is used to display web page content. Typically, a WebView is used to expose a web page. When the client needs to alternately display the contents of the multiple Web pages, the Web server needs to develop and complete the contents of the multiple Web pages and provide URL addresses (uniform resource locator systems) of the pages to the client. And a corresponding client side needs to create a plurality of WebViews and load a plurality of URL addresses given by the Web server to display corresponding webpage content.
However, when the client creates a plurality of WebView controls to load and display a plurality of web page contents, the creation of the plurality of WebView controls occupies a large amount of system memory, which causes insufficient system memory, and forced closing of the application is easily caused under the condition of memory pressure alarm, which affects the stability of the application.
Disclosure of Invention
The embodiment of the application provides a method, a system, equipment and a storage medium for optimizing the memory of a web browser, which can load and display contents of a plurality of web pages through one web browser, reduce the memory pressure of the system and improve the application stability.
In a first aspect, an embodiment of the present application provides a method for optimizing a memory of a web browser, including:
receiving a URL address of container page content sent by a Web server, wherein the URL address is configured correspondingly when the Web server creates the container page content, and the container page content comprises a plurality of sub-page contents;
and correspondingly creating a WebView container page according to the URL address, pulling the content of the container page from the Web server based on the WebView container page and the URL address, and alternately loading and displaying the content of each sub-page based on the content of the container page.
Further, the container page content includes a sub-page list, and the sub-page list includes sub-page addresses of the respective sub-page contents;
correspondingly, based on the WebView container page, pulling the content of the container page from the Web server through the URL address, and based on the content of the container page, loading and displaying the content of each sub-page, wherein the steps comprise:
the WebView container page pulls the sub-page list from the Web server through the URL address;
and pulling each corresponding sub-page content from the Web server based on each sub-page address of the sub-page list to perform alternate rendering display in a page window corresponding to the WebView container page.
Further, after pulling each corresponding sub-page content from the Web server based on each sub-page address of the sub-page list and performing rotation rendering display on a page window corresponding to the WebView container page, the method further includes:
based on the modification of the content of the container page by the Web server, pulling the modified content of the container page from the Web server through the URL address, and alternately loading and displaying the content of each sub-page based on the modified content of the container page.
Further, the modification of the content of the container page by the Web server includes:
and increasing or decreasing the sub-page addresses of the sub-page list, and correspondingly increasing or decreasing the mapped sub-page contents.
Further, the modification of the content of the container page by the Web server includes:
replacing the original one of the sub-page contents in the container page contents with the new one of the sub-page contents.
Furthermore, the content of the container page further includes a display time configuration parameter and a display sequence configuration parameter of each sub-page content, the display time configuration parameter is used for setting the time length of each sub-page content in rotation display, and the display sequence configuration parameter is used for setting the sequence of sub-page content in rotation display.
Further, the modification of the content of the container page by the Web server further includes:
and modifying the display time configuration parameters and/or the display sequence configuration parameters of the sub-page contents according to the display time requirements and/or the display sequence requirements of the sub-page contents.
Further, after pulling each corresponding sub-page content from the Web server based on each sub-page address of the sub-page list and performing rotation rendering display on a page window corresponding to the WebView container page, the method further includes:
receiving overtime display information or closing display information of the sub-page content, and stopping rendering and displaying the corresponding sub-page content.
Further, after the loading and displaying of the content of each sub page based on the container page content rotation, the method further includes:
and receiving overtime display information or closed display information of the page content of the container, and pulling and displaying the page content again according to the URL address.
In a second aspect, an embodiment of the present application provides a system for optimizing a memory of a web browser, including:
the receiving module is used for receiving a URL (uniform resource locator) address of container page content sent by a Web server, the URL address is correspondingly configured when the Web server creates the container page content, and the container page content comprises a plurality of sub-page contents;
and the pulling module is used for correspondingly creating a WebView container page according to the URL address, pulling the content of the container page from the Web server based on the WebView container page and the URL address, and alternately loading and displaying the content of each sub-page based on the content of the container page.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a memory and one or more processors;
the memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method for optimizing memory of a web browser according to the first aspect.
In a fourth aspect, embodiments of the present application provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the method for optimizing a memory of a web browser according to the first aspect.
The method comprises the steps of receiving a URL address correspondingly configured when a Web server creates container page content, correspondingly creating a WebView container page according to the URL address, pulling the container page content from the Web server based on the WebView container page and through the URL address, and alternately loading and displaying each sub-page content based on the container page content. By adopting the technical means, the creation of the WebView control can be reduced by pulling the content of the container page and alternately loading and displaying the content of each sub-page, the memory pressure of the system is reduced by displaying the content of a plurality of web pages through one WebView container page, the situations that the memory of the system is tense and the application is forcibly closed due to excessive creation of the WebView control and excessive creation of the rendering process are avoided, and the running stability of the application is improved.
In addition, the embodiment of the application can perform custom setting on the display of the WebView container page by increasing, decreasing and replacing the sub-page content and setting and modifying the display duration and the display sequence of the sub-page content, thereby optimizing the display effect of the page content.
Drawings
FIG. 1 is a diagram of a conventional web browser architecture;
fig. 2 is a flowchart of a method for optimizing a memory of a web browser according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating a Web server creating content of a container page according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a client content rotation loading process according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating a process of loading content of a display page by a client according to an embodiment of the present application;
FIG. 6 is a diagram illustrating a web browser architecture according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a device for optimizing a memory of a web browser according to a second embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to a third embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, specific embodiments of the present application will be described in detail with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some but not all of the relevant portions of the present application are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
The method for optimizing the memory of the Web browser aims to create a WebView container page through a URL (Uniform resource locator) address of container page content issued by a Web server and pull sub-page content of the container page content according to the URL to perform alternate loading and display. Therefore, the multiple page contents are loaded and displayed alternately through one WebView control, the creation of the WebView control is reduced on the premise of realizing the alternate loading and displaying of the multiple page contents, and the occupation of a system memory is reduced. Compared with the traditional client application, when the webpage browser is used for loading and displaying the webpage content, the corresponding number of WebView controls need to be created according to the amount of the webpage content to be loaded. As shown in fig. 1, taking the architecture of an active component of a client application as an example, the active component needs to alternately display three page contents on corresponding web page windows. And creating three WebView controls, wherein each WebView control pulls page content from the Web server according to the corresponding URL address to display. Due to the fact that the three WebView controls are created, the occupation of the system memory tends to be large. And each time a WebView control is created, a corresponding rendering process needs to be created to display the content of the pulled page, a plurality of rendering processes further occupy the system memory, so that the system memory is tense, and the client application is easily influenced by insufficient memory to be forcibly closed. Therefore, the method for optimizing the memory of the web browser is provided to solve the problem of memory occupation when the existing web browser performs multi-page content alternate display.
The first embodiment is as follows:
fig. 1 is a flowchart of a method for optimizing a memory of a web browser according to an embodiment of the present disclosure, where the method for optimizing a memory of a web browser provided in this embodiment may be executed by a memory optimizing device of a web browser, the memory optimizing device of a web browser may be implemented in a software and/or hardware manner, and the memory optimizing device of a web browser may be formed by two or more physical entities or may be formed by one physical entity. Generally, the device for optimizing the memory of the web browser can be an intelligent terminal device such as a mobile phone, a tablet or a computer.
The following description will be given by taking the web browser memory optimization device as an example of a main body for executing the web browser memory optimization method. Referring to fig. 2, the method for optimizing the memory of the web browser specifically includes:
s110, receiving a URL address of container page content sent by a Web server, wherein the URL address is configured correspondingly when the Web server creates the container page content, and the container page content comprises a plurality of sub-page contents;
s120, correspondingly creating a WebView container page according to the URL address, pulling the content of the container page from the Web server based on the WebView container page and the URL address, and alternately loading and displaying the content of each sub-page based on the content of the container page.
Specifically, when a Web browser is used for performing multi-page content alternate loading and displaying, in order to reduce creation of a WebView control and a corresponding rendering process, in the embodiment of the present application, a container page content is created corresponding to the WebView control, the container page content is a merged page content of a plurality of sub-page contents, a plurality of Web pages to be alternately loaded and displayed are required according to a Web page window corresponding to a client, and a Web server correspondingly creates the sub-page contents to form the container page content. In particular, referring to FIG. 3, a flow diagram of a Web server creating container page content is provided. As shown in fig. 3, when developing the content of the container page, the Web server first develops a corresponding number of sub-page contents according to a plurality of Web pages that need to be alternately displayed in a Web page window corresponding to the client. And correspondingly configuring a sub-page address based on the sub-page contents, wherein the sub-page address is substantially the same as the URL address and is used for searching resources corresponding to the sub-page contents in the Internet. And mapping the sub-page addresses and the sub-page contents with each other so that the client can pull the sub-page contents from the Web server subsequently according to the sub-page addresses. Furthermore, a sub-page list is formed based on each sub-page address, and each sub-page address is recorded in the sub-page list. And configuring corresponding URL addresses according to the sub-page list, and mapping the URL addresses with each other so as to facilitate the client to pull the sub-page list from the Web server according to the URL addresses. And finally, based on the created sub-page content, the sub-page address, the sub-page list and the URL address, the merged page content can be formed, and the creation of the merged page content is completed. After the creation of the merged page content is completed, the Web server issues the URL address to the client, the URL address is set as an address identifier when the client application requests the corresponding webpage content from the Web server, and the client application uses the URL address to request the webpage content from the Web server when loading and displaying the corresponding webpage content.
And the corresponding client side issues the URL address according to the Web server, and when a plurality of webpage pages need to be loaded and displayed, a WebView container page is created, wherein the WebView container page is equivalent to a WebView control, and the action essence of creating the WebView container page is to trigger the operation of the WebView control, namely, a webpage browser is started to load the URL address and pull the webpage content. Specifically, after the WebView container page is created, based on a URL address received in advance, the WebView container page requests the Web page content from the Web server using the URL address. It can be understood that, because the URL address is created corresponding to the content of the container page and is delivered to the client in advance, the corresponding content of the container page can be requested to be obtained based on the URL address. The content of the container page comprises the content of each sub-page, and after the content of the container page is pulled by the client, the content of the sub-page can be alternately loaded and displayed on a page window corresponding to the WebView container page through a rendering process based on the content of each sub-page contained in the content of the container page. Therefore, the rotation loading display of the contents of the multiple pages can be realized through one WebView control.
Specifically, referring to fig. 4, the client sub-page content rotation loading display process includes:
s1201, the WebView container page pulls the sub-page list from the Web server through the URL address;
s1202, pulling each corresponding sub-page content from the Web server based on each sub-page address of the sub-page list, and performing alternate rendering display on a page window corresponding to the WebView container page.
And when the WebView container page loads and displays the merged page content, requesting a sub-page list from the Web server through the corresponding URL address. The mapping relation between the URL address and the sub-page list is constructed in advance. And when the Web server receives a sub-page list pulling request containing the URL address, the corresponding sub-page list is obtained through the URL address query, and the sub-page list is sent to the client. Furthermore, the WebView container page analyzes the sub-page list to obtain the sub-page addresses based on the sub-page list received by the client, and the WebView container page can request the corresponding sub-page contents from the Web server through the sub-page addresses because the sub-page addresses are the unique address identifiers of the sub-page contents in the Internet. And the Web server sends the sub-page content corresponding to the sub-page address to the client according to the mapping relation between the sub-page address and the sub-page content. After the sub-page content which needs to be displayed by multi-page rotation is obtained by pulling, the sub-page content can be alternately rendered and displayed corresponding to the rendering process established by the WebView container page. Therefore, the alternate loading and display of the content of the plurality of pages by one WebView control and one rendering process are realized, the excessive occupation of the memory of the system by a plurality of WebView controls and a plurality of rendering processes is avoided, the memory management of the system is optimized, and the running stability of the application of the client is improved.
Referring to fig. 5, according to the page content that is alternately displayed in the Web page window corresponding to the client, the Web server correspondingly generates container page content by creating sub-page content and issues a corresponding URL address to the client. When a client opens a corresponding page, the creation of a WebView container page is triggered, a sub-page list is requested from a Web server according to a URL address, sub-page content is requested from the Web server according to the sub-page address in the sub-page list, and a rendering process is invoked to perform alternate rendering display of the sub-page content based on the pulled sub-page content. Because only one WebView control is created and one rendering process is used for performing sub-page content rotation rendering display, compared with a mode that a plurality of WebView controls are used for loading different page contents respectively and a plurality of rendering processes are used for rendering and displaying the different page contents, the embodiment of the application can reduce the occupation of the rendering processes on a system memory by reducing the WebView controls, so that the system memory management is optimized, and the effect of multi-page content rotation loading display can be achieved. Illustratively, as shown in fig. 6, taking the architecture of a client application activity component as an example, the activity component needs to display three page contents on the corresponding page window in turn. Based on the method for optimizing the memory of the Web browser in the embodiment of the application, the WebView container page is created, and the WebView container page pulls three sub-page contents from the Web server according to the corresponding URL address to perform loading display, so that the effect of alternately displaying the three page contents on one page window is achieved. The whole process only uses one WebView control (namely the WebView container page) and one corresponding rendering process, and the occupation of the WebView control and the rendering process on a system memory is relatively reduced.
Furthermore, according to actual display requirements, the content of the container page in the embodiment of the application can be adaptively modified, so that the client displays the page content required by the user corresponding to the webpage window. And the client pulls the modified content of the container page from the Web server through the URL address based on the modification of the content of the container page by the Web server, and alternately loads and displays the content of each sub-page based on the modified content of the container page. And modifying the sub-page content and the corresponding sub-page address in the container page content through the Web server, and displaying the modified page content at the client when the client requests to obtain the modified container page content again.
Specifically, the modification of the page content includes addition, reduction, and replacement of sub-page content. When the content of the sub-page is increased or decreased, the Web server correspondingly increases or decreases the mapped content of the sub-page by increasing or decreasing the address of the sub-page list. And when replacing sub-page content, replacing original one of the sub-page content in the container page content by using new sub-page content. It can be understood that after the content of the sub-page is modified, when the WebView container page requests the content of the container page from the Web server according to the same URL address, the obtained content of the container page after the content of the sub-page is modified is natural. Similarly, the page content displayed on the webpage window corresponding to the client by the alternate rendering will also change correspondingly. Therefore, the user-defined setting of the alternate display of the multi-page content can be realized, the display of the page content is adaptive to the real-time requirement of a user, and the display effect of the page content is optimized. In an embodiment, the Web server may also issue a page refresh instruction to the client, and the client refreshes the page content currently being alternately loaded and displayed in response to the page refresh instruction, corresponding to the modified container page content. And re-requesting the content of the container page from the Web server through the URL address, and rendering and displaying by loading the sub-page content in the content of the modified container page after the content of the container page is requested, so as to realize the real-time updating and displaying of the content of the container page.
On the other hand, the container page content further comprises a display time configuration parameter and a display sequence configuration parameter of each sub-page content, the display time configuration parameter is used for setting the alternate display duration of each sub-page content, and the display sequence configuration parameter is used for setting the alternate display sequence of the sub-page content. And when the Web server creates the content of the container page, setting corresponding display time configuration parameters and display sequence configuration parameters according to the display duration and display sequence requirements of each sub-page content. And when the subsequent client rendering process renders and displays each sub-page content, rendering and displaying each sub-page content based on the corresponding display time configuration parameter and display sequence configuration parameter. Through the setting of the configuration parameters of the display time and the configuration parameters of the display sequence, the display time and the display sequence for alternately loading and displaying the sub-page content can meet the content display requirements of developers, and the page content display effect is further optimized.
Correspondingly, in one embodiment, the display time configuration parameters and/or the display sequence configuration parameters of the sub-page contents are modified according to preset display time configuration parameters and display sequence configuration parameters and according to display duration requirements and/or display sequence requirements of the sub-page contents. In order to meet the real-time display requirement of the page content, when the content of the container page is modified, besides the addition, the reduction and the replacement of the content of the sub-page, the embodiment of the application may also modify the configuration parameter of the display time of the content of the sub-page and/or the configuration parameter of the display sequence. By modifying the display duration and the display sequence of the sub-page content in real time, the real-time display requirement of the sub-page content can be adapted, and the display effect of the page content is further optimized.
After the Web server modifies the content of the container page, the WebView container page can acquire the modified content of the container page for displaying when requesting the content of the container page next time according to the URL address. And if necessary, the content of the container page currently displayed by the webpage window related to the client side is changed in time. The rendering display flow of the content of the container page can be directly changed by issuing a relevant information instruction through a client background or a Web server.
And the client stops rendering and displaying the corresponding sub-page content by receiving overtime display information or closing display information of one sub-page content. Specifically, if it is required to stop displaying a certain sub-page content which is displayed by rotation in a webpage window related to a current client, and keep displaying the rest of the sub-page contents by rotation, the client background or the Web server issues overtime display information or closing display information of the sub-page content, at this time, the rendering process of the WebView container page stops rendering and displaying the sub-page content in response to the overtime display information or closing display information, and for the rest of the sub-page contents, the rotation rendering and displaying process is kept as usual. On the other hand, the client terminal pulls and displays the page content again according to the URL address by receiving overtime display information or closing display information of the page content of the container. Specifically, if all sub-page contents which are displayed alternately in a webpage window related to the current client are required to be stopped being displayed, overtime display information or closing display information of the container page contents is issued through a client background or a Web server, and at the moment, the WebView container page responds to the overtime display information or closing display information and requests the page contents from the Web server again according to the URL address. According to the modification of the original container page content by the Web server, the WebView container page requests the modified container page content to perform alternate loading display of the sub-page content. If the modified container page only contains one page content, the loading display of the page content is directly carried out. The overtime display information or the closing display information of the sub-page content or the whole combined container page content is received through the client, and then the display of the corresponding sub-page content or the combined container page content is stopped, so that the page content display can be changed in time, and the timeliness of the page content display change is ensured.
The method comprises the steps of receiving a URL address correspondingly configured when a Web server creates container page content, correspondingly creating a WebView container page according to the URL address, pulling the container page content from the Web server based on the WebView container page and through the URL address, and alternately loading and displaying each sub-page content based on the container page content. By adopting the technical means, the creation of the WebView control can be reduced by pulling the content of the container page and alternately loading and displaying the content of each sub-page, the memory pressure of the system is reduced by displaying the content of a plurality of web pages through one WebView container page, the situations that the memory of the system is tense and the application is forcibly closed due to excessive creation of the WebView control and excessive creation of the rendering process are avoided, and the running stability of the application is improved.
In addition, the embodiment of the application can perform custom setting on the display of the WebView container page by increasing, decreasing and replacing the sub-page content and setting and modifying the display duration and the display sequence of the sub-page content, thereby optimizing the display effect of the page content.
Example two:
on the basis of the foregoing embodiments, fig. 7 is a schematic structural diagram of a memory optimization system of a web browser according to a second embodiment of the present application. Referring to fig. 7, the system for optimizing a memory of a web browser provided in this embodiment specifically includes: a receiving module 21 and a pulling module 22.
The receiving module 21 is configured to receive a URL address of container page content sent by a Web server, where the URL address is configured when the Web server creates the container page content, and the container page content includes multiple sub-page contents;
the pulling module 22 is configured to create a WebView container page according to the URL address, pull the content of the container page from the Web server based on the WebView container page and the URL address, and alternately load and display the content of each sub-page based on the content of the container page.
The method comprises the steps of receiving a URL address correspondingly configured when a Web server creates container page content, correspondingly creating a WebView container page according to the URL address, pulling the container page content from the Web server based on the WebView container page and through the URL address, and alternately loading and displaying each sub-page content based on the container page content. By adopting the technical means, the creation of the WebView control can be reduced by pulling the content of the container page and alternately loading and displaying the content of each sub-page, the memory pressure of the system is reduced by displaying the content of a plurality of web pages through one WebView container page, the situations that the memory of the system is tense and the application is forcibly closed due to excessive creation of the WebView control and excessive creation of the rendering process are avoided, and the running stability of the application is improved.
Specifically, the pulling module 22 includes:
the first pulling unit is used for pulling the sub-page list from the Web server through the URL address by the WebView container page;
and the second pulling unit is used for pulling each corresponding sub-page content from the Web server based on each sub-page address of the sub-page list to perform alternate rendering display on a page window corresponding to the WebView container page.
The webpage browser memory optimization system provided by the second embodiment of the present application can be used for executing the webpage browser memory optimization method provided by the first embodiment of the present application, and has corresponding functions and beneficial effects.
Example three:
an embodiment of the present application provides an electronic device, and with reference to fig. 8, the electronic device includes: a processor 31, a memory 32, a communication module 33, an input device 34, and an output device 35. The storage 32 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the method for optimizing a memory of a web browser according to any embodiment of the present application (for example, a receiving module and a pulling module of a memory optimizing system of a web browser). The communication module 33 is used for data transmission. The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory, so as to implement the above-mentioned method for optimizing the memory of the web browser. The input device 34 may be used to receive entered numeric or character information and to generate key signal inputs relating to user settings and function controls of the apparatus. The output device 35 may include a display device such as a display screen. The electronic device provided by the embodiment can be used for executing the method for optimizing the memory of the web browser provided by the embodiment, and has corresponding functions and beneficial effects.
Example four:
embodiments of the present application also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform a method for memory optimization of a web browser as described above, and the storage medium may be any of various types of storage devices or storage devices. Of course, the storage medium including the computer-executable instructions provided in the embodiments of the present application is not limited to the method for optimizing the memory of the web browser described above, and may also perform related operations in the method for optimizing the memory of the web browser provided in any embodiment of the present application.
The foregoing is considered as illustrative of the preferred embodiments of the invention and the technical principles employed. The present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the claims.
Claims (12)
1. A method for optimizing a memory of a web browser is characterized by comprising the following steps:
receiving a URL address of container page content sent by a Web server, wherein the URL address is configured correspondingly when the Web server creates the container page content, and the container page content comprises a plurality of sub-page contents;
and correspondingly creating a WebView container page according to the URL address, pulling the content of the container page from the Web server based on the WebView container page and the URL address, and alternately loading and displaying the content of each sub-page based on the content of the container page.
2. The method according to claim 1, wherein the container page content comprises a sub-page list, the sub-page list comprising sub-page addresses of the sub-page content;
correspondingly, based on the WebView container page, pulling the content of the container page from the Web server through the URL address, and based on the content of the container page, loading and displaying the content of each sub-page, wherein the steps comprise:
the WebView container page pulls the sub-page list from the Web server through the URL address;
and pulling each corresponding sub-page content from the Web server based on each sub-page address of the sub-page list to perform alternate rendering display in a page window corresponding to the WebView container page.
3. The method for optimizing the memory of the Web browser according to claim 2, wherein after pulling each corresponding sub-page content from the Web server based on each sub-page address of the sub-page list to perform alternate rendering display in a page window corresponding to the WebView container page, the method further comprises:
based on the modification of the content of the container page by the Web server, pulling the modified content of the container page from the Web server through the URL address, and alternately loading and displaying the content of each sub-page based on the modified content of the container page.
4. The method for optimizing the memory of the Web browser according to claim 3, wherein the modification of the content of the container page by the Web server comprises:
and increasing or decreasing the sub-page addresses of the sub-page list, and correspondingly increasing or decreasing the mapped sub-page contents.
5. The method for optimizing the memory of the Web browser according to claim 3, wherein the modification of the content of the container page by the Web server comprises:
replacing the original one of the sub-page contents in the container page contents with the new one of the sub-page contents.
6. The method according to claim 3, wherein the container page content further includes a presentation time configuration parameter and a presentation sequence configuration parameter of each sub-page content, the presentation time configuration parameter is used to set a time duration for the alternative presentation of each sub-page content, and the presentation sequence configuration parameter is used to set an order for the alternative presentation of the sub-page content.
7. The method for optimizing memory of a Web browser according to claim 6, wherein the modification of the content of the container page by the Web server further comprises:
and modifying the display time configuration parameters and/or the display sequence configuration parameters of the sub-page contents according to the display time requirements and/or the display sequence requirements of the sub-page contents.
8. The method for optimizing the memory of the Web browser according to claim 2, wherein after pulling each corresponding sub-page content from the Web server based on each sub-page address of the sub-page list to perform alternate rendering display in a page window corresponding to the WebView container page, the method further comprises:
receiving overtime display information or closing display information of the sub-page content, and stopping rendering and displaying the corresponding sub-page content.
9. The method for optimizing the memory of the web browser according to claim 1, wherein after the content of each sub-page is alternately loaded and displayed based on the content of the container page, the method further comprises:
and receiving overtime display information or closed display information of the page content of the container, and pulling and displaying the page content again according to the URL address.
10. A system for optimizing memory of a web browser, comprising:
the receiving module is used for receiving a URL (uniform resource locator) address of container page content sent by a Web server, the URL address is correspondingly configured when the Web server creates the container page content, and the container page content comprises a plurality of sub-page contents;
and the pulling module is used for correspondingly creating a WebView container page according to the URL address, pulling the content of the container page from the Web server based on the WebView container page and the URL address, and alternately loading and displaying the content of each sub-page based on the content of the container page.
11. An electronic device, comprising:
a memory and one or more processors;
the memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method for optimizing memory of a web browser of any one of claims 1-9.
12. A storage medium containing computer-executable instructions for performing the method of optimizing memory of a web browser according to any one of claims 1 to 9 when executed by a computer processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011424013.3A CN112559172A (en) | 2020-12-08 | 2020-12-08 | Method, system, equipment and storage medium for optimizing memory of web browser |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011424013.3A CN112559172A (en) | 2020-12-08 | 2020-12-08 | Method, system, equipment and storage medium for optimizing memory of web browser |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112559172A true CN112559172A (en) | 2021-03-26 |
Family
ID=75059722
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011424013.3A Pending CN112559172A (en) | 2020-12-08 | 2020-12-08 | Method, system, equipment and storage medium for optimizing memory of web browser |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112559172A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113641929A (en) * | 2021-08-12 | 2021-11-12 | 百度在线网络技术(北京)有限公司 | Page rendering method and device, electronic equipment and computer-readable storage medium |
CN114117277A (en) * | 2021-11-26 | 2022-03-01 | 有半岛(北京)信息科技有限公司 | Webpage view display control method, device, equipment and storage medium |
CN115426510A (en) * | 2022-08-24 | 2022-12-02 | 北京嗨动视觉科技有限公司 | Programming method, programming device, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104516885A (en) * | 2013-09-26 | 2015-04-15 | 腾讯科技(深圳)有限公司 | Implementation method and device of browse program double-kernel assembly |
CN104850602A (en) * | 2015-05-04 | 2015-08-19 | 微梦创科网络科技(中国)有限公司 | Method and apparatus for rendering and refreshing based on Internet webpage |
CN104866534A (en) * | 2015-04-28 | 2015-08-26 | 北京奇虎科技有限公司 | Page demonstration method and device |
CN106682176A (en) * | 2016-12-29 | 2017-05-17 | 北京五八信息技术有限公司 | Page loading method, equipment and device |
CN109684590A (en) * | 2018-12-25 | 2019-04-26 | 威创集团股份有限公司 | A kind of browsing device net page data sharing method and device |
CN110069309A (en) * | 2019-04-23 | 2019-07-30 | 广州华多网络科技有限公司 | A kind of page configuration method, system and client |
-
2020
- 2020-12-08 CN CN202011424013.3A patent/CN112559172A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104516885A (en) * | 2013-09-26 | 2015-04-15 | 腾讯科技(深圳)有限公司 | Implementation method and device of browse program double-kernel assembly |
CN104866534A (en) * | 2015-04-28 | 2015-08-26 | 北京奇虎科技有限公司 | Page demonstration method and device |
CN104850602A (en) * | 2015-05-04 | 2015-08-19 | 微梦创科网络科技(中国)有限公司 | Method and apparatus for rendering and refreshing based on Internet webpage |
CN106682176A (en) * | 2016-12-29 | 2017-05-17 | 北京五八信息技术有限公司 | Page loading method, equipment and device |
CN109684590A (en) * | 2018-12-25 | 2019-04-26 | 威创集团股份有限公司 | A kind of browsing device net page data sharing method and device |
CN110069309A (en) * | 2019-04-23 | 2019-07-30 | 广州华多网络科技有限公司 | A kind of page configuration method, system and client |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113641929A (en) * | 2021-08-12 | 2021-11-12 | 百度在线网络技术(北京)有限公司 | Page rendering method and device, electronic equipment and computer-readable storage medium |
CN113641929B (en) * | 2021-08-12 | 2023-08-29 | 百度在线网络技术(北京)有限公司 | Page rendering method, device, electronic equipment and computer readable storage medium |
CN114117277A (en) * | 2021-11-26 | 2022-03-01 | 有半岛(北京)信息科技有限公司 | Webpage view display control method, device, equipment and storage medium |
CN115426510A (en) * | 2022-08-24 | 2022-12-02 | 北京嗨动视觉科技有限公司 | Programming method, programming device, electronic equipment and storage medium |
CN115426510B (en) * | 2022-08-24 | 2024-02-02 | 北京嗨动视觉科技有限公司 | Program arrangement method, program arrangement device, electronic apparatus, and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11144711B2 (en) | Webpage rendering method, device, electronic apparatus and storage medium | |
JP5805867B2 (en) | Remote browsing session management | |
US8719421B2 (en) | Cross domain interaction of a web application | |
CN112559172A (en) | Method, system, equipment and storage medium for optimizing memory of web browser | |
US20130014037A1 (en) | Multi-Process Browser Architecture | |
US20140026057A1 (en) | Providing access to a remote application via a web client | |
US20120042016A1 (en) | Exposing resource capabilities to web applications | |
WO2020052337A1 (en) | Information processing method and apparatus, storage medium, and electronic device | |
CN113468448A (en) | Page rendering method and device | |
US20150220496A1 (en) | Dynamic sprite based theme switching | |
US11151314B2 (en) | Extensible grid layout | |
WO2014035870A1 (en) | Method and apparatus of responding to webpage access request | |
JP5937207B2 (en) | Remote browsing session management | |
EP3407186B1 (en) | Interface refresh synchronization method and apparatus, terminal, and storage medium | |
CN115309470B (en) | Method, device, equipment and storage medium for loading widget | |
WO2020215833A1 (en) | Offline cache method and apparatus, and terminal and readable storage medium | |
CN108334322B (en) | Data request method and system of MVC framework | |
CN111294377B (en) | Dependency network request sending method, terminal device and storage medium | |
CN111581553A (en) | Network image display method, system, electronic equipment and storage medium | |
US8819568B1 (en) | Electronic paper display updates | |
CN112395535A (en) | Image lazy loading method and device, medium and electronic equipment | |
CN106874010A (en) | A kind of method of the quick paging loadings of ListView in android system | |
CN115858978A (en) | Page loading method and device based on updated resources | |
US11288336B2 (en) | Systems and methods for providing content items in situations involving suboptimal network conditions | |
CN114896011B (en) | Method and device for playing dynamic content in page, electronic equipment and storage medium |
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 |