CN102033778A - Thread processing method for control, analysis and composition of embedded browser - Google Patents

Thread processing method for control, analysis and composition of embedded browser Download PDF

Info

Publication number
CN102033778A
CN102033778A CN 201010592474 CN201010592474A CN102033778A CN 102033778 A CN102033778 A CN 102033778A CN 201010592474 CN201010592474 CN 201010592474 CN 201010592474 A CN201010592474 A CN 201010592474A CN 102033778 A CN102033778 A CN 102033778A
Authority
CN
China
Prior art keywords
thread
message
browser
change step
webpage
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
Application number
CN 201010592474
Other languages
Chinese (zh)
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.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN 201010592474 priority Critical patent/CN102033778A/en
Publication of CN102033778A publication Critical patent/CN102033778A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a thread processing method for control, analysis and composition of an embedded browser. In the embedded browser, the requirements of analysis, style calculation and composition on calculation are higher and higher; the occupied resources of a central processing unit, an internal memory and the like are more and more; and the defects of low webpage displaying speed and poor user experience caused by serialized webpage analysis, style calculation and composition mode exist. In the method, the control and the composition of the embedded browser are categorized into a main thread; resource loading and analysis are categorized into a secondary thread; the serialized webpage analysis and composition process are parallelized; scheduling management is performed according to the information types of the browser; and a multi-thread scheduling mode of an operating system is combined, so that the problem of poor user experience caused by single webpage analysis and low single-thread response efficiency of composition is solved and the aims of responding to user operation quickly and updating webpage display timely are fulfilled.

Description

