WO2016197441A1 - 基于多核处理器的资源调度方法及装置 - Google Patents
基于多核处理器的资源调度方法及装置 Download PDFInfo
- Publication number
- WO2016197441A1 WO2016197441A1 PCT/CN2015/085854 CN2015085854W WO2016197441A1 WO 2016197441 A1 WO2016197441 A1 WO 2016197441A1 CN 2015085854 W CN2015085854 W CN 2015085854W WO 2016197441 A1 WO2016197441 A1 WO 2016197441A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- area
- cpu usage
- cpu
- usage requirement
- resource scheduling
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
Definitions
- the present invention relates to the field of communications technologies, and in particular, to a resource scheduling method and apparatus based on a multi-core processor.
- the allocation method is not flexible: When the processor area is used excessively in the normal area or the security area, the fixed allocation of the processor core limits the intelligent optimization of the processor core, resulting in reduced efficiency.
- an object of the present invention is to provide a resource scheduling based on a multi-core processor.
- the method and device can realize intelligent scheduling and control for the use of CPU resources between different regions, thereby improving the use efficiency of CPU resources.
- the present invention provides a resource scheduling method based on a multi-core processor, which is applied to a communication terminal including a system and at least two areas, and the method includes the following steps:
- a matching number of processor cores are scheduled for the current region based on the CPU usage requirements of the current region.
- the step of real-time detecting the CPU usage requirement of the running current region includes:
- the step of detecting the CPU usage requirement of the current area in real time in real time includes:
- the step of scheduling a matching number of processor cores for the current region according to the CPU usage requirement of the current region includes:
- a matching number of the sub-processes are scheduled from the parent process to the first area.
- the step of detecting the CPU usage requirement of the running current area in real time includes:
- the step of scheduling a matching number of processor cores for the current region according to the CPU usage requirement of the current region includes:
- the step of scheduling a matching number of processor cores for the current region according to the CPU usage requirement of the current region further includes:
- Terminating at least one of the child processes that the first region has invoked.
- the system is a TrustZone system, and the area Includes separate security zones and common zones.
- the present invention also provides a multi-core processor-based resource scheduling apparatus, which is applied to a communication terminal including a system and at least two areas, and the resource scheduling apparatus includes:
- a CPU detection module for detecting CPU usage requirements of a current area in operation in real time
- a CPU scheduling module configured to schedule a matching number of processor cores for the current region according to the CPU usage requirement of the current region.
- the resource scheduling apparatus further includes:
- An initialization module configured to initialize a parent process when running in the first region, and derive a plurality of child processes for the parent process, each of the child processes managing one of the processor cores;
- the CPU detection module includes:
- a first detecting submodule configured to detect a first CPU usage requirement of the first area in real time
- the CPU scheduling module includes:
- a first scheduling submodule configured to schedule, according to the first CPU usage requirement, a matching number of the subprocesses from the parent process to the first area.
- the CPU detection module includes:
- a second detecting submodule configured to detect a second CPU usage requirement of the second area in real time when switching from the first area to the second area
- the CPU scheduling module includes:
- a second scheduling submodule configured to schedule, according to the second CPU usage requirement, a matching number of the subprocesses from the parent process to the second area.
- the CPU scheduling module further includes:
- Terminating a submodule for terminating at least one of the child processes that the first region has invoked.
- the system is a TrustZone system
- the area includes a security area and a common area that are isolated from each other.
- the invention provides a resource scheduling technology based on a multi-core processor, detects the CPU usage requirement of the current area in real time, and schedules a matched number of processor cores for the current area according to the CPU usage requirement. Thereby, the invention can monitor the CPU usage status of the current area in real time, and freely schedule the occupied number of the processor core according to the CPU usage status of the current area, thereby realizing intelligent scheduling and control of the use of CPU resources between different areas, thereby improving the CPU resource usage efficiency.
- the invention is particularly applicable to A communication terminal with a TrustZone system.
- FIG. 1 is a schematic structural diagram of a resource scheduling apparatus based on a multi-core processor according to the present invention
- FIG. 2 is a schematic structural diagram of a preferred multi-core processor-based resource scheduling apparatus according to the present invention.
- FIG. 3 is a flowchart of a resource scheduling method based on a multi-core processor of the present invention
- FIG. 4 is a flowchart of a resource scheduling method based on a multi-core processor in the first embodiment of the present invention
- FIG. 5 is a flowchart of a multi-core processor-based resource scheduling method in a second embodiment of the present invention.
- FIG. 6 is a schematic diagram of a resource scheduling method based on a multi-core processor in a third embodiment of the present invention.
- FIG. 1 is a schematic structural diagram of a resource scheduling apparatus based on a multi-core processor according to the present invention, which is applied to a communication terminal including a system and at least two areas, the communication terminal including a mobile phone, a PDA (Personal Digital Assistant), and a tablet. Computer, etc.
- the system is a TrustZone system
- the area includes a security area and a common area that are isolated from each other.
- the resource scheduling apparatus 100 includes at least a CPU detecting module 10 and a CPU scheduling module 20, where:
- the CPU detection module 10 is configured to detect the CPU usage requirement of the current area in operation in real time.
- the CPU usage requirement is preferably the number of processor cores required to ensure normal operation of the current region, wherein the multi-core processor may include any number of processor cores such as 2, 4, 8, and the like.
- the current area may be a secure area or a normal area.
- the CPU scheduling module 20 is configured to schedule a matching number of processor cores for the current region according to the CPU usage requirements of the current region, so as to ensure that the current region can operate normally and efficiently.
- the application if it has a non-verified normal page, it is placed in a normal area; if the password input interface to be verified is placed in a secure area to ensure password security. And when the user enters the password input page from the normal page, the system will switch from the normal area to the secure area. If the user runs an application, it enters a normal page, and the normal page is placed in the normal area. At this time, the CPU usage requirement of the running normal area is detected in real time, and the matching number of processor cores are scheduled for the common area according to the CPU usage requirements of the common area. For example, if a normal area needs to run 6 normal core pages, then 6 processor cores are required. Allocate 6 processor cores to the normal area.
- the user runs an application, enter a password input interface, and the password input interface is placed in a secure area.
- the CPU usage requirement of the running security zone is detected in real time, and a matching number of processor cores are scheduled for the security zone according to the CPU usage requirement of the security zone.
- the security zone normal operation password input interface requires five processor cores. Then allocate 5 processor cores to the normal area.
- the invention can implement intelligent scheduling and control for the use of the inter-area processor core, and specifically includes: adding a middleware-resource scheduling device 100 between the common area and the security area to monitor the CPU usage of the current domain in real time, and Freely expand or reduce CPU usage depending on CPU usage. Reasonable utilization of CPU resources; no need to monitor each processor core, only need to issue instructions to the resource scheduling device 100, the resource scheduling device 100 uniformly detects and records the CPU usage, and automatically schedules resources, and if problems arise, directly Reported.
- FIG. 2 is a schematic structural diagram of a preferred multi-core processor-based resource scheduling apparatus according to the present invention, which is applied to a communication terminal including a system and at least two areas, the communication terminal including a mobile phone, a PDA, a tablet computer, etc., preferably,
- the system is a TrustZone system, and the area includes a security area and a common area that are isolated from each other.
- the resource scheduling apparatus 100 includes a CPU detecting module 10, a CPU scheduling module 20, and/or an initialization module 30, where:
- the initialization module 30 is configured to initialize a parent process when running in the first area, and derive multiple child processes for the parent process, each child process managing one processor core.
- the first area is preferably a normal area or a secure area. For example, if a user enters a normal page when running an application, and the normal page is placed in a normal area, the normal area is run at this time.
- the CPU detection module 10 includes:
- the first detecting sub-module 11 is configured to detect the first CPU usage requirement of the first area in real time.
- the first CPU usage requirement is 6 processor cores.
- the CPU scheduling module 20 includes: allocating 6 processor cores to the common area
- a first scheduling sub-module 21 configured to schedule a match from the parent process according to the first CPU usage requirement The number of child processes is given to the first zone.
- the first CPU usage requirement is 6 processor cores
- 6 child processes are scheduled from the parent process to the first area, and the first area can occupy 6 processor cores.
- the CPU detection module 10 includes:
- the second detecting sub-module 12 is configured to detect the second CPU usage requirement of the second area in real time when switching from the first area to the second area.
- the second area is preferably a secure area or a common area. For example, when the user enters the password input page from the normal page, the system will switch from the normal area to the security area.
- the security area normally runs the password input page and needs 5 processor cores, and the second CPU usage requirement is 5 processor cores.
- the CPU scheduling module 20 includes:
- the second scheduling sub-module 22 is configured to schedule a matching number of child processes from the parent process to the second area according to the second CPU usage requirement.
- the second CPU usage requirement is 5 processor cores
- 5 child processes are scheduled from the parent process to the first area, and the first area can occupy 5 processor cores.
- the CPU scheduling module 20 further includes:
- the terminating sub-module 23 is configured to terminate at least one child process that has been called by the first area.
- the demand for the CPU is reduced, and at least one child process in the first area is terminated to reduce the overhead of the CPU, and the purpose of free scheduling and resource saving is achieved.
- FIG. 3 is a flowchart of a multi-core processor-based resource scheduling method according to the present invention. The method is implemented by the resource scheduling apparatus 100 shown in FIG. 1 or FIG. 2, and is applied to a communication terminal including a system and at least two areas. The method includes the steps of:
- step S301 the CPU usage requirement of the current area that is running is detected in real time.
- the CPU usage requirement is preferably the number of processor cores required to ensure normal operation of the current region, wherein the multi-core processor may include any number of processor cores such as 2, 4, 8, and the like.
- the current area may be a secure area or a normal area.
- Step S302 scheduling a matching number of processor cores for the current region according to the CPU usage requirement of the current region.
- the system is a TrustZone system, and the area includes a security area and a common area that are isolated from each other.
- the application has a non-verified normal page. It is placed in the normal area; if you need to verify the password input interface, put it in the security area to ensure password security. And when the user enters the password input page from the normal page, the system will switch from the normal area to the secure area. If the user runs an application, it enters a normal page, and the normal page is placed in the normal area. At this time, the CPU usage requirement of the running normal area is detected in real time, and the matching number of processor cores are scheduled for the common area according to the CPU usage requirements of the common area.
- a normal area needs to run 6 normal core pages, then 6 processor cores are required. Allocate 6 processor cores to the normal area. Or, if the user runs an application, enter a password input interface, and the password input interface is placed in a secure area. At this time, the CPU usage requirement of the running security zone is detected in real time, and a matching number of processor cores are scheduled for the security zone according to the CPU usage requirement of the security zone. For example, the security zone normal operation password input interface requires five processor cores. Then allocate 5 processor cores to the normal area.
- FIG. 4 is a flowchart of a multi-core processor-based resource scheduling method according to a first embodiment of the present invention.
- the method is implemented by the resource scheduling apparatus 100 shown in FIG. 2, and is applied to a communication terminal including a system and at least two areas.
- the method includes the steps of:
- Step S401 when running in the first area, initialize a parent process, and derive multiple child processes for the parent process, each child process managing one processor core.
- the first area is preferably a normal area or a secure area. For example, if a user enters a normal page when running an application, and the normal page is placed in a normal area, the normal area is run at this time.
- Step S402 detecting the first CPU usage requirement of the first area in real time.
- the first CPU usage requirement is 6 processor cores.
- Step S403 scheduling a matching number of child processes from the parent process to the first area according to the first CPU usage requirement.
- the first CPU usage requirement is 6 processor cores
- 6 child processes are scheduled from the parent process to the first area, and the first area can occupy 6 processor cores.
- FIG. 5 is a flowchart of a multi-core processor-based resource scheduling method according to a second embodiment of the present invention.
- the method is implemented by the resource scheduling apparatus 100 shown in FIG. 2, and is applied to a communication terminal including a system and at least two areas.
- the method includes the steps of:
- Step S501 when running in the first area, initialize a parent process and derive the parent process There are multiple child processes, each of which manages one processor core.
- the first area is preferably a normal area or a secure area. For example, if a user enters a normal page when running an application, and the normal page is placed in a normal area, the normal area is run at this time.
- Step S502 detecting the first CPU usage requirement of the first area in real time.
- the first CPU usage requirement is 6 processor cores.
- Step S503 scheduling a matched number of child processes from the parent process to the first area according to the first CPU usage requirement.
- the first CPU usage requirement is 6 processor cores
- 6 child processes are scheduled from the parent process to the first area, and the first area can occupy 6 processor cores.
- Step S504 when switching from the first area to the second area, detecting the second CPU usage requirement of the second area in real time.
- the second area is preferably a secure area or a common area. For example, when the user enters the password input page from the normal page, the system will switch from the normal area to the security area.
- the security area normally runs the password input page and needs 5 processor cores, and the second CPU usage requirement is 5 processor cores.
- Step S505 According to the second CPU usage requirement, a matching number of child processes are scheduled from the parent process to the second area.
- the second CPU usage requirement is 5 processor cores
- 5 child processes are scheduled from the parent process to the first area, and the first area can occupy 5 processor cores.
- Step S506 terminating at least one child process that has been called by the first area.
- the demand for the CPU is reduced, and at least one child process in the first area is terminated to reduce the overhead of the CPU, and the purpose of free scheduling and resource saving is achieved.
- FIG. 6 is a schematic diagram of a multi-core processor-based resource scheduling method according to a third embodiment of the present invention, applied to a communication terminal having a multi-core processor, the communication terminal having a TrustZone system, a common area, a security area, and a resource scheduling apparatus 100,
- the TrustZone system is connected to the common area, the security area, and the resource scheduling apparatus 100, respectively.
- the user runs an APP and enters a normal page. It notifies the TrustZone system that if the normal page is loaded, more processor cores are needed.
- the TrustZone system invokes the resource scheduling device 100 to initialize a parent process and derive a child process. Each child process will call a processor core and call the appropriate number of processor cores according to the page requirements.
- the resource scheduling apparatus 100 monitors the usage status of the CPU in the normal area.
- the resource scheduling apparatus 100 automatically adjusts the increase or decrease of the CPU as the user browses the usage of the page.
- the security zone informs the TrustZone system that if the password verification page is loaded, more processor cores are needed.
- the TrustZone system will invoke the resource scheduling device 100 to derive a new child process from the initialized parent process to invoke the new processor core. If the current CPU's child processes are all occupied, you need to terminate at least one child process of the normal system and then call the new child process in the idle state. If the child processes are not all occupied, the new child process in the idle state can be directly called.
- the resource scheduling apparatus 100 automatically controls the processor core used to reduce the security zone and increases the processor core of the normal zone.
- the present invention provides a resource scheduling technology based on a multi-core processor, detects the CPU usage requirement of the current area in real time, and schedules a matched number of processor cores for the current area according to the CPU usage requirement. Thereby, the invention can monitor the CPU usage status of the current area in real time, and freely schedule the occupied number of the processor core according to the CPU usage status of the current area, thereby realizing intelligent scheduling and control of the use of CPU resources between different areas, thereby improving the CPU resource usage efficiency.
- the invention is particularly applicable to communication terminals having a TrustZone system.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mobile Radio Communication Systems (AREA)
- Multi Processors (AREA)
- Stored Programmes (AREA)
Abstract
一种基于多核处理器的资源调度方法及装置,适用于通信技术领域,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有:实时检测正在运行的当前区域的CPU使用需求(S301);根据所述当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核(S302)。借此,能够实时监控当前区域的CPU使用状况,并根据当前区域的CPU使用状况自由调度处理器内核的占用数量,从而对不同区域间的CPU资源的使用实现智能调度和控制,提高了CPU资源的使用效率。
Description
本申请要求于2015年06月09日提交中国专利局,申请号为201510313646.X、发明名称为“基于多核处理器的资源调度方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及通信技术领域,尤其涉及一种基于多核处理器的资源调度方法及装置。
随着有线、无线网络在嵌入式系统的日益深入,嵌入式应用的安全性成为系统功能最重要的要求。在数据服务和支付应用等嵌入式应用中,安全性更是消费者保护和商业价值内容保护的强制性要求。现有技术在CPU(Central Processing Unit,中央处理器)内核的设计中集成系统安全性扩展,是TrustZone-ARMv6内核架构下的重要扩展特性之一,在对内核的功耗、性能和硅片面积不产生大的影响前提下,TrustZone技术为设计具有高度安全性的嵌入式系统提供了坚实的基础。在一个具有八核CPU的系统下,普通区域与安全区域各占有一半的处理器内核。现有技术方案的缺陷主要包括:
一、资源浪费:当用户由普通区域切换至安全区域时,普通区域会使用较少的处理器资源,但是占用一半处理器内核导致资源使用上的浪费,反之亦然。
二、分配方式不灵活:当普通区域或安全区域过多使用处理器资源时,处理器内核的固定分配限制了处理器内核的智能优化使用,导致使用效率降低。
三、不方便监控与管理:不能统一对CPU使用数据进行收集、整理。
综上可知,现有技术在实际使用上显然存在不便与缺陷,所以有必要加以改进。
发明内容
针对上述的缺陷,本发明的目的在于提供一种基于多核处理器的资源调度
方法及装置,其能够对不同区域间的CPU资源的使用实现智能调度和控制,从而提高了CPU资源的使用效率。
为了实现上述目的,本发明提供一种基于多核处理器的资源调度方法,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有:
实时检测正在运行的当前区域的CPU使用需求;
根据所述当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核。
根据本发明所述的资源调度方法,所述实时检测正在运行的当前区域的CPU使用需求的步骤之前包括:
当运行在第一区域时,初始化一个父进程,并为所述父进程派生出多个子进程,每个所述子进程管理一个所述处理器内核;
所述实时检测正在运行的当前区域的CPU使用需求的步骤包括:
实时检测所述第一区域的第一CPU使用需求;
所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤包括:
根据所述第一CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第一区域。
根据本发明所述的资源调度方法,所述实时检测正在运行的当前区域的CPU使用需求的步骤包括:
当从所述第一区域切换到第二区域时,实时检测所述第二区域的第二CPU使用需求;
所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤包括:
根据所述第二CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第二区域。
根据本发明所述的资源调度方法,所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤还包括:
终止所述第一区域已调用的至少一个所述子进程。
根据本发明所述的资源调度方法,所述系统为TrustZone系统,所述区域
包括相互隔离的安全区域和普通区域。
本发明还提供一种基于多核处理器的资源调度装置,应用于包括系统和至少两个区域的通信终端中,所述资源调度装置包括有:
CPU检测模块,用于实时检测正在运行的当前区域的CPU使用需求;
CPU调度模块,用于根据所述当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核。
根据本发明所述的资源调度装置,还包括:
初始化模块,用于当运行在第一区域时,初始化一个父进程,并为所述父进程派生出多个子进程,每个所述子进程管理一个所述处理器内核;
所述CPU检测模块包括:
第一检测子模块,用于实时检测所述第一区域的第一CPU使用需求;
所述CPU调度模块包括:
第一调度子模块,用于根据所述第一CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第一区域。
根据本发明所述的资源调度装置,所述CPU检测模块包括:
第二检测子模块,用于当从所述第一区域切换到第二区域时,实时检测所述第二区域的第二CPU使用需求;
所述CPU调度模块包括:
第二调度子模块,用于根据所述第二CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第二区域。
根据本发明所述的资源调度装置,所述CPU调度模块还包括:
终止子模块,用于终止所述第一区域已调用的至少一个所述子进程。
根据本发明所述的资源调度装置,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。
本发明提供基于多核处理器的资源调度技术,实时检测当前区域的CPU使用需求,并根据所述CPU使用需求为当前区域调度匹配数量的处理器内核。借此,本发明能够实时监控当前区域的CPU使用状况,并根据当前区域的CPU使用状况自由调度处理器内核的占用数量,从而对不同区域间的CPU资源的使用实现智能调度和控制,提高了CPU资源的使用效率。本发明尤其适用于
具有TrustZone系统的通信终端。
图1是本发明基于多核处理器的资源调度装置的结构示意图;
图2是本发明优选基于多核处理器的资源调度装置的结构示意图;
图3是本发明基于多核处理器的资源调度方法的流程图;
图4是本发明第一实施例中基于多核处理器的资源调度方法的流程图;
图5是本发明第二实施例中基于多核处理器的资源调度方法的流程图;
图6是本发明第三实施例中基于多核处理器的资源调度方法的原理图。
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
图1是本发明基于多核处理器的资源调度装置的结构示意图,应用于包括系统和至少两个区域的通信终端中,所述通信终端包括手机、PDA(Personal Digital Assistant,个人数字助理)、平板电脑等。优选的是,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。所述资源调度装置100至少包括有CPU检测模块10和CPU调度模块20,其中:
CPU检测模块10,用于实时检测正在运行的当前区域的CPU使用需求。所述CPU使用需求优选为当前区域保证正常运行所需的处理器内核的数量,其中所述多核处理器可以包括2、4、8等任意个处理器内核。优选的是,所述当前区域可以是安全区域或普通区域。
CPU调度模块20,用于根据当前区域的CPU使用需求,为当前区域调度匹配数量的处理器内核,以保证当前区域能够正常而高效运行。
在本发明一具体实施例中,假设应用程序有非校验的普通页面,则被放在普通区域;若需校验的密码输入界面,则放在安全区域以保证密码安全。且当用户从普通页面进入密码输入页面时,系统将从普通区域切换至安全区域。若用户运行一个应用程序时进入一个普通页面,且该普通页面被放在普通区域。
此时,实时检测正在运行的普通区域的CPU使用需求,并根据普通区域的CPU使用需求,为普通区域调度匹配数量的处理器内核,例如普通区域正常运行普通页面需要6个处理器内核,则分配6个处理器内核给普通区域。或者,若用户运行一个应用程序时进入一个密码输入界面,且该密码输入界面被放在安全区域。此时,实时检测正在运行的安全区域的CPU使用需求,并根据安全区域的CPU使用需求,为安全区域调度匹配数量的处理器内核,例如安全区域正常运行密码输入界面需要5个处理器内核,则分配5个处理器内核给普通区域。
本发明能够对区域间处理器内核的使用实现智能调度和控制,具体有点包括:在普通区域与安全区域中间加入一中间件—资源调度装置100,用来实时监测当前域的CPU使用状况,并根据CPU使用状况自由扩展或减少对CPU的占用。CPU资源的合理利用;不需对每一处理器内核进行监控,只需给资源调度装置100发布指令,资源调度装置100统一检测和记录CPU使用情况,并自动调度资源,一旦出现问题,可直接上报。
图2是本发明优选基于多核处理器的资源调度装置的结构示意图,应用于包括系统和至少两个区域的通信终端中,所述通信终端包括手机、PDA、平板电脑等,优选的是,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。所述资源调度装置100包括有CPU检测模块10、CPU调度模块20和/或初始化模块30,其中:
初始化模块30,用于当运行在第一区域时,初始化一个父进程,并为父进程派生出多个子进程,每个子进程管理一个处理器内核。所述第一区域优选为普通区域或安全区域。例如,若用户运行一个应用程序时进入一个普通页面,且该普通页面被放在普通区域,此时运行普通区域。
所述CPU检测模块10包括:
第一检测子模块11,用于实时检测第一区域的第一CPU使用需求。
例如,普通区域正常运行普通页面需要6个处理器内核,则第一CPU使用需求为6个处理器内核。
CPU调度模块20包括:则分配6个处理器内核给普通区域
第一调度子模块21,用于根据第一CPU使用需求,从父进程中调度匹配
数量的子进程给第一区域。
例如,第一CPU使用需求为6个处理器内核,则从父进程中调度6个子进程给第一区域,此时第一区域可占用6个处理器内核。
优选的是,所述CPU检测模块10包括:
第二检测子模块12,用于当从第一区域切换到第二区域时,实时检测第二区域的第二CPU使用需求。所述第二区域优选为安全区域或普通区域。例如,当用户从普通页面进入密码输入页面时,系统将从普通区域切换至安全区域,安全区域正常运行密码输入页面需要5个处理器内核,则第二CPU使用需求为5个处理器内核。
所述CPU调度模块20包括:
第二调度子模块22,用于根据第二CPU使用需求,从父进程中调度匹配数量的子进程给第二区域。
例如,第二CPU使用需求为5个处理器内核,则从父进程中调度5个子进程给第一区域,此时第一区域可占用5个处理器内核。
更好的是,CPU调度模块20还包括:
终止子模块23,用于终止第一区域已调用的至少一个子进程。
由于第一区域不再运行,因此对CPU的需求量减少,则终止第一区域中至少一个子进程来减少对CPU的开销,达到自由调度和节省资源的目的。
图3是本发明基于多核处理器的资源调度方法的流程图,所述方法通过如图1或图2所示的资源调度装置100实现,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有:
步骤S301,实时检测正在运行的当前区域的CPU使用需求。
所述CPU使用需求优选为当前区域保证正常运行所需的处理器内核的数量,其中所述多核处理器可以包括2、4、8等任意个处理器内核。优选的是,所述当前区域可以是安全区域或普通区域。
步骤S302,根据当前区域的CPU使用需求,为当前区域调度匹配数量的处理器内核。
优选的是,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。在本发明一具体实施例中,假设应用程序有非校验的普通页面,
则被放在普通区域;若需校验的密码输入界面,则放在安全区域以保证密码安全。且当用户从普通页面进入密码输入页面时,系统将从普通区域切换至安全区域。若用户运行一个应用程序时进入一个普通页面,且该普通页面被放在普通区域。此时,实时检测正在运行的普通区域的CPU使用需求,并根据普通区域的CPU使用需求,为普通区域调度匹配数量的处理器内核,例如普通区域正常运行普通页面需要6个处理器内核,则分配6个处理器内核给普通区域。或者,若用户运行一个应用程序时进入一个密码输入界面,且该密码输入界面被放在安全区域。此时,实时检测正在运行的安全区域的CPU使用需求,并根据安全区域的CPU使用需求,为安全区域调度匹配数量的处理器内核,例如安全区域正常运行密码输入界面需要5个处理器内核,则分配5个处理器内核给普通区域。
图4是本发明第一实施例中基于多核处理器的资源调度方法的流程图,所述方法通过如图2所示的资源调度装置100实现,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有:
步骤S401,当运行在第一区域时,初始化一个父进程,并为父进程派生出多个子进程,每个子进程管理一个处理器内核。
所述第一区域优选为普通区域或安全区域。例如,若用户运行一个应用程序时进入一个普通页面,且该普通页面被放在普通区域,此时运行普通区域。
步骤S402,实时检测第一区域的第一CPU使用需求。
例如,普通区域正常运行普通页面需要6个处理器内核,则第一CPU使用需求为6个处理器内核。
步骤S403,根据第一CPU使用需求,从父进程中调度匹配数量的子进程给第一区域。
例如,第一CPU使用需求为6个处理器内核,则从父进程中调度6个子进程给第一区域,此时第一区域可占用6个处理器内核。
图5是本发明第二实施例中基于多核处理器的资源调度方法的流程图,所述方法通过如图2所示的资源调度装置100实现,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有:
步骤S501,当运行在第一区域时,初始化一个父进程,并为父进程派生
出多个子进程,每个子进程管理一个处理器内核。
所述第一区域优选为普通区域或安全区域。例如,若用户运行一个应用程序时进入一个普通页面,且该普通页面被放在普通区域,此时运行普通区域。
步骤S502,实时检测第一区域的第一CPU使用需求。
例如,普通区域正常运行普通页面需要6个处理器内核,则第一CPU使用需求为6个处理器内核。
步骤S503,根据第一CPU使用需求,从父进程中调度匹配数量的子进程给第一区域。
例如,第一CPU使用需求为6个处理器内核,则从父进程中调度6个子进程给第一区域,此时第一区域可占用6个处理器内核。
步骤S504,当从第一区域切换到第二区域时,实时检测第二区域的第二CPU使用需求。
所述第二区域优选为安全区域或普通区域。例如,当用户从普通页面进入密码输入页面时,系统将从普通区域切换至安全区域,安全区域正常运行密码输入页面需要5个处理器内核,则第二CPU使用需求为5个处理器内核。
步骤S505,根据第二CPU使用需求,从父进程中调度匹配数量的子进程给第二区域。
例如,第二CPU使用需求为5个处理器内核,则从父进程中调度5个子进程给第一区域,此时第一区域可占用5个处理器内核。
步骤S506,终止第一区域已调用的至少一个子进程。
由于第一区域不再运行,因此对CPU的需求量减少,则终止第一区域中至少一个子进程来减少对CPU的开销,达到自由调度和节省资源的目的。
图6是本发明第三实施例中基于多核处理器的资源调度方法的原理图,应用于具有多核处理器的通信终端,该通信终端具有TrustZone系统、普通区域、安全区域和资源调度装置100,所述TrustZone系统分别连接普通区域、安全区域和资源调度装置100。
假设APP(Application,应用程序)有非校验的普通页面,则被放在普通区域;若需校验的密码输入界面,则放在安全区域以保证密码安全。当用户从普通页面进入密码输入页面时,系统将从普通区域切换至安全区域。
1、用户运行一个APP,进入一个普通页面,它会通知TrustZone系统若加载该普通页面,需更多的处理器内核。
2、TrustZone系统调用资源调度装置100,初始化一个父进程,并派生出子进程,每个子进程将调用一处理器内核,根据页面需求调用适当数量的处理器内核。
3、资源调度装置100对普通区域的CPU的使用状况进行监控,随着用户浏览页面的使用情况,资源调度装置100会自动调整CPU的增加或减少。
4、当APP在某一个普通页面弹出输入密码的对话框时,普通页面被隐藏在后台,由于涉及到密码安全,TrustZone系统将自动从普通区域切换至安全区域。
5、安全区域通知TrustZone系统若加载该密码校验页面,需更多的处理器内核。
6、TrustZone系统将调用资源调度装置100,从已经初始化的父进程中派生新的子进程来调用新的处理器内核。若当前CPU的子进程已经全部被占用,需先终止普通系统的至少一个子进程后再调用空闲状态的新子进程,若子进程未全部被占用,则可直接调用空闲状态的新子进程。
7、由于普通页面被隐藏在后台,对CPU资源的需求量减少,资源调度装置100将终止其中至少一个子进程来减少对CPU资源的开销,达到自由调度和节省资源的目的。
8、若由安全区域切换至普通区域,资源调度装置100自动控制减少安全区域使用的处理器内核,并增加普通区域的处理器内核。
综上所述,本发明提供基于多核处理器的资源调度技术,实时检测当前区域的CPU使用需求,并根据所述CPU使用需求为当前区域调度匹配数量的处理器内核。借此,本发明能够实时监控当前区域的CPU使用状况,并根据当前区域的CPU使用状况自由调度处理器内核的占用数量,从而对不同区域间的CPU资源的使用实现智能调度和控制,提高了CPU资源的使用效率。本发明尤其适用于具有TrustZone系统的通信终端。
当然,本发明还可有其它多种实施例,在不背离本发明精神及其实质的情况下,熟悉本领域的技术人员当可根据本发明作出各种相应的改变和变形,但
这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。
Claims (10)
- 一种基于多核处理器的资源调度方法,其特征在于,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有:实时检测正在运行的当前区域的CPU使用需求;根据所述当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核。
- 根据权利要求1所述的资源调度方法,其特征在于,所述实时检测正在运行的当前区域的CPU使用需求的步骤之前包括:当运行在第一区域时,初始化一个父进程,并为所述父进程派生出多个子进程,每个所述子进程管理一个所述处理器内核;所述实时检测正在运行的当前区域的CPU使用需求的步骤包括:实时检测所述第一区域的第一CPU使用需求;所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤包括:根据所述第一CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第一区域。
- 根据权利要求2所述的资源调度方法,其特征在于,所述实时检测正在运行的当前区域的CPU使用需求的步骤还包括:当从所述第一区域切换到第二区域时,实时检测所述第二区域的第二CPU使用需求;所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤还包括:根据所述第二CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第二区域。
- 根据权利要求3所述的资源调度方法,其特征在于,所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤还包括:终止所述第一区域已调用的至少一个所述子进程。
- 根据权利要求1~4任一项所述的资源调度方法,其特征在于,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。
- 一种基于多核处理器的资源调度装置,其特征在于,应用于包括系统和至少两个区域的通信终端中,所述资源调度装置包括有:CPU检测模块,用于实时检测正在运行的当前区域的CPU使用需求;CPU调度模块,用于根据所述当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核。
- 根据权利要求6所述的资源调度装置,其特征在于,还包括:初始化模块,用于当运行在第一区域时,初始化一个父进程,并为所述父进程派生出多个子进程,每个所述子进程管理一个所述处理器内核;所述CPU检测模块包括:第一检测子模块,用于实时检测所述第一区域的第一CPU使用需求;所述CPU调度模块包括:第一调度子模块,用于根据所述第一CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第一区域。
- 根据权利要求7所述的资源调度装置,其特征在于,所述CPU检测模块包括:第二检测子模块,用于当从所述第一区域切换到第二区域时,实时检测所述第二区域的第二CPU使用需求;所述CPU调度模块包括:第二调度子模块,用于根据所述第二CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第二区域。
- 根据权利要求8所述的资源调度装置,其特征在于,所述CPU调度模块还包括:终止子模块,用于终止所述第一区域已调用的至少一个所述子进程。
- 根据权利要求6~9任一项所述的资源调度装置,其特征在于,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510313646.XA CN106293905B (zh) | 2015-06-09 | 2015-06-09 | 基于多核处理器的资源调度方法及装置 |
| CN201510313646.X | 2015-06-09 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2016197441A1 true WO2016197441A1 (zh) | 2016-12-15 |
Family
ID=57502917
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2015/085854 Ceased WO2016197441A1 (zh) | 2015-06-09 | 2015-07-31 | 基于多核处理器的资源调度方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106293905B (zh) |
| WO (1) | WO2016197441A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108803509A (zh) * | 2018-05-31 | 2018-11-13 | 广东盛哲科技有限公司 | 一种多类型cpu兼容工业控制器系统 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120131376A1 (en) * | 2010-11-19 | 2012-05-24 | Alcatel-Lucent | Method and system for cell recovery in telecommunication networks |
| CN102722388A (zh) * | 2012-05-30 | 2012-10-10 | 曙光信息产业(北京)有限公司 | 一种实现图形界面程序与cpu绑定的系统和方法 |
| CN102831015A (zh) * | 2012-08-01 | 2012-12-19 | 华为技术有限公司 | 多核处理器的调度方法和设备 |
| CN103729248A (zh) * | 2012-10-16 | 2014-04-16 | 华为技术有限公司 | 一种基于缓存感知的确定待迁移任务的方法和装置 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103023922B (zh) * | 2012-12-05 | 2014-07-02 | 清华大学 | 基于控制流模型行为的动态远程证明方法 |
-
2015
- 2015-06-09 CN CN201510313646.XA patent/CN106293905B/zh active Active
- 2015-07-31 WO PCT/CN2015/085854 patent/WO2016197441A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120131376A1 (en) * | 2010-11-19 | 2012-05-24 | Alcatel-Lucent | Method and system for cell recovery in telecommunication networks |
| CN102722388A (zh) * | 2012-05-30 | 2012-10-10 | 曙光信息产业(北京)有限公司 | 一种实现图形界面程序与cpu绑定的系统和方法 |
| CN102831015A (zh) * | 2012-08-01 | 2012-12-19 | 华为技术有限公司 | 多核处理器的调度方法和设备 |
| CN103729248A (zh) * | 2012-10-16 | 2014-04-16 | 华为技术有限公司 | 一种基于缓存感知的确定待迁移任务的方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106293905B (zh) | 2019-03-22 |
| CN106293905A (zh) | 2017-01-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11467646B2 (en) | Context data sharing | |
| US12259835B2 (en) | Disaggregation of computing devices using enhanced retimers with circuit switching | |
| EP3248132B1 (en) | Detection of malicious invocation of application program interface calls | |
| CN103294970B (zh) | 双操作系统共用加密设定的方法以及电子装置 | |
| US10754691B2 (en) | Policy based requesting/approval system across multiple hybrid clouds | |
| US20110106935A1 (en) | Power management for idle system in clusters | |
| CN106899649B (zh) | 一种任务请求处理方法、装置和用户设备 | |
| US20110173465A1 (en) | Data center power adjustment | |
| TW201232242A (en) | Method, apparatus and system to transition system power state of a computer platform | |
| CN102981878A (zh) | 自动关闭后台程序的方法及其移动终端 | |
| CN102419718A (zh) | 资源调度方法 | |
| CN107844189A (zh) | 一种降低黑屏耗电的方法、系统、终端及计算机可读存储介质 | |
| CN104021104B (zh) | 一种基于双总线结构的协同系统及其通信方法 | |
| CN107766145B (zh) | 双系统下的内存管理方法和装置 | |
| TW201732496A (zh) | 用於經由記憶體時延控制來提供功率效率的系統和方法 | |
| CN112346834A (zh) | 数据库的请求处理方法和装置、电子设备和介质 | |
| CN106125891A (zh) | 终端电量优化方法、装置及终端 | |
| US10545562B2 (en) | Electronic device and method for operating the same | |
| CN107943269A (zh) | 调度作业控制方法、装置、终端设备及存储介质 | |
| WO2015172283A1 (zh) | 一种降低功耗的方法、装置及移动终端 | |
| CN107659509B (zh) | 控制应用流量使用方法、装置、可读存储介质及终端设备 | |
| WO2016197441A1 (zh) | 基于多核处理器的资源调度方法及装置 | |
| CN103077081B (zh) | 资源调整的方法及装置 | |
| US20140237475A1 (en) | Sleep/wake with suppression and donated importance | |
| WO2022204873A1 (zh) | 电子装置、系统级芯片和物理核分配方法 |
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: 15894709 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07.05.2018) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 15894709 Country of ref document: EP Kind code of ref document: A1 |