WO2012109961A1 - 一种分配浏览器进程的方法及其设备 - Google Patents

一种分配浏览器进程的方法及其设备 Download PDF

Info

Publication number
WO2012109961A1
WO2012109961A1 PCT/CN2012/070908 CN2012070908W WO2012109961A1 WO 2012109961 A1 WO2012109961 A1 WO 2012109961A1 CN 2012070908 W CN2012070908 W CN 2012070908W WO 2012109961 A1 WO2012109961 A1 WO 2012109961A1
Authority
WO
WIPO (PCT)
Prior art keywords
browser
allocating
browser process
cpu
current system
Prior art date
Application number
PCT/CN2012/070908
Other languages
English (en)
French (fr)
Inventor
刘鸿威
赵晨曦
谢震宇
Original Assignee
北京奇虎科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京奇虎科技有限公司 filed Critical 北京奇虎科技有限公司
Priority to US14/000,045 priority Critical patent/US10048986B2/en
Publication of WO2012109961A1 publication Critical patent/WO2012109961A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method and device for allocating a browser process. Background technique
  • single-process mode all pages are running in the same process.
  • most IE kernel browsers use single-process mode.
  • the advantage of single-process mode is that resources are used less when opening multiple pages.
  • the disadvantage of the single-process mode is that it cannot solve the problem of webpage resource leakage. When a webpage crashes and a suspended animation occurs, it is easy to be involved in the entire device, such as being easily involved in the entire browser.
  • each page runs in a separate process.
  • the advantage of the multi-process mode is that it can completely solve the problem of page resource leakage, and does not interfere with each other when there is a problem with the page.
  • the disadvantage of multi-process mode is that when you open multiple pages, the resources are more occupied.
  • mixed process mode processes can be created based on the number of open pages.
  • the browser in general, the browser is set to run nine pages in the same process.
  • the resource usage is small, which can better solve the problem of page resource leakage, and also has a good performance when the page crashes. Therefore, the hybrid process mode achieves a relative balance between page resource usage and page resource leakage.
  • the Internet has thousands of users, many users have different computer performances, and the hybrid mode cannot be fully adapted to each type of computer. For example, this hybrid mode does not apply to browsers in computer systems with single-core CPUs.
  • the present invention provides a method and apparatus for allocating a browser process that solves the above problems.
  • the present invention provides a method of assigning a browser process. The method obtains data related to a current system operating environment; based on the data, the browser process is allocated.
  • the process mode of the browser process includes at least two of a single process mode, a mixed process mode, and a multi-process mode.
  • the step of allocating a browser process comprises: selecting a process mode from a process mode of the browser process based on the data, and allocating a browser process according to the selected process mode.
  • the data related to the current system operating environment includes one or more of the number of CPU cores, the CPU main frequency, and the system memory.
  • the number of CPU cores of the current system is obtained by the GetSystemlnfo function.
  • the system memory of the current system is obtained by the G loba lMemorySta tusEx function.
  • the CPU main frequency in the current system is obtained through the records in the registry of the current system.
  • the step of accessing the record in the registry further comprises: opening a corresponding key value in the registry by using a RegOpenKeyEx function, querying a value of the related item under the key value by using a RegQueryVa lueEx function, and closing the registry by using a RegC l oseKey function. .
  • the path of the registry is: or ⁇ 0 ⁇ "MHz; wherein ⁇ in ⁇ MHz indicates the acquired CPU main frequency.
  • the browser process mode is switched according to a preset policy.
  • the process mode of the browser is set according to a preset policy during the installation of the browser.
  • the browser process mode is configured according to a preset policy when the browser is first turned on.
  • the preset policy is to configure the browser to be a single-process mode when the CPU in the current system is a single-core CPU. And/or, preferably, the preset policy is that when the current system CPU is a multi-core CPU, and the CPU clock speed or the current system is within a set threshold, the browser is configured according to the CPU clock frequency or the current system memory. Mixed process mode or multi-process mode.
  • the current system running environment related data includes data related to page resource consumption, and the browser process is allocated according to the page resource consumption.
  • the page resource type Determine the page resource consumption.
  • the page resource consumption is determined according to the data loading amount.
  • the present invention provides an apparatus for distributing a browser process.
  • the device includes a data acquisition module and a process allocation module, wherein the data acquisition module is configured to acquire data related to a current system operating environment; the process allocation module is configured to allocate the browser process according to the data acquired by the data acquisition module. .
  • the process mode of the browser process includes at least two of a single process mode, a mixed process mode, and a multi-process mode.
  • the process allocation module is configured to select a process mode from a process mode of the browser process based on the data, and allocate a browser process according to the selected process mode.
  • the data related to the current system operating environment includes one or more of the number of CPU cores, the CPU main frequency, and the system memory.
  • the process allocation module includes a module that switches the browser process mode according to a preset policy.
  • the preset policy is to configure the browser to be a single-process mode when the CPU in the current system is a single-core CPU. And/or, preferably, the preset policy is that when the current system CPU is a multi-core CPU, and the CPU clock speed or the current system is within a set threshold, the browser is configured according to the CPU clock frequency or the current system memory. Mixed process mode or multi-process mode.
  • the current system operating environment related data includes data related to page resource consumption, and the process allocation module allocates a browser process according to the page resource consumption.
  • the page resource consumption is determined according to a page resource type.
  • the page resource consumption is determined based on the data load.
  • the invention intelligently allocates browser processes according to the current system operating environment, thereby maximizing the performance of the browser.
  • the invention provides convenience for the user and better user experience.
  • FIG. 1 is a flow chart of a method for allocating a browser process according to an embodiment of the present invention
  • FIG. 2 is a flow chart of a method for switching a browser process mode according to a preferred embodiment of the present invention
  • 3 is a schematic diagram of a configuration of a browser process mode option in the prior art
  • FIG. 4 is a flowchart of a method for switching a browser process mode according to a preferred embodiment of the present invention
  • FIG. 5 is a flowchart of a method for allocating a browser process according to page resource consumption according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of an apparatus for allocating a browser process according to an embodiment of the present invention. detailed description
  • FIG. 1 is a flow chart of a method of assigning a browser process in accordance with one embodiment of the present invention.
  • step 110 data related to the current system operating environment is obtained.
  • the data related to the current system operating environment includes the number of CPU cores, CPU main frequency, and system memory.
  • data related to the current system operating environment includes data related to page resource consumption.
  • a process of the browser is allocated based on the acquired data.
  • data acquisition and the process allocation to the browser of the present invention are not limited to being completed only by the browser, but also by a dedicated plug-in or module or device.
  • FIG. 2 is a flowchart of a method for switching a browser process mode according to an embodiment of the present invention, wherein a process mode of the browser includes a single process mode, a multi-process mode, and a mixed process mode.
  • a process mode of the browser includes a single process mode, a multi-process mode, and a mixed process mode.
  • an appropriate process mode is selected according to the data related to the current system running environment, and then the process is assigned to the browser according to the selected process mode.
  • the browser's process mode can also include only two of the single process mode, the multi-process mode, and the mixed process mode.
  • Those skilled in the art can refer to this embodiment to implement browser process allocation in two process modes.
  • the user first opens a browser in the system (e.g., computer system, mobile phone system, etc.). That is, after the user has installed the browser, the browser is opened for the first time.
  • This step 210 is an optional step.
  • the browser obtains data related to the operating environment of the system, such as obtaining the number of CPUs (central processing units) in the system, the CPU main frequency, or the system memory size.
  • the browser uses the GetSys temlnfo function to get the number of CPU cores in the current system (that is, the system to which the browser belongs).
  • the browser uses the Globa lMemorySta tusEx function to get the current The memory size of the system (that is, the system to which the browser belongs).
  • the browser obtains the CPU main frequency from the records in the registry of the current system (ie, the system to which the browser belongs).
  • the browser accesses the records in the registry in the system to which it belongs.
  • ⁇ in ⁇ MHz indicates the main frequency of the current system acquired by the browser.
  • the present invention is not limited to the above manner to obtain the number of CPU cores, system memory, and CPU main frequency.
  • step 230 the browser obtains the CPU core number, the CPU main frequency, the system memory size according to the browser, and configures the browser process mode according to the browser's preset policy, and then saves, so that the user can open the file later.
  • the browser has the process mode of this configuration.
  • FIG. 3 is a schematic diagram of a browser process mode option configuration in the prior art.
  • the user can select the browser's process mode by going to the browser process mode in the 360 Secure Browser Options module. And the user can choose to include any one of the single process mode, the mixed process mode, and the multi-process mode.
  • the preset policy described in step 230 is: when the CPU in the current system is a single-core CPU, the browser is configured to be in a single-process mode.
  • the preset policy described in step 230 is: when the current system CPU is a multi-core CPU, and the CPU clock frequency or the current system is within a set threshold, according to the CPU clock speed or Current system memory configuration The browser is in mixed process mode or multi-process mode.
  • the above two preset strategies can also exist at the same time, and the system is based on the current system.
  • the CPU in the system is single-core or multi-core, and one of two preset strategies is selected.
  • the browser's process mode can also be set during the browser installation process.
  • step 410 the user first turns on the browser in the computer system.
  • the browser obtains the number of CPU cores in the computer system.
  • the browser obtains the number of CPU cores of the current computer system through the GetSys temlnfo function.
  • step 430 if the CPU in the computer system is a single-core CPU, the browser configures its process mode to a single-process mode, and then saves, so that the browser still has such a single-process mode when it is turned on later. Unless the user actively changes the browser's process mode.
  • step 440 if the CPU in the computer system is a multi-core CPU, the browser continues to obtain the CPU frequency and system memory in the current computer system.
  • the browser accesses the registry in the current computer system through the functions RegOpenKeyEx , RegQueryVa lueEx , RegC oseKey , and then the path in the registry
  • ⁇ in ⁇ MHz indicates the main frequency of the current computer system acquired by the browser.
  • the browser obtains the memory of the current computer system through the G loba lMemoryS ta tusEx function.
  • step 450 if the browser obtains that the CPU frequency of the current computer system is above 2G, or obtains that the current computer system has more than 1G, the browser configures the process mode to be a mixed process mode, and then saves the configuration result. , so that the browser will still have this mixed process mode when it is turned on later, unless the user voluntarily modifies it.
  • step 460 if the browser obtains that the number of CPU cores in the current computer system exceeds two cores, and the system memory exceeds 2G, the browser configures its process mode to multi-process mode.
  • the browser does not configure its process mode to multi-process mode, but prefers the mixed process mode. That is, the browser process mode is configured to multi-process mode only if the current computer system has excellent performance.
  • the browser configures the process mode to single-process mode only when the browser obtains the CPU in the current computer system as a single-core CPU, and in any other case, the browser will process mode. Match Set to mixed process mode.
  • FIG. 5 is a flow chart of a method for allocating a browser process according to page resource consumption according to an embodiment of the present invention.
  • step 51 0 the user opens the page through the browser.
  • step 520 the browser acquires data related to the current system running environment, and the data related to the current system running environment is data related to the page resource consumption situation. Therefore, the browser detects the resource consumption of the page at this time. happening.
  • the browser detects the resource type of the page and determines the resource consumption of the page based on the resource type. For example, when the browser detects that a video, audio, game, or the like type resource is to be loaded in the page, it is determined that the page resource consumption is large, and therefore the object with a large resource consumption should be allocated to a new process, and can be Whether the new page opened after the judgment of the page resource status is assigned to the original process or the above new process, if the resource consumption of the new page is large, it can be continuously allocated to the new process, if the resource consumption of the new page is small , you can assign it to the original process, but make sure that the allocation page does not cause the process to affect the running state due to the increase of page resources.
  • the browser monitors the data load of the page and determines that the page resource consumption is large when the load reaches a certain threshold.
  • the browser process is allocated based on page resource consumption.
  • the browser detects that the page resource consumption is large, the part of the page that consumes a large resource is stripped from the page, and a new process is separately opened for the part of the content, so that the new process is in the new process. Running in.
  • the browser detects that video data is being loaded on the page, the video is stripped from the page and a new process is opened for the video.
  • the device 61 0 includes a data acquisition module 611 and a process allocation module 612.
  • the data acquisition module 61 1 is arranged to acquire data related to the current system operating environment.
  • the process assignment module 612 allocates the progress of the browser based on the corresponding data from the data acquisition module.
  • the process mode of the process includes at least two of a single process mode, a mixed process mode, and a multi-process mode.
  • the process allocation module 612 is configured to process from the browser process based on the data Select a process mode in the mode and assign a browser process according to the selected process mode.
  • the data related to the current system operating environment includes the number of CPU cores, CPU main frequency, and system memory.
  • the data associated with the current system operating environment is data related to page resource consumption.
  • the page resource consumption is determined by the page resource type and/or the data load in the page.
  • the process allocation module 612 further includes a switching module 6122 that switches the browser process mode according to a preset policy.
  • the preset policy is to configure the browser to be in single-process mode when the CPU in the current system is a single-core CPU.
  • the preset strategy is that when the current system CPU is a multi-core CPU, and the CPU clock speed or the current system is within a set threshold, the browser is configured as a hybrid process according to the CPU clock frequency or the current system memory. Mode or multi-process mode.
  • the above two preset policies can also exist at the same time.
  • the system selects a corresponding preset policy according to whether the CPU in the current system is a single core or a multi-core.
  • the present invention is not limited to use only in a PC (Personal Computer), but also in various electronic devices such as a PDA (PDA), a mobile phone, and the like.
  • the information transmission method of the present invention may be wired or wireless.
  • the present invention can be realized by being recorded on a computer readable recording medium including any medium for storing or transmitting information in a computer readable form, for example, a read only memory (ROM), random access Memory (RAM), disk storage media, optical storage media, flash storage media, electrical, optical, acoustic or other forms of propagating signals (eg, carrier waves, infrared signals, digital signals, etc.).
  • the invention is applicable to a wide variety of general purpose or special purpose computing system environments or configurations.
  • personal computer server computer, handheld or portable device, tablet device, multiprocessor system, microprocessor based system, set-top box, programmable consumer electronics device, network PC, small computer, mainframe computer, including A distributed computing environment of any of the above systems or devices, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)
  • User Interface Of Digital Computer (AREA)
  • Stored Programmes (AREA)