A kind of built-in browser control, the thread process method of resolving and setting type
Technical field
The invention belongs to the built-in browser technical field, particularly a kind of built-in browser control, the thread process method of resolving and setting type.
Background technology
Browser is a kind of client software based on HTML (Hypertext Markup Language), its major function is to download web page elements such as web document, picture, CSS (cascading style sheet) from the webserver, at first according to grammar explanation, the execution of these elements self, determine the layout of each element in webpage by calculating then, at last each element is outputed to screen and present to the user.The desktop browsers development has been tending towards ripe, and the built-in browser technology is just flourish.Because the restriction of resources such as embedded device CPU processing speed, storage space and power consumption, technology such as this resource downloading to built-in browser, parsing, composing have proposed challenge.
At present, when most of browsers are handled at the single-page webpage, to the loading section employing multithreading loading of Internet resources; Processing employing download, web page element parsing, structure DOM (DocumentObject Model) tree, calculating pattern, the composing of webpage is presented to the single-threaded serial processing process of screen.Along with enriching constantly of web page element, in built-in browser, parsing, pattern calculating and composing present the requirement of calculating more and more higher, and it is also more and more to take resources such as CPU, internal memory, causes web displaying speed slow, and user experience becomes worse and worse.
Summary of the invention
The objective of the invention is the single-threaded response efficiency difference of resolving, setting type and cause the relatively poor problem of user experience, the thread process method of proposed a kind of built-in browser control, resolving and setting type for the single-page that solves existing built-in browser.
To achieve these goals, technical scheme of the present invention is: the control of a kind of built-in browser, resolve the thread process method with composing, specific as follows: this method is divided into the main thread treatment step and from the thread process step, wherein,
A. main thread treatment step process user window events and webpage are set type and are presented;
B. load and dissection process from thread process step process web page resources.
Above-mentioned main thread treatment step is divided into following a few class to the message of handling to be handled:
A1. user's mouse or keyboard message are carried out mouse or keyboard message JS script;
A2. from thread webpage composing message, carrying out sets type calculates, and output has been set type webpage to screen;
A3. calculate pattern message from the thread webpage, calculate and renewal web displaying pattern.
Wherein, user's mouse or keyboard message are further divided into following a few class and are handled:
A11. send the web page resources loading messages to from thread: when needing the Web page loading resource, send the web page resources loading messages to from thread;
A12. carry out mouse or keyboard message JS script: during the No Assets load request, carry out mouse or keyboard message JS script; When the resource load request is arranged, send the resource loading messages and arrive from thread.
The above-mentioned message of handling from thread process step handle is divided into following a few class and handles:
B1. handle main thread web page resources loading messages, by network load-on module Web page loading resource;
B2. resolve data and structure webpage dom tree that network arrives.
Wherein, making up the webpage dom tree is further divided into following a few class and is handled:
B21. ask Internet resources to load: style sheet, picture etc. not to be downloaded the web page resources network requests join the request queue of network load-on module;
B22. need to set type: the operation of will setting type sends to main thread with form of message;
B23. need to calculate pattern: the pattern calculating operation is sent to main thread with form of message.
Further, the main thread treatment step comprises step by step following again:
Step 101: start browser, the initialization browser is created from thread, enters main thread, waits for receiving user's input and from Thread Messages, changeing step 102;
Step 102: check the main thread message queue,, change step 102 if empty; Otherwise, change step 103;
Step 103: handle the main thread message queue;
Step 104: whether check processing controls and composing message,, change step 105 if need; Otherwise, change step 106;
Step 105: if mouse-keyboard message is handled mouse-keyboard message: if need the load networks resource, to sending loading messages from thread; Otherwise, carry out mouse-keyboard JS script, change step 102; If composing message, carrying out sets type outputs to screen, changes step 102; If calculate pattern message, carry out and calculate pattern, change step 102;
Step 106: check whether be that browser withdraws from message,, change step 102 if not browser withdraws from message; Otherwise, change step 107;
Step 107: main thread is destroyed from resources such as thread, releasing memory, and browser withdraws from.
Further, comprise step by step following again from the thread process step:
Step 201: from the thread initialization, wait for main thread message, change step 202;
Step 202: check from thread message queue,, change step 202 if empty; Otherwise, change step 203;
Step 203: handle from thread message queue;
Step 204: check whether to handle and resolve and loading messages,, change step 205 if need; Otherwise, change step 207;
Step 205: if need to handle the web page resources loading messages, by changeing step 202 after the network load-on module loading resource; If need network data to arrive message, resolve network data and make up dom tree, change step 206;
Step 206: if need the load networks resource, the request Internet resources load, and change step 205; If need to set type, send composing message to main thread, change step 202; If need to calculate pattern, send and calculate pattern message to main thread, change step 202;
Step 207: check whether be that browser withdraws from message,, change step 202 if not browser withdraws from message; Otherwise, change step 208;
Step 208:, withdraw from from thread from resources such as thread releasing memory.
Beneficial effect of the present invention: the present invention is by being divided into main thread to built-in browser control and composing, resource loads and parsing is divided into from thread, the webpage of serial is resolved and the process of typeset parallelization, and carry out management and running according to the browser type of message, the multithread scheduling pattern of binding operation system, overcome the single-threaded response efficiency difference of single-page parsing, composing and caused the relatively poor problem of user experience, reached quick response user operation, the purpose of the web displaying that upgrades in time.
Description of drawings
Fig. 1 is the process flow diagram of treatment step of principal and subordinate's thread of built-in browser control, parsing and the composing framework of the embodiment of the invention.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, the present invention is further illustrated below in conjunction with drawings and Examples.
With the digital TV set-top box example below, the disposal route of the thread of specifically setting forth built-in browser control of the present invention, resolve and setting type.
Built-in browser of the present invention control, resolve that disposal route with the thread of composing is divided into the main thread treatment step and from the thread process step, specifically as shown in Figure 1, wherein,
A. main thread treatment step process user window events and webpage are set type and are presented;
B. load and dissection process from thread process step process web page resources.
Above-mentioned main thread treatment step is divided into following a few class to the message of handling to be handled:
A1. user's mouse or keyboard message are carried out mouse or keyboard message JS script;
A2. from thread webpage composing message, carrying out sets type calculates, and output has been set type webpage to screen;
A3. calculate pattern message from the thread webpage, calculate and renewal web displaying pattern.
Wherein, user's mouse or keyboard message are further divided into following a few class and are handled:
A11. send the web page resources loading messages to from thread: when needing the Web page loading resource, send the web page resources loading messages to from thread;
A12. carry out mouse or keyboard message JS script: during the No Assets load request, carry out mouse or keyboard message JS script; When the resource load request is arranged, send the resource loading messages and arrive from thread.
The above-mentioned message of handling from thread process step handle is divided into following a few class and handles:
B1. handle main thread web page resources loading messages, by network load-on module Web page loading resource;
B2. resolve data and structure webpage dom tree that network arrives.
Wherein, making up the webpage dom tree is further divided into following a few class and is handled:
B21. ask Internet resources to load: style sheet, picture etc. not to be downloaded the web page resources network requests join the request queue of network load-on module;
B22. need to set type: the operation of will setting type sends to main thread with form of message;
B23. need to calculate pattern: the pattern calculating operation is sent to main thread with form of message.
As shown in Figure 1a, further, the main thread treatment step comprises step by step following again:
Step 101: start browser, the initialization browser is created from thread, enters main thread, waits for receiving user's input and from Thread Messages, changeing step 102;
Step 102: check the main thread message queue,, change step 102 if empty; Otherwise, change step 103;
Step 103: handle the main thread message queue;
Step 104: whether check processing controls and composing message,, change step 105 if need; Otherwise, change step 106;
Step 105: if mouse-keyboard message is handled mouse-keyboard message: if need the load networks resource, to sending loading messages from thread; Otherwise, carry out mouse-keyboard JS (JavaScript) script, change step 102; If composing message, carrying out sets type outputs to screen, changes step 102; If calculate pattern message, carry out and calculate pattern, change step 102;
Step 106: check whether be that browser withdraws from message,, change step 102 if not browser withdraws from message; Otherwise, change step 107;
Step 107: main thread is destroyed from resources such as thread, releasing memory, and browser withdraws from.
Shown in Fig. 1 b, further, comprise step by step following again from the thread process step:
Step 201: from the thread initialization, wait for main thread message, change step 202;
Step 202: check from thread message queue,, change step 202 if empty; Otherwise, change step 203;
Step 203: handle from thread message queue;
Step 204: check whether to handle and resolve and loading messages,, change step 205 if need; Otherwise, change step 207;
Step 205: if need to handle the web page resources loading messages, by changeing step 202 after the network load-on module loading resource; If need network data to arrive message, resolve network data and make up dom tree, change step 206;
Step 206: if need the load networks resource, the request Internet resources load, and change step 205; If need to set type, send composing message to main thread, change step 202; If need to calculate pattern, send and calculate pattern message to main thread, change step 202;
Step 207: check whether be that browser withdraws from message,, change step 202 if not browser withdraws from message; Otherwise, change step 208;
Step 208:, withdraw from from thread from resources such as thread releasing memory.
The present invention is by being divided into main thread to built-in browser control and composing, resource loads and parsing is divided into from thread, the webpage of serial is resolved and the process of typeset parallelization, and carry out management and running according to the browser type of message, the multithread scheduling pattern of binding operation system, overcome the single-threaded response efficiency difference of single-page parsing, composing and caused the relatively poor problem of user experience, reached quick response user operation, the purpose of the web displaying that upgrades in time.
Those of ordinary skill in the art will appreciate that embodiment described here is in order to help reader understanding's principle of the present invention, should to be understood that the protection domain of inventing is not limited to such special statement and embodiment.Everyly make various possible being equal to according to foregoing description and replace or change, all be considered to belong to the protection domain of claim of the present invention.

