WO2016197441A1 - Resource scheduling method and device based on multi-core processor - Google Patents

Resource scheduling method and device based on multi-core processor Download PDF

Info

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
Application number
PCT/CN2015/085854
Other languages
French (fr)
Chinese (zh)
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 宇龙计算机通信科技(深圳)有限公司
Publication of WO2016197441A1 publication Critical patent/WO2016197441A1/en

Links

Images

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/48Program 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)
  • Multi Processors (AREA)
  • Stored Programmes (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A resource scheduling method and device based on a multi-core processor, which are applicable to the technical field of communications, and are applied to a communication terminal comprising a system and at least two areas. The method comprises the steps of: detecting CPU use needs of a current area which is running in real time (S301); and scheduling a matched number of processor cores for the current area according to the CPU use needs of the current area (S302). Thereby, a CPU use status of a current area can be monitored in real time, and the occupied number of processor cores can be scheduled freely according to the CPU use status of the current area, so as to achieve the intelligent scheduling and control of the use of CPU resources between different areas, thus improving the use efficiency of the CPU resources.

Description

基于多核处理器的资源调度方法及装置Resource scheduling method and device based on multi-core processor
本申请要求于2015年06月09日提交中国专利局,申请号为201510313646.X、发明名称为“基于多核处理器的资源调度方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 201510313646.X, entitled "Multi-core processor-based resource scheduling method and apparatus", which is filed on June 9, 2015, the entire contents of which are hereby incorporated by reference. Combined in this application.
技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种基于多核处理器的资源调度方法及装置。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.
背景技术Background technique
随着有线、无线网络在嵌入式系统的日益深入,嵌入式应用的安全性成为系统功能最重要的要求。在数据服务和支付应用等嵌入式应用中,安全性更是消费者保护和商业价值内容保护的强制性要求。现有技术在CPU(Central Processing Unit,中央处理器)内核的设计中集成系统安全性扩展,是TrustZone-ARMv6内核架构下的重要扩展特性之一,在对内核的功耗、性能和硅片面积不产生大的影响前提下,TrustZone技术为设计具有高度安全性的嵌入式系统提供了坚实的基础。在一个具有八核CPU的系统下,普通区域与安全区域各占有一半的处理器内核。现有技术方案的缺陷主要包括:With the deepening of wired and wireless networks in embedded systems, the security of embedded applications has become the most important requirement of system functions. In embedded applications such as data services and payment applications, security is a mandatory requirement for consumer protection and business value content protection. The prior art integrates system security extensions in the design of a CPU (Central Processing Unit) core, and is one of the important extension features of the TrustZone-ARMv6 core architecture, in terms of power consumption, performance, and silicon area of the core. With no major impact, TrustZone technology provides a solid foundation for designing highly secure embedded systems. In a system with an eight-core CPU, the normal area and the security area each occupy half of the processor core. The shortcomings of the prior art solutions mainly include:
一、资源浪费:当用户由普通区域切换至安全区域时,普通区域会使用较少的处理器资源,但是占用一半处理器内核导致资源使用上的浪费,反之亦然。I. Resource waste: When a user switches from a normal area to a secure area, the normal area will use less processor resources, but occupying half of the processor core causes waste of resource usage, and vice versa.
二、分配方式不灵活:当普通区域或安全区域过多使用处理器资源时,处理器内核的固定分配限制了处理器内核的智能优化使用,导致使用效率降低。Second, 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.
三、不方便监控与管理:不能统一对CPU使用数据进行收集、整理。Third, it is not convenient to monitor and manage: Can not collect and organize the CPU usage data uniformly.
综上可知,现有技术在实际使用上显然存在不便与缺陷,所以有必要加以改进。In summary, the prior art obviously has inconveniences and defects in practical use, so it is necessary to improve.
发明内容Summary of the invention
针对上述的缺陷,本发明的目的在于提供一种基于多核处理器的资源调度 方法及装置,其能够对不同区域间的CPU资源的使用实现智能调度和控制,从而提高了CPU资源的使用效率。In view of the above drawbacks, 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.
为了实现上述目的,本发明提供一种基于多核处理器的资源调度方法,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有:In order to achieve the above object, 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:
实时检测正在运行的当前区域的CPU使用需求;Real-time detection of CPU usage requirements for the current zone being run;
根据所述当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核。A matching number of processor cores are scheduled for the current region based on the CPU usage requirements of the current region.
根据本发明所述的资源调度方法,所述实时检测正在运行的当前区域的CPU使用需求的步骤之前包括:According to the resource scheduling method of the present invention, the step of real-time detecting the CPU usage requirement of the running current region includes:
当运行在第一区域时,初始化一个父进程,并为所述父进程派生出多个子进程,每个所述子进程管理一个所述处理器内核;When running in the first region, initializing a parent process, and deriving a plurality of child processes for the parent process, each of the child processes managing one of the processor cores;
所述实时检测正在运行的当前区域的CPU使用需求的步骤包括:The step of detecting the CPU usage requirement of the current area in real time in real time includes:
实时检测所述第一区域的第一CPU使用需求;Detecting a first CPU usage requirement of the first area in real time;
所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤包括: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:
根据所述第一CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第一区域。And according to the first CPU usage requirement, a matching number of the sub-processes are scheduled from the parent process to the first area.
根据本发明所述的资源调度方法,所述实时检测正在运行的当前区域的CPU使用需求的步骤包括:According to the resource scheduling method of the present invention, the step of detecting the CPU usage requirement of the running current area in real time includes:
当从所述第一区域切换到第二区域时,实时检测所述第二区域的第二CPU使用需求;Detecting a second CPU usage requirement of the second area in real time when switching from the first area to the second area;
所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤包括: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:
根据所述第二CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第二区域。And according to the second CPU usage requirement, a matching number of the sub-processes are scheduled from the parent process to the second area.
根据本发明所述的资源调度方法,所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤还包括:According to the resource scheduling method of the present invention, 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.
根据本发明所述的资源调度方法,所述系统为TrustZone系统,所述区域 包括相互隔离的安全区域和普通区域。According to the resource scheduling method of the present invention, 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:
CPU检测模块,用于实时检测正在运行的当前区域的CPU使用需求;a CPU detection module for detecting CPU usage requirements of a current area in operation in real time;
CPU调度模块,用于根据所述当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核。And 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 according to the present invention 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;
所述CPU检测模块包括:The CPU detection module includes:
第一检测子模块,用于实时检测所述第一区域的第一CPU使用需求;a first detecting submodule, configured to detect a first CPU usage requirement of the first area in real time;
所述CPU调度模块包括:The CPU scheduling module includes:
第一调度子模块,用于根据所述第一CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第一区域。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.
根据本发明所述的资源调度装置,所述CPU检测模块包括:According to the resource scheduling apparatus of the present invention, the CPU detection module includes:
第二检测子模块,用于当从所述第一区域切换到第二区域时,实时检测所述第二区域的第二CPU使用需求;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;
所述CPU调度模块包括:The CPU scheduling module includes:
第二调度子模块,用于根据所述第二CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第二区域。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.
根据本发明所述的资源调度装置,所述CPU调度模块还包括:According to the resource scheduling apparatus of the present invention, the CPU scheduling module further includes:
终止子模块,用于终止所述第一区域已调用的至少一个所述子进程。Terminating a submodule for terminating at least one of the child processes that the first region has invoked.
根据本发明所述的资源调度装置,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。According to the resource scheduling apparatus of the present invention, the system is a TrustZone system, and the area includes a security area and a common area that are isolated from each other.
本发明提供基于多核处理器的资源调度技术,实时检测当前区域的CPU使用需求,并根据所述CPU使用需求为当前区域调度匹配数量的处理器内核。借此,本发明能够实时监控当前区域的CPU使用状况,并根据当前区域的CPU使用状况自由调度处理器内核的占用数量,从而对不同区域间的CPU资源的使用实现智能调度和控制,提高了CPU资源的使用效率。本发明尤其适用于 具有TrustZone系统的通信终端。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.
附图说明DRAWINGS
图1是本发明基于多核处理器的资源调度装置的结构示意图;1 is a schematic structural diagram of a resource scheduling apparatus based on a multi-core processor according to the present invention;
图2是本发明优选基于多核处理器的资源调度装置的结构示意图;2 is a schematic structural diagram of a preferred multi-core processor-based resource scheduling apparatus according to the present invention;
图3是本发明基于多核处理器的资源调度方法的流程图;3 is a flowchart of a resource scheduling method based on a multi-core processor of the present invention;
图4是本发明第一实施例中基于多核处理器的资源调度方法的流程图;4 is a flowchart of a resource scheduling method based on a multi-core processor in the first embodiment of the present invention;
图5是本发明第二实施例中基于多核处理器的资源调度方法的流程图;5 is a flowchart of a multi-core processor-based resource scheduling method in a second embodiment of the present invention;
图6是本发明第三实施例中基于多核处理器的资源调度方法的原理图。6 is a schematic diagram of a resource scheduling method based on a multi-core processor in a third embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
图1是本发明基于多核处理器的资源调度装置的结构示意图,应用于包括系统和至少两个区域的通信终端中,所述通信终端包括手机、PDA(Personal Digital Assistant,个人数字助理)、平板电脑等。优选的是,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。所述资源调度装置100至少包括有CPU检测模块10和CPU调度模块20,其中: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. 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 at least a CPU detecting module 10 and a CPU scheduling module 20, where:
CPU检测模块10,用于实时检测正在运行的当前区域的CPU使用需求。所述CPU使用需求优选为当前区域保证正常运行所需的处理器内核的数量,其中所述多核处理器可以包括2、4、8等任意个处理器内核。优选的是,所述当前区域可以是安全区域或普通区域。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. Preferably, the current area may be a secure area or a normal area.
CPU调度模块20,用于根据当前区域的CPU使用需求,为当前区域调度匹配数量的处理器内核,以保证当前区域能够正常而高效运行。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.
在本发明一具体实施例中,假设应用程序有非校验的普通页面,则被放在普通区域;若需校验的密码输入界面,则放在安全区域以保证密码安全。且当用户从普通页面进入密码输入页面时,系统将从普通区域切换至安全区域。若用户运行一个应用程序时进入一个普通页面,且该普通页面被放在普通区域。 此时,实时检测正在运行的普通区域的CPU使用需求,并根据普通区域的CPU使用需求,为普通区域调度匹配数量的处理器内核,例如普通区域正常运行普通页面需要6个处理器内核,则分配6个处理器内核给普通区域。或者,若用户运行一个应用程序时进入一个密码输入界面,且该密码输入界面被放在安全区域。此时,实时检测正在运行的安全区域的CPU使用需求,并根据安全区域的CPU使用需求,为安全区域调度匹配数量的处理器内核,例如安全区域正常运行密码输入界面需要5个处理器内核,则分配5个处理器内核给普通区域。In a specific embodiment of the present invention, if the application 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. 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.
本发明能够对区域间处理器内核的使用实现智能调度和控制,具体有点包括:在普通区域与安全区域中间加入一中间件—资源调度装置100,用来实时监测当前域的CPU使用状况,并根据CPU使用状况自由扩展或减少对CPU的占用。CPU资源的合理利用;不需对每一处理器内核进行监控,只需给资源调度装置100发布指令,资源调度装置100统一检测和记录CPU使用情况,并自动调度资源,一旦出现问题,可直接上报。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.
图2是本发明优选基于多核处理器的资源调度装置的结构示意图,应用于包括系统和至少两个区域的通信终端中,所述通信终端包括手机、PDA、平板电脑等,优选的是,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。所述资源调度装置100包括有CPU检测模块10、CPU调度模块20和/或初始化模块30,其中: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:
初始化模块30,用于当运行在第一区域时,初始化一个父进程,并为父进程派生出多个子进程,每个子进程管理一个处理器内核。所述第一区域优选为普通区域或安全区域。例如,若用户运行一个应用程序时进入一个普通页面,且该普通页面被放在普通区域,此时运行普通区域。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.
所述CPU检测模块10包括:The CPU detection module 10 includes:
第一检测子模块11,用于实时检测第一区域的第一CPU使用需求。The first detecting sub-module 11 is configured to detect the first CPU usage requirement of the first area in real time.
例如,普通区域正常运行普通页面需要6个处理器内核,则第一CPU使用需求为6个处理器内核。For example, if a normal area requires 6 processor cores to run a normal page, the first CPU usage requirement is 6 processor cores.
CPU调度模块20包括:则分配6个处理器内核给普通区域The CPU scheduling module 20 includes: allocating 6 processor cores to the common area
第一调度子模块21,用于根据第一CPU使用需求,从父进程中调度匹配 数量的子进程给第一区域。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.
例如,第一CPU使用需求为6个处理器内核,则从父进程中调度6个子进程给第一区域,此时第一区域可占用6个处理器内核。For example, if the first CPU usage requirement is 6 processor cores, then 6 child processes are scheduled from the parent process to the first area, and the first area can occupy 6 processor cores.
优选的是,所述CPU检测模块10包括:Preferably, the CPU detection module 10 includes:
第二检测子模块12,用于当从第一区域切换到第二区域时,实时检测第二区域的第二CPU使用需求。所述第二区域优选为安全区域或普通区域。例如,当用户从普通页面进入密码输入页面时,系统将从普通区域切换至安全区域,安全区域正常运行密码输入页面需要5个处理器内核,则第二CPU使用需求为5个处理器内核。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.
所述CPU调度模块20包括:The CPU scheduling module 20 includes:
第二调度子模块22,用于根据第二CPU使用需求,从父进程中调度匹配数量的子进程给第二区域。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.
例如,第二CPU使用需求为5个处理器内核,则从父进程中调度5个子进程给第一区域,此时第一区域可占用5个处理器内核。For example, if the second CPU usage requirement is 5 processor cores, then 5 child processes are scheduled from the parent process to the first area, and the first area can occupy 5 processor cores.
更好的是,CPU调度模块20还包括:More preferably, the CPU scheduling module 20 further includes:
终止子模块23,用于终止第一区域已调用的至少一个子进程。The terminating sub-module 23 is configured to terminate at least one child process that has been called by the first area.
由于第一区域不再运行,因此对CPU的需求量减少,则终止第一区域中至少一个子进程来减少对CPU的开销,达到自由调度和节省资源的目的。Since the first area is no longer running, 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.
图3是本发明基于多核处理器的资源调度方法的流程图,所述方法通过如图1或图2所示的资源调度装置100实现,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有: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:
步骤S301,实时检测正在运行的当前区域的CPU使用需求。In step S301, the CPU usage requirement of the current area that is running is detected in real time.
所述CPU使用需求优选为当前区域保证正常运行所需的处理器内核的数量,其中所述多核处理器可以包括2、4、8等任意个处理器内核。优选的是,所述当前区域可以是安全区域或普通区域。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. Preferably, the current area may be a secure area or a normal area.
步骤S302,根据当前区域的CPU使用需求,为当前区域调度匹配数量的处理器内核。Step S302, scheduling a matching number of processor cores for the current region according to the CPU usage requirement of the current region.
优选的是,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。在本发明一具体实施例中,假设应用程序有非校验的普通页面, 则被放在普通区域;若需校验的密码输入界面,则放在安全区域以保证密码安全。且当用户从普通页面进入密码输入页面时,系统将从普通区域切换至安全区域。若用户运行一个应用程序时进入一个普通页面,且该普通页面被放在普通区域。此时,实时检测正在运行的普通区域的CPU使用需求,并根据普通区域的CPU使用需求,为普通区域调度匹配数量的处理器内核,例如普通区域正常运行普通页面需要6个处理器内核,则分配6个处理器内核给普通区域。或者,若用户运行一个应用程序时进入一个密码输入界面,且该密码输入界面被放在安全区域。此时,实时检测正在运行的安全区域的CPU使用需求,并根据安全区域的CPU使用需求,为安全区域调度匹配数量的处理器内核,例如安全区域正常运行密码输入界面需要5个处理器内核,则分配5个处理器内核给普通区域。Preferably, the system is a TrustZone system, and the area includes a security area and a common area that are isolated from each other. In a specific embodiment of the present invention, it is assumed that 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. 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. 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.
图4是本发明第一实施例中基于多核处理器的资源调度方法的流程图,所述方法通过如图2所示的资源调度装置100实现,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有: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:
步骤S401,当运行在第一区域时,初始化一个父进程,并为父进程派生出多个子进程,每个子进程管理一个处理器内核。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.
步骤S402,实时检测第一区域的第一CPU使用需求。Step S402, detecting the first CPU usage requirement of the first area in real time.
例如,普通区域正常运行普通页面需要6个处理器内核,则第一CPU使用需求为6个处理器内核。For example, if a normal area requires 6 processor cores to run a normal page, the first CPU usage requirement is 6 processor cores.
步骤S403,根据第一CPU使用需求,从父进程中调度匹配数量的子进程给第一区域。Step S403, scheduling a matching number of child processes from the parent process to the first area according to the first CPU usage requirement.
例如,第一CPU使用需求为6个处理器内核,则从父进程中调度6个子进程给第一区域,此时第一区域可占用6个处理器内核。For example, if the first CPU usage requirement is 6 processor cores, then 6 child processes are scheduled from the parent process to the first area, and the first area can occupy 6 processor cores.
图5是本发明第二实施例中基于多核处理器的资源调度方法的流程图,所述方法通过如图2所示的资源调度装置100实现,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有: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:
步骤S501,当运行在第一区域时,初始化一个父进程,并为父进程派生 出多个子进程,每个子进程管理一个处理器内核。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.
步骤S502,实时检测第一区域的第一CPU使用需求。Step S502, detecting the first CPU usage requirement of the first area in real time.
例如,普通区域正常运行普通页面需要6个处理器内核,则第一CPU使用需求为6个处理器内核。For example, if a normal area requires 6 processor cores to run a normal page, the first CPU usage requirement is 6 processor cores.
步骤S503,根据第一CPU使用需求,从父进程中调度匹配数量的子进程给第一区域。Step S503, scheduling a matched number of child processes from the parent process to the first area according to the first CPU usage requirement.
例如,第一CPU使用需求为6个处理器内核,则从父进程中调度6个子进程给第一区域,此时第一区域可占用6个处理器内核。For example, if the first CPU usage requirement is 6 processor cores, then 6 child processes are scheduled from the parent process to the first area, and the first area can occupy 6 processor cores.
步骤S504,当从第一区域切换到第二区域时,实时检测第二区域的第二CPU使用需求。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.
所述第二区域优选为安全区域或普通区域。例如,当用户从普通页面进入密码输入页面时,系统将从普通区域切换至安全区域,安全区域正常运行密码输入页面需要5个处理器内核,则第二CPU使用需求为5个处理器内核。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.
步骤S505,根据第二CPU使用需求,从父进程中调度匹配数量的子进程给第二区域。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.
例如,第二CPU使用需求为5个处理器内核,则从父进程中调度5个子进程给第一区域,此时第一区域可占用5个处理器内核。For example, if the second CPU usage requirement is 5 processor cores, then 5 child processes are scheduled from the parent process to the first area, and the first area can occupy 5 processor cores.
步骤S506,终止第一区域已调用的至少一个子进程。Step S506, terminating at least one child process that has been called by the first area.
由于第一区域不再运行,因此对CPU的需求量减少,则终止第一区域中至少一个子进程来减少对CPU的开销,达到自由调度和节省资源的目的。Since the first area is no longer running, 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.
图6是本发明第三实施例中基于多核处理器的资源调度方法的原理图,应用于具有多核处理器的通信终端,该通信终端具有TrustZone系统、普通区域、安全区域和资源调度装置100,所述TrustZone系统分别连接普通区域、安全区域和资源调度装置100。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.
假设APP(Application,应用程序)有非校验的普通页面,则被放在普通区域;若需校验的密码输入界面,则放在安全区域以保证密码安全。当用户从普通页面进入密码输入页面时,系统将从普通区域切换至安全区域。 Assume that APP (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. When the user enters the password entry page from the normal page, the system will switch from the normal area to the secure area.
1、用户运行一个APP,进入一个普通页面,它会通知TrustZone系统若加载该普通页面,需更多的处理器内核。1. 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.
2、TrustZone系统调用资源调度装置100,初始化一个父进程,并派生出子进程,每个子进程将调用一处理器内核,根据页面需求调用适当数量的处理器内核。2. 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.
3、资源调度装置100对普通区域的CPU的使用状况进行监控,随着用户浏览页面的使用情况,资源调度装置100会自动调整CPU的增加或减少。3. 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.
4、当APP在某一个普通页面弹出输入密码的对话框时,普通页面被隐藏在后台,由于涉及到密码安全,TrustZone系统将自动从普通区域切换至安全区域。4. When the APP pops up a dialog box for entering a password on a normal page, the normal page is hidden in the background. Due to the password security involved, the TrustZone system will automatically switch from the normal area to the secure area.
5、安全区域通知TrustZone系统若加载该密码校验页面,需更多的处理器内核。5. The security zone informs the TrustZone system that if the password verification page is loaded, more processor cores are needed.
6、TrustZone系统将调用资源调度装置100,从已经初始化的父进程中派生新的子进程来调用新的处理器内核。若当前CPU的子进程已经全部被占用,需先终止普通系统的至少一个子进程后再调用空闲状态的新子进程,若子进程未全部被占用,则可直接调用空闲状态的新子进程。6. 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.
7、由于普通页面被隐藏在后台,对CPU资源的需求量减少,资源调度装置100将终止其中至少一个子进程来减少对CPU资源的开销,达到自由调度和节省资源的目的。7. Since the normal page is hidden in the background, the demand for CPU resources is reduced, and the resource scheduling apparatus 100 terminates at least one of the child processes to reduce the overhead of the CPU resources, and achieves the purpose of free scheduling and resource saving.
8、若由安全区域切换至普通区域,资源调度装置100自动控制减少安全区域使用的处理器内核,并增加普通区域的处理器内核。8. If the security zone is switched to the normal zone, 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.
综上所述,本发明提供基于多核处理器的资源调度技术,实时检测当前区域的CPU使用需求,并根据所述CPU使用需求为当前区域调度匹配数量的处理器内核。借此,本发明能够实时监控当前区域的CPU使用状况,并根据当前区域的CPU使用状况自由调度处理器内核的占用数量,从而对不同区域间的CPU资源的使用实现智能调度和控制,提高了CPU资源的使用效率。本发明尤其适用于具有TrustZone系统的通信终端。In summary, 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.
当然,本发明还可有其它多种实施例,在不背离本发明精神及其实质的情况下,熟悉本领域的技术人员当可根据本发明作出各种相应的改变和变形,但 这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。 Of course, the invention may be embodied in various other forms and modifications, and various modifications and changes can be made in accordance with the present invention without departing from the spirit and scope of the invention. These respective changes and modifications are intended to fall within the scope of the appended claims.

Claims (10)

  1. 一种基于多核处理器的资源调度方法,其特征在于,应用于包括系统和至少两个区域的通信终端中,所述方法包括步骤有:A resource scheduling method based on a multi-core processor is characterized in that it is applied to a communication terminal including a system and at least two areas, and the method comprises the steps of:
    实时检测正在运行的当前区域的CPU使用需求;Real-time detection of CPU usage requirements for the current zone being run;
    根据所述当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核。A matching number of processor cores are scheduled for the current region based on the CPU usage requirements of the current region.
  2. 根据权利要求1所述的资源调度方法,其特征在于,所述实时检测正在运行的当前区域的CPU使用需求的步骤之前包括:The resource scheduling method according to claim 1, wherein the step of detecting the CPU usage requirement of the current region in operation in real time comprises:
    当运行在第一区域时,初始化一个父进程,并为所述父进程派生出多个子进程,每个所述子进程管理一个所述处理器内核;When running in the first region, initializing a parent process, and deriving a plurality of child processes for the parent process, each of the child processes managing one of the processor cores;
    所述实时检测正在运行的当前区域的CPU使用需求的步骤包括:The step of detecting the CPU usage requirement of the current area in real time in real time includes:
    实时检测所述第一区域的第一CPU使用需求;Detecting a first CPU usage requirement of the first area in real time;
    所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤包括: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:
    根据所述第一CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第一区域。And according to the first CPU usage requirement, a matching number of the sub-processes are scheduled from the parent process to the first area.
  3. 根据权利要求2所述的资源调度方法,其特征在于,所述实时检测正在运行的当前区域的CPU使用需求的步骤还包括:The resource scheduling method according to claim 2, wherein the step of detecting the CPU usage requirement of the currently running current area in real time further comprises:
    当从所述第一区域切换到第二区域时,实时检测所述第二区域的第二CPU使用需求;Detecting a second CPU usage requirement of the second area in real time when switching from the first area to the second area;
    所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤还包括: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:
    根据所述第二CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第二区域。And according to the second CPU usage requirement, a matching number of the sub-processes are scheduled from the parent process to the second area.
  4. 根据权利要求3所述的资源调度方法,其特征在于,所述根据当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核的步骤还包括:The resource scheduling method according to claim 3, wherein 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 comprises:
    终止所述第一区域已调用的至少一个所述子进程。 Terminating at least one of the child processes that the first region has invoked.
  5. 根据权利要求1~4任一项所述的资源调度方法,其特征在于,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。The resource scheduling method according to any one of claims 1 to 4, wherein the system is a TrustZone system, and the area includes a security area and a common area that are isolated from each other.
  6. 一种基于多核处理器的资源调度装置,其特征在于,应用于包括系统和至少两个区域的通信终端中,所述资源调度装置包括有:A resource scheduling apparatus based on a multi-core processor is characterized in that, in a communication terminal including a system and at least two areas, the resource scheduling apparatus includes:
    CPU检测模块,用于实时检测正在运行的当前区域的CPU使用需求;a CPU detection module for detecting CPU usage requirements of a current area in operation in real time;
    CPU调度模块,用于根据所述当前区域的所述CPU使用需求,为所述当前区域调度匹配数量的处理器内核。And 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.
  7. 根据权利要求6所述的资源调度装置,其特征在于,还包括:The resource scheduling apparatus according to claim 6, further comprising:
    初始化模块,用于当运行在第一区域时,初始化一个父进程,并为所述父进程派生出多个子进程,每个所述子进程管理一个所述处理器内核;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;
    所述CPU检测模块包括:The CPU detection module includes:
    第一检测子模块,用于实时检测所述第一区域的第一CPU使用需求;a first detecting submodule, configured to detect a first CPU usage requirement of the first area in real time;
    所述CPU调度模块包括:The CPU scheduling module includes:
    第一调度子模块,用于根据所述第一CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第一区域。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.
  8. 根据权利要求7所述的资源调度装置,其特征在于,所述CPU检测模块包括:The resource scheduling apparatus according to claim 7, wherein the CPU detecting module comprises:
    第二检测子模块,用于当从所述第一区域切换到第二区域时,实时检测所述第二区域的第二CPU使用需求;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;
    所述CPU调度模块包括:The CPU scheduling module includes:
    第二调度子模块,用于根据所述第二CPU使用需求,从所述父进程中调度匹配数量的所述子进程给所述第二区域。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.
  9. 根据权利要求8所述的资源调度装置,其特征在于,所述CPU调度模块还包括:The resource scheduling apparatus according to claim 8, wherein the CPU scheduling module further comprises:
    终止子模块,用于终止所述第一区域已调用的至少一个所述子进程。Terminating a submodule for terminating at least one of the child processes that the first region has invoked.
  10. 根据权利要求6~9任一项所述的资源调度装置,其特征在于,所述系统为TrustZone系统,所述区域包括相互隔离的安全区域和普通区域。 The resource scheduling apparatus according to any one of claims 6 to 9, wherein the system is a TrustZone system, and the area includes a security area and a common area that are isolated from each other.
PCT/CN2015/085854 2015-06-09 2015-07-31 Resource scheduling method and device based on multi-core processor WO2016197441A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510313646.X 2015-06-09
CN201510313646.XA CN106293905B (en) 2015-06-09 2015-06-09 Resource regulating method and device based on multi-core processor

Publications (1)

Publication Number Publication Date
WO2016197441A1 true WO2016197441A1 (en) 2016-12-15

Family

ID=57502917

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/085854 WO2016197441A1 (en) 2015-06-09 2015-07-31 Resource scheduling method and device based on multi-core processor

Country Status (2)

Country Link
CN (1) CN106293905B (en)
WO (1) WO2016197441A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108803509A (en) * 2018-05-31 2018-11-13 广东盛哲科技有限公司 A kind of polymorphic type CPU compatibilities industrial controller system

Citations (4)

* Cited by examiner, † Cited by third party
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 (en) * 2012-05-30 2012-10-10 曙光信息产业(北京)有限公司 System and method for realizing binding of graphical interface and CPU (central processing unit)
CN102831015A (en) * 2012-08-01 2012-12-19 华为技术有限公司 Method and equipment for scheduling multi-core processor
CN103729248A (en) * 2012-10-16 2014-04-16 华为技术有限公司 Method and device for determining tasks to be migrated based on cache perception

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103023922B (en) * 2012-12-05 2014-07-02 清华大学 Control flow model behavior based dynamic remote attestation method

Patent Citations (4)

* Cited by examiner, † Cited by third party
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 (en) * 2012-05-30 2012-10-10 曙光信息产业(北京)有限公司 System and method for realizing binding of graphical interface and CPU (central processing unit)
CN102831015A (en) * 2012-08-01 2012-12-19 华为技术有限公司 Method and equipment for scheduling multi-core processor
CN103729248A (en) * 2012-10-16 2014-04-16 华为技术有限公司 Method and device for determining tasks to be migrated based on cache perception

Also Published As

Publication number Publication date
CN106293905A (en) 2017-01-04
CN106293905B (en) 2019-03-22

Similar Documents

Publication Publication Date Title
US11467646B2 (en) Context data sharing
US9378536B2 (en) CPU/GPU DCVS co-optimization for reducing power consumption in graphics frame processing
US20120198254A1 (en) Capping power consumption in a data storage system
US20140331039A1 (en) Data center power adjustment
Yu et al. Hybrid spectrum access in cognitive-radio-based smart-grid communications systems
EP3268842B1 (en) Methods and systems for coordination of operating states amongst multiple socs within a computing device
CN103294970B (en) Method for sharing encryption setting by dual operating systems and electronic device
US10754691B2 (en) Policy based requesting/approval system across multiple hybrid clouds
TW201232242A (en) Method, apparatus and system to transition system power state of a computer platform
US10948968B2 (en) Controlling processor performance scaling based on context
CN107766145B (en) Memory management method and device under dual systems
US20170212581A1 (en) Systems and methods for providing power efficiency via memory latency control
US8539271B2 (en) Determining a power saving mode based on a hardware resource utilization trend
US20210311895A1 (en) Disaggregation of computing devices using enhanced retimers with circuit switching
WO2014023259A1 (en) Multifunctional intelligent terminal and energy management method thereof
WO2015172283A1 (en) Method, device and mobile terminal for reducing power consumption
CN107659509B (en) Application flow use control method and device, readable storage medium and terminal equipment
WO2016197441A1 (en) Resource scheduling method and device based on multi-core processor
CN110536389A (en) Method and device for reducing power consumption of terminal equipment and terminal equipment
Wu et al. An SRP-based energy-efficient scheduling algorithm for dependent real-time tasks
CN103713946A (en) Operating instruction dispatching method and device
JP4226472B2 (en) Scalable home control platform and architecture
WO2022204873A1 (en) Electronic apparatus, system on chip, and physical core allocation method
TWI235564B (en) Method of embedded power saving system
Gokhale A budget-based policy for operating system scheduling of background tasks

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