Patented claim of the present invention is to be the divisional application that September 26, application number in 2011 are 201110289062.5, name is called the Chinese invention patent application of " a kind of page-downloading control method and system of IE kernel browser " applying date.
Summary of the invention
Technical problems to be solved in this application are to provide a kind of page-downloading control method of IE kernel browser, in order to the page-downloading process of effective control IE kernel browser, improve efficiency and the stability of page-downloading.
Correspondingly, the application also provides a kind of page-downloading control system of IE kernel browser, in order to ensure said method application in practice.
For addressing the above problem, the application provides a kind of page-downloading control method of IE kernel browser, comprising:
Start IE kernel browser process, and start preset downloading process;
Registering communication agreement in described IE kernel browser process, waits for the page-downloading request based on respective communication agreement;
In the time that described IE kernel browser process is received page-downloading request, trigger described downloading process and control page-downloading according to default download rule, and return to download status information to IE kernel browser process in described page-downloading process.
Preferably, described method also comprises:
The described download status information of described IE kernel browser process foundation, the operation that the page data of downloading is resolved, carried out and/or plays up.
Preferably, described in IE kernel browser process the step of registering communication agreement be, use the RegisterNameSpace method of IInternetSession interface, registering communication agreement in IE kernel browser process, described communication protocol comprises http agreement, https agreement, mailto agreement and File Transfer Protocol.
Preferably, described in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and comprise according to the step of default download rule control page-downloading:
In the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Downloading process is added into described page-downloading request in the download task list generating in advance;
Obtain page resource type corresponding to described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Process successively the page-downloading request in described download task list, carry out corresponding page-downloading operation.
Preferably, described page-downloading request comprises URL information, and described URL information comprises extension name information, and page resource type corresponding to described page-downloading request is by reading described extension name acquisition of information.
Preferably, described in the time that IE kernel browser process is received IE download request, trigger described downloading process and comprise according to the step of default download rule control page-downloading:
In the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Downloading process is obtained document size information corresponding to described page-downloading request;
Judge whether described document size information exceedes default file size threshold value, the mode that if so, adopts multithreading to download is carried out the down operation of respective page, otherwise, adopt the mode of single-threaded download to carry out the down operation of respective page.
Preferably, described in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and comprise according to the step of default download rule control page-downloading:
In the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Downloading process judges according to described page-downloading request whether the file of asking is write in buffer memory in advance, if so, from buffer memory, extracts this file; If not, download corresponding file according to described page-downloading request from server, and this file is write to buffer memory.
Preferably, described in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and also comprise according to the step of default download rule control page-downloading:
Before the step of downloading at extraction document from buffer memory, inquire about the time that this file writes buffer memory and whether exceed the default time limit, if so, download corresponding file according to page-downloading request from server, and this file is write to buffer memory.
Preferably, described in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and comprise according to the step of default download rule control page-downloading:
In the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process; Wherein, described page-downloading request comprises URL information, and described URL information comprises extension name information;
Downloading process is added into described page-downloading request in the download task list generating in advance;
Read the page resource type corresponding to extension name acquisition of information of described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Process successively the page-downloading request in described download task list, obtain document size information corresponding to page-downloading request;
Judge whether described document size information exceedes default file size threshold value, the mode that if so, adopts multithreading to download is carried out the down operation of respective page, otherwise, adopt the mode of single-threaded download to carry out the down operation of respective page.
Preferably, described in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and comprise according to the step of default download rule control page-downloading:
In the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process; Wherein, described page-downloading request comprises URL information, and described URL information comprises extension name information;
Downloading process judges according to described page-downloading request whether the file of asking is write in buffer memory in advance, if, whether inquire about the time that this file writes buffer memory exceedes the default time limit, if, download corresponding file according to page-downloading request from server, and this file is write to buffer memory; If not, from buffer memory, extract this file;
If the corresponding file of described page-downloading request is not write in buffer memory in advance, download corresponding file according to described page-downloading request from server, and this file is write to buffer memory.
Wherein, the described step of downloading corresponding file from server according to page-downloading request comprises:
Downloading process is added into described page-downloading request in the download task list generating in advance;
Read the page resource type corresponding to extension name acquisition of information of described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Process successively the page-downloading request in described download task list, carry out corresponding page-downloading operation.
Preferably, described in the time that IE kernel browser process is received IE download request, trigger described downloading process and comprise according to the step of default download rule control page-downloading:
In the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Downloading process judges according to described page-downloading request whether the file of asking is write in buffer memory in advance, if, whether inquire about the time that this file writes buffer memory exceedes the default time limit, if, download corresponding file according to page-downloading request from server, and this file is write to buffer memory; If not, from buffer memory, extract this file;
If the corresponding file of described page-downloading request is not write in buffer memory in advance, download corresponding file according to described page-downloading request from server, and this file is write to buffer memory.
Wherein, the described step of downloading corresponding file from server according to page-downloading request comprises:
Downloading process is obtained document size information corresponding to described page-downloading request;
Judge whether described document size information exceedes default file size threshold value, the mode that if so, adopts multithreading to download is carried out the down operation of respective page, otherwise, adopt the mode of single-threaded download to carry out the down operation of respective page.
Preferably, described in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and comprise according to the step of default download rule control page-downloading:
In the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process; Wherein, described page-downloading request comprises URL information, and described URL information comprises extension name information;
Downloading process judges according to described page-downloading request whether the file of asking is write in buffer memory in advance, if, whether inquire about the time that this file writes buffer memory exceedes the default time limit, if, download corresponding file according to page-downloading request from server, and this file is write to buffer memory; If not, from buffer memory, extract this file;
If the corresponding file of described page-downloading request is not write in buffer memory in advance, download corresponding file according to described page-downloading request from server, and this file is write to buffer memory.
Wherein, the described step of downloading corresponding file from server according to page-downloading request comprises:
Downloading process is added into described page-downloading request in the download task list generating in advance;
Read the page resource type corresponding to extension name acquisition of information of described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Process successively the page-downloading request in described download task list, obtain document size information corresponding to page-downloading request;
Judge whether described document size information exceedes default file size threshold value, the mode that if so, adopts multithreading to download is carried out the down operation of respective page, otherwise, adopt the mode of single-threaded download to carry out the down operation of respective page.
The embodiment of the present application also discloses a kind of page-downloading control system of IE kernel browser, comprising:
Start module, for starting IE kernel browser process, and start preset downloading process;
Protocol registration module, in described IE kernel browser process registering communication agreement, waits for the page-downloading request based on respective communication agreement;
Downloading control module, in the time that described IE kernel browser process is received page-downloading request, triggers described downloading process and controls page-downloading according to default download rule;
State is reported module, for returning to download status information in described page-downloading process to IE kernel browser process.
Preferably, described page-downloading control system, also comprises:
Kernel operations module, for by described IE kernel browser process according to described download status information, the operation that the page data of downloading is resolved, carried out and/or plays up.
Preferably, described downloading control module comprises:
Request transmits submodule, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Task is added submodule, for described page-downloading request being added into by downloading process to the download task list generating in advance;
Sequence submodule, for obtaining page resource type corresponding to described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Download implementation sub-module, for processing successively the page-downloading request of described download task list, carry out corresponding page-downloading operation.
Preferably, described page-downloading request comprises URL information, and described URL information comprises extension name information, and page resource type corresponding to described page-downloading request is by reading described extension name acquisition of information.
Preferably, described downloading control module comprises:
Request transmits submodule, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
File size is obtained submodule, for obtained document size information corresponding to described page-downloading request by downloading process;
File size judges submodule, for judging whether described document size information exceedes default file size threshold value, if so, calls multithreading and downloads submodule; Otherwise, call single-threaded download submodule;
Multithreading is downloaded submodule, carries out the down operation of respective page for the mode that adopts multithreading to download;
Single-threaded download submodule, for adopting the mode of single-threaded download to carry out the down operation of respective page.
Preferably, described downloading control module comprises:
Request transmits submodule, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Buffer memory judges submodule, for judging according to described page-downloading request whether the file of asking has been write buffer memory in advance by downloading process, if so, triggers buffer memory and extracts submodule; If not, trigger server and download submodule;
Buffer memory extracts submodule, for extract this file from buffer memory;
Server is downloaded submodule, for downloading corresponding file according to described page-downloading request from server, and this file is write to buffer memory.
Preferably, described downloading control module also comprises:
Buffer memory exceeds the time limit to judge submodule, for extracting before submodule triggering buffer memory, inquires about the time that this file writes buffer memory and whether exceedes the default time limit, and if so, invoking server is downloaded submodule.
Compared with prior art, the application has the following advantages:
The application uses the consultative management expansion interface of IE, whole downloads of IE kernel browser all oneself are taken over, thereby make to embed the shell of IE kernel browser, can control voluntarily the download of browser kernel, and send the data after downloading back to IE kernel, allow it continue to carry out the work of resolving, carrying out, playing up.Because download behavior does not occur in browser process, in the time that download encounters problems program crashing, browser process can not collapsed thereupon, can restart a downloading process and continue to download.Thereby the application can effectively control the page-downloading process of IE kernel browser, to improve efficiency and the stability of page-downloading.
Moreover the application, by adopting the download prioritization scheme of resource sequence, multithreading download and buffer memory read-write, can promote speed of download and webpage representation speed, gives full play to user's bandwidth, improves resource utilization.
Embodiment
For the above-mentioned purpose, the feature and advantage that make the application can become apparent more, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
The application's core idea is, makes to embed the shell of IE kernel browser, can control voluntarily the download of browser kernel, and sends the data after downloading back to IE kernel, allows it continue to carry out the work of resolving, carrying out, playing up.
With reference to figure 1, show the flow chart of steps of the page-downloading control method embodiment of a kind of IE kernel browser of the application, specifically can comprise the following steps:
Step 101, startup IE kernel browser process, and start preset downloading process;
In the embodiment of the present application, described IE kernel browser process refers to and adopts IE(Internet Explorer) browser process of browser kernel.In prior art, browser kernel is responsible for the page to download, resolve, carry out, play up, and in the present embodiment, the only operation for completing parsing, carrying out, play up of IE browser kernel, the operation of download is completed by preset downloading process.
Be well known that, process is a program of carrying out, the program example moving in computing machine; It can be distributed to processor and be carried out by processor as an entity.From the user point of view, browser process can be understood as the process of the browser representative starting in task manager.
Described downloading process can be understood as the another one process of IE kernel browser, is a process that is specifically designed to down operation.Be that described downloading process is specifically designed to download, and do not do other operations.As a kind of example of the embodiment of the present application specific implementation, it is Microsoft Windows HTTP Services that described downloading process inside can be used the full name of WinHTTP(WinHTTP, it offers HTTP client application program interface of developer, send request to other http server by this API by http protocol) realize a downloader, and a download manager.Be in described downloading process, to comprise a download manager and some downloaders, wherein, described download manager can be controlled page-downloading for the download rule according to default, for example to the request of downloaded resources sort, optimization etc.; Downloader can be for realizing concrete down operation, and by download manager to IE kernel browser process report download situation, i.e. download status information.In practice, this downloading process, just as a service, is waited for called at any time after startup.
In the embodiment of the present application, when described IE kernel browser process initiation, described downloading process also can start, and in other words, described IE kernel browser process initiation can trigger described downloading process and start, to ensure the page normally representing in browser.
Step 102, in described IE kernel browser process registering communication agreement, wait for page-downloading request based on respective communication agreement;
In specific implementation, described in IE kernel browser process the step of registering communication agreement can be, use the RegisterNameSpace method of IInternetSession interface, registering communication agreement in IE kernel browser process, described communication protocol can comprise http agreement, https agreement, mailto agreement and File Transfer Protocol etc.
Particularly, the RegisterNameSpace method of IInternetSession interface, require the interface of a set form, use this method in IE kernel browser process after registering communication agreement, the page-downloading request of all employing respective communication agreements, capital is sent to default shell interface, in the time there is the page-downloading request of any employing respective communication agreement (as http, https agreement, mailto agreement, File Transfer Protocol), default shell interface can be notified or call to IE kernel.
Step 103, in the time that described IE kernel browser process is received page-downloading request, trigger described downloading process and control page-downloading according to default download rule, and return to download status information to IE kernel browser process in described page-downloading process.
In specific implementation, when the Start method of the IInternetProtocol interface providing in communication protocol registration process when IE kernel calls, communicate by letter by striding course, page-downloading request is sent to downloading process, and return to operational character E_PENDING, notice IE kernel operations is just in commission.When downloading to after data, downloading process can be notified the IE kernel browser process of initiating download, the correlation technique of the IInternetProtocolSink interface that IE kernel browser process transfer IE kernel provides, the download status information such as the data that notify IE kernel download progress, download to.
More specifically, striding course communication, refer to and forward the request of a process to another process, refer in the present embodiment forward the page-downloading request of IE kernel browser process to downloading process, and in downloading process, in real time to download status information such as IE kernel report download progress and downloading datas.Striding course communication can be used windows message mechanism, and coordinates kernel objects to carry out data transmission.For example, in IE browser process, register after http agreement, once there be the page-downloading request based on http agreement will deliver in default browser shell.When described in IE kernel calls when shell, the relevant information of this page-downloading request all can be passed over, shell can (be put into these information package in a data block, in data block, mainly comprise url, refresh, cookie etc.), then the standard pipe communication providing by Windows system, sends to downloading process by this data block.The windows messaging sending to browser process in downloading process is mainly the progress of telling the current download of browser.
In brief, striding course communication is both sides, and first, IE kernel browser process is received after page-downloading request, can communicate by letter by striding course, tells that those files of downloading process need to download.On the other hand, when in download request implementation, downloading process can send message to IE kernel browser process, notifies the download status information such as its download progress, downloading data.
In a preferred embodiment of the present application, in described step 103, in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and specifically can comprise following sub-step according to the step of default download rule control page-downloading:
Sub-step S11, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Sub-step S12, downloading process are added into described page-downloading request in the download task list generating in advance;
Sub-step S13, obtain page resource type corresponding to described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Sub-step S14, process the page-downloading request in described download task list successively, carry out corresponding page-downloading operation.
In practice, described page-downloading request comprises URL information, and described URL information comprises extension name information, and in this case, page resource type corresponding to described page-downloading request can be by reading described extension name acquisition of information.
The present embodiment relates generally to by resource and sorts and download the scheme of optimizing, to realize in the process of downloading in downloading process control, that is to say, in the time that browser process receives IE download request, trigger downloading process and carry out download, before formal download the by downloader, download manager can sort to resource corresponding to download request.
In actual applications, the preferentially file of download text type (as the file of the types such as html, css, js), by the file of multimedia type (as the file of the large resource such as picture, flash) by rear download, because the representing and do not rely on them of webpage.In download manager in downloading process, have a download task list, according to priority, can determine the downloading task newly increasing is put into that position in this table.Such as, the file of html, css, these text of js is all that webpage is necessary while opening, thus can put into this table before.The file of other the multimedia such as picture, flash type is put into table tail.Downloader can be from gauge outfit ceaselessly the task of getting start to download.So just realize resource sequence.
In practice, the corresponding downloading task of each page-downloading request, each downloading task resource type is a kind of.
For example, suppose to access http://www.360.cn/ in browser, IE kernel can produce 5 download requests, and the content/type/order of request is as follows:
http://www.360.cn/index.htm;
http://www.360.cn/360safe.css;
http://www.360.cn/product.swf;
http://www.360.cn/360safe.png;
http://www.360.cn/frame.htm。
According to producing consistent order with IE download request, above-mentioned page-downloading request is sent to downloading process from IE kernel browser process.
Suppose that the download task list in present downloading process is sky.In the time that we receive the page-downloading request of http://www.360.cn/index.htm, because table is empty, directly put into queue.As shown in table 1, in current download task list, only have a request.
Table 1:
Next receiving the page-downloading request of http://www.360.cn/360safe.css, can learn that by its extension name this is a text, is the same rank with htm, so be directly put into the back location of first list item in download task list.As shown in table 2, the request sequence situation in current download task list is:
Table 2:
Continue to receive the page-downloading request of http://www.360.cn/product.swf, can learn that by its extension name it is a flash file, due to the file maximum of this type, so put into the most end position of table.
As shown in table 3, the request sequence situation in current download task list is:
Table 3:
index.htm |
360safe.css |
product.swf |
Continue to receive the page-downloading request of http://www.360.cn/360safe.png, can learn that by its extension name it is a picture file, because the size of this type of file is greater than text but is less than the file of flash type, so be inserted into the centre of text and flash type.
As shown in table 4, the request sequence situation in current download task list is:
Table 4:
index.htm |
360safe.css |
360safe.png |
product.swf |
Continue to receive the request of http://www.360.cn/frame.htm, can learn that by its extension name it is a htm file, so be inserted into the back location of all text.
As shown in table 5, the request sequence situation in current download task list is:
Table 5:
index.htm |
360safe.css |
frame.htm |
360safe.png |
product.swf |
So just generate download task list.This download task list is different from raw requests order, downloads according to this download task list, and the preferential download text of meeting, ensures that word shows as early as possible, next Shows Picture, and finally just takes turns to larger flash.
In another preferred embodiment of the present application, in described step 103, in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and specifically can comprise following sub-step according to the step of default download rule control page-downloading:
Sub-step S21, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Sub-step S22, downloading process are obtained document size information corresponding to described page-downloading request;
Sub-step S23, judge whether described document size information exceedes default file size threshold value, the mode that if so, adopts multithreading to download is carried out the down operation of respective page, otherwise, adopt the mode of single-threaded download to carry out the down operation of respective page.
Thread can be understood as the passage of download, single-threaded download is exactly for download channel of a file opening, multithreading is downloaded and is opened multiple download channel for a file exactly simultaneously, and particularly, it is exactly the different piece of while to the single file of server request in fact that multithreading is downloaded.
The present embodiment relates generally to the download prioritization scheme by carry out multithreading download for the large file that exceedes predetermined threshold value, to realize in the process of downloading in downloading process control, that is to say, in the time that browser process receives IE download request, trigger downloading process and carry out download, in formal download the by downloader, download manager can judge whether current file size exceedes predetermined threshold value, if so, controlling downloader adopts the mode of multithreading download to download file corresponding to current page download request.
In specific implementation, only need to server communication once, as send the http request of a standard, can get file size, and, whether support the information such as multithreading download.By such as flash, the file of the multimedia types such as picture can be larger, for actual demand, file size threshold value can be set, and such as 1M, when exceeding 1M, starts multithreading and download.
In another preferred embodiment of the present application, in described step 103, in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and specifically can comprise following sub-step according to the step of default download rule control page-downloading:
Sub-step S31, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Sub-step S32, downloading process judge according to described page-downloading request whether the file of asking is write in buffer memory in advance, if so, from buffer memory, extracts this file; If not, download corresponding file according to described page-downloading request from server, and this file is write to buffer memory.
More preferably, described in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and also comprise according to the step of default download rule control page-downloading:
Before the step of downloading at extraction document from buffer memory, inquire about the time that this file writes buffer memory and whether exceed the default time limit, if so, download corresponding file according to page-downloading request from server, and this file is write to buffer memory.
The present embodiment relates generally to the download prioritization scheme of buffer memory read-write, to realize in the process of downloading in downloading process control, that is to say, in the time that browser process receives IE download request, trigger downloading process and carry out download, before formal download the by downloader, download manager can judge it is to read or download in real time from buffer memory, after formal download the by downloader, the data after downloading are write to buffer memory.
In concrete application, can decide according to the actual requirements certain file whether write buffer memory, certain file buffer memory whether can directly use etc.For example, if certain file had just carried out renewal in local cache, in a few minutes, can not remove server communication completely, directly read the file in local cache.Or as, with browser access http://www.360.cn/index.htm, first check that this file whether in buffer memory, if not, first downloads and then put into buffer memory.If had, can needn't remove server communication completely, directly use, so just accelerate access speed.
The present embodiment in practice more preferred way is, in the time that each IE starts, do not carry out to the whether expired operation of the corresponding buffer memory of server request, but allows user first use cache access.After access, then carry out inspection and the renewal of buffer memory.Certainly, when the strategy here also can finally upgrade with reference to used buffer memory.If just upgraded soon, such as only clock or several hours in a measure, just can first use buffer memory to reexamine.If but buffer memory is before several days, also can just carry out buffer memory inspection in the time starting, to avoid user to be old content.
The all right applied in any combination of above-mentioned download prioritization scheme, for making those skilled in the art understand better the application, below provides the example of several applied in any combination:
Example 1:
Described in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and specifically can comprise following sub-step according to the step of default download rule control page-downloading:
Sub-step S41, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process; Wherein, described page-downloading request comprises URL information, and described URL information comprises extension name information;
Sub-step S42, downloading process are added into described page-downloading request in the download task list generating in advance;
Sub-step S43, read the page resource type corresponding to extension name acquisition of information of described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Sub-step S44, process the page-downloading request in described download task list successively, obtain document size information corresponding to page-downloading request;
Sub-step S45, judge whether described document size information exceedes default file size threshold value, the mode that if so, adopts multithreading to download is carried out the down operation of respective page, otherwise, adopt the mode of single-threaded download to carry out the down operation of respective page.
Example 2:
Described in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and specifically can comprise following sub-step according to the step of default download rule control page-downloading:
Sub-step S51, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process; Wherein, described page-downloading request comprises URL information, and described URL information comprises extension name information;
Sub-step S52, downloading process judge according to described page-downloading request whether the file of asking is write in buffer memory in advance, if, whether inquire about the time that this file writes buffer memory exceedes the default time limit, if, download corresponding file according to page-downloading request from server, and this file is write to buffer memory; If not, from buffer memory, extract this file;
If the corresponding file of the described page-downloading request of sub-step S53 is not write in buffer memory in advance, download corresponding file according to described page-downloading request from server, and this file is write to buffer memory.
Wherein, the described step of downloading corresponding file from server according to page-downloading request comprises:
Sub-step S54, downloading process are added into described page-downloading request in the download task list generating in advance;
Sub-step S55, read the page resource type corresponding to extension name acquisition of information of described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Sub-step S56, process the page-downloading request in described download task list successively, carry out corresponding page-downloading operation.
Example 3:
Described in the time that IE kernel browser process is received IE download request, trigger described downloading process and can comprise following sub-step according to the step of default download rule control page-downloading:
Sub-step S61, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Sub-step S62, downloading process judge according to described page-downloading request whether the file of asking is write in buffer memory in advance, if, whether inquire about the time that this file writes buffer memory exceedes the default time limit, if, download corresponding file according to page-downloading request from server, and this file is write to buffer memory; If not, from buffer memory, extract this file;
If the corresponding file of the described page-downloading request of sub-step S63 is not write in buffer memory in advance, download corresponding file according to described page-downloading request from server, and this file is write to buffer memory.
Wherein, the described step of downloading corresponding file from server according to page-downloading request comprises:
Sub-step S64, downloading process are obtained document size information corresponding to described page-downloading request;
Sub-step S65, judge whether described document size information exceedes default file size threshold value, the mode that if so, adopts multithreading to download is carried out the down operation of respective page, otherwise, adopt the mode of single-threaded download to carry out the down operation of respective page.
Example 4:
Described in the time that IE kernel browser process is received page-downloading request, trigger described downloading process and specifically can comprise following sub-step according to the step of default download rule control page-downloading:
Sub-step S71, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process; Wherein, described page-downloading request comprises URL information, and described URL information comprises extension name information;
Sub-step S72, downloading process judge according to described page-downloading request whether the file of asking is write in buffer memory in advance, if, whether inquire about the time that this file writes buffer memory exceedes the default time limit, if, download corresponding file according to page-downloading request from server, and this file is write to buffer memory; If not, from buffer memory, extract this file;
If the corresponding file of the described page-downloading request of sub-step S73 is not write in buffer memory in advance, download corresponding file according to described page-downloading request from server, and this file is write to buffer memory.
Wherein, the described step of downloading corresponding file from server according to page-downloading request comprises:
Sub-step S74, downloading process are added into described page-downloading request in the download task list generating in advance;
Sub-step S75, read the page resource type corresponding to extension name acquisition of information of described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Sub-step S76, process the page-downloading request in described download task list successively, obtain document size information corresponding to page-downloading request;
Sub-step S77, judge whether described document size information exceedes default file size threshold value, the mode that if so, adopts multithreading to download is carried out the down operation of respective page, otherwise, adopt the mode of single-threaded download to carry out the down operation of respective page.
Certainly, each embodiment of above-mentioned download prioritization scheme and combination thereof are all only as example, and it is all feasible that those skilled in the art adopt other to download optimization method, the application to this without being limited.
In specific implementation, the embodiment of the present application can also comprise the steps:
Step 104, the described download status information of described IE kernel browser process foundation, the operation that the page data of downloading is resolved, carried out and/or plays up.
When downloading process completes after down operation, send the data after downloading back to IE kernel, continue to carry out the work of resolving, carrying out, playing up by IE kernel.
It should be noted that, for embodiment of the method, for simple description, therefore it is all expressed as to a series of combination of actions, but those skilled in the art should know, the application is not subject to the restriction of described sequence of movement, because according to the application, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and related action and module might not be that the application is necessary.
With reference to figure 2, show the structured flowchart of the page-downloading control system embodiment of a kind of IE kernel browser of the application, specifically can comprise as lower module:
Start module 201, for starting IE kernel browser process, and start preset downloading process;
Protocol registration module 202, in described IE kernel browser process registering communication agreement, waits for the page-downloading request based on respective communication agreement;
Downloading control module 203, in the time that described IE kernel browser process is received page-downloading request, triggers described downloading process and controls page-downloading according to default download rule;
State is reported module 204, for returning to download status information in described page-downloading process to IE kernel browser process.
In the concrete application of the embodiment of the present application, described system embodiment can also comprise:
Kernel operations module 205, for by described IE kernel browser process according to described download status information, the operation that the page data of downloading is resolved, carried out and/or plays up.
In a preferred embodiment of the present application, described downloading control module 203 specifically can comprise following submodule:
Request transmits submodule, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Task is added submodule, for described page-downloading request being added into by downloading process to the download task list generating in advance;
Sequence submodule, for obtaining page resource type corresponding to described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Download implementation sub-module, for the page-downloading request by processing successively described download task list, carry out corresponding page-downloading operation.
In specific implementation, in described page-downloading request, can comprise URL information, in described URL information, can comprise extension name information, in this case, page resource type corresponding to described page-downloading request can be by reading described extension name acquisition of information.
In another preferred embodiment of the present application, described downloading control module 203 specifically can comprise following submodule:
Request transmits submodule, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
File size is obtained submodule, for obtained document size information corresponding to described page-downloading request by downloading process;
File size judges submodule, for judging whether described document size information exceedes default file size threshold value, if so, calls multithreading and downloads submodule; Otherwise, call single-threaded download submodule;
Multithreading is downloaded submodule, carries out the down operation of respective page for the mode that adopts multithreading to download;
Single-threaded download submodule, for adopting the mode of single-threaded download to carry out the down operation of respective page.
In another preferred embodiment of the application, described downloading control module 203 specifically can comprise following submodule:
Request transmits submodule, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Buffer memory judges submodule, for judging according to described page-downloading request whether the file of asking has been write buffer memory in advance by downloading process, if so, triggers buffer memory and extracts submodule; If not, trigger server and download submodule;
Buffer memory extracts submodule, for extract this file from buffer memory;
Server is downloaded submodule, for downloading corresponding file according to described page-downloading request from server, and this file is write to buffer memory.
More preferably, in the present embodiment, described downloading control module can also comprise following submodule:
Buffer memory exceeds the time limit to judge submodule, for extracting before submodule triggering buffer memory, inquires about the time that this file writes buffer memory and whether exceedes the default time limit, and if so, invoking server is downloaded submodule.
Those skilled in the art are understandable, and each submodule in above-mentioned preferred embodiment in downloading control module 203 is applied in any combination mutually, specifically can comprise following example:
Example 1:
Described downloading control module 203 specifically can comprise following submodule:
Request transmits submodule, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process; Wherein, described page-downloading request comprises URL information, and described URL information comprises extension name information;
Task is added submodule, for described page-downloading request being added into by downloading process to the download task list generating in advance;
Resource sequence submodule, for reading the page resource type corresponding to extension name acquisition of information of described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Process successively the page-downloading request in described download task list, obtain document size information corresponding to page-downloading request;
File size judges submodule, for judging whether described document size information exceedes default file size threshold value, if so, calls multithreading and downloads submodule; Otherwise, call single-threaded download submodule;
Multithreading is downloaded submodule, carries out the down operation of respective page for the mode that adopts multithreading to download;
Single-threaded download submodule, for adopting the mode of single-threaded download to carry out the down operation of respective page.
Example 2:
Described downloading control module 203 specifically can comprise following submodule:
Request transmits submodule, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process; Wherein, described page-downloading request comprises URL information, and described URL information comprises extension name information;
Buffer memory judges submodule, and for judging according to described page-downloading request whether the file of asking has been write buffer memory in advance, if so, calls buffer memory and exceeds the time limit to judge submodule by downloading process, if not, invoking server is downloaded submodule;
Buffer memory exceeds the time limit to judge submodule, and whether the time that writes buffer memory for inquiring about this file exceedes the default time limit, and if so, invoking server is downloaded submodule; If not, call buffer memory and extract submodule;
Buffer memory extracts submodule, for extract this file from buffer memory;
Server is downloaded submodule, for downloading corresponding file according to page-downloading request from server, and this file is write to buffer memory; Wherein, download corresponding file according to page-downloading request from server by calling with lower unit:
Task adding device, for being added into described page-downloading request by downloading process the download task list generating in advance;
Resource sequencing unit, for reading the page resource type corresponding to extension name acquisition of information of described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
Download performance element, for the page-downloading request by processing successively described download task list, carry out corresponding page-downloading operation.
Example 3:
Described downloading control module 203 specifically can comprise following submodule:
Request transmits submodule, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process;
Buffer memory judges submodule, and for judging according to described page-downloading request whether the file of asking has been write buffer memory in advance, if so, calls buffer memory and exceeds the time limit to judge submodule by downloading process, if not, invoking server is downloaded submodule;
Buffer memory exceeds the time limit to judge submodule, and whether the time that writes buffer memory for inquiring about this file exceedes the default time limit, and if so, invoking server is downloaded submodule; If not, call buffer memory and extract submodule;
Buffer memory extracts submodule, for extract this file from buffer memory;
Server is downloaded submodule, for downloading corresponding file according to page-downloading request from server, and this file is write to buffer memory; Wherein, download corresponding file according to page-downloading request from server by calling with lower unit:
File size acquiring unit, for being obtained document size information corresponding to described page-downloading request by downloading process;
File size judging unit, for judging that whether described document size information exceedes default file size threshold value, if so, calls multithreading download unit; Otherwise, call single-threaded download unit;
Multithreading download unit, for adopting the mode of multithreading download to carry out the down operation of respective page;
Single-threaded download unit, for adopting the mode of single-threaded download to carry out the down operation of respective page.
Example 4:
Described downloading control module 203 specifically can comprise following submodule:
Request transmits submodule, in the time that IE kernel browser process is received page-downloading request, described page-downloading request is sent to downloading process; Wherein, described page-downloading request comprises URL information, and described URL information comprises extension name information;
Buffer memory judges submodule, and for judging according to described page-downloading request whether the file of asking has been write buffer memory in advance, if so, calls buffer memory and exceeds the time limit to judge submodule by downloading process, if not, invoking server is downloaded submodule;
Buffer memory exceeds the time limit to judge submodule, and whether the time that writes buffer memory for inquiring about this file exceedes the default time limit, and if so, invoking server is downloaded submodule; If not, call buffer memory and extract submodule;
Buffer memory extracts submodule, for extract this file from buffer memory;
Server is downloaded submodule, for downloading corresponding file according to page-downloading request from server, and this file is write to buffer memory; Wherein, download corresponding file according to page-downloading request from server by calling with lower unit:
Task adding device, for being added into described page-downloading request by downloading process the download task list generating in advance;
Resource sequencing unit, for reading the page resource type corresponding to extension name acquisition of information of described page-downloading request, in described download task list, according to described page resource type to page-downloading request sort;
File size acquiring unit, for the page-downloading request by processing successively described download task list, obtains document size information corresponding to page-downloading request;
File size judging unit, for judging that whether described document size information exceedes default file size threshold value, if so, calls multithreading download unit; Otherwise, call single-threaded download unit;
Multithreading download unit, for adopting the mode of multithreading download to carry out the down operation of respective page;
Single-threaded download unit, for adopting the mode of single-threaded download to carry out the down operation of respective page.
For system embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
The application can be used in numerous general or special purpose computingasystem environment or configuration.For example: personal computer, server computer, handheld device or portable set, laptop device, multicomputer system, system based on microprocessor, set top box, programmable consumer-elcetronics devices, network PC, small-size computer, mainframe computer, the distributed computing environment that comprises above any system or equipment etc.
The application can describe in the general context of computer executable instructions, for example program module.Usually, program module comprises and carries out particular task or realize routine, program, object, assembly, data structure of particular abstract data type etc.Also can in distributed computing environment, put into practice the application, in these distributed computing environment, be executed the task by the teleprocessing equipment being connected by communication network.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium including memory device.
The page-downloading control method of a kind of IE kernel browser above the application being provided and a kind of page-downloading control system of IE kernel browser are described in detail, applied principle and the embodiment of specific case to the application herein and set forth, the explanation of above embodiment is just for helping to understand the application's method and core concept thereof; , for one of ordinary skill in the art, according to the application's thought, all will change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application meanwhile.