Claims (7)

1. built-in browser control, resolve the thread process method with composing, it is characterized in that, this method is divided into the main thread treatment step and from the thread process step, wherein,
A. main thread treatment step process user window events and webpage are set type and are presented;
B. load and dissection process from thread process step process web page resources.
2. built-in browser control according to claim 1, the thread process method of resolving and setting type is characterized in that, described main thread treatment step is divided into following a few class to the message of handling to be handled:
A1. user's mouse or keyboard message: carry out mouse or keyboard message JS script;
A2. from thread webpage composing message: carrying out sets type calculates, and output has been set type webpage to screen;
A3. calculate pattern message from the thread webpage: calculate and renewal web displaying pattern.
3. built-in browser control according to claim 2, the thread process method of resolving and setting type is characterized in that described user's mouse or keyboard message further are divided into following a few class and handle:
A11. send the web page resources loading messages to from thread: when needing the Web page loading resource, send the web page resources loading messages to from thread;
A12. carry out mouse or keyboard message JS script: during the No Assets load request, carry out mouse or keyboard message JS script; When the resource load request is arranged, send the resource loading messages and arrive from thread.
4. built-in browser according to claim 1 control, resolve and the thread process method of setting type, it is characterized in that, describedly from the thread process step message of processing is divided into following a few class and handles:
B1. handle main thread web page resources loading messages, by network load-on module Web page loading resource;
B2. resolve data and structure webpage dom tree that network arrives.
5. built-in browser control according to claim 4, the thread process method of resolving and setting type is characterized in that described structure webpage dom tree further is divided into following a few class to be handled:
B21. ask Internet resources to load: style sheet, picture etc. not to be downloaded the web page resources network requests join the request queue of network load-on module;
B22. need to set type: the operation of will setting type sends to main thread with form of message;
B23. need to calculate pattern: the pattern calculating operation is sent to main thread with form of message.
6. according to the thread process method of the described arbitrary built-in browser control of claim 1 to 5, parsing and composing, it is characterized in that described main thread treatment step comprises step by step following again:
Step 101: start browser, the initialization browser is created from thread, enters main thread, waits for receiving user's input and from Thread Messages, changeing step 102;
Step 102: check the main thread message queue,, change step 102 if empty; Otherwise, change step 103;
Step 103: handle the main thread message queue;
Step 104: whether check processing controls and composing message,, change step 105 if need; Otherwise, change step 106;
Step 105: if mouse-keyboard message is handled mouse-keyboard message: if need the load networks resource, to sending loading messages from thread; Otherwise, carry out mouse-keyboard JS script, change step 102; If composing message, carrying out sets type outputs to screen, changes step 102; If calculate pattern message, carry out and calculate pattern, change step 102;
Step 106: check whether be that browser withdraws from message,, change step 102 if not browser withdraws from message; Otherwise, change step 107;
Step 107: main thread is destroyed from resources such as thread, releasing memory, and browser withdraws from.
According to the described arbitrary built-in browser control of claim 1 to 5, resolve the thread process method with composing, it is characterized in that, describedly comprise step by step following again from the thread process step::
Step 201: from the thread initialization, wait for main thread message, change step 202;
Step 202: check from thread message queue,, change step 202 if empty; Otherwise, change step 203;
Step 203: handle from thread message queue;
Step 204: check whether to handle and resolve and loading messages,, change step 205 if need; Otherwise, change step 207;
Step 205: if need to handle the web page resources loading messages, by changeing step 202 after the network load-on module loading resource; If need network data to arrive message, resolve network data and make up dom tree, change step 206;
Step 206: if need the load networks resource, the request Internet resources load, and change step 205; If need to set type, send composing message to main thread, change step 202; If need to calculate pattern, send and calculate pattern message to main thread, change step 202;
Step 207: check whether be that browser withdraws from message,, change step 202 if not browser withdraws from message; Otherwise, change step 208;
Step 208:, withdraw from from thread from resources such as thread releasing memory.
CN 201010592474 2010-12-16 2010-12-16 Thread processing method for control, analysis and composition of embedded browser Pending CN102033778A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010592474 CN102033778A (en) 2010-12-16 2010-12-16 Thread processing method for control, analysis and composition of embedded browser

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010592474 CN102033778A (en) 2010-12-16 2010-12-16 Thread processing method for control, analysis and composition of embedded browser