Description

说 明 书 一种分配浏览器进程的方法及其设备 技术领域
本发明涉及互联网技术领域, 尤其涉及一种分配浏览器进程的方法及其 设备。 背景技术
现有浏览器进程的进程模式通常有三种, 分别是单进程模式、 多进程模 式和混合进程模式。
在单进程模式下, 所有页面都在同一进程中运行, 目前多数 IE 内核浏 览器都是使用单进程模式。 单进程模式的优点是, 打开多个页面时, 资源占 用较少。 单进程模式的缺点是, 其无法解决网页资源泄露问题, 在某个网页 崩溃和假死情况发生时, 容易牵连到整个设备, 如容易牵连到整个浏览器。
在多进程模式下,每个页面都在单独进程中运行。多进程模式的优点是, 其能够彻底解决页面资源泄露问题, 在页面出问题时, 互不干扰。 多进程模 式的缺点是, 打开多个页面时, 资源占用较多。
在混合进程模式下, 可根据打开页面数量来创建进程。 以浏览器为例, 通常情况下,浏览器设定在同一进程中可运行九个页面。在混合进程模式下, 打开多个页面时的资源占用较少, 能较好地解决页面资源泄露问题, 并且在 页面崩溃时也有上佳表现。 因此, 混合进程模式在页面资源占用以及页面资 源泄漏问题上达到了一种相对平衡状态。 然而互联网有千千万万个用户, 很 多用户计算机性能不同, 混合模式不能完全适应于每种计算机。 例如, 此种 混合进行模式不适用于, 具有单核 CPU的计算机系统中的浏览器。
互联网上很多用户只是计算机的简单使用者,通常只是在互联网上做些 简单操作, 对计算机及互联网知识掌握不多。 因此, 很多用户根本不清楚自 己机器的性能, 更不知道如何根据计算机性能来选择浏览器中的进程模式。 并且, 还有一些计算机用户工作很忙, 无暇顾及为其计算机中的浏览器选择 最优的进程模式。 发明内容
本发明提供了一种能解决以上问题的分配浏览器进程的方法及其设备。 在第一方面, 本发明提供了一种分配浏览器进程的方法。 该方法获取与 当前系统运行环境相关的数据; 基于该数据, 分配该浏览器进程。
优选地, 该浏览器进程的进程模式包括单进程模式、 混合进程模式、 多 进程模式中的至少二个。
优选地, 基于所述数据, 分配浏览器进程的步骤包括: 基于所述数据, 从浏览器进程的进程模式中选择一种进程模式, 并根据选择的进程模式分配 浏览器进程。
优选地,与当前系统运行环境相关的数据包括 CPU内核数、 CPU主频率、 系统内存中的一个或多个。
优选地, 通过 GetSys temlnfo函数获取当前系统的 CPU内核数。
优选地, 通过 G loba lMemoryS ta tusEx 函数获取当前系统的系统内存。 优选地,通过当前系统的注册表中的记录获取当前系统中的 CPU主频率。 较佳地, 该访问所述注册表中记录的步骤还包括用 RegOpenKeyEx 函数打开 注册表里面相应键值, 用 RegQueryVa lueEx函数查询该键值下相关项的值, 用 RegC l oseKey函数关闭该注册表。
优选地, 注册表的路径为: or\0\ "MHz; 其中, ~MHz中的〜表示所获取到的 CPU主频率。
优选地, 根据预置策略切换该浏览器进程模式。
优选地, 在安装浏览器过程中根据预置策略设定该浏览器的进程模式。 优选地, 在该浏览器首次被开启时根据预置策略配置该浏览器进程模 式。
优选地, 该预置策略为在当前系统中的 CPU为单核 CPU时, 配置该浏览 器为单进程模式。和 /或,优选地,该预置策略为在当前系统 CPU为多核 CPU, 且该 CPU主频或者当前系统内存在设定阈值内, 则根据该 CPU主频或当前系 统内存配置该浏览器为混合进程模式或多进程模式。
优选地, 当前系统运行环境相关数据包括与页面资源消耗情况相关的数 据, 并根据页面资源消耗情况分配浏览器进程。 较佳地, 根据页面资源类型 确定所述页面资源消耗情况。 较佳地, 根据数据加载量确定所述页面资源消 耗情况。
在第二方面, 本发明提供了一种分配浏览器进程的设备。 该设备包括数 据获取模块和进程分配模块, 其中, 该数据获取模块设置为获取与当前系统 运行环境相关的数据; 该进程分配模块设置为根据该数据获取模块获取的数 据, 分配该浏览器的进程。
优选地, 该浏览器进程的进程模式包括单进程模式、 混合进程模式、 多 进程模式中的至少二个。
优选地, 进程分配模块设置为基于所述数据, 从浏览器进程的进程模式 中选择一种进程模式, 并根据选择的进程模式分配浏览器进程。
优选地,与当前系统运行环境相关的数据包括 CPU内核数、 CPU主频率、 系统内存中的一个或多个。
优选地, 该进程分配模块包括根据预置策略切换该浏览器进程模式的模 块。
优选地, 该预置策略为在当前系统中的 CPU为单核 CPU时, 配置该浏览 器为单进程模式。和 /或,优选地,该预置策略为在当前系统 CPU为多核 CPU , 且该 CPU主频或者当前系统内存在设定阈值内, 则根据该 CPU主频或当前系 统内存配置该浏览器为混合进程模式或多进程模式。
优选地, 当前系统运行环境相关的数据包括与页面资源消耗情况相关的 数据, 且该进程分配模块根据页面资源消耗情况分配浏览器进程。 较佳地, 根据页面资源类型确定所述页面资源消耗情况。 较佳地, 根据数据加载量确 定所述页面资源消耗情况。
本发明依据当前系统运行环境, 智能地分配浏览器进程, 最大化地提高 了浏览器的使用性能。 本发明为用户提供了方便, 用户体验更佳。 附图说明
下面将参照附图对本发明的具体实施方案进行更详细的说明, 在附图 中:
图 1 是本发明一个实施例的分配浏览器进程的方法流程图;
图 2是本发明一个较佳实施例的切换浏览器进程模式的方法流程图; 图 3是现有技术中的浏览器进程模式选项配置示意图;
图 4是本发明一个较佳实施例的切换浏览器进程模式的方法流程图; 图 5本发明一个实施例的根据页面资源消耗情况分配浏览器进程的方法 流程图;
图 6是本发明一个实施例的分配浏览器进程的设备示意图。 具体实施方式
图 1是本发明一个实施例的分配浏览器进程的方法流程图。
在步骤 110, 获取与当前系统运行环境相关的数据。
一个例子中, 与当前系统运行环境相关的数据包括 CPU内核数、 CPU主 频率、 系统内存。
另一个例子中, 与当前系统运行环境相关的数据包括与页面资源消耗情 况相关的数据。
在步骤 120, 根据所获取到的数据, 分配浏览器的进程。
需要说明的是, 本发明的数据获取以及对浏览器的进程分配, 并未被限 定在仅由浏览器来完成, 也可以由专用插件或模块或设备来完成。
图 2是本发明一个实施例的切换浏览器进程模式的方法流程图, 其中, 该浏览器的进程模式包括单进程模式、 多进程模式、 混合进程模式。 在分配 浏览器进程时, 根据与当前系统运行环境相关的数据, 选择一种适当的进程 模式, 进而根据选择的进程模式为浏览器分配进程。 另外, 该浏览器的进程 模式也可以仅包括单进程模式、 多进程模式、 混合进程模式中的任意两个。 本领域技术人员可以参照本实施例, 实现两个进程模式下浏览器进程分配。
在步骤 210 , 用户初次开启系统(如计算机系统、 手机系统等) 中的浏 览器。 也就是说, 用户安装完该浏览器后, 初次打开该浏览器。 该步骤 210 是一个可选步骤。
在步骤 220 , 该浏览器获取与该系统运行环境相关的数据, 如获取该系 统中 CPU (中央处理器) 内核数、 CPU主频率或者该系统内存大小。
一个例子中, 该浏览器通过 GetSys temlnfo函数来获取当前系统 (即该 浏览器所属系统) 的 CPU内核数。
另一个例子中, 该浏览器通过 Globa lMemorySta tusEx 函数来获取当前 系统(即该浏览器所属系统) 的内存大小。
又一个例子中, 该浏览器通过当前系统(即该浏览器所属系统)注册表 里的记录来获得 CPU主频率。 其中, 该浏览器访问其所属系统中注册表里的 记录的方法为, 首先用 RegOpenKeyEx 函数打开注册表里面相应键值, 然后 用 RegQueryVa l ueEx函数查询该键值下的相关项值, 最后再用 RegC l os eKey 函数关闭该注册表。
并且该当前计算机系统中注册表路径为: or\0\ "MHz
其中, ~MHz中的〜表示该浏览器所获取到的当前系统的主频率。
需要说明的是, 本发明不限于以上方式来获取 CPU内核数、 系统内存、 CPU主频率。
在步骤 230 , 该浏览器根据其获取到 CPU内核数、 CPU主频率、 系统内 存大小,并根据该浏览器的预置策略配置该浏览器的进程模式,然后再保存, 以便用户以后再开启该浏览器时, 该浏览器具有此次配置的进程模式。
也就是说, 用户初次开启浏览器后, 该浏览器就会配置其进程模式, 并 保存此次配置结果。 从而使此次配置完成后, 用户以后再开启该浏览器时, 该浏览器将不会再获取 CPU内核数、 CPU主频率、 系统内存大小, 也不再对 该浏览器进程模式进行配置, 而是保有浏览器首次配置的进程模式, 除非用 户主动修改该浏览器的进程模式, 具体修改方式参照图 3。 图 3是现有技术 中的浏览器进程模式选项配置示意图。
图 3中, 用户可通过进入 " 360安全浏览器选项" 模块中的浏览器进程 模式来选择该浏览器的进程模式。 并且用户可选择包括单进程模式、 混合进 程模式、 多进程模式中的任意一种进程模式。
在本发明的一个实施例中, 步骤 230所述的预置策略为, 在当前系统中 的 CPU为单核 CPU时, 配置该浏览器为单进程模式。
在本发明的另一个实施例中, 步骤 230所述的预置策略为, 在当前系统 CPU为多核 CPU , 且该 CPU主频或者当前系统内存在设定阈值内, 则根据该 CPU主频或当前系统内存配置该浏览器为混合进程模式或多进程模式。
需要说明的是, 上述两种预置策略也可以同时存在, 由系统根据当前系 统中的 CPU为单核或多核, 选择两种预置策略中的一种。
此外, 也可以在该浏览器安装过程中, 设定该浏览器的进程模式。
图 4是本发明一个较佳实施例的切换浏览器进程模式的方法流程图。 在步骤 410 , 用户初次开启计算机系统中的浏览器。
在步骤 420 , 该浏览器获取该计算机系统中 CPU内核数。
具体地, 该浏览器通过 GetSys temlnfo 函数来获取当前计算机系统的 CPU内核数。
在步骤 430 , 若该计算机系统中的 CPU为单核 CPU, 则该浏览器配置其 进程模式为单进程模式, 然后再保存, 以便该浏览器以后再被开启时仍旧具 有此种单进程模式, 除非用户主动更改该浏览器的进程模式。
在步骤 440 , 若该计算机系统中的 CPU为多核 CPU, 则该浏览器继续获 取当前计算机系统中 CPU主频以及系统内存。
具体地 , 该浏览器通过函数 RegOpenKeyEx , RegQueryVa lueEx , RegC l oseKey访问当前计算机系统中的注册表, 然后在该注册表中的路径
\ ~MHz中, 来获取该 CPU主频率。 其中, ~MHz中的〜表示该浏览器所获取到 的当前计算机系统的主频率。
并且, 该浏览器通过 G loba lMemoryS ta tusEx 函数获取当前计算机系统 的内存。
在步骤 450 , 若该浏览器获取到当前计算机系统中 CPU主频在 2G以上, 或者获取到当前计算机系统内存在 1G 以上, 则该浏览器配置其进程模式为 混合进程模式, 然后保存该配置结果, 以便该浏览器以后再被开启时仍旧具 有此种混合进程模式, 除非用户主动修改。
在步骤 460 ,若该浏览器获取到当前计算机系统中 CPU内核数超过两核, 并且系统内存超过 2G , 则该浏览器配置其进程模式为多进程模式。
需要说明的是, 多数情况下, 该浏览器不会将其进程模式配置成多进程 模式, 而是更倾向于混合进程模式。 也就是说, 只有当前计算机系统具有极 好的性能时, 才会将该浏览器进程模式配置为多进程模式。 一个例子中, 仅 当该浏览器获取到当前计算机系统中 CPU为单核 CPU时, 该浏览器才会将进 程模式配置成单进程模式, 而在其他任何情况下, 该浏览器都将进程模式配 置成混合进程模式。
图 5是本发明一个实施例的根据页面资源消耗情况分配浏览器进程的方 法流程图。
在步骤 51 0 , 用户通过浏览器开启页面。
在步骤 520 , 该浏览器获取与当前系统运行环境相关的数据, 且该与当 前系统运行环境相关的数据为与页面资源消耗情况相关的数据, 因此, 此时 该浏览器检测该页面的资源消耗情况。
一个例子中, 该浏览器检测该页面的资源类型, 并才艮据该资源类型判定 该页面的资源消耗情况。例如,该浏览器检测到该页面中要加载视频、音频、 游戏等类型的资源时, 判定该页面资源消耗较大, 因此应当将资源消耗较大 的对象分配至一个新的进程, 并可以根据页面资源状况判断之后开启的新页 面是否分配至原有进程、 或上述新的进程, 如果新页面的资源消耗较大, 则 可以将其继续分配给新的进程, 如果新页面的资源消耗较小, 则可以将其分 配至原有的各进程中,但应确保分配页面不导致该进程因页面资源增加影响 运行状态。
另一个例子中, 该浏览器监测页面的数据加载量, 并在加载量达到一定 阈值时, 判定该页面资源消耗较大。
在步骤 530 , 根据页面资源消耗情况分配浏览器进程。
具体地, 在该浏览器检测到该页面资源消耗较大时, 将该页面中消耗较 大资源的部分从该页面中剥离出来, 并为该部分内容单独开启一个新进程, 使其在新进程中运行。
例如, 该浏览器检测到该页面中正在加载视频数据, 则将该视频从该页 面中剥离出来, 并为该视频开启一个新进程。
图 6是本发明一个实施例的分配浏览器进程的设备示意图。 该设备 61 0 包括数据获取模块 611、 进程分配模块 612。
该数据获取模块 61 1设置为获取与当前系统运行环境相关的数据。该进 程分配模块 612根据来自该数据获取模块的相应数据, 分配浏览器的进程。
其中, 该进程的进程模式包括单进程模式、 混合进程模式、 多进程模式 中的至少二个。
优选地, 进程分配模块 612设置为基于所述数据, 从浏览器进程的进程 模式中选择一种进程模式, 并根据选择的进程模式分配浏览器进程。
一个例子中, 与当前系统运行环境相关的数据包括 CPU内核数、 CPU主 频率、 系统内存。
另一个例子中, 与当前系统运行环境相关的数据为与页面资源消耗情况 相关的数据。 较佳地, 该页面资源消耗情况是通过该页面资源类型和 /或该 页面中的数据加载量来判定。 优选地, 该进程分配模块 612还包括根据预置策略切换该浏览器进程模 式的切换模块 6122。
一个例子中, 该预置策略为在当前系统中的 CPU为单核 CPU时, 配置该 浏览器为单进程模式。
另一个例子中, 该预置策略为在当前系统 CPU为多核 CPU , 且该 CPU主 频或者当前系统内存在设定阈值内, 则根据该 CPU主频或当前系统内存配置 该浏览器为混合进程模式或多进程模式。
上述两种预置策略也可同时存在, 由系统根据当前系统中的 CPU为单核 或多核, 选择相应的预置策略。
需要说明的是, 本发明并未被限定在仅用于 PC (个人计算机)中, 也可 以用于 PDA (掌上电脑)、 手机等各种电子设备中。 此外, 本发明的信息发送 方式可以是有线的也可以是无线的。 本发明可以通过记录在计算机可读记录介质上实现, 所述计算机可读记 录介质包括用于以计算机可读的形式存储或传送信息的任何介质, 例如, 只 读存储器(ROM ) 、 随机存取存储器(RAM ) 、 磁盘存储介质、 光存储介 质、 闪速存储介质、 电、 光、 声或其他形式的传播信号(例如, 载波、 红外 信号、 数字信号等)等。
本发明可用于众多通用或专用的计算系统环境或配置中。 例如: 个人计 算机、服务器计算机、手持设备或便携式设备、平板型设备、 多处理器系统、 基于微处理器的系统、 置顶盒、 可编程的消费电子设备、 网络 PC、 小型计算 机、 大型计算机、 包括以上任何系统或设备的分布式计算环境等等。
显而易见, 在不偏离本发明的真实精神和范围的前提下, 在此描述的本 发明可以有许多变化。因此,所有对于本领域技术人员来说显而易见的改变, 都应包括在本权利要求书所涵盖的范围之内。本发明所要求保护的范围仅由 所述的权利要求书进行限定。

