Summary of the invention
Technical matters to be solved by this invention is to provide a kind of course control method of the abnormal page, and when avoiding user to access the high-risk page, the normal use of browser is affected.
Present invention also offers a kind of progress control unit and system of the abnormal page, in order to ensure said method application in practice and realization.
In order to solve the problem, the invention discloses a kind of course control method of the abnormal page, comprising:
Obtain the page address list of the abnormal page, the described abnormal page comprises makes browser collapse and/or the stuck page;
Judge that the page address of user's request access is whether in the list of described page address;
If so, then create page independence subprocess by browser host process, and play up the page corresponding to page address that described request accesses by described page independence subprocess.
Preferably, the address list of the described abnormal page is stored in browser end or server end.
Preferably, the address list of described server end is collected by least one browser end and end of uploading onto the server.
Preferably, the address list of described browser end is collected by browser end, or downloads from server end, and server end preserves the address list that at least one browser end is collected.
Preferably, the step that described browser end collects the page address list of the abnormal page comprises:
The render time of each page of monitoring browser, invalid handle and null pointer;
If the render time of certain page is greater than the first pre-set threshold value, or the number of times that described invalid handle/null pointer occurs in preset time period is more than the second pre-set threshold value, then judge that this page is as the abnormal page causing browser to collapse;
The address of this page is added in the page address list of the described abnormal page.
Preferably, the step that described browser end collects the page address list of the abnormal page also comprises:
According to each page transmission detect-message of predeterminated frequency to browser;
If do not receive the response of all pages to detect-message, then judge that this page is as the abnormal page causing browser stuck;
The address of the page do not responded is added in the page address list of the described abnormal page.
Preferably, the step that described browser end collects the address list of the abnormal page also comprises:
Reception user is fed back by browser, browser is collapsed and/or stuck page address, and adds in the page address list of the described abnormal page.
Preferably, in the page address list of the described abnormal page, part or all of address includes the abnormal information of the abnormal page further, and described abnormal information indicates it is that Flash exception and/or Javascript are abnormal.
Preferably, described method is by following steps determination abnormal information:
If the render time of this page is greater than the first pre-set threshold value, then described abnormal information is that Javascript is abnormal;
If the number of times that described invalid handle/null pointer occurs in preset time period is more than the second pre-set threshold value, or the Flash of the page is in preset Flash blacklist, then described abnormal information is that Flash is abnormal.
Preferably, if described page address is to having abnormal information, then described page independence subprocess comprises multiple, and the described step by browser host process establishment page independence subprocess comprises:
Page management process is created by browser host process;
Flash managing process and/or Javascript managing process is created according to described abnormal information by described page management process.
Preferably, the step that described page independence subprocess plays up the page comprises:
Described page independence subprocess initialization browser page;
Described browser page obtains content of pages corresponding to the page address of user's request access, and plays up the page corresponding to the page address of described request access according to described content of pages.
Preferably, the step that described page independence subprocess plays up the page comprises:
Described page management process initialization browser page, and send handle information to described Flash managing process and/or Javascript managing process;
Described Flash managing process and/or Javascript managing process according to the main frame of described handle information searching browser page, and determine the loading position of the page that Javascript plays up or Flash;
Described browser page obtains content of pages corresponding to the page address of user's request access, and the page that the position loaded according to described content of pages, Flash and/or Javascript play up carries out page rendering.
Preferably, described method also comprises, and is repaired there is abnormal Flash by following steps:
Judge that whether the version of the Flash of the described abnormal page is consistent with the recommendation version in initialized data base, if inconsistent, then download the Flash recommending version at server end.
Present invention also offers a kind of process control system of the abnormal page, comprising:
One server and at least one browser end;
Described server is configured to: the page address of the abnormal page submitted to by least one browser end described is added in the page address list of the abnormal page;
Described at least one browser end is configured to: the page address obtaining the abnormal page, and be sent to server end, and the page address list of the abnormal page is obtained from server end, and according to described page address list, carried out the Process flowchart of the abnormal page by the course control method of the above-mentioned abnormal page.
Present invention also offers a kind of progress control unit of the abnormal page, comprising:
Page address list acquisition module, for obtaining the page address list of the abnormal page, the described abnormal page comprises makes browser collapse and/or the stuck page;
Page address judge module, for judging that the page address of user's request access is whether in the list of described page address, if so, then executive process creation module;
Process creation module, for creating page independence subprocess by browser host process;
Page rendering module, the page that the page address for being played up described request access by described page independence subprocess is corresponding.
Preferably, described page address list is stored in browser end or server end.
Preferably, the address list of described server end is collected by least one browser end and end of uploading onto the server.
Preferably, the address list of described browser end is collected by browser end, or downloads from server end, and server end preserves the address list that at least one browser end is collected.
Preferably, described page address list acquisition module comprises:
Page rendering monitoring submodule, for monitoring the render time of each page of browser, invalid handle and null pointer;
Browser collapse decision sub-module, if the render time for certain page is greater than the first pre-set threshold value, or the number of times that described invalid handle/null pointer occurs in preset time period is more than the second pre-set threshold value, then judge that this page is as the abnormal page causing browser to collapse;
First object page list adds submodule, for adding the address of this page to described page address list.
Preferably, described page address list is set up module and is also comprised:
Detect-message send submodule, for according to each page from predeterminated frequency to browser send detect-message;
The stuck decision sub-module of browser, if for not receiving the response of all pages to detect-message, then judges that browser is stuck;
Second target pages list adds submodule, for adding the address of the page do not responded to page address list.
Preferably, described page address list is set up module and is also comprised:
Module is added in user feedback, and for receiving, user fed back by browser, browser collapsed and/or stuck page address, and adds in the list of described page address.
Preferably, in the address list of the described abnormal page, part or all of address includes the abnormal information of the abnormal page further, and described abnormal information indicates it is that Flash exception and/or Javascript are abnormal.
Preferably, described device is by following submodule determination abnormal information:
The abnormal submodule of Javascript, if be greater than the first pre-set threshold value for the render time of this page, then described abnormal information is that Javascript is abnormal;
The abnormal submodule of Flash, if the number of times occurred in preset time period for described invalid handle/null pointer is more than the second pre-set threshold value, or the Flash of the page is in preset Flash blacklist, then described abnormal information is that Flash is abnormal.
Preferably, if described page address is to having abnormal information, then described page independence subprocess comprises multiple, and described process creation module comprises:
First process creation submodule, for creating page management process by browser host process;
Second process creation submodule, for creating Flash managing process and/or Javascript managing process by described page management process according to described abnormal information.
Preferably, described page rendering module comprises:
First page initialization submodule, for described page independence subprocess initialization browser page;
First page plays up submodule, the content of pages that the page address for described browser page acquisition user request access is corresponding, and carries out page rendering according to described content of pages.
Preferably, described page rendering module comprises:
Second page initialization submodule, for described page management process initialization browser page, and sends handle information to described Flash managing process and/or Javascript managing process;
Information searching submodule, for described Flash managing process and/or the Javascript managing process main frame according to described handle information searching browser page, and determines the loading position of the page that Javascript plays up or Flash;
Second page rendering submodule, obtains content of pages corresponding to the page address of user's request access for described browser page, and the page that the position loaded according to described content of pages, Flash and/or Javascript play up carries out page rendering.
Preferably, described device also comprises reparation module, for being repaired there is abnormal Flash by following submodule:
Version judges submodule, for judging that whether the version of the Flash of the described abnormal page is consistent with the recommendation version in initialized data base;
Redaction downloads submodule, if for inconsistent, then downloads the Flash recommending version at server end.
Compared with prior art, the present invention has the following advantages:
The present invention is by collecting high-risk page list, for the network address of user's request access, if in described list, then create detached process and play up this page, isolate with browser process, even if thus the high-risk page is collapsed stuckly also can not affect the browser process of just producing, effectively solve the stuck whole browser caused of high-risk page collapse and cannot use problem, increase stability and the ease for use of browser, make good online to user and experience.
In addition; the present invention can when collecting the abnormal page; can also judge that the page is due to Flash exception or Javascript is abnormal; and after setting up page detached process; corresponding managing process is set up again for Flash or Javascript; when Flash or the Javascript collapse in the page is stuck, page process can not be affected, improve the stability of page process.
Embodiment
For enabling above-mentioned purpose of the present invention, feature and advantage become apparent more, and below in conjunction with the drawings and specific embodiments, the present invention is further detailed explanation.
With reference to figure 1, show the process flow diagram of the course control method embodiment 1 of a kind of abnormal page of the present invention, specifically can comprise the following steps:
Step 101, obtain the page address list of the abnormal page, the described abnormal page comprises makes browser collapse and/or the stuck page.
In concrete realization, the address list of the described abnormal page can be stored in browser end or server end.
Wherein, the address list of described server end can be collected by least one browser end and end of uploading onto the server.The address list of described browser end can be collected by browser end, or downloads from server end, and server end can preserve the address list that at least one browser end is collected.In one preferred embodiment of the invention, described step 101 can comprise:
The render time of sub-step S11, each page of monitoring browser, invalid handle and null pointer;
If the render time of certain page of sub-step S12 is greater than the first pre-set threshold value, or the number of times that described invalid handle/null pointer occurs in preset time period is more than the second pre-set threshold value, then judge that this page is as the abnormal page causing browser to collapse;
Sub-step S13, the address of this page to be added in the page address list of the described abnormal page.
In the present invention, namely the browser generation abnormal behaviour place page is the high-risk page, monitoring browser abnormal behaviour, comprise collapse and/or stuck, these high-risk pages can be recorded, then add in target pages list.
Wherein, browser collapse can be judged by page rendering process, specifically, the render time of browser when each page of front opening can be monitored, if the render time of certain page exceedes preset value, then can think that browser there occurs collapse, namely described render time is the high-risk page causing browser to collapse more than the page of the first pre-set threshold value, the render time of expectation can be calculated, as the first pre-set threshold value according to user environment and content of pages; Or, also can be judged by the invalid handle of each page and null pointer, if the invalid handle of certain page and null pointer, the number of times occurred within the time period of presetting exceedes preset value, then can think that browser there occurs collapse, so, described invalid handle and null pointer exceed the page of preset value is exactly the high-risk page causing browser to collapse.Further, these high-risk pages can be added in the list of page address.
In concrete realization, the number of invalid handle and null pointer can carry out record by arranging abnormality processing function with SetUnhandledExceptionFilter, once there is invalid handle or null pointer in certain page, abnormality processing function will be recorded, if the number of times that invalid handle or null pointer occur continuously has exceeded the second pre-set threshold value (having occurred 3 times in such as 5 minutes), just think that browser there occurs collapse.
In one preferred embodiment of the invention, described step 101 can also comprise:
Sub-step S21, according to each page from predeterminated frequency to browser send detect-message;
If sub-step S22 does not receive the response of all pages to detect-message, then judge that this page is as the abnormal page causing browser stuck;
Sub-step S23, the address of the page do not responded to be added in the page address list of the described abnormal page.
Because browser is that Effect-based operation drives, each page current opened to browser sends message, if some pages (or GUI graphical user interface window) are not responded message, just mean that GUI thread there occurs stuck, namely think that browser is stuck, so, the page not doing to respond is exactly the high-risk page causing browser stuck.Further, these high-risk pages can be added in the list of page address.
In specific implementation, can according to each page transmission detect-message of predeterminated frequency (such as every 1000ms) to browser.
Due to the abnormal page be due to the Flash exception of this page and/or Javascript is abnormal caused, therefore, in concrete realization, in the address list of the described abnormal page, partly or entirely can include the abnormal information of the abnormal page further in address, described abnormal information can indicate it is that Flash exception and/or Javascript are abnormal.
Concrete, can by following steps determination abnormal information:
If the render time of this page is greater than the first pre-set threshold value, then described abnormal information is that Javascript is abnormal;
If the number of times that described invalid handle/null pointer occurs in preset time period is more than the second pre-set threshold value, or the Flash of the page is in preset Flash blacklist, then described abnormal information is that Flash is abnormal.
Above-mentionedly determining that the step of abnormal information can perform while judging the abnormal page, when being added in the list of page address the page address of the abnormal page, corresponding abnormal information can be added simultaneously.
Step 102, judge that the page address of user's request access is whether in the list of described page address, if so, then performs step 103.
Step 103, create page independence subprocess by browser host process.
If described page address is to having abnormal information, then described page independence subprocess comprises multiple, and the described step by browser host process establishment page independence subprocess comprises:
Sub-step S31, create page management process by browser host process;
Sub-step S32, create Flash managing process and/or Javascript managing process by described page management process according to described abnormal information.
If user asks the page address of opening in the list of described page address, then can create a page independence subprocess for managing this page.If correspondence has abnormal information in this page address, then can manage for causing abnormal Flash or Javascript to set up detached process again.
Detached process is the subprocess of browser host process, function (CreateReaderActiveXProcess) can be created by corresponding detached process to create, such as under Windows operating system, detached process can be created by CreateProcess, under linux operating system, fork () function creation detached process can be passed through.Because detached process is independent of browser host process, therefore, be namely the collapse or stuck of the high-risk page, also only can have influence on detached process, can't have influence on browser process, user can continue normally to use browser.
Step 104, to be played up the page corresponding to the page address of described request access by described page independence subprocess.
If user asks the page address of opening in described target pages list; then illustrate that this page is the high-risk page; browser collapse or stuck may be made, be the process avoiding the high-risk page to affect whole browser, a detached process can be created to play up this page.
Concrete, described step 104 can comprise:
Sub-step S41, described page independence subprocess initialization browser page;
Sub-step S42, described browser page obtain content of pages corresponding to the page address of user request access, and play up the page corresponding to the page address of described request access according to described content of pages.
In the present invention, detached process plays up process exactly, in one the independently page, open the high-risk page.Therefore, first initialization browser page is needed, i.e. initialization WebBrowser control, WebBrowser is a container of Microsoft's encapsulation, be used to be carried on window application and play up document that webpage and other browsers support, a page is exactly a WebBrowser container.The interface that detached process calls WebBrowser control just completes initialization.
After WebBrowser initialization, the content of pages that the played up high-risk page is corresponding can be obtained, concrete, can obtain content of pages by calling the high-risk network address of WebBrowser Navigate interface accessing, then WebBrowser can complete the work of page rendering according to the content of pages obtained.
In another preferred embodiment of the invention, described step 104 can comprise:
Sub-step S51, described page management process initialization browser page, and send handle information to described Flash managing process and/or Javascript managing process;
Sub-step S52, described Flash managing process and/or Javascript managing process according to the main frame of described handle information searching browser page, and determine the loading position of the page that Javascript plays up or Flash;
Sub-step S53, described browser page obtain content of pages corresponding to the page address of user request access, and the page that the position loaded according to described content of pages, Flash and/or Javascript play up carries out page rendering.
If correspondence has abnormal information in the list of page address, then can set up corresponding Flash managing process or Javascript managing process, when playing up the page, page management process, by sending handle information to Flash managing process or Javascript managing process, indicates the position that Flash loads, or the page that Javascript plays up, when carrying out page rendering, according to content of pages, and the page that the position that loads of Flash or Javascript play up, complete page rendering.
In concrete realization, if page address is to having abnormal information, can also repair occurring abnormal Flash.
Concrete, first judge that whether the version of the Flash of the described abnormal page is consistent with the recommendation version in initialized data base, if inconsistent, then download the Flash recommending version at server end.
With reference to figure 2, show the process flow diagram of the course control method embodiment 2 of a kind of abnormal page of the present invention, specifically can comprise the following steps:
Step 201, obtain the page address list of the abnormal page, the described abnormal page comprises makes browser collapse and/or the stuck page;
Step 202, reception user are fed back by browser, make the page address causing browser collapse and/or stuck abnormal behaviour, and add target pages list in the page address list of the described abnormal page to.
The high-risk page can be collected by the abnormal behaviour monitoring browser in step 201, in concrete realization, also can manually collect the high-risk page, can set up in a browser and feed back entrance accordingly, for submitting the high-risk page to; Also can collect user by social network sites, run the feedback of team or technician.
Step 203, judge that the page address of user's request access is whether in the list of described page address, if so, then performs step 204;
Step 204, create page independence subprocess by browser host process;
Step 205, to be played up the page corresponding to the page address of described request access by described page independence subprocess.
In sum, the present invention is by collecting high-risk page list, for the network address of user's request access, if in described list, then create detached process and play up this page, isolate with browser process, thus even if the high-risk page is collapsed stuckly also can not affect the browser process of just producing, the stuck whole browser caused of effective solution high-risk page collapse cannot use problem, increases stability and the ease for use of browser, makes good online experience to user.
In addition, the present invention can when collecting the abnormal page, can also judge that the page is because Flash or Javascript is abnormal, and after setting up page detached process, corresponding managing process is set up again for Flash or Javascript, when Flash or the Javascript collapse in the page is stuck, page process can not be affected, improve the stability of page process.
For embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not by the restriction of described sequence of movement, because according to the present invention, 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 involved action and module might not be that the present invention is necessary.
With reference to figure 3, show the structured flowchart of the progress control unit embodiment 1 of a kind of abnormal page of the present invention, specifically can comprise with lower module:
Page address list acquisition module 301, for obtaining the page address list of the abnormal page, the described abnormal page comprises makes browser collapse and/or the stuck page;
Page address judge module 302, for about judging that the page address of user's request access is whether in the list of described page address, if so, then executive process creation module;
Process creation module 303, for creating page independence subprocess by browser host process;
Page rendering module 304, the page that the page address for being played up described request access by described page detached process is corresponding.
In one preferred embodiment of the invention, described page address list can be stored in browser end or server end.
Wherein, the address list of described server end can be collected by least one browser end and end of uploading onto the server.The address list of described browser end can be collected by browser end, or downloads from server end, and server end preserves the address list that at least one browser end is collected.
In one preferred embodiment of the invention, described page address list acquisition module can comprise:
Page rendering monitoring submodule 3011, for monitoring the render time of each page of browser, invalid handle and null pointer;
Browser collapse decision sub-module 3012, if the render time for certain page is greater than the first pre-set threshold value, or the number of times that described invalid handle/null pointer occurs in preset time period is more than the second pre-set threshold value, then judge that this page is as the abnormal page causing browser to collapse;
First adds submodule 3013, for adding the address of this page to described page address list.
In one preferred embodiment of the invention, described target pages list is set up module and can also be comprised:
Detect-message send submodule 3014, for according to each page from predeterminated frequency to browser send detect-message;
The stuck decision sub-module 3015 of browser, if for not receiving the response of all pages to detect-message, then judges that browser is stuck;
Second adds submodule 3016, for adding the address of the page do not responded to page address list.
In one preferred embodiment of the invention, in the address list of the described abnormal page, part or all of address may further include the abnormal information of the abnormal page, and described abnormal information can indicate it is that Flash exception and/or Javascript are abnormal.
Concrete, can by following submodule determination abnormal information:
The abnormal submodule of Javascript, if be greater than the first pre-set threshold value for the render time of this page, then described abnormal information is that Javascript is abnormal;
The abnormal submodule of Flash, if the number of times occurred in preset time period for described invalid handle/null pointer is more than the second pre-set threshold value, or the Flash of the page is in preset Flash blacklist, then described abnormal information is that Flash is abnormal.
In one preferred embodiment of the invention, if described page address is to having abnormal information, then described page independence subprocess comprises multiple, and described process creation module 303 can comprise:
First process creation submodule 3031, for creating page management process by browser host process;
Second process creation submodule 3032, for creating Flash managing process and/or Javascript managing process by described page management process according to described abnormal information.
In one preferred embodiment of the invention, described page rendering module can comprise:
First page initialization submodule 3033, for described page independence subprocess initialization browser page;
First page plays up submodule 3034, the content of pages that the page address for described browser page acquisition user request access is corresponding, and carries out page rendering according to described content of pages.
In one preferred embodiment of the invention, described page rendering module 304 can comprise:
Second page initialization submodule 3041, for described page management process initialization browser page, and sends handle information to described Flash managing process and/or Javascript managing process;
Information searching submodule 3042, for described Flash managing process and/or the Javascript managing process main frame according to described handle information searching browser page, and determines the loading position of the page that Javascript plays up or Flash;
Second page rendering submodule 3043, obtains content of pages corresponding to the page address of user's request access for described browser page, and the page that the position loaded according to described content of pages, Flash and/or Javascript play up carries out page rendering.
In one preferred embodiment of the invention, described device can also comprise reparation module, for being repaired there is abnormal Flash by following submodule:
Version judges submodule, for judging that whether the version of the Flash of the described abnormal page is consistent with the recommendation version in initialized data base;
Redaction downloads submodule, if for inconsistent, then downloads the Flash recommending version at server end.
With reference to figure 4, show the structured flowchart of the progress control unit embodiment 2 of a kind of abnormal page of the present invention, specifically can comprise with lower module:
Page address list acquisition module 401, for obtaining the page address list of the abnormal page, the described abnormal page comprises makes browser collapse and/or the stuck page.
User feedback adds module 402, and for receiving, user fed back by browser, causes the page address of browser abnormal behaviour, and adds in the list of described page address.
Page address judge module 403, for about judging that the page address of user's request access is whether in the list of described page address, if so, then executive process creation module.
Process creation module 404, for creating page independence subprocess by browser host process;
Page rendering module 405, the page that the page address for being played up described request access by described page detached process is corresponding.
The progress control unit embodiment 2 of the abnormal page of the invention described above is preferably implemented in browser program, can process the abnormal page process in browser.
With reference to figure 5, show the structured flowchart of the process control system embodiment of a kind of abnormal page of the present invention, specifically can comprise:
One server 501 and at least one browser end 502;
Described server is configured to: the page address of the abnormal page submitted to by least one browser end described is added in the page address list of the abnormal page;
Described at least one browser end is configured to: the page address obtaining the abnormal page, and be sent to server end, and the page address list of the abnormal page is obtained from server end, and according to described page address list, carried out the Process flowchart of the abnormal page by the course control method of the above-mentioned abnormal page.
Because described device embodiment and system embodiment are substantially corresponding to the embodiment of the method shown in earlier figures 1 and Fig. 2, therefore not detailed part in the description of the present embodiment, see the related description in previous embodiment, just can not repeat at this.
The present invention can be used in numerous general or special purpose computing system environment or configuration.Such as: personal computer, server computer, handheld device or portable set, laptop device, multicomputer system, system, set top box, programmable consumer-elcetronics devices, network PC, small-size computer, mainframe computer, the distributed computing environment comprising above any system or equipment etc. based on microprocessor.
The present invention can describe in the general context of computer executable instructions, such as program module.Usually, program module comprises the routine, program, object, assembly, data structure etc. that perform particular task or realize particular abstract data type.Also can put into practice the present invention in a distributed computing environment, in these distributed computing environment, be executed the task by the remote processing devices be connected by communication network.In a distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium comprising memory device.
In this article, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
Above to the course control method of a kind of abnormal page provided by the present invention, a kind of progress control unit of the abnormal page, and, a kind of process control system of the abnormal page is described in detail, apply specific case herein to set forth principle of the present invention and embodiment, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.