Publications (1)

Publication Number Publication Date
CN102033778A true CN102033778A (en) 2011-04-27

Family

ID=43886712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010592474 Pending CN102033778A (en) 2010-12-16 2010-12-16 Thread processing method for control, analysis and composition of embedded browser

Country Status (1)

Country Link
CN (1) CN102033778A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761436A (en) * 2012-01-11 2012-10-31 武汉迈威光电技术有限公司 Implementation of private network management interface based on TCP (transmission control protocol)/UDP (user datagram protocol)
CN103034736A (en) * 2012-12-27 2013-04-10 深圳Tcl新技术有限公司 Browser based on webkit kernel and processing method of browser based on webkit kernel
CN103645849A (en) * 2013-12-20 2014-03-19 广东威创视讯科技股份有限公司 Processing method for browser page operation
CN104834544A (en) * 2015-05-04 2015-08-12 广州杰赛科技股份有限公司 Data loading method and device
CN105022667A (en) * 2014-04-25 2015-11-04 中国科学院声学研究所 Embedded browser CSS (Cascading Style Sheets) based engine parallelization method
CN108595457A (en) * 2017-12-29 2018-09-28 北京奇虎科技有限公司 A kind of rendering intent and device of the waterfall stream page
CN110851756A (en) * 2019-10-12 2020-02-28 平安普惠企业管理有限公司 Page loading method and device, computer readable storage medium and terminal equipment
CN111243044A (en) * 2020-01-06 2020-06-05 福建天泉教育科技有限公司 PDF transcoding method and storage medium for webpage containing picture

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003208253A (en) * 2002-01-11 2003-07-25 Sharp Corp Data structure for web page data, device and method for preparing or outputting web page, its program and recording medium having the program recorded thereon
CN1867144A (en) * 2006-06-08 2006-11-22 中国移动通信集团公司 Map browser embedded mobile terminal and mobile phone map mobile terminal platform
CN101178739A (en) * 2007-11-30 2008-05-14 四川长虹电器股份有限公司 Embedded browsing system and web page browsing method
CN101599015A (en) * 2009-07-07 2009-12-09 阿里巴巴集团控股有限公司 A kind of method and system of analyzing component

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003208253A (en) * 2002-01-11 2003-07-25 Sharp Corp Data structure for web page data, device and method for preparing or outputting web page, its program and recording medium having the program recorded thereon
CN1867144A (en) * 2006-06-08 2006-11-22 中国移动通信集团公司 Map browser embedded mobile terminal and mobile phone map mobile terminal platform
CN101178739A (en) * 2007-11-30 2008-05-14 四川长虹电器股份有限公司 Embedded browsing system and web page browsing method
CN101599015A (en) * 2009-07-07 2009-12-09 阿里巴巴集团控股有限公司 A kind of method and system of analyzing component

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《中国优秀硕士学位论文全文数据库》 20041231 周兴俊 嵌入式浏览器图像处理技术研究 第1页至第42页 1-7 , *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761436A (en) * 2012-01-11 2012-10-31 武汉迈威光电技术有限公司 Implementation of private network management interface based on TCP (transmission control protocol)/UDP (user datagram protocol)
CN103034736A (en) * 2012-12-27 2013-04-10 深圳Tcl新技术有限公司 Browser based on webkit kernel and processing method of browser based on webkit kernel
CN103034736B (en) * 2012-12-27 2016-12-28 深圳Tcl新技术有限公司 Browser based on webkit kernel and processing method thereof
CN103645849A (en) * 2013-12-20 2014-03-19 广东威创视讯科技股份有限公司 Processing method for browser page operation
CN105022667A (en) * 2014-04-25 2015-11-04 中国科学院声学研究所 Embedded browser CSS (Cascading Style Sheets) based engine parallelization method
CN105022667B (en) * 2014-04-25 2018-08-14 中国科学院声学研究所 One kind being based on built-in browser CSS engine parallel methods
CN104834544A (en) * 2015-05-04 2015-08-12 广州杰赛科技股份有限公司 Data loading method and device
CN104834544B (en) * 2015-05-04 2018-03-13 广州杰赛科技股份有限公司 Data load method and device
CN108595457A (en) * 2017-12-29 2018-09-28 北京奇虎科技有限公司 A kind of rendering intent and device of the waterfall stream page
CN110851756A (en) * 2019-10-12 2020-02-28 平安普惠企业管理有限公司 Page loading method and device, computer readable storage medium and terminal equipment
CN111243044A (en) * 2020-01-06 2020-06-05 福建天泉教育科技有限公司 PDF transcoding method and storage medium for webpage containing picture

