CN109885408B - Lightweight browser resource optimization method based on Android system - Google Patents

Lightweight browser resource optimization method based on Android system Download PDF

Info

Publication number
CN109885408B
CN109885408B CN201910191759.5A CN201910191759A CN109885408B CN 109885408 B CN109885408 B CN 109885408B CN 201910191759 A CN201910191759 A CN 201910191759A CN 109885408 B CN109885408 B CN 109885408B
Authority
CN
China
Prior art keywords
resource
path
kernel
resources
content
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.)
Active
Application number
CN201910191759.5A
Other languages
Chinese (zh)
Other versions
CN109885408A (en
Inventor
曾祥阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN201910191759.5A priority Critical patent/CN109885408B/en
Publication of CN109885408A publication Critical patent/CN109885408A/en
Application granted granted Critical
Publication of CN109885408B publication Critical patent/CN109885408B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a resource optimization method of a lightweight browser based on an Android system, which is used for reducing the time for loading kernel resources and the space occupied by the kernel resources by optimizing the access mode of the kernel resources.

Description

Lightweight browser resource optimization method based on Android system
Technical Field
The invention relates to the technical field of browsers, in particular to a resource optimization method of a lightweight browser based on an Android system.
Background
At present, with the popularization of Android smart televisions, the requirements on the application performance and the user experience of the Android televisions are higher and higher, and as the first application which enters after the Android system is started, the performance of the Android desktop management application directly influences the experience of the whole system.
In order to solve the problems, Android television desktop management application developers use a lightweight browser to develop television desktop management applications. The resources of a typical lightweight browser require more space and time to access. Under the background that the application of the television is more and the functions are more and more abundant nowadays, under the condition that the functions are not influenced, the resource occupation of all the applications is reduced, and the method has a decisive role in improving the Android television performance. Therefore, optimizing the resources of the lightweight browser is the most important point in optimizing the performance of the Android television.
The existing problem is that the resources of the common lightweight browser need more space and time to access, because a common resource access mode is adopted. In a general resource access method, all resources are written first, and then the written resources are read, so that the operation of writing the resources consumes much space and time.
In order to provide better user experience for users and enable a light browser to run faster and occupy less space on Android, the method and the device optimize kernel resources by changing the access mode of the kernel resources.
Disclosure of Invention
Aiming at the problems, the invention provides a resource optimization method and a resource optimization method for a lightweight browser based on an Android system, which are used for reducing the time for loading kernel resources and the space occupied by the kernel resources by optimizing the access mode of the kernel resources.
In the invention, the core component of the browser is a browser kernel, and the browser kernel is a rendering engine adopted by the browser. In the invention, the browser rendering engine also becomes a browser kernel, which is called the kernel for short. The kernel is responsible for interpreting the syntax of the web page and displaying the web page.
The resource related to the invention is a kernel resource, and the kernel resource is a resource which can be used by the kernel to display the webpage content after explaining the webpage grammar, for example, font resources can be used to display the characters on the webpage.
The lightweight browser is a browser occupying a small amount of resources during operation, and the kernel of the Android native browser occupies more resources during operation. Compared with the kernel of the Android native browser, the kernel of the lightweight browser occupies less system resources.
The kernel resources of the lightweight browser are typically stored in the Android system by writing. And calling the resources written into the Android system when the kernel explains the webpage and displays the webpage.
The invention realizes the purpose through the following technical scheme:
a resource optimization method of a lightweight browser based on an Android system comprises the following steps:
step s1, defining a SYSTEM PATH SYSTEM _ PATH and a write PATH control _ PATH corresponding to the kernel resource in the kernel;
step s2, starting the desktop management application, and initializing the browser kernel;
step s3, step s2 is executed to start the initialization of the browser kernel in the process, the SYSTEM PATH is scanned correspondingly according to the SYSTEM _ PATH defined in step s1, if the SYSTEM resources exist, step s4 is executed, and if the SYSTEM resources do not exist, step s6 is executed;
step s4, according to the scanning result of step s3, determining whether all the target resources exist, if yes, entering step s5, otherwise, entering step s 6;
step s5, the resource in the SYSTEM _ PATH is used as the corresponding kernel resource, and the kernel resource completes the storage;
step s6, creating a resource write directory CONTENT _ PATH, and writing the resource write directory CONTENT _ PATH into the kernel resource;
step s7, storing the required kernel resource in the CONTENT _ PATH, and finishing the storage of the kernel resource at this time;
step s8, creating a resource write directory CONTENT _ PATH, and writing the missing kernel resource, where part of the kernel resource is stored in SYSTEM _ PATH and CONTENT _ PATH;
step s9, the kernel resource storage is finished, and the kernel starts to read the kernel resource;
step s10, scanning whether the SYSTEM _ PATH has the target resource, if yes, entering step s12, and if not, entering step s 11;
step s11, scanning and reading the target resource in the CONTENT _ PATH;
and step s12, the kernel renders the webpage by using the kernel resource, and finally displays the desktop management application.
In step s1, the font resource path is defined as: "/system/fonts", or multiple paths for multiple resources, depending on the particular path definition of the resources in the system.
In a further embodiment, in step s1, the modified kernel reads the system PATH resources first, and the modified kernel does not find the read write PATH CONTENT _ PATH.
The invention has the beneficial effects that:
according to the resource optimization method of the lightweight browser based on the Android system, the access mode of the kernel resource is optimized, so that the time for loading the kernel resource by the lightweight browser and the space occupied by the kernel resource are reduced; the method comprises the following steps: 1. the system resources stored in the Android system are used as kernel resources of the lightweight browser; 2. when the android system runs, the lightweight browser firstly scans a system resource path; 3. when the lightweight browser runs in the android system, scanning a target resource file under a system resource path, and not writing corresponding resources into a system disk; and changing the reading of the lightweight browser on the kernel resource on the android system, wherein the reading comprises the following steps: 1. when reading the kernel resource, scanning a corresponding system resource path; 2. the system resource path is directly read when scanned to the target, and is not scanned under the system resource path, and then the system resource path is scanned and written into the resource path for reading; 3. and scanning the target resource by the kernel under the system path, and rendering the page by taking the read system resource as the kernel resource.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the embodiments or the drawings needed to be practical in the prior art description, and obviously, the drawings in the following description are only some embodiments of the embodiments, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of kernel resource access when a lightweight browser is started according to the prior art;
FIG. 2 is a flow chart of a method of an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
FIG. 1 is a flow chart of kernel resource access when a lightweight browser is started according to the prior art; wherein, the inside of the dotted line frame is a reading flow, the outside of the frame is a storage flow, and the module for thickening the font carries out writing operation, which is a main time-consuming and resource-consuming part;
FIG. 2 is a flow chart of a method of an embodiment of the present invention for describing an optimized resource access process; the reading process is arranged in the dotted line frame, and the storage process is arranged outside the dotted line frame; the s6 and s8 steps are time consuming and resource consuming operations that are not performed when system resources exist that are kernel resources.
In a specific embodiment, as shown in fig. 2, a resource optimization method for a lightweight browser based on an Android system of the present invention includes the following steps:
step s1, defining a SYSTEM PATH SYSTEM _ PATH and a write PATH control _ PATH corresponding to the kernel resource in the kernel;
step s2, starting the desktop management application, and initializing the browser kernel;
step s3, step s2 is executed to start the initialization of the browser kernel in the process, the SYSTEM PATH is scanned correspondingly according to the SYSTEM _ PATH defined in step s1, if the SYSTEM resources exist, step s4 is executed, and if the SYSTEM resources do not exist, step s6 is executed;
step s4, according to the scanning result of step s3, determining whether all the target resources exist, if yes, entering step s5, otherwise, entering step s 6;
step s5, the resource in the SYSTEM _ PATH is used as the corresponding kernel resource, and the kernel resource completes the storage;
step s6, creating a resource write directory CONTENT _ PATH, and writing the resource write directory CONTENT _ PATH into the kernel resource;
step s7, storing the required kernel resource in the CONTENT _ PATH, and finishing the storage of the kernel resource at this time;
step s8, creating a resource write directory CONTENT _ PATH, and writing the missing kernel resource, where part of the kernel resource is stored in SYSTEM _ PATH and CONTENT _ PATH;
step s9, the kernel resource storage is finished, and the kernel starts to read the kernel resource;
step s10, scanning whether the SYSTEM _ PATH has the target resource, if yes, entering step s12, and if not, entering step s 11;
step s11, scanning and reading the target resource in the CONTENT _ PATH;
and step s12, the kernel renders the webpage by using the kernel resource, and finally displays the desktop management application.
In this embodiment, in step s1, the font resource path is defined as: "/system/fonts", or multiple paths for multiple resources, depending on the particular path definition of the resources in the system.
In this embodiment, in step s1, the modified kernel reads the system PATH resources first, and the write PATH CONTENT _ PATH is not found.
In the first aspect of the present invention, changing the storage of kernel resources of a lightweight browser on an android system includes:
1. the system resources stored in the Android system are used as kernel resources of the lightweight browser;
2. when the android system runs, the lightweight browser firstly scans a system resource path;
3. when the lightweight browser runs in the android system, scanning a target resource file under a system resource path, and not writing corresponding resources into a system disk;
in a second aspect of the present invention, changing the reading of the kernel resource by the lightweight browser on the android system includes:
1. when reading the kernel resource, scanning a corresponding system resource path;
2. the system resource path is directly read when scanned to the target, and is not scanned under the system resource path, and then the system resource path is scanned and written into the resource path for reading;
3. and scanning the target resource by the kernel under the system path, and rendering the page by taking the read system resource as the kernel resource.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims. It should be noted that the various technical features described in the above embodiments can be combined in any suitable manner without contradiction, and the invention is not described in any way for the possible combinations in order to avoid unnecessary repetition. In addition, any combination of the various embodiments of the present invention is also possible, and the same should be considered as the disclosure of the present invention as long as it does not depart from the spirit of the present invention.

Claims (1)

1. A resource optimization method of a lightweight browser based on an Android system is characterized by comprising the following steps:
step s1, defining a SYSTEM PATH SYSTEM _ PATH and a write PATH control _ PATH corresponding to the kernel resource in the kernel; in step s1, defining font resource path as "/system/fonts", or defining multiple paths corresponding to multiple resources according to the specific path of the resources in the system; in step s1, the modified kernel first reads the system PATH resource, and reads the write PATH CONTENT _ PATH if the modified kernel is not found;
step s2, starting the desktop management application, and initializing the browser kernel;
step s3, step s2 is executed to start the initialization of the browser kernel in the process, the corresponding SYSTEM PATH is scanned according to the SYSTEM _ PATH defined in step s1, if there are SYSTEM resources, step s4 is executed, otherwise, step s6 is executed;
step s4, according to the scanning result of step s3, determining whether all the target resources exist, if yes, entering step s5, otherwise, entering step s 8;
step s5, the resource in the SYSTEM _ PATH is used as the corresponding kernel resource, and the kernel resource completes the storage;
step s6, creating a resource write directory CONTENT _ PATH, and writing the resource write directory CONTENT _ PATH into the kernel resource;
step s7, storing the required kernel resource in the CONTENT _ PATH, and finishing the storage of the kernel resource at this time;
step s8, creating a resource write directory CONTENT _ PATH, and writing the missing kernel resource, where part of the kernel resource is stored in SYSTEM _ PATH and CONTENT _ PATH;
step s9, the kernel resource storage is finished, and the kernel starts to read the kernel resource;
step s10, scanning whether the SYSTEM _ PATH has the target resource, if yes, entering step s12, and if not, entering step s 11;
step s11, scanning and reading the target resource in the CONTENT _ PATH;
and step s12, the kernel renders the webpage by using the kernel resource, and finally displays the desktop management application.
CN201910191759.5A 2019-03-13 2019-03-13 Lightweight browser resource optimization method based on Android system Active CN109885408B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910191759.5A CN109885408B (en) 2019-03-13 2019-03-13 Lightweight browser resource optimization method based on Android system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910191759.5A CN109885408B (en) 2019-03-13 2019-03-13 Lightweight browser resource optimization method based on Android system

Publications (2)

Publication Number Publication Date
CN109885408A CN109885408A (en) 2019-06-14
CN109885408B true CN109885408B (en) 2022-05-03

Family

ID=66932186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910191759.5A Active CN109885408B (en) 2019-03-13 2019-03-13 Lightweight browser resource optimization method based on Android system

Country Status (1)

Country Link
CN (1) CN109885408B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105549993A (en) * 2015-12-09 2016-05-04 Tcl集团股份有限公司 Android system resource switching method and system
CN107436810A (en) * 2017-07-03 2017-12-05 北京东土科技股份有限公司 A kind of resource for computer system dispatching method and device
CN108182090A (en) * 2016-12-08 2018-06-19 腾讯科技(深圳)有限公司 Flash plug-in loading methods and device based on blink kernels
CN108549556A (en) * 2018-04-16 2018-09-18 腾讯科技(深圳)有限公司 A kind of application program accelerated method, device, terminal and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101447937A (en) * 2009-02-27 2009-06-03 北京理工大学 Rapid data positioning method based on path division and multi-distributed-directory
US8402018B2 (en) * 2010-02-12 2013-03-19 Korea Advanced Institute Of Science And Technology Semantic search system using semantic ranking scheme
WO2013019996A1 (en) * 2011-08-02 2013-02-07 Cavium, Inc. Lookup front end input processor
CN104657193B (en) * 2013-11-21 2018-07-20 华为技术有限公司 A kind of method and apparatus accessing physical resource
CN103902696B (en) * 2014-03-28 2017-10-13 广州华多网络科技有限公司 A kind of method and device for loading resource file
CN105511864A (en) * 2015-11-30 2016-04-20 青岛海信移动通信技术股份有限公司 Resource positioning method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105549993A (en) * 2015-12-09 2016-05-04 Tcl集团股份有限公司 Android system resource switching method and system
CN108182090A (en) * 2016-12-08 2018-06-19 腾讯科技(深圳)有限公司 Flash plug-in loading methods and device based on blink kernels
CN107436810A (en) * 2017-07-03 2017-12-05 北京东土科技股份有限公司 A kind of resource for computer system dispatching method and device
CN108549556A (en) * 2018-04-16 2018-09-18 腾讯科技(深圳)有限公司 A kind of application program accelerated method, device, terminal and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"Python+Selenium基础篇-打开和关闭火狐浏览器";smile_xxx;《https://www.cnblogs.com/baby0511/p/7873880.html》;20171121;第1-5页 *
"WebKit内核的嵌入式浏览器磁盘缓存方法";段虎才;《计算机工程与设计.2015》;20150330(第3期);第624-629页 *
"面向新硬件的数据处理软件技术";涂云山;《华东师范大学学报(自然科学版).2018》;20180925(第05期);第30-40、78页 *

Also Published As

Publication number Publication date
CN109885408A (en) 2019-06-14

Similar Documents

Publication Publication Date Title
CN111339455B (en) Method and device for loading page first screen by browser application
CN111639289A (en) Webpage loading method and device
US9003381B2 (en) Context-specific optimized code
EP2525294A1 (en) Method and device for rendering user interface font
US20110063258A1 (en) Handwriting input processing device and method
KR20140133807A (en) Drawing method, apparatus, and terminal
CN111026493B (en) Interface rendering processing method and device
CN105630454A (en) Information display method and terminal equipment
CN111880813B (en) Method for realizing android card UI (user interface) and storage medium
CN114218890A (en) Page rendering method and device, electronic equipment and storage medium
CN110471700B (en) Graphic processing method, apparatus, storage medium and electronic device
CN109885408B (en) Lightweight browser resource optimization method based on Android system
CN111737614A (en) Page display method and device, electronic equipment and storage medium
CN103678340B (en) The operation method of browser engine, device, browser and terminal
CN113703893A (en) Page rendering method, device, terminal and storage medium
CN114911541B (en) Processing method and device of configuration information, electronic equipment and storage medium
CN111596970A (en) Dynamic library delay loading method, device, equipment and storage medium
CN111538667A (en) Page testing method and device
CN111625290A (en) Layout file preloading method and device under Android platform and electronic equipment
CN105630556A (en) Resource loading method and system
CN113448649A (en) Redis-based home page data loading server and method
CN112148450A (en) Data processing method, device, equipment and storage medium
CN112612531A (en) Application program starting method and device, electronic equipment and storage medium
CN112559922B (en) Page rendering method, terminal device and storage medium
CN113779466B (en) Page display method and device, storage medium 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
GR01 Patent grant
GR01 Patent grant