Claims

权 利 要 求 书
1.一种分配浏览器进程的方法, 包括:
获取与当前系统运行环境相关的数据;
基于所述数据, 分配浏览器进程。
2.如权利要求 1所述的分配浏览器进程的方法, 其中, 所述浏览器进程 的进程模式包括单进程模式、 混合进程模式、 多进程模式中的至少二个。
3.如权利要求 2所述的分配浏览器进程的方法, 其中, 所述基于所述数 据, 分配浏览器进程的步骤包括:
基于所述数据, 从所述浏览器进程的进程模式中选择一种进程模式, 并 根据选择的所述进程模式分配浏览器进程。
4.如权利要求 1所述的分配浏览器进程的方法, 其中, 所述与当前系统 运行环境相关的数据包括: CPU 内核数、 CPU主频率、 系统内存中的一个或 多个。
5.如权利要求 4 所述的分配浏览器进程的方法, 其中, 通过 GetSys temlnfo函数获取所述当前系统的 CPU内核数。
6.如权利要求 4 所述的分配浏览器进程的方法, 其中, 通过 G loba lMemoryS ta tusEx 函数获取所述当前系统的系统内存。
7.如权利要求 4所述的分配浏览器进程的方法, 其中, 通过所述当前系 统的注册表中的记录, 来获取所述当前系统中的 CPU主频率。
8.如权利要求 7所述的分配浏览器进程的方法, 其中, 对所述注册表中 的记录的访问包括: 用 RegOpenKeyEx 函数打开所述注册表里面相应键值, 用 RegQueryVa lueEx函数查询该键值下相关项的值, 用 RegC loseKey函数关 闭该注册表。
9.如权利要求 7所述的分配浏览器进程的方法, 其中, 所述注册表的路 径为: or\0\ "MHz
其中, ~MHz中的〜表示所获取到的 CPU主频率。
1 0.如权利要求 2所述的分配浏览器进程的方法, 其中, 所述分配浏览 器进程的步骤包括: 根据预置策略切换该浏览器进程模式。
1 1.如权利要求 2所述的分配浏览器进程的方法, 其中, 所述分配浏览 器进程的步骤包括: 在安装浏览器过程中根据预置策略设定该浏览器的进程 模式。
12. 如权利要求 2所述的分配浏览器进程的方法, 其中, 所述分配浏览 器进程的步骤包括: 在该浏览器首次被开启时根据预置策略配置该浏览器进 程模式。
1 3.如权利要求 10至 12中任一权利要求所述的分配浏览器进程的方法, 其中, 所述预置策略为在所述当前系统中的 CPU为单核 CPU时, 配置该浏览 器为单进程模式; 和 /或,
所述预置策略为在所述当前系统 CPU为多核 CPU, 且该 CPU主频或者所 述当前系统内存在设定阈值内, 则根据该 CPU主频或当前系统内存配置该浏 览器为混合进程模式或多进程模式。
14. 如权利要求 1所述的分配浏览器进程的方法, 其中, 所述当前系统 运行环境相关的数据包括与页面资源消耗情况相关的数据; 所述基于所述数 据,分配浏览器进程的步骤包括:根据所述与页面资源消耗情况相关的数据, 分配所述浏览器进程。
15.如权利要求 14所述的分配浏览器进程的方法, 其中, 所述页面资源 消耗情况根据页面资源类型确定; 或者,
所述页面资源消耗情况根据数据加载量确定。
16.—种分配浏览器进程的设备, 包括: 数据获取模块和进程分配模块; 其中,
该数据获取模块设置为获取与当前系统运行环境相关的数据;
该进程分配模块设置为根据该数据获取模块获取的相应数据,分配浏览 器进程。
17.如权利要求 16所述的分配浏览器进程的设备, 其中, 所述浏览器进 程的进程模式包括单进程模式、 混合进程模式、 多进程模式中的至少二个。
18.如权利要求 17所述的分配浏览器进程的设备, 其中, 所述进程分配 模块设置为基于所述数据,从所述浏览器进程的进程模式中选择一种进程模 式, 并根据选择的所述进程模式分配浏览器进程。
19.如权利要求 17所述的分配浏览器进程的设备, 其中, 所述与当前系 统运行环境相关的数据包括: CPU 内核数、 CPU主频率、 系统内存中的一个 或多个。
20.如权利要求 17所述的分配浏览器进程的设备, 其中, 所述进程分配 模块包括根据预置策略切换该浏览器进程模式的切换模块。
21.如权利要求 20所述的分配浏览器进程的设备, 其中, 所述预置策略 为在所述当前系统中的 CPU为单核 CPU时, 配置该浏览器为单进程模式; 和 /或,
所述预置策略为在所述当前系统 CPU为多核 CPU , 且该 CPU主频或者当 前系统内存在设定阈值内, 则根据该 CPU主频或当前系统内存配置该浏览器 为混合进程模式或多进程模式。
22. 如权利要求 17所述的分配浏览器进程的设备, 其中, 所述当前系 统运行环境相关的数据包括与页面资源消耗情况相关的数据,且所述进程分 配模块根据所述与页面资源消耗情况相关的数据, 分配所述浏览器进程。
2 3.如权利要求 22所述的分配浏览器进程的设备, 其中, 所述页面资源 消耗情况根据页面资源类型确定; 或者,
所述页面资源消耗情况根据数据加载量确定。
24.—种在其上记录有用于执行权利要求 1 所述方法的程序的计算机可 读记录介质。
PCT/CN2012/070908 2011-02-18 2012-02-06 一种分配浏览器进程的方法及其设备 WO2012109961A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/000,045 US10048986B2 (en) 2011-02-18 2012-02-06 Method and device for allocating browser processes according to a selected browser process mode

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110040827.1 2011-02-18
CN201110040827.1A CN102436457B (zh) 2011-02-18 2011-02-18 一种分配浏览器进程的方法及其设备