Similar Documents

Publication Publication Date Title
CN102033778A (en) Thread processing method for control, analysis and composition of embedded browser
US10831858B2 (en) Mobile enablement of existing web sites
EP2916243B1 (en) Method, apparatus, server and system for implementing web application
US20180060139A1 (en) Application processing allocation in a computing system
US8245125B1 (en) Hybrid rendering for webpages
CN102855318B (en) Method and system for preloading of webpages
EP2352104A1 (en) Method and device for loading web page
US20110239108A1 (en) Configurable dynamic combination of html resources for download optimization in script based web page
CN102938776A (en) Dynamic page processing system based on Asynchronous JavaScript and XML (ajax) technique
US20130179767A1 (en) Reducing Ad Impact to Browser Onload Event
US20130339485A1 (en) Multi-Threaded Asynchronous Download of a Set of Script files Used in a Web Application
WO2012055764A1 (en) Interactive element management in a web page
JP2009294801A (en) Web page distribution system
CN105786455A (en) Method, device and terminal for data processing
CN104935666B (en) A kind of method and system for mobile terminal viewing pdf document
CN102999578A (en) Method and device for processing page element
CN103136290A (en) Processing method and processing device of web script file
US8860735B2 (en) Aligning script animations with display refresh
Wilkinson et al. QMachine: commodity supercomputing in web browsers
CN102981845A (en) Page elements processing method of browser and page elements processing device of browser
CN102955852A (en) Method, device and equipment for webpage resource processing
CN103458037A (en) Method and device for providing complex web applications in resource-constrained environment
CN103197922A (en) Technical method for developing (WEB) dynamic script by HTML (hypertext markup language)
CN113360139A (en) Integration method and device of front-end frame, electronic equipment and storage medium
CN111723314B (en) Webpage display method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20110427