Publications (1)

Publication Number Publication Date
WO2012109961A1 true WO2012109961A1 (zh) 2012-08-23

Family

ID=45984523

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/070908 WO2012109961A1 (zh) 2011-02-18 2012-02-06 一种分配浏览器进程的方法及其设备

Country Status (3)

Country Link
US (1) US10048986B2 (zh)
CN (1) CN102436457B (zh)
WO (1) WO2012109961A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9367211B1 (en) * 2012-11-08 2016-06-14 Amazon Technologies, Inc. Interface tab generation
CN103902367B (zh) * 2012-12-28 2018-08-10 联想(北京)有限公司 一种动态切换进程模型的方法及电子设备
CN106096030B (zh) * 2013-04-23 2019-10-15 北京奇虎科技有限公司 对浏览器运行进行优化的方法和装置
CN104133616B (zh) * 2014-07-30 2018-05-08 北京金山安全软件有限公司 一种信息显示方法、装置及终端
CN104239102B (zh) * 2014-09-15 2016-08-24 腾讯科技(深圳)有限公司 应用程序运行方法和装置
US10693974B2 (en) * 2017-09-28 2020-06-23 Citrix Systems, Inc. Managing browser session navigation between one or more browsers
JP7155584B2 (ja) * 2018-03-30 2022-10-19 株式会社リコー 情報処理装置、情報処理方法及び情報処理プログラム
US20190347315A1 (en) * 2018-05-08 2019-11-14 International Business Machines Corporation Methods and systems for rendering web pages with restricted features
CN109117274B (zh) * 2018-08-28 2021-03-09 Oppo广东移动通信有限公司 应用于浏览器的内存管理方法、装置、终端及存储介质

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101968838A (zh) * 2010-09-29 2011-02-09 北京握奇数据系统有限公司 一种浏览器及配置安全浏览器的方法

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6122744A (en) * 1998-05-20 2000-09-19 Intel Corporation Selecting a routine based on processing power
KR101282139B1 (ko) * 2006-09-11 2013-07-04 삼성전자주식회사 별도 버튼을 이용하여 성능모드 변경이 가능한컴퓨터시스템 및 그 제어방법
KR100962531B1 (ko) * 2007-12-11 2010-06-15 한국전자통신연구원 동적 로드 밸런싱을 지원하는 멀티 쓰레딩 프레임워크를 수행하는 장치 및 이를 이용한 프로세싱 방법
US8307300B1 (en) * 2008-05-13 2012-11-06 Google Inc. Content resizing and caching in multi-process browser architecture
US20100225640A1 (en) * 2009-03-03 2010-09-09 Vieri Carlin J Switching Operating Modes of Liquid Crystal Displays
CN101930719A (zh) * 2009-06-18 2010-12-29 辉达公司 自动切换显示器场景模式的方法及系统
KR101584058B1 (ko) * 2009-08-07 2016-01-12 삼성전자주식회사 현재 상황에 적합한 사용 환경을 제공하는 휴대 단말기 및 이의 운용 방법
CN101853102B (zh) * 2010-06-01 2012-05-09 深圳市汇顶科技有限公司 一种触控设备配置参数的自动生成方法、系统
US9384054B2 (en) * 2010-09-22 2016-07-05 Nokia Technologies Oy Process allocation to applications executing on a mobile device
US20130160024A1 (en) * 2011-12-20 2013-06-20 Sybase, Inc. Dynamic Load Balancing for Complex Event Processing

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101968838A (zh) * 2010-09-29 2011-02-09 北京握奇数据系统有限公司 一种浏览器及配置安全浏览器的方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"How to prevent a browser occupying too much resource?", PC WORLD, no. 3, 2010, pages 102 *
MUCHMORE, M. ET AL.: "How to choose the optimum web browser", SOFTWARE WORLD, no. 9, 2009, pages 78 - 89 *

Also Published As

Publication number Publication date
CN102436457B (zh) 2014-04-16
CN102436457A (zh) 2012-05-02
US10048986B2 (en) 2018-08-14
US20140007126A1 (en) 2014-01-02

Similar Documents

Publication Publication Date Title
WO2012109961A1 (zh) 一种分配浏览器进程的方法及其设备
US10416932B2 (en) Dirty data management for hybrid drives
KR101707880B1 (ko) 신축적 컴퓨팅 시스템 및 환경에서 안전한 서비스 제공자 이용
US8595366B2 (en) Method and system for dynamically creating and servicing master-slave pairs within and across switch fabrics of a portable computing device
US9626126B2 (en) Power saving mode hybrid drive access management
US20160013980A1 (en) Private Content Distribution Network
CN106104485A (zh) 针对多进程应用的动态资源管理
JP2016503911A (ja) サービス品質を使用して異なるメモリデバイスにメモリを割り振るためのシステムおよび方法
WO2013083065A1 (zh) 音乐播放方法、第三方应用及装置
US20190124174A1 (en) Resource cache management method and system and apparatus
US20170212581A1 (en) Systems and methods for providing power efficiency via memory latency control
CN109992399B (zh) 资源管理方法、装置、移动终端及计算机可读存储介质
US11588909B1 (en) System and method for subscription based solution data compatibility
US11789718B2 (en) System and method for subscription based solution modification implementation
WO2024119988A1 (zh) 多cpu环境下的进程调度方法、装置、电子设备和介质
CN112346657A (zh) 用于降低功率状态中的存储器访问的技术
WO2021135574A1 (zh) 数据存储方法、装置及终端设备
US11888690B2 (en) System and method for subscription limitation enforcement in distributed system
TW202232316A (zh) 計算裝置以及用於儲存裝置資源管理的系統和方法
US20150295991A1 (en) Method and device for browsing network data, and storage medium
Yang et al. Implementation of a distributed data storage system with resource monitoring on cloud computing
Li et al. Flexible and Efficient Memory Swapping Across Mobile Devices With LegoSwap
TWI553462B (zh) 可降低耗電之硬碟裝置以及降低硬碟裝置耗電之方法
US20240231912A1 (en) Resource-capability-and-connectivity-based workload performance improvement system
US20240231936A1 (en) Resource-capability-and-connectivity-based workload performance system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12746628

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 14000045

Country of ref document: US

122 Ep: pct application non-entry in european phase

Ref document number: 12746628

Country of ref document: EP

Kind code of ref document: A1