[go: up one dir, main page]

WO2014154045A1 - Method, apparatus and system for implementing multicore operating system - Google Patents

Method, apparatus and system for implementing multicore operating system Download PDF

Info

Publication number
WO2014154045A1
WO2014154045A1 PCT/CN2014/070952 CN2014070952W WO2014154045A1 WO 2014154045 A1 WO2014154045 A1 WO 2014154045A1 CN 2014070952 W CN2014070952 W CN 2014070952W WO 2014154045 A1 WO2014154045 A1 WO 2014154045A1
Authority
WO
WIPO (PCT)
Prior art keywords
kernel
function module
memory
application
core
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
Application number
PCT/CN2014/070952
Other languages
French (fr)
Chinese (zh)
Inventor
王磊
詹剑锋
丁科
谭崇康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of WO2014154045A1 publication Critical patent/WO2014154045A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Definitions

  • Multi-core operating system implementation method and implementation device and system The present application claims to be submitted to the Chinese Patent Office on March 27, 2013, the application number is 201310101210.5, and the invention name is "multi-core operating system implementation method and implementation device and system" Chinese patent Priority of the application, the entire contents of which are incorporated herein by reference.
  • TECHNICAL FIELD Embodiments of the present invention relate to computer technologies, and in particular, to a multi-core operating system implementation method, apparatus, and system. BACKGROUND OF THE INVENTION With the rapid development of computer technology, multi-processor computer systems including multiple processors, such as a multi-core processor computing system and a heterogeneous computing system, have appeared.
  • Multi-processor Computing System in order to effectively manage such systems, make full use of the rich resources provided by the system, and ensure the efficiency of the system, a multi-core operating system running on a multi-processor computer system (Multi -Kernel Operating System ).
  • Multi-core operating system refers to deploying an operating system kernel on the processor core of a multi-processor computer system, and deploying system services providing external interfaces on the basis of the kernel, such as: file system, communication
  • the system thus forms a complete operating system.
  • the cores of the multi-core operating system are peer-to-peer.
  • the functions of the cores are completely the same.
  • the peer-to-peer interaction mechanism is used to implement the management function through the negotiation protocol.
  • an embodiment of the present invention provides a multi-core operating system implementation method, where the method includes: allocating memory for a basic functional module of each core of a multi-core operating system;
  • the memory allocated for the characteristic function module supporting the first application in the first kernel is released.
  • the allocating memory for the feature function module that supports the first application in the first kernel selected from the kernels includes:
  • the feature of the first application is supported in the first kernel selected from the kernels After the function module allocates the memory, and after releasing the memory allocated for the characteristic function module supporting the first application in the first kernel, the method further includes:
  • the characteristic function module is at least two types, according to the The application classifies the required characteristics of the system resources of the multi-core operating system.
  • the characteristic function module includes at least an input and output intensive characteristic function module, a thread intensive characteristic function module, and a network intensive characteristic function module.
  • an embodiment of the present invention provides a multi-core operating system implementation apparatus, where the apparatus includes: a basic memory allocation module, configured to allocate memory for a basic functional module of each core of the multi-core operating system;
  • a feature memory allocation module configured to allocate memory for a feature function module supporting the first application in the first kernel selected from the kernels;
  • a release module configured to release the memory allocated for the feature function module supporting the first application in the first kernel.
  • the feature memory allocation module includes: a receiving unit, configured to receive a loading request of the first application;
  • a selecting unit configured to select, according to a characteristic of the first application, and application load information of each of the kernels recorded in a kernel function registry, from the kernels, where the first application is to be loaded Said first kernel;
  • a memory allocation unit configured to allocate memory for the feature function module supporting the first application in the first kernel.
  • the method further includes:
  • An update module after allocating memory for a feature function module supporting the first application in the first kernel selected from the kernels, and supporting the first application in the first kernel After the memory allocated by the characteristic function module is released, the application load information of the first kernel of the first application and the memory allocation information of the characteristic function module thereof are updated in the kernel function registry.
  • the characteristic function module is at least two types, according to the The application classifies the required characteristics of the system resources of the multi-core operating system.
  • the characteristic function module includes at least an input and output intensive characteristic function module, a thread intensive characteristic function module, and a network intensive characteristic function module.
  • an embodiment of the present invention provides a multi-core operating system implementation system, where the platform includes an implementation device of a multi-core operating system provided by any embodiment of the present invention, and further includes at least two processors, each of which is A kernel with a multi-core operating system is deployed on the core.
  • the multi-core operating system implementation method and implementation device and system provided by the embodiments of the present invention divide the functions of the kernel of the multi-core operating system into basic functional modules for providing basic kernel functions and characteristic functions for supporting the application.
  • a module that allocates or releases memory for running the corresponding application for the feature function module of the kernel, so that the kernel has the ability to load or unload the application, implements application-based features, and allocates the corresponding functions of the kernel as needed. Used to run the corresponding application The memory of the program, which improves the system management efficiency and resource usage efficiency of the multi-core operating system.
  • FIG. 1 is a flowchart of a method for implementing a multi-core operating system according to Embodiment 1 of the present invention
  • FIG. 2 is a schematic structural diagram of a device for implementing a multi-core operating system according to Embodiment 4 of the present invention
  • FIG. 4 is a schematic structural diagram of a multi-core operating system implementation apparatus according to Embodiment 6 of the present invention
  • FIG. 5 is a schematic structural diagram of a multi-core operating system implementation system according to Embodiment 7 of the present invention.
  • FIG. 1 is a flowchart of a method for implementing a multi-core operating system according to Embodiment 1 of the present invention.
  • the method of this embodiment is applicable to a situation in which system management efficiency and resource use efficiency of a multi-core operating system are optimized.
  • the method is implemented by a multi-core operating system implementation device, and the device is usually implemented in hardware and/or software. Integrated in a multi-core operating system implementation system. As shown in FIG. 1, the method in this embodiment includes:
  • the multi-core operating system refers to deploying an operating system kernel on each processor core of the multi-processor computer system, and deploying system services providing external interfaces on the basis of the kernel, such as: a file system, a communication system, thereby Form a complete operating system.
  • the kernel of the multi-core operating system adopts a modular design, and divides the functions of the kernel into basic functional modules and characteristic functional modules according to functions, and each functional module can be composed of a program or a program set.
  • the basic function module provides basic functions that all kernels must have, such as memory resource management and message communication mechanism.
  • the feature function module is constructed according to the characteristics of the application, and is used to support the application by assigning the feature function module. Or release the memory used to run the appropriate application to have the kernel in it have the ability to load or unload the appropriate application.
  • Each core is responsible for managing the system's processes, memory, device drivers, files, and network systems.
  • the processes include the operating system service processes and application processes, and the operating system service processes provide system services for the external interfaces.
  • a special statistical service program can be run, and the statistical service program is uniformly responsible for monitoring various applications and cores in the system; or, each core can monitor itself.
  • the operation in a negotiated manner to determine which kernel is running which application.
  • the system allocates memory for each core to store the kernel's own code, data, and memory required for initialization, so that the basic function module can provide basic functions. Kernel functions, such as memory resource management, message communication mechanism, etc.; when the statistics service program decides to allocate memory for the feature function module, first select the first kernel that meets the requirements among the cores, and then support for each first kernel.
  • the feature module of the first application allocates the required memory so that the first kernel has the ability to load the first application, and then the statistics server loads the first application on the first kernel.
  • the multi-core operating system implementation method provided by the embodiment of the present invention divides the functions of the kernel of the multi-core operating system into basic functional modules for providing basic kernel functions and characteristic functional modules for supporting the application, for each core
  • the feature function module of the qualifying kernel allocates or releases the memory used to run the corresponding application, so that the kernel has the ability to load or unload the application, implements application-based features, and corresponds to the kernel on demand.
  • the function allocation is used to run the memory of the corresponding application, thereby improving the system management efficiency and resource usage efficiency of the multi-core operating system.
  • the second embodiment of the present invention provides a multi-core operating system implementation method.
  • the kernel can access after allocating memory for the basic functional modules of each core of the multi-core operating system.
  • Kernel function registry and register itself to the kernel function registry.
  • the system can maintain a kernel function registry shared by all cores.
  • the kernel function registry is used to record the kernel identifier of each kernel, the processor chip identifier of the kernel, the application load information of the kernel, and the characteristic functions of the kernel.
  • the module's memory allocation information and other information of the kernel and update the information of each kernel according to the monitoring data of the statistical service program.
  • the kernel can access the kernel function registry.
  • the kernel registers itself with the kernel function registry; if the system has not been established yet The kernel function registry, the kernel has the right to establish a kernel function registry, and then register itself to the kernel function registry, and specify itself as a temporary management kernel, at this time, the kernel application registry load information recorded in the kernel function registry Empty; After the system is initialized and started, after the set time interval, the temporary management kernel stops accepting registration.
  • a multi-core operating system implementation method provided by an embodiment of the present invention, by using a multi-core operating system The functions of the kernel are divided into basic function modules and feature function modules, and a kernel function registry is established.
  • the kernel can access the kernel function registry and register itself to the kernel function registry.
  • the statistical service program selects the required kernel in each kernel according to the application load information of each kernel recorded in the kernel function registry and the memory allocation information of the characteristic function module, and allocates or releases the characteristic function module for the qualified kernel.
  • the memory used to run the corresponding application so that the kernel has the ability to load or unload the application, implements application-based features, and allocates memory for running the corresponding application for the corresponding function of the kernel as needed. Thereby improving the system management efficiency and resource use efficiency of the multi-core operating system.
  • a preferred method is to trigger the loading or unloading request of the application.
  • the allocating memory for the feature function module supporting the first application in the first kernel selected from the kernels comprises: receiving a loading request of the first application; according to the first application And the application load information of each of the kernels recorded in the kernel function registry, the first kernel to be loaded from the first application is selected from the kernels; The feature function module supporting the first application allocates memory.
  • the statistics service program receives the loading request of the first application, triggering the step of allocating memory for the characteristic function module: first determining the type of the characteristic function module capable of supporting the first application according to the characteristic of the first application Then, in the kernel function registry, query the application load information of each kernel and the memory allocation information of the feature function module, select a kernel that has not allocated memory for the type of feature function module, and combine the application load information of the kernels. Comprehensively determining, selecting a first kernel to be loaded with the first application; and allocating memory for the characteristic function module supporting the first application in the first kernel.
  • the selecting does not have a kernel for allocating memory for the type of characteristic function module, and specifically: in the kernel function registry, first searching for a kernel that does not allocate memory for any kind of characteristic function module; A kernel that allocates memory for this type of feature function module.
  • the multi-core operating system implementation method divides the function of the kernel of the multi-core operating system into the basic function module and the characteristic function module, and establishes a kernel function registry.
  • a kernel function registry When receiving the loading request of the application program, According to the characteristics of the application and the query kernel function registry, select the required kernel in each kernel, and allocate or release the memory for running the corresponding application for the characteristic function module of the required kernel, so that the kernel has The ability to load or unload the application, implements application-based features, and allocates memory for running the appropriate application for the corresponding functions of the kernel as needed, thereby improving system management efficiency and resource utilization efficiency of the multi-core operating system. .
  • the method further includes: updating, in the kernel function registry, application load information of the first kernel, and each of the characteristic function modules thereof Memory allocation information.
  • the statistics service program monitors the running status of various applications and cores in the system, and after allocating or releasing the memory for the characteristic function module, updating the application load information of the first kernel in the kernel function registry, and Memory allocation information of each of the characteristic function modules
  • the multi-core operating system implementation method provided by the embodiment of the present invention divides the function of the kernel of the multi-core operating system into the basic function module and the characteristic function module, and establishes a kernel function registry, after allocating or releasing the memory for the characteristic function module , update the kernel function registry to make kernel functions
  • the application load information of each kernel recorded by the registry and the memory allocation information of each of the characteristic function modules can accurately reflect the use of system resources, thereby improving the system management efficiency and resource use efficiency of the multi-core operating system.
  • a preferred implementation is as follows:
  • the types of the characteristic function modules are at least two, and the required characteristics of the system resources of the multi-core operating system are classified according to the application program.
  • the requirement characteristic of the application for the system resource of the multi-core operating system refers to a feature that the system resource needs are different based on characteristics of different types of applications based on its own characteristics, for example, for a search engine service,
  • the service front end requires a large number of concurrent threads, while threads are frequently created and destroyed, while the service backend requires a large amount of disk reads and writes.
  • the kernel's feature function modules are divided into at least two categories.
  • the characteristic function module includes at least an input and output dense characteristic function module, a thread dense characteristic function module, and a network dense characteristic function module.
  • the characteristics of the application are divided into input and output intensive characteristics, thread intensive characteristics, and network intensive characteristics.
  • the characteristic function module includes at least an input and output intensive characteristic function module, Thread-intensive feature modules and network-intensive feature modules.
  • Thread-intensive feature modules For example, for search engine services, the service front end needs a large number of concurrent threads, and threads are frequently created and destroyed. This is a typical thread-intensive feature.
  • the kernel allocates or frees memory for thread-intensive feature modules, so that the kernel has load.
  • the kernel is allocated for input/output intensive feature modules or Free up memory, giving the kernel the ability to load or unload input and output intensive applications; for streaming media
  • the application front end is a typical thread-intensive feature, and its service backend requires a large amount of network transmission. It is a typical network intensive.
  • the kernel allocates or releases memory for the network-intensive feature module, so that the kernel has load or unload. The ability of network-intensive applications.
  • the multi-core operating system implementation method divides the function of the kernel of the multi-core operating system into the basic functional module and the characteristic functional module, and according to the demand characteristics of the application system for the system resources of the multi-core operating system,
  • the feature function module is divided into at least an input and output intensive feature module, a thread intensive feature module, and a network intensive feature module; when receiving an application load request, based on the application feature, the corresponding feature function module in the kernel Allocate or release memory for running the appropriate application, so that the kernel has the ability to load or unload the corresponding application, implements application-based features, and allocates the corresponding functions of the kernel for running the corresponding application as needed Memory, which improves system management efficiency and resource usage efficiency of multi-core operating systems.
  • the method for implementing the multi-core operating system provided by the third embodiment of the present invention has various methods for triggering the allocation or releasing of memory for the characteristic function module based on the foregoing method embodiments, and another preferred method is to monitor the kernel.
  • the application load reaches the trigger threshold as the trigger condition.
  • the statistics service program detects that the load of the kernel K1 where the application a is located exceeds the threshold T1 of the processor utilization, that is, the trigger threshold of the overload is reached, an operation of allocating memory for the characteristic function module is triggered.
  • the type of the characteristic function module capable of supporting the application a is determined, and then in the kernel function registry, the kernel that has not allocated memory for the characteristic function module of the kind is not queried, and on this basis, select The kernel application load does not exceed the processor utilization threshold T2 kernel as the kernel K2 of the application a to be loaded.
  • K1 identifies the statistical service program
  • the threshold T1 is, for example, the processor utilization rate is 90. %
  • the threshold T1 is, for example, the processor utilization rate is 10%
  • Tl can use the system default value, or can be set by the user as needed.
  • the statistical service program selects the kernel K2 that loads the application a, allocates memory for the selected feature modules of the kernel supporting the application a, so that the kernels have the ability to load the application a; the statistical service program is The application program a is loaded on the kernel K2; the statistics service program updates the kernel function registry according to the kernel load information and the change of the memory allocation information of the related characteristic function modules.
  • the multi-core operating system implementation method provided by the embodiment of the present invention triggers an operation of allocating memory for the characteristic function module when the statistical service program detects that the application load of the kernel where the application is located reaches the trigger threshold of the overload function,
  • the characteristics of the application select the lighter-loaded kernel, allocate the memory for running the application for the corresponding feature function modules in the kernel, so that the cores have the ability to load the application, and realize the application-based
  • the characteristics of the kernel dynamically adjust the load of the system to achieve load balancing, thereby improving the system management efficiency and resource utilization efficiency of the multi-core operating system.
  • a preferred implementation is as follows: When the statistical service program detects that the load of the kernel K1 falls below the threshold T3, that is, when the trigger threshold is restored to the normal level, the trigger is a characteristic function module. The operation of releasing the memory.
  • the characteristic function module capable of supporting the application a is determined according to the characteristics of the application a.
  • the kernel function registry select in the kernel K1
  • the kernel K2 of the application a is successfully loaded for load balancing; on the kernel ⁇ 2, the application a is uninstalled, and the memory allocated for the characteristic function module supporting the application a in the kernel K2 is released; the statistical service program
  • the kernel function registry is updated based on changes in kernel load information and memory allocation information of related feature modules.
  • the kernel K2 that successfully loads the application a in order to achieve load balancing when the kernel K1 is overloaded may be selected as follows: In the kernel function registry, the first lookup is not only loaded. The kernel of application a; then find the kernel that only loaded application a.
  • the multi-core operating system implementation method when the statistical service program detects that the application load of the kernel where an application is located returns to a normal level, triggering the operation of releasing the memory for the characteristic function module, and selecting Unloading the application on the relevant kernel, and releasing the memory of the feature function module supporting the application in the relevant kernel, realizing the application-based characteristics, dynamically adjusting the load of the kernel in the system, realizing load balancing, thereby improving the multi-core System management efficiency and resource usage efficiency of the operating system.
  • FIG. 2 is a schematic structural diagram of a device for implementing a multi-core operating system according to Embodiment 4 of the present invention.
  • the multi-core operating system implementation apparatus 200 of this embodiment may include: a basic memory allocation module 201, a characteristic memory allocation module 202, and a release module 203, where:
  • the basic memory allocation module 201 is configured to allocate memory for the basic functional modules of each core of the multi-core operating system
  • the feature memory allocation module 202 is configured to allocate memory for the feature function module supporting the first application in the first kernel selected from the kernels;
  • a release module 203 configured to use the feature that supports the first application in the first kernel
  • the memory allocated by the module can be released.
  • the apparatus for implementing the multi-core operating system provided by the embodiment of the present invention may be used to perform the technical solution of the method embodiment shown in FIG. 1.
  • the multi-core operating system implementation apparatus divides the functions of the kernel of the multi-core operating system into basic functional modules for providing basic kernel functions and characteristic functional modules for supporting the application, for each core
  • the feature function module of the qualifying kernel allocates or releases the memory used to run the corresponding application, so that the kernel has the ability to load or unload the application, implements application-based features, and corresponds to the kernel on demand.
  • the function allocation is used to run the memory of the corresponding application, thereby improving the system management efficiency and resource usage efficiency of the multi-core operating system.
  • FIG. 3 is a schematic structural diagram of a device for implementing a multi-core operating system according to Embodiment 5 of the present invention.
  • the multi-core operating system implementation apparatus 300 provided in this embodiment is based on the apparatus structure shown in FIG. 2.
  • the characteristic memory allocation module 202 may include: a receiving unit 301, a selecting unit 302, and a memory. Distribution unit 303, wherein:
  • the receiving unit 301 is configured to receive a loading request of the first application.
  • the selecting unit 302 is configured to select, from the kernels, the first application to be loaded, according to characteristics of the first application, and application load information of each kernel recorded in a kernel function registry.
  • the memory allocation unit 303 is configured to allocate memory for the feature function module that supports the first application in the first kernel.
  • the apparatus for implementing the multi-core operating system provided by the embodiment of the present invention may be used to perform the technical solution of the embodiment of the method for implementing the multi-core operating system provided by the embodiment of the present invention. For the specific process of performing the method, refer to the embodiment of the present invention. The related description of the method embodiment is not described here.
  • the multi-core operating system implementation apparatus divides the functions of the kernel of the multi-core operating system into basic functional modules for providing basic kernel functions and characteristic functional modules for supporting the application, and establishes a kernel.
  • Function registry when receiving the application's load request, according to the characteristics of the application and querying the kernel function registry, select the required kernel in each kernel, and allocate or release the feature module for the required kernel.
  • FIG. 4 is a schematic structural diagram of a device for implementing a multi-core operating system according to Embodiment 6 of the present invention.
  • the multi-core operating system implementation apparatus 400 provided in this embodiment is based on the apparatus structure shown in FIG. 3, and further includes: an update module 401, where the update module 401 is used to After the memory of the first function selected by each of the cores supporting the first application is allocated, and after releasing the memory allocated for the characteristic function module supporting the first application in the first kernel Updating the application load information of the first kernel and the memory allocation information of the characteristic function module in the kernel function registry
  • the apparatus for implementing the multi-core operating system provided by the embodiment of the present invention may be used to perform the technical solution of the embodiment of the method for implementing the multi-core operating system provided by the embodiment of the present invention.
  • the multi-core operating system implementation apparatus provided by the embodiment of the present invention divides the functions of the kernel of the multi-core operating system into basic functional modules for providing basic kernel functions and characteristic functional modules for supporting the application, and establishes a kernel.
  • the function registry after allocating or releasing memory for the feature function module, updating the kernel function registry, so that the application load information of each kernel recorded by the kernel function registry and the memory allocation information of each of the characteristic function modules can Accurately reflect the use of system resources, thereby improving the system management efficiency and resource usage efficiency of multi-core operating systems.
  • FIG. 5 is a schematic structural diagram of a multi-core operating system implementation system according to Embodiment 7 of the present invention.
  • the multi-core operating system implementation system 500 provided in this embodiment includes a multi-core operating system implementation device 502, at least two processors 504, and a multi-core operating system deployed on a core of each processor 504.
  • the structure of any of the illustrated device embodiments is correspondingly configured to implement the technical solution of the embodiment of the multi-core operating system implementation method provided by the embodiment of the present invention. The principle and technical effects are similar, and are not described herein again.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

Embodiments of the present invention provide a method, an apparatus and a system for implementing a multicore operating system. The method comprises: allocating memories for basic function modules of cores of a multicore operating system; allocating a memory for a feature function module supporting a first application program in a first core selected from the cores; and releasing the memory allocated for the feature function module supporting the first application program in the first core. By means of the method, the apparatus and the system for implementing a multicore operating system provided in the embodiments of the present invention, an application program-based feature is implemented, a memory is allocated for a corresponding function of a core according to a requirement, thereby improving the system management efficiency and the resource use efficiency of the multicore operating system.

Description

多内核操作系统实现方法和实现装置及系统 本申请要求于 2013 年 03 月 27 日提交中国专利局、 申请号为 201310101210.5、 发明名称为"多内核操作系统实现方法和实现装置及系统 "的 中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域 本发明实施例涉及计算机技术,尤其涉及一种多内核操作系统实现方法和 实现装置及系统。 背景技术 随着计算机技术的飞速发展, 出现了诸如多核心处理器计算机系统 ( Multi-core processor computing system ) 、 异构计算机系统 ( Heterogeneous computing system ) 等包含有多个处理器的多处理器计算机系统 ( Multi-processor Computing System ) , 为了有效地管理这类系统, 充分利用 系统提供的丰富资源, 同时保证系统的使用效率,提出了一种运行在多处理器 计算机系统上的多内核操作系统( Multi-Kernel Operating System )的设计方法。  Multi-core operating system implementation method and implementation device and system The present application claims to be submitted to the Chinese Patent Office on March 27, 2013, the application number is 201310101210.5, and the invention name is "multi-core operating system implementation method and implementation device and system" Chinese patent Priority of the application, the entire contents of which are incorporated herein by reference. TECHNICAL FIELD Embodiments of the present invention relate to computer technologies, and in particular, to a multi-core operating system implementation method, apparatus, and system. BACKGROUND OF THE INVENTION With the rapid development of computer technology, multi-processor computer systems including multiple processors, such as a multi-core processor computing system and a heterogeneous computing system, have appeared. (Multi-processor Computing System) , in order to effectively manage such systems, make full use of the rich resources provided by the system, and ensure the efficiency of the system, a multi-core operating system running on a multi-processor computer system (Multi -Kernel Operating System ).

多内核操作系统, 是指在多处理器计算机系统的每个处理器的核心 ( Processor core )上部署一个操作系统内核, 在内核的基础上部署提供对外接 口的系统服务, 如: 文件系统、 通信系统, 从而形成一个完整的操作系统。  Multi-core operating system refers to deploying an operating system kernel on the processor core of a multi-processor computer system, and deploying system services providing external interfaces on the basis of the kernel, such as: file system, communication The system thus forms a complete operating system.

现有技术中, 多内核操作系统的内核之间是对等的关系, 各内核的功能完 全相同, 需要进行资源协调时, 依靠对等的交互机制, 通过协商协议实现管理 功能。  In the prior art, the cores of the multi-core operating system are peer-to-peer. The functions of the cores are completely the same. When resource coordination is required, the peer-to-peer interaction mechanism is used to implement the management function through the negotiation protocol.

但是,现有技术的多内核操作系统中, 在某些内核上的一些功能很长一段 时间内用不上, 但是仍然需要占用很多内存, 造成计算机资源的浪费。 发明内容 本发明实施例提供一种多内核操作系统实现方法和实现装置及系统,以提 高多内核操作系统的系统管理效率和资源使用效率。 第一方面,本发明实施例提供一种多内核操作系统实现方法,该方法包括: 为多内核操作系统的各内核的基础功能模块分配内存; However, in the prior art multi-core operating system, some functions on some cores are not used for a long time, but still need to occupy a lot of memory, resulting in waste of computer resources. SUMMARY OF THE INVENTION Embodiments of the present invention provide a multi-core operating system implementation method and implementation apparatus and system, to improve system management efficiency and resource usage efficiency of a multi-core operating system. In a first aspect, an embodiment of the present invention provides a multi-core operating system implementation method, where the method includes: allocating memory for a basic functional module of each core of a multi-core operating system;

为从所述各内核中选取的第一内核中支持第一应用程序的特性功能模块 分配内存;  Allocating memory for a feature function module supporting the first application in the first kernel selected from the respective cores;

将所述为所述第一内核中支持第一应用程序的特性功能模块分配的内存 释放。  The memory allocated for the characteristic function module supporting the first application in the first kernel is released.

在第一方面的第一种可能的实现方式中,所述为从所述各内核中选取的第 一内核中支持第一应用程序的特性功能模块分配内存包括:  In a first possible implementation manner of the first aspect, the allocating memory for the feature function module that supports the first application in the first kernel selected from the kernels includes:

接收所述第一应用程序的加载请求;  Receiving a loading request of the first application;

根据所述第一应用程序的特性、以及内核功能注册表中记录的各所述内核 的应用程序负载信息,从所述各内核中选取待加载所述第一应用程序的所述第 一内核;  Determining, from the kernels, the first kernel to be loaded by the first application according to characteristics of the first application and application load information of each kernel recorded in a kernel function registry;

为所述第一内核中支持第一应用程序的特性功能模块分配内存。  Allocating memory for the feature function module supporting the first application in the first kernel.

根据第一方面或第一方面的第一种可能的实现方式,在第二种可能的实现 方式中,在所述为从所述各内核中选取的第一内核中支持第一应用程序的特性 功能模块分配内存之后 ,以及在将所述为所述第一内核中支持第一应用程序的 特性功能模块分配的内存释放之后, 还包括:  According to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation, the feature of the first application is supported in the first kernel selected from the kernels After the function module allocates the memory, and after releasing the memory allocated for the characteristic function module supporting the first application in the first kernel, the method further includes:

在所述内核功能注册表中更新所述第一应用程序的所述第一内核的应用 程序负载信息、 及其各所述特性功能模块的内存分配信息。  Updating application load information of the first kernel of the first application and memory allocation information of each of the characteristic function modules in the kernel function registry.

根据第一方面、 第一方面的第一种至第二种可能的实现方式的任意一种, 在第三种可能的实现方式中, 所述特性功能模块的种类为至少两个,按照所述 应用程序对所述多内核操作系统的系统资源的需求特性进行分类。  According to the first aspect, any one of the first to the second possible implementation manners of the first aspect, in a third possible implementation, the characteristic function module is at least two types, according to the The application classifies the required characteristics of the system resources of the multi-core operating system.

根据第一方面的第三种可能的实现方式,在第四种可能的实现方式中, 所 述特性功能模块至少包括输入输出密集特性功能模块、线程密集特性功能模块 和网络密集特性功能模块。  According to a third possible implementation manner of the first aspect, in a fourth possible implementation, the characteristic function module includes at least an input and output intensive characteristic function module, a thread intensive characteristic function module, and a network intensive characteristic function module.

第二方面,本发明实施例提供一种多内核操作系统实现装置,该装置包括: 基础内存分配模块,用于为多内核操作系统的各内核的基础功能模块分配 内存;  In a second aspect, an embodiment of the present invention provides a multi-core operating system implementation apparatus, where the apparatus includes: a basic memory allocation module, configured to allocate memory for a basic functional module of each core of the multi-core operating system;

特性内存分配模块,用于为从所述各内核中选取的第一内核中支持第一应 用程序的特性功能模块分配内存; 释放模块,用于将所述为所述第一内核中支持第一应用程序的特性功能模 块分配的内存释放。 a feature memory allocation module, configured to allocate memory for a feature function module supporting the first application in the first kernel selected from the kernels; And a release module, configured to release the memory allocated for the feature function module supporting the first application in the first kernel.

在第二方面的第一种可能的实现方式中, 特性内存分配模块包括: 接收单元, 用于接收所述第一应用程序的加载请求;  In a first possible implementation manner of the second aspect, the feature memory allocation module includes: a receiving unit, configured to receive a loading request of the first application;

选取单元, 用于根据所述第一应用程序的特性、 以及内核功能注册表中记 录的各所述内核的应用程序负载信息 ,从所述各内核中选取待加载所述第一应 用程序的所述第一内核;  a selecting unit, configured to select, according to a characteristic of the first application, and application load information of each of the kernels recorded in a kernel function registry, from the kernels, where the first application is to be loaded Said first kernel;

内存分配单元,用于为所述第一内核中支持第一应用程序的特性功能模块 分配内存。  And a memory allocation unit, configured to allocate memory for the feature function module supporting the first application in the first kernel.

根据第二方面或第二方面的第一种可能的实现方式,在第二种可能的实现 方式中, 还包括:  According to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner, the method further includes:

更新模块 ,用于在为从所述各内核中选取的第一内核中支持第一应用程序 的特性功能模块分配内存之后 ,以及在将所述为所述第一内核中支持第一应用 程序的特性功能模块分配的内存释放之后,在所述内核功能注册表中更新所述 第一应用程序的所述第一内核的应用程序负载信息、及其特性功能模块的内存 分配信息。  An update module, after allocating memory for a feature function module supporting the first application in the first kernel selected from the kernels, and supporting the first application in the first kernel After the memory allocated by the characteristic function module is released, the application load information of the first kernel of the first application and the memory allocation information of the characteristic function module thereof are updated in the kernel function registry.

根据第二方面、 第二方面的第一种至第二种可能的实现方式的任意一种, 在第三种可能的实现方式中, 所述特性功能模块的种类为至少两个,按照所述 应用程序对所述多内核操作系统的系统资源的需求特性进行分类。  According to the second aspect, any one of the first to the second possible implementation manners of the second aspect, in a third possible implementation, the characteristic function module is at least two types, according to the The application classifies the required characteristics of the system resources of the multi-core operating system.

根据第二方面的第三种可能的实现方式,在第四种可能的实现方式中, 所 述特性功能模块至少包括输入输出密集特性功能模块、线程密集特性功能模块 和网络密集特性功能模块。  According to a third possible implementation manner of the second aspect, in a fourth possible implementation, the characteristic function module includes at least an input and output intensive characteristic function module, a thread intensive characteristic function module, and a network intensive characteristic function module.

第三方面, 本发明实施例提供一种多内核操作系统实现系统, 该平台包括 本发明任意实施例所提供的多内核操作系统的实现装置,还包括至少两个处理 器, 每个处理器的核心上都部署有多内核操作系统的内核。  In a third aspect, an embodiment of the present invention provides a multi-core operating system implementation system, where the platform includes an implementation device of a multi-core operating system provided by any embodiment of the present invention, and further includes at least two processors, each of which is A kernel with a multi-core operating system is deployed on the core.

本发明实施例提供的多内核操作系统实现方法和实现装置及系统,通过将 多内核操作系统的内核的功能划分为用于提供基本的内核功能的基础功能模 块和用于支持应用程序的特性功能模块,为内核的特性功能模块分配或释放用 于运行对应的应用程序的内存, 以使内核具备加载或卸载该应用程序的能力, 实现了基于应用程序的特性,按需为内核的相应功能分配用于运行相应的应用 程序的内存, 从而提高了多内核操作系统的系统管理效率和资源使用效率。 附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描 述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出 创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。 The multi-core operating system implementation method and implementation device and system provided by the embodiments of the present invention divide the functions of the kernel of the multi-core operating system into basic functional modules for providing basic kernel functions and characteristic functions for supporting the application. A module that allocates or releases memory for running the corresponding application for the feature function module of the kernel, so that the kernel has the ability to load or unload the application, implements application-based features, and allocates the corresponding functions of the kernel as needed. Used to run the corresponding application The memory of the program, which improves the system management efficiency and resource usage efficiency of the multi-core operating system. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. The drawings are some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive labor.

图 1为本发明实施例一提供的多内核操作系统实现方法的流程图; 图 2为本发明实施例四提供的多内核操作系统实现装置的结构示意图; 图 3为本发明实施例五提供的多内核操作系统实现装置的结构示意图; 图 4为本发明实施例六提供的多内核操作系统实现装置的结构示意图; 图 5为本发明实施例七提供的多内核操作系统实现系统的结构示意图。 具体实施方式 为使本发明实施例的目的、技术方案和优点更加清楚, 下面将结合本发明 实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。基于本发明中 的实施例 ,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其 他实施例, 都属于本发明保护的范围。  1 is a flowchart of a method for implementing a multi-core operating system according to Embodiment 1 of the present invention; FIG. 2 is a schematic structural diagram of a device for implementing a multi-core operating system according to Embodiment 4 of the present invention; FIG. 4 is a schematic structural diagram of a multi-core operating system implementation apparatus according to Embodiment 6 of the present invention; FIG. 5 is a schematic structural diagram of a multi-core operating system implementation system according to Embodiment 7 of the present invention. The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. The embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.

实施例一  Embodiment 1

图 1为本发明实施例一提供的多内核操作系统实现方法的流程图。 本实施 例的方法适用于对多内核操作系统的系统管理效率和资源使用效率进行优化 的情形, 该方法由多内核操作系统实现装置执行, 该装置通常以硬件和 /或软 件的方式来实现, 集成在多内核操作系统实现系统中。 如图 1所示, 本实施例 的方法包括:  FIG. 1 is a flowchart of a method for implementing a multi-core operating system according to Embodiment 1 of the present invention. The method of this embodiment is applicable to a situation in which system management efficiency and resource use efficiency of a multi-core operating system are optimized. The method is implemented by a multi-core operating system implementation device, and the device is usually implemented in hardware and/or software. Integrated in a multi-core operating system implementation system. As shown in FIG. 1, the method in this embodiment includes:

101、 为多内核操作系统的各内核的基础功能模块分配内存;  101. Allocating memory for basic functional modules of each core of the multi-core operating system;

102、 为从所述各内核中选取的第一内核中支持第一应用程序的特性功能 模块分配内存;  102. Allocate memory for a feature function module that supports the first application in the first kernel selected from the cores;

103、 将所述为所述第一内核中支持第一应用程序的特性功能模块分配的 内存释放。 103. Allocating the function function module that supports the first application in the first kernel Memory is released.

具体地,多内核操作系统是指在多处理器计算机系统的每个处理器核心上 部署一个操作系统内核, 在内核的基础上部署提供对外接口的系统服务, 如: 文件系统、 通信系统, 从而形成一个完整的操作系统。  Specifically, the multi-core operating system refers to deploying an operating system kernel on each processor core of the multi-processor computer system, and deploying system services providing external interfaces on the basis of the kernel, such as: a file system, a communication system, thereby Form a complete operating system.

在本发明实施例中, 多内核操作系统的内核釆用模块化设计,按照功能将 内核的功能划分为基础功能模块和特性功能模块,各功能模块可以由程序或程 序集合来构成。 其中, 基础功能模块提供所有内核都必须要有的基本功能, 如 内存资源管理、消息通信机制等;特性功能模块是根据应用程序的特性构造的, 用于支持应用程序 ,通过为特性功能模块分配或释放用于运行相应的应用程序 的内存, 以使其所在的内核具备加载或卸载相应的应用程序的能力。各内核负 责管理系统的进程、 内存、 设备驱动程序、 文件和网络系统, 其中, 进程包括 操作系统服务进程和应用程序进程,操作系统服务进程提供对外接口的系统服 务。  In the embodiment of the present invention, the kernel of the multi-core operating system adopts a modular design, and divides the functions of the kernel into basic functional modules and characteristic functional modules according to functions, and each functional module can be composed of a program or a program set. The basic function module provides basic functions that all kernels must have, such as memory resource management and message communication mechanism. The feature function module is constructed according to the characteristics of the application, and is used to support the application by assigning the feature function module. Or release the memory used to run the appropriate application to have the kernel in it have the ability to load or unload the appropriate application. Each core is responsible for managing the system's processes, memory, device drivers, files, and network systems. The processes include the operating system service processes and application processes, and the operating system service processes provide system services for the external interfaces.

在本发明实施例的多内核操作系统上可以运行专门的一个统计服务程序, 由该统计服务程序统一负责监控系统中各种应用、 各内核的运行情况; 或者, 也可以由各内核各自监控自身的运行情况,以协商方式确定哪个内核运行哪个 应用。  In the multi-core operating system of the embodiment of the present invention, a special statistical service program can be run, and the statistical service program is uniformly responsible for monitoring various applications and cores in the system; or, each core can monitor itself. The operation, in a negotiated manner to determine which kernel is running which application.

在多内核操作系统初始化和启动时,系统在为各内核分配用于存储内核的 自身代码、数据以及初始化所需的内存之后, 为各内核的基础功能模块分配内 存, 使得基础功能模块能够提供基本的内核功能, 例如内存资源管理、 消息通 信机制等; 当统计服务程序决定为特性功能模块分配内存时,首先在所述各内核中选 取符合要求的第一内核,然后为各第一内核中支持第一应用程序的特性功能模 块分配所需的内存, 从而使第一内核具备加载第一应用程序的能力, 接着, 统 计服务程序在第一内核上加载第一应用程序。 当统计服务程序决定为特性功能模块释放内存时,首先在所述各内核中查 找已经成功加载了第一应用程序的所述第一内核,然后在查找到的所述第一内 核上卸载第一应用程序 ,并且释放为所述第一内核中支持第一应用程序的特性 功能模块分配的内存。 本发明实施例提供的多内核操作系统实现方法,通过将多内核操作系统的 内核的功能划分为用于提供基本的内核功能的基础功能模块和用于支持应用 程序的特性功能模块,为各内核中符合要求的内核的特性功能模块分配或释放 用于运行对应的应用程序的内存,以使该内核具备加载或卸载该应用程序的能 力, 实现了基于应用程序的特性,按需为内核的相应功能分配用于运行相应的 应用程序的内存, 从而提高了多内核操作系统的系统管理效率和资源使用效 率。 When the multi-core operating system is initialized and started, the system allocates memory for each core to store the kernel's own code, data, and memory required for initialization, so that the basic function module can provide basic functions. Kernel functions, such as memory resource management, message communication mechanism, etc.; when the statistics service program decides to allocate memory for the feature function module, first select the first kernel that meets the requirements among the cores, and then support for each first kernel. The feature module of the first application allocates the required memory so that the first kernel has the ability to load the first application, and then the statistics server loads the first application on the first kernel. When the statistics service program decides to release the memory for the feature function module, first searching for the first kernel that has successfully loaded the first application in each of the kernels, and then searching for the first inner The first application is unloaded on the core, and the memory allocated for the feature function module supporting the first application in the first kernel is released. The multi-core operating system implementation method provided by the embodiment of the present invention divides the functions of the kernel of the multi-core operating system into basic functional modules for providing basic kernel functions and characteristic functional modules for supporting the application, for each core The feature function module of the qualifying kernel allocates or releases the memory used to run the corresponding application, so that the kernel has the ability to load or unload the application, implements application-based features, and corresponds to the kernel on demand. The function allocation is used to run the memory of the corresponding application, thereby improving the system management efficiency and resource usage efficiency of the multi-core operating system.

实施例二 本发明实施例二提供的多内核操作系统实现方法,在上述方法实施例的基 础上,优选的是:在为多内核操作系统的各内核的基础功能模块分配内存之后, 内核可以访问内核功能注册表并将自身注册到内核功能注册表。 具体地, 系统可以维护一个由所有内核共同使用的内核功能注册表, 该内 核功能注册表用于记录各内核的内核标识、 内核所在处理器芯片标识、 内核的 应用程序负载信息、 内核的特性功能模块的内存分配信息以及内核的其他信 息, 并根据统计服务程序的监控数据更新各内核的信息。 在为所述各内核的基础功能模块分配内存之后,内核可以访问内核功能注 册表,如果系统中已经存在内核功能注册表, 则该内核将自身注册到内核功能 注册表; 如果系统中还没有建立内核功能注册表, 则该内核有权建立内核功能 注册表, 然后将自身注册到内核功能注册表, 并指定自身为临时管理内核, 此 时, 内核功能注册表中记录的内核的应用程序负载信息为空; 系统初始化和启 动完成后, 再经过设定的时间间隔后, 临时管理内核停止接受注册。 本发明实施例提供的多内核操作系统实现方法,通过将多内核操作系统的 内核的功能划分为用于基础功能模块和特性功能模块,并且建立内核功能注册 表,在为各内核的基础功能模块分配内存之后, 内核可以访问内核功能注册表 并将自身注册到内核功能注册表;统计服务程序根据内核功能注册表中记录的 各内核的应用程序负载信息和特性功能模块的内存分配信息在各内核中选择 符合要求的内核,并为符合要求的内核的特性功能模块分配或释放用于运行对 应的应用程序的内存, 以使该内核具备加载或卸载该应用程序的能力, 实现了 基于应用程序的特性,按需为内核的相应功能分配用于运行相应的应用程序的 内存, 从而提高了多内核操作系统的系统管理效率和资源使用效率。 The second embodiment of the present invention provides a multi-core operating system implementation method. Based on the foregoing method embodiments, it is preferred that the kernel can access after allocating memory for the basic functional modules of each core of the multi-core operating system. Kernel function registry and register itself to the kernel function registry. Specifically, the system can maintain a kernel function registry shared by all cores. The kernel function registry is used to record the kernel identifier of each kernel, the processor chip identifier of the kernel, the application load information of the kernel, and the characteristic functions of the kernel. The module's memory allocation information and other information of the kernel, and update the information of each kernel according to the monitoring data of the statistical service program. After allocating memory for the basic function modules of the cores, the kernel can access the kernel function registry. If the kernel function registry already exists in the system, the kernel registers itself with the kernel function registry; if the system has not been established yet The kernel function registry, the kernel has the right to establish a kernel function registry, and then register itself to the kernel function registry, and specify itself as a temporary management kernel, at this time, the kernel application registry load information recorded in the kernel function registry Empty; After the system is initialized and started, after the set time interval, the temporary management kernel stops accepting registration. A multi-core operating system implementation method provided by an embodiment of the present invention, by using a multi-core operating system The functions of the kernel are divided into basic function modules and feature function modules, and a kernel function registry is established. After allocating memory for the basic function modules of each kernel, the kernel can access the kernel function registry and register itself to the kernel function registry. The statistical service program selects the required kernel in each kernel according to the application load information of each kernel recorded in the kernel function registry and the memory allocation information of the characteristic function module, and allocates or releases the characteristic function module for the qualified kernel. The memory used to run the corresponding application, so that the kernel has the ability to load or unload the application, implements application-based features, and allocates memory for running the corresponding application for the corresponding function of the kernel as needed. Thereby improving the system management efficiency and resource use efficiency of the multi-core operating system.

在上述方法实施例的基础上,触发为特性功能模块分配或释放内存的方式 有多种, 优选的一种方式是以接收到应用程序的加载或卸载请求为触发条件。  On the basis of the foregoing method embodiments, there are multiple ways to trigger the allocation or release of memory for the characteristic function module. A preferred method is to trigger the loading or unloading request of the application.

可选地,所述为从所述各内核中选取的第一内核中支持第一应用程序的特 性功能模块分配内存包括: 接收所述第一应用程序的加载请求; 根据所述第一 应用程序的特性、以及内核功能注册表中记录的各所述内核的应用程序负载信 息,从所述各内核中选取待加载所述第一应用程序的所述第一内核; 为所述第 一内核中支持第一应用程序的特性功能模块分配内存。  Optionally, the allocating memory for the feature function module supporting the first application in the first kernel selected from the kernels comprises: receiving a loading request of the first application; according to the first application And the application load information of each of the kernels recorded in the kernel function registry, the first kernel to be loaded from the first application is selected from the kernels; The feature function module supporting the first application allocates memory.

具体地, 当统计服务程序接收到第一应用程序的加载请求时,触发为特性 功能模块分配内存的步骤: 首先根据第一应用程序的特性,确定能够支持第一 应用程序的特性功能模块的种类,然后在内核功能注册表中查询各内核的应用 程序负载信息和特性功能模块的内存分配信息,选择还没有为该种类特性功能 模块分配内存的内核, 并结合该些内核的应用程序负载信息, 综合判断, 选取 待加载第一应用程序的第一内核;为第一内核中支持第一应用程序的特性功能 模块分配内存。 可选地, 所述选择还没有为该种类特性功能模块分配内存的内核, 具体可 以为: 在内核功能注册表中, 首先查找没有为任一种类的特性功能模块分配内 存的内核; 其次查找没有为该种类的特性功能模块分配内存的内核。 Specifically, when the statistics service program receives the loading request of the first application, triggering the step of allocating memory for the characteristic function module: first determining the type of the characteristic function module capable of supporting the first application according to the characteristic of the first application Then, in the kernel function registry, query the application load information of each kernel and the memory allocation information of the feature function module, select a kernel that has not allocated memory for the type of feature function module, and combine the application load information of the kernels. Comprehensively determining, selecting a first kernel to be loaded with the first application; and allocating memory for the characteristic function module supporting the first application in the first kernel. Optionally, the selecting does not have a kernel for allocating memory for the type of characteristic function module, and specifically: in the kernel function registry, first searching for a kernel that does not allocate memory for any kind of characteristic function module; A kernel that allocates memory for this type of feature function module.

本发明实施例提供的多内核操作系统实现方法,通过将多内核操作系统的 内核的功能划分为基础功能模块和特性功能模块, 并且建立内核功能注册表, 当接收到应用程序的加载请求时 ,根据应用程序的特性以及查询内核功能注册 表,在各内核中选择符合要求的内核, 并为符合要求的内核的特性功能模块分 配或释放用于运行对应的应用程序的内存,以使该内核具备加载或卸载该应用 程序的能力, 实现了基于应用程序的特性,按需为内核的相应功能分配用于运 行相应的应用程序的内存,从而提高了多内核操作系统的系统管理效率和资源 使用效率。  The multi-core operating system implementation method provided by the embodiment of the present invention divides the function of the kernel of the multi-core operating system into the basic function module and the characteristic function module, and establishes a kernel function registry. When receiving the loading request of the application program, According to the characteristics of the application and the query kernel function registry, select the required kernel in each kernel, and allocate or release the memory for running the corresponding application for the characteristic function module of the required kernel, so that the kernel has The ability to load or unload the application, implements application-based features, and allocates memory for running the appropriate application for the corresponding functions of the kernel as needed, thereby improving system management efficiency and resource utilization efficiency of the multi-core operating system. .

在上述方法实施例的基础上,优选的是: 在所述为从所述各内核中选取的 第一内核中支持第一应用程序的特性功能模块分配内存之后,以及在将上述为 所述第一内核中支持第一应用程序的特性功能模块分配的内存释放之后,还包 括: 在所述内核功能注册表中更新所述第一内核的应用程序负载信息、及其各 所述特性功能模块的内存分配信息。  Based on the foregoing method embodiment, it is preferable that: after the memory is allocated by the feature function module that supports the first application in the first kernel selected from the kernels, and After releasing the memory allocated by the characteristic function module of the first application in a kernel, the method further includes: updating, in the kernel function registry, application load information of the first kernel, and each of the characteristic function modules thereof Memory allocation information.

具体地, 统计服务程序监控系统中各种应用、 各内核的运行情况, 在为特 性功能模块分配或释放内存之后,在内核功能注册表中更新所述第一内核的应 用程序负载信息、 及其各所述特性功能模块的内存分配信息  Specifically, the statistics service program monitors the running status of various applications and cores in the system, and after allocating or releasing the memory for the characteristic function module, updating the application load information of the first kernel in the kernel function registry, and Memory allocation information of each of the characteristic function modules

本发明实施例提供的多内核操作系统实现方法,通过将多内核操作系统的 内核的功能划分为基础功能模块和特性功能模块, 并且建立内核功能注册表, 在为特性功能模块分配或释放内存之后, 更新内核功能注册表, 以使内核功能 注册表记录的各内核的应用程序负载信息、及其各所述特性功能模块的内存分 配信息能准确地反应系统资源的使用情况,从而提高了多内核操作系统的系统 管理效率和资源使用效率。 The multi-core operating system implementation method provided by the embodiment of the present invention divides the function of the kernel of the multi-core operating system into the basic function module and the characteristic function module, and establishes a kernel function registry, after allocating or releasing the memory for the characteristic function module , update the kernel function registry to make kernel functions The application load information of each kernel recorded by the registry and the memory allocation information of each of the characteristic function modules can accurately reflect the use of system resources, thereby improving the system management efficiency and resource use efficiency of the multi-core operating system.

在上述方法实施例的基础上,优选的一种实现情况为: 所述特性功能模块 的种类为至少两个,按照应用程序对多内核操作系统的系统资源的需求特性进 行分类。  On the basis of the foregoing method embodiments, a preferred implementation is as follows: The types of the characteristic function modules are at least two, and the required characteristics of the system resources of the multi-core operating system are classified according to the application program.

具体地, 所述应用程序对多内核操作系统的系统资源的需求特性是指,基 于不同种类的应用程序基于自身的特点, 对于系统资源的需求存在差异的特 性, 例如, 对于搜索引擎服务, 其服务前端需要大量的并发线程, 同时线程会 频繁的创建、销毁, 而其服务后端则需要大量的磁盘读写。 按照各种应用程序 对于系统资源的需求特性, 将内核的特性功能模块至少分为两类。  Specifically, the requirement characteristic of the application for the system resource of the multi-core operating system refers to a feature that the system resource needs are different based on characteristics of different types of applications based on its own characteristics, for example, for a search engine service, The service front end requires a large number of concurrent threads, while threads are frequently created and destroyed, while the service backend requires a large amount of disk reads and writes. According to the requirements of various applications for system resources, the kernel's feature function modules are divided into at least two categories.

可选地, 所述特性功能模块至少包括输入输出密集特性功能模块、线程密 集特性功能模块和网络密集特性功能模块。  Optionally, the characteristic function module includes at least an input and output dense characteristic function module, a thread dense characteristic function module, and a network dense characteristic function module.

具体地,按照各种应用程序对于系统资源的需求特性,将应用程序的特性 分为输入输出密集特性、 线程密集特性和网络密集特性, 进一步地, 特性功能 模块至少包括输入输出密集特性功能模块、线程密集特性功能模块和网络密集 特性功能模块。 比如, 对于搜索引擎服务, 其服务前端需要大量的并发线程, 同时线程会频繁的创建、销毁, 是典型的线程密集特性, 内核通过为线程密集 特性功能模块分配或释放内存,使得该内核具备加载或卸载线程密集特性应用 程序的能力, 其服务后端是典型的输入 /输出(I/O, Input/Output)密集特性, 需 要大量的磁盘读写, 内核通过为输入输出密集特性功能模块分配或释放内存, 使得该内核具备加载或卸载输入输出密集特性应用程序的能力;而对于流媒体 应用,其服务前端是典型的线程密集特性,其服务后端则需要大量的网络传输, 是一个典型的网络密集, 内核通过为网络密集特性功能模块分配或释放内存, 使得该内核具备加载或卸载网络密集特性应用程序的能力。 Specifically, according to the demand characteristics of various application programs for system resources, the characteristics of the application are divided into input and output intensive characteristics, thread intensive characteristics, and network intensive characteristics. Further, the characteristic function module includes at least an input and output intensive characteristic function module, Thread-intensive feature modules and network-intensive feature modules. For example, for search engine services, the service front end needs a large number of concurrent threads, and threads are frequently created and destroyed. This is a typical thread-intensive feature. The kernel allocates or frees memory for thread-intensive feature modules, so that the kernel has load. Or the ability to offload thread-intensive applications whose service backends are typically input/output (I/O) intensive, requiring a large amount of disk reads and writes, and the kernel is allocated for input/output intensive feature modules or Free up memory, giving the kernel the ability to load or unload input and output intensive applications; for streaming media The application front end is a typical thread-intensive feature, and its service backend requires a large amount of network transmission. It is a typical network intensive. The kernel allocates or releases memory for the network-intensive feature module, so that the kernel has load or unload. The ability of network-intensive applications.

本发明实施例提供的多内核操作系统实现方法,通过将多内核操作系统的 内核的功能划分为基础功能模块和特性功能模块,并按照应用程序对多内核操 作系统的系统资源的需求特性,将特性功能模块分为至少包括输入输出密集特 性功能模块、线程密集特性功能模块和网络密集特性功能模块; 当接收到应用 程序的加载请求时,基于应用程序的特性, 为内核中相应的特性功能模块分配 或释放用于运行相应的应用程序的内存,以使内核具备加载或卸载相应的应用 程序的能力, 实现了基于应用程序的特性,按需为内核的相应功能分配用于运 行相应的应用程序的内存,从而提高了多内核操作系统的系统管理效率和资源 使用效率。  The multi-core operating system implementation method provided by the embodiment of the present invention divides the function of the kernel of the multi-core operating system into the basic functional module and the characteristic functional module, and according to the demand characteristics of the application system for the system resources of the multi-core operating system, The feature function module is divided into at least an input and output intensive feature module, a thread intensive feature module, and a network intensive feature module; when receiving an application load request, based on the application feature, the corresponding feature function module in the kernel Allocate or release memory for running the appropriate application, so that the kernel has the ability to load or unload the corresponding application, implements application-based features, and allocates the corresponding functions of the kernel for running the corresponding application as needed Memory, which improves system management efficiency and resource usage efficiency of multi-core operating systems.

实施例三  Embodiment 3

本发明实施例三提供的多内核操作系统实现方法,在上述方法实施例的基 础上,触发为特性功能模块分配或释放内存的方式有多种,优选的另一种方式 是以监测到内核的应用程序负载达到触发门限为触发条件。  The method for implementing the multi-core operating system provided by the third embodiment of the present invention has various methods for triggering the allocation or releasing of memory for the characteristic function module based on the foregoing method embodiments, and another preferred method is to monitor the kernel. The application load reaches the trigger threshold as the trigger condition.

具体地, 当统计服务程序监测到应用程序 a所在的内核 K1的负载超过处理 器利用率的阔值 T1 , 即达到过载的触发门限时,就会触发为特性功能模块分配 内存的操作。 首先, 根据应用程序 a的特性确定能够支持应用程序 a的特性功能 模块的种类, 然后在内核功能注册表中, 查询还没有为该种类的特性功能模块 分配内存的内核, 在此基础上,选取内核的应用程序负载不超过处理器利用率 的阔值 T2的内核作为待加载应用程序 a的内核 K2。 其中, K1标识了统计服务程 序检测到内核过载时, 应用程序 a所在的内核的集合, K2标识了为实现负载均 衡, 而选取的将要加载应用程序 a的内核的集合; 所述阔值 T1例如是处理器利 用率为 90%, 所述阔值 T1例如是处理器利用率为 10%, Tl、 Τ2可以使用系统默 认值, 或者由用户按需设置。 Specifically, when the statistics service program detects that the load of the kernel K1 where the application a is located exceeds the threshold T1 of the processor utilization, that is, the trigger threshold of the overload is reached, an operation of allocating memory for the characteristic function module is triggered. First, according to the characteristics of the application a, the type of the characteristic function module capable of supporting the application a is determined, and then in the kernel function registry, the kernel that has not allocated memory for the characteristic function module of the kind is not queried, and on this basis, select The kernel application load does not exceed the processor utilization threshold T2 kernel as the kernel K2 of the application a to be loaded. Among them, K1 identifies the statistical service program When the kernel is overloaded, the set of kernels where the application a is located, K2 identifies the set of kernels to be loaded for application a to implement load balancing; the threshold T1 is, for example, the processor utilization rate is 90. %, the threshold T1 is, for example, the processor utilization rate is 10%, Tl, Τ2 can use the system default value, or can be set by the user as needed.

在统计服务程序选取了加载应用程序 a的内核 K2后, 为选取的该些内核中 支持应用程序 a的特性功能模块分配内存,从而使该些内核具备加载应用程序 a 的能力; 统计服务程序在内核 K2上加载应用程序 a; 统计服务程序根据内核负 载信息、及相关特性功能模块的内存分配信息的变动情况, 更新内核功能注册 表。  After the statistical service program selects the kernel K2 that loads the application a, allocates memory for the selected feature modules of the kernel supporting the application a, so that the kernels have the ability to load the application a; the statistical service program is The application program a is loaded on the kernel K2; the statistics service program updates the kernel function registry according to the kernel load information and the change of the memory allocation information of the related characteristic function modules.

本发明实施例提供的多内核操作系统实现方法,通过当统计服务程序检测 到某个应用程序所在的内核的应用程序负载达到过载的触发门限时,触发为特 性功能模块分配内存的操作, 基于该应用程序的特性, 选取负载较轻的内核, 为该些内核中相应的特性功能模块分配用于运行该应用程序的内存,以使该些 内核具备加载该应用程序的能力, 实现了基于应用程序的特性, 动态调整系统 中内核的负载情况, 实现负载均衡,从而提高了多内核操作系统的系统管理效 率和资源使用效率。  The multi-core operating system implementation method provided by the embodiment of the present invention triggers an operation of allocating memory for the characteristic function module when the statistical service program detects that the application load of the kernel where the application is located reaches the trigger threshold of the overload function, The characteristics of the application, select the lighter-loaded kernel, allocate the memory for running the application for the corresponding feature function modules in the kernel, so that the cores have the ability to load the application, and realize the application-based The characteristics of the kernel dynamically adjust the load of the system to achieve load balancing, thereby improving the system management efficiency and resource utilization efficiency of the multi-core operating system.

在上述方法实施例的基础上,优选的一种实现情况为: 当统计服务程序检 测到内核 K1的负载降到阔值 T3以下, 即达到恢复到正常水平的触发门限时, 触发为特性功能模块释放内存的操作。  On the basis of the foregoing method embodiments, a preferred implementation is as follows: When the statistical service program detects that the load of the kernel K1 falls below the threshold T3, that is, when the trigger threshold is restored to the normal level, the trigger is a characteristic function module. The operation of releasing the memory.

具体地, 当统计服务程序检测到内核 K1的负载降到阔值 T3以下, 即达到 恢复到正常水平的触发门限时: 首先, 根据应用程序 a的特性确定能够支持应 用程序 a的特性功能模块的种类, 然后在内核功能注册表中, 选取在内核 K1过 载时为了实现负载均衡而成功加载了应用程序 a的内核 K2; 在内核 Κ2上, 卸载 应用程序 a,并将上述为内核 K2中支持应用程序 a的特性功能模块分配的内存释 放; 统计服务程序根据内核负载信息、及相关特性功能模块的内存分配信息的 变动情况, 更新内核功能注册表。 Specifically, when the statistic service program detects that the load of the kernel K1 falls below the threshold T3, that is, when the trigger threshold is restored to the normal level: First, the characteristic function module capable of supporting the application a is determined according to the characteristics of the application a. Kind, then in the kernel function registry, select in the kernel K1 At the time of loading, the kernel K2 of the application a is successfully loaded for load balancing; on the kernel Κ2, the application a is uninstalled, and the memory allocated for the characteristic function module supporting the application a in the kernel K2 is released; the statistical service program The kernel function registry is updated based on changes in kernel load information and memory allocation information of related feature modules.

可选地, 所述在内核功能注册表中, 选取在内核 K1过载时为了实现负载 均衡而成功加载了应用程序 a的内核 K2 , 具体可以为: 在内核功能注册表中, 首先查找不只加载了应用程序 a的内核; 然后查找只加载了应用程序 a的内核。  Optionally, in the kernel function registry, the kernel K2 that successfully loads the application a in order to achieve load balancing when the kernel K1 is overloaded may be selected as follows: In the kernel function registry, the first lookup is not only loaded. The kernel of application a; then find the kernel that only loaded application a.

本发明实施例提供的多内核操作系统实现方法,通过当统计服务程序检测 到某个应用程序所在的内核的应用程序负载恢复到正常水平时,触发为特性功 能模块释放内存的操作, 将在选取的相关内核上卸载应用程序, 并且释放相关 内核中支持该应用程序的特性功能模块的内存, 实现了基于应用程序的特性, 动态调整系统中内核的负载情况, 实现负载均衡,从而提高了多内核操作系统 的系统管理效率和资源使用效率。  The multi-core operating system implementation method provided by the embodiment of the present invention, when the statistical service program detects that the application load of the kernel where an application is located returns to a normal level, triggering the operation of releasing the memory for the characteristic function module, and selecting Unloading the application on the relevant kernel, and releasing the memory of the feature function module supporting the application in the relevant kernel, realizing the application-based characteristics, dynamically adjusting the load of the kernel in the system, realizing load balancing, thereby improving the multi-core System management efficiency and resource usage efficiency of the operating system.

实施例四  Embodiment 4

图 2为本发明实施例四提供的多内核操作系统实现装置的结构示意图。 如 图 2所示, 本实施例的多内核操作系统实现装置 200可以包括: 基础内存分配模 块 201、 特性内存分配模块 202和释放模块 203 , 其中:  FIG. 2 is a schematic structural diagram of a device for implementing a multi-core operating system according to Embodiment 4 of the present invention. As shown in FIG. 2, the multi-core operating system implementation apparatus 200 of this embodiment may include: a basic memory allocation module 201, a characteristic memory allocation module 202, and a release module 203, where:

基础内存分配模块 201 , 用于为多内核操作系统的各内核的基础功能模块 分配内存;  The basic memory allocation module 201 is configured to allocate memory for the basic functional modules of each core of the multi-core operating system;

特性内存分配模块 202 , 用于为从所述各内核中选取的第一内核中支持第 一应用程序的特性功能模块分配内存;  The feature memory allocation module 202 is configured to allocate memory for the feature function module supporting the first application in the first kernel selected from the kernels;

释放模块 203 , 用于将所述为所述第一内核中支持第一应用程序的特性功 能模块分配的内存释放。 a release module 203, configured to use the feature that supports the first application in the first kernel The memory allocated by the module can be released.

本发明实施例提供的多内核操作系统实现装置, 可以用于执行图 1所示方 法实施例的技术方案, 执行该方法的具体过程可参见图 1所示方法实施例的相 关描述, 此处不再赘述。  The apparatus for implementing the multi-core operating system provided by the embodiment of the present invention may be used to perform the technical solution of the method embodiment shown in FIG. 1. For the specific process of executing the method, refer to the related description of the method embodiment shown in FIG. Let me repeat.

本发明实施例提供的多内核操作系统实现装置,通过将多内核操作系统的 内核的功能划分为用于提供基本的内核功能的基础功能模块和用于支持应用 程序的特性功能模块,为各内核中符合要求的内核的特性功能模块分配或释放 用于运行对应的应用程序的内存,以使该内核具备加载或卸载该应用程序的能 力, 实现了基于应用程序的特性,按需为内核的相应功能分配用于运行相应的 应用程序的内存, 从而提高了多内核操作系统的系统管理效率和资源使用效 率。  The multi-core operating system implementation apparatus provided by the embodiment of the present invention divides the functions of the kernel of the multi-core operating system into basic functional modules for providing basic kernel functions and characteristic functional modules for supporting the application, for each core The feature function module of the qualifying kernel allocates or releases the memory used to run the corresponding application, so that the kernel has the ability to load or unload the application, implements application-based features, and corresponds to the kernel on demand. The function allocation is used to run the memory of the corresponding application, thereby improving the system management efficiency and resource usage efficiency of the multi-core operating system.

实施例五  Embodiment 5

图 3为本发明实施例五提供的多内核操作系统实现装置的结构示意图。 如 图 3所示, 本实施例提供的多内核操作系统实现装置 300是在图 2所示装置结构 的基础上, 进一步地, 特性内存分配模块 202可以包括: 接收单元 301、 选取单 元 302和内存分配单元 303 , 其中:  FIG. 3 is a schematic structural diagram of a device for implementing a multi-core operating system according to Embodiment 5 of the present invention. As shown in FIG. 3, the multi-core operating system implementation apparatus 300 provided in this embodiment is based on the apparatus structure shown in FIG. 2. Further, the characteristic memory allocation module 202 may include: a receiving unit 301, a selecting unit 302, and a memory. Distribution unit 303, wherein:

接收单元 301 , 用于接收所述第一应用程序的加载请求;  The receiving unit 301 is configured to receive a loading request of the first application.

选取单元 302, 用于根据所述第一应用程序的特性、 以及内核功能注册表 中记录的各所述内核的应用程序负载信息 ,从所述各内核中选取待加载所述第 一应用程序的所述第一内核;  The selecting unit 302 is configured to select, from the kernels, the first application to be loaded, according to characteristics of the first application, and application load information of each kernel recorded in a kernel function registry. The first core;

内存分配单元 303, 用于为所述第一内核中支持第一应用程序的特性功能 模块分配内存。 本发明实施例提供的多内核操作系统实现装置,可以用于执行本发明实施 例所提供的多内核操作系统实现方法实施例的技术方案,执行该方法的具体过 程可参见本发明实施例所提供的方法实施例的相关描述, 此处不再赘述。 The memory allocation unit 303 is configured to allocate memory for the feature function module that supports the first application in the first kernel. The apparatus for implementing the multi-core operating system provided by the embodiment of the present invention may be used to perform the technical solution of the embodiment of the method for implementing the multi-core operating system provided by the embodiment of the present invention. For the specific process of performing the method, refer to the embodiment of the present invention. The related description of the method embodiment is not described here.

本发明实施例提供的多内核操作系统实现装置,通过将多内核操作系统的 内核的功能划分为用于提供基本的内核功能的基础功能模块和用于支持应用 程序的特性功能模块, 并且建立内核功能注册表, 当接收到应用程序的加载请 求时,根据应用程序的特性以及查询内核功能注册表,在各内核中选择符合要 求的内核,并为符合要求的内核的特性功能模块分配或释放用于运行对应的应 用程序的内存, 以使该内核具备加载或卸载该应用程序的能力, 实现了基于应 用程序的特性, 按需为内核的相应功能分配用于运行相应的应用程序的内存, 从而提高了多内核操作系统的系统管理效率和资源使用效率。  The multi-core operating system implementation apparatus provided by the embodiment of the present invention divides the functions of the kernel of the multi-core operating system into basic functional modules for providing basic kernel functions and characteristic functional modules for supporting the application, and establishes a kernel. Function registry, when receiving the application's load request, according to the characteristics of the application and querying the kernel function registry, select the required kernel in each kernel, and allocate or release the feature module for the required kernel. Running the memory of the corresponding application, so that the kernel has the ability to load or unload the application, implements the application-based feature, and allocates the memory for running the corresponding application to the corresponding function of the kernel as needed, thereby Improve system management efficiency and resource usage efficiency of multi-core operating systems.

实施例六  Embodiment 6

图 4为本发明实施例六提供的多内核操作系统实现装置的结构示意图。 如 图 4所示, 本实施例提供的多内核操作系统实现装置 400是在图 3所示装置结构 的基础上, 进一步地, 还可以包括: 更新模块 401 , 该更新模块 401用于在为从 所述各内核中选取的第一内核中支持第一应用程序的特性功能模块分配内存 之后 ,以及在将所述为所述第一内核中支持第一应用程序的特性功能模块分配 的内存释放之后,在所述内核功能注册表中更新所述第一内核的应用程序负载 信息、 及其特性功能模块的内存分配信息  FIG. 4 is a schematic structural diagram of a device for implementing a multi-core operating system according to Embodiment 6 of the present invention. As shown in FIG. 4, the multi-core operating system implementation apparatus 400 provided in this embodiment is based on the apparatus structure shown in FIG. 3, and further includes: an update module 401, where the update module 401 is used to After the memory of the first function selected by each of the cores supporting the first application is allocated, and after releasing the memory allocated for the characteristic function module supporting the first application in the first kernel Updating the application load information of the first kernel and the memory allocation information of the characteristic function module in the kernel function registry

本发明实施例提供的多内核操作系统实现装置,可以用于执行本发明实施 例所提供的多内核操作系统实现方法实施例的技术方案,执行该方法的具体过 程可参见本发明实施例所提供的方法实施例的相关描述, 此处不再赘述。 本发明实施例提供的多内核操作系统实现装置,通过将多内核操作系统的 内核的功能划分为用于提供基本的内核功能的基础功能模块和用于支持应用 程序的特性功能模块, 并且建立内核功能注册表, 在为特性功能模块分配或释 放内存之后, 更新内核功能注册表, 以使内核功能注册表记录的各内核的应用 程序负载信息、及其各所述特性功能模块的内存分配信息能准确地反应系统资 源的使用情况, 从而提高了多内核操作系统的系统管理效率和资源使用效率。 The apparatus for implementing the multi-core operating system provided by the embodiment of the present invention may be used to perform the technical solution of the embodiment of the method for implementing the multi-core operating system provided by the embodiment of the present invention. For the specific process of performing the method, refer to the embodiment of the present invention. The related description of the method embodiment is not described here. The multi-core operating system implementation apparatus provided by the embodiment of the present invention divides the functions of the kernel of the multi-core operating system into basic functional modules for providing basic kernel functions and characteristic functional modules for supporting the application, and establishes a kernel. The function registry, after allocating or releasing memory for the feature function module, updating the kernel function registry, so that the application load information of each kernel recorded by the kernel function registry and the memory allocation information of each of the characteristic function modules can Accurately reflect the use of system resources, thereby improving the system management efficiency and resource usage efficiency of multi-core operating systems.

实施例七  Example 7

图 5为本发明实施例七提供的多内核操作系统实现系统的结构示意图。 如 图 5所示, 本实施例所提供的多内核操作系统实现系统 500包括, 多内核操作系 统实现装置 502、 至少两个处理器 504 , 每个处理器 504的核心上部署有多内核 操作系统的内核 503 , 其中, 处理器 504可以为不同种类或相同种类的处理器, 应用程序 501可以为系统处理的任意应用程序; 多内核操作系统实现装置 502 可以釆用本发明图 2至图 4中任意所示装置实施例的结构, 其对应地, 可以执行 本发明实施例所提供的多内核操作系统实现方法实施例的技术方案,其原理和 技术效果类似, 此处不再赘述。  FIG. 5 is a schematic structural diagram of a multi-core operating system implementation system according to Embodiment 7 of the present invention. As shown in FIG. 5, the multi-core operating system implementation system 500 provided in this embodiment includes a multi-core operating system implementation device 502, at least two processors 504, and a multi-core operating system deployed on a core of each processor 504. Kernel 503, wherein the processor 504 can be a different kind or the same kind of processor, the application 501 can be any application processed by the system; the multi-core operating system implementing device 502 can use the present invention in FIG. 2 to FIG. The structure of any of the illustrated device embodiments is correspondingly configured to implement the technical solution of the embodiment of the multi-core operating system implementation method provided by the embodiment of the present invention. The principle and technical effects are similar, and are not described herein again.

本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤 可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取 存储介质中。 该程序在执行时, 执行包括上述各方法实施例的步骤; 而前述的 存储介质包括: ROM, RAM,磁碟或者光盘等各种可以存储程序代码的介质。  One of ordinary skill in the art will appreciate that all or a portion of the steps to implement the various method embodiments described above can be accomplished by hardware associated with the program instructions. The aforementioned program can be stored in a computer readable storage medium. The program, when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非 对其限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并不 使相应技术方案的本质脱离本发明各实施例技术方案的范围。 It should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art The technical solutions described in the foregoing embodiments can still be modified. Equivalent to some or all of the technical features, and the modifications or substitutions do not depart from the scope of the technical solutions of the embodiments of the present invention.

Claims

权 利 要 求 Rights request 1、 一种多内核操作系统的实现方法, 其特征在于, 包括: 1. An implementation method of a multi-core operating system, which is characterized by including: 为多内核操作系统的各内核的基础功能模块分配内存; Allocate memory for the basic functional modules of each core of the multi-core operating system; 为从所述各内核中选取的第一内核中支持第一应用程序的特性功能模块 分配内存; Allocate memory for a feature function module that supports the first application program in the first core selected from the cores; 将所述为所述第一内核中支持第一应用程序的特性功能模块分配的内存 释放。 Release the memory allocated for the feature function module supporting the first application program in the first kernel. 2、 根据权利要求 1所述的方法, 其特征在于, 所述为从所述各内核中选取 的第一内核中支持第一应用程序的特性功能模块分配内存包括: 2. The method according to claim 1, wherein allocating memory for the feature function module supporting the first application program in the first core selected from the cores includes: 接收所述第一应用程序的加载请求; Receive the loading request of the first application program; 根据所述第一应用程序的特性、以及内核功能注册表中记录的各所述内核 的应用程序负载信息,从所述各内核中选取待加载所述第一应用程序的所述第 一内核; Select the first core to be loaded with the first application program from the cores according to the characteristics of the first application program and the application load information of each core recorded in the kernel function registry; 为所述第一内核中支持第一应用程序的特性功能模块分配内存。 Allocate memory to a feature function module in the first kernel that supports the first application program. 3、 根据权利要求 2所述的方法, 其特征在于, 在所述为从所述各内核中选 取的第一内核中支持第一应用程序的特性功能模块分配内存之后,以及在将所 述为所述第一内核中支持第一应用程序的特性功能模块分配的内存释放之后, 还包括: 3. The method according to claim 2, characterized in that, after allocating memory for the feature function module supporting the first application program in the first core selected from the cores, and after allocating the memory to the feature function module that supports the first application program, After the memory allocated by the feature function module supporting the first application program in the first kernel is released, it also includes: 在所述内核功能注册表中更新所述第一内核的应用程序负载信息、及其各 所述特性功能模块的内存分配信息。 The application load information of the first kernel and the memory allocation information of each of the characteristic function modules are updated in the kernel function registry. 4、 根据权利要求 1-3任一所述的方法, 其特征在于, 所述特性功能模块的 种类为至少两个,按照所述应用程序对所述多内核操作系统的系统资源的需求 特性进行分类。 4. The method according to any one of claims 1 to 3, characterized in that, there are at least two types of characteristic function modules, and the characteristics of the system resources of the multi-core operating system are determined according to the requirements of the application program. Classification. 5、 根据权利要求 4所述的方法, 其特征在于, 所述特性功能模块至少包括 输入输出密集特性功能模块、 线程密集特性功能模块和网络密集特性功能模 块。 5. The method according to claim 4, wherein the characteristic function module at least includes an input-output intensive characteristic function module, a thread-intensive characteristic function module and a network-intensive characteristic function module. 6、 一种多内核操作系统的实现装置, 其特征在于, 包括: 6. A device for implementing a multi-core operating system, which is characterized by including: 基础内存分配模块,用于为多内核操作系统的各内核的基础功能模块分配 内存; 特性内存分配模块,用于为从所述各内核中选取的第一内核中支持第一应 用程序的特性功能模块分配内存; The basic memory allocation module is used to allocate memory for the basic functional modules of each core of the multi-core operating system; A feature memory allocation module, configured to allocate memory to a feature function module that supports the first application program in the first core selected from the cores; 释放模块,用于将所述为所述第一内核中支持第一应用程序的特性功能模 块分配的内存释放。 A release module, configured to release the memory allocated for the feature function module supporting the first application program in the first kernel. 7、 根据权利要求 6所述的装置, 其特征在于, 特性内存分配模块包括: 接收单元, 用于接收所述第一应用程序的加载请求; 7. The device according to claim 6, wherein the characteristic memory allocation module includes: a receiving unit, configured to receive the loading request of the first application program; 选取单元, 用于根据所述第一应用程序的特性、 以及内核功能注册表中记 录的各所述内核的应用程序负载信息 ,从所述各内核中选取待加载所述第一应 用程序的所述第一内核; A selection unit configured to select all of the first application programs to be loaded from each of the cores based on the characteristics of the first application program and the application load information of each of the cores recorded in the kernel function registry. Describe the first core; 内存分配单元,用于为所述第一内核中支持第一应用程序的特性功能模块 分配内存。 A memory allocation unit, configured to allocate memory to a feature function module in the first kernel that supports the first application program. 8、 根据权利要求 7所述的装置, 其特征在于, 还包括: 8. The device according to claim 7, further comprising: 更新模块 ,用于在为从所述各内核中选取的第一内核中支持第一应用程序 的特性功能模块分配内存之后 ,以及在将所述为所述第一内核中支持第一应用 程序的特性功能模块分配的内存释放之后,在所述内核功能注册表中更新所述 第一内核的应用程序负载信息、 及其特性功能模块的内存分配信息。 An update module, configured to allocate memory for the feature function module that supports the first application program in the first core selected from the cores, and after allocating memory to the feature function module that supports the first application program in the first core. After the memory allocated by the characteristic function module is released, the application load information of the first kernel and the memory allocation information of its characteristic function module are updated in the kernel function registry. 9、 根据权利要求 6-8任一所述的装置, 其特征在于, 所述特性功能模块的 种类为至少两个,按照所述应用程序对所述多内核操作系统的系统资源的需求 特性进行分类。 9. The device according to any one of claims 6 to 8, characterized in that there are at least two types of characteristic function modules, which are configured according to the characteristics of the application program's demand for system resources of the multi-core operating system. Classification. 10、 根据权利要求 9所述的装置, 其特征在于, 所述特性功能模块至少包 括输入输出密集特性功能模块、线程密集特性功能模块和网络密集特性功能模 块。 10. The device according to claim 9, characterized in that the characteristic function module at least includes an input-output intensive characteristic function module, a thread-intensive characteristic function module and a network-intensive characteristic function module. 11、 一种多内核操作系统实现系统, 其特征在于, 包括权利要求 6-10任 一所述的多内核操作系统的实现装置,还包括至少两个处理器,每个处理器的 核心上部署有多内核操作系统的内核。 11. A multi-core operating system implementation system, characterized in that it includes the multi-core operating system implementation device described in any one of claims 6 to 10, and also includes at least two processors, each of which is deployed on the core of the processor. The kernel of a multi-core operating system.
PCT/CN2014/070952 2013-03-27 2014-01-21 Method, apparatus and system for implementing multicore operating system Ceased WO2014154045A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310101210.5 2013-03-27
CN201310101210.5A CN104077266B (en) 2013-03-27 2013-03-27 Many kernel operating system implementation methods and realize apparatus and system

Publications (1)

Publication Number Publication Date
WO2014154045A1 true WO2014154045A1 (en) 2014-10-02

Family

ID=51598528

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/070952 Ceased WO2014154045A1 (en) 2013-03-27 2014-01-21 Method, apparatus and system for implementing multicore operating system

Country Status (2)

Country Link
CN (1) CN104077266B (en)
WO (1) WO2014154045A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104503831B (en) * 2014-12-22 2017-10-13 北京奇虎科技有限公司 Equipment optimization method and device
CN105786612B (en) * 2014-12-23 2019-05-24 杭州华为数字技术有限公司 A kind of method for managing resource and device
CN104795072A (en) * 2015-03-25 2015-07-22 无锡天脉聚源传媒科技有限公司 Method and device for coding audio data
CN109426565B (en) * 2017-09-05 2024-01-02 中兴通讯股份有限公司 A memory allocation method, device and terminal
CN111095199B (en) * 2017-10-09 2021-10-01 华为技术有限公司 A method for loading an application and a terminal device
CN108132841A (en) * 2017-12-11 2018-06-08 杭州迪普科技股份有限公司 A kind of memory allocation method and device of the equipment based on linux system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1937591A (en) * 2006-11-02 2007-03-28 杭州华为三康技术有限公司 Multi-core processor for realizing adaptive dispatching and multi-core processing method
CN101276289A (en) * 2008-05-09 2008-10-01 中兴通讯股份有限公司 The method of communication between user and multi-core in Linux system
CN101799772A (en) * 2010-02-26 2010-08-11 上海华为技术有限公司 Kernel dispatching method, kernel backup method and multi-core processor
CN101859279A (en) * 2010-05-21 2010-10-13 北京星网锐捷网络技术有限公司 Memory allocation and release method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6742145B2 (en) * 2001-03-01 2004-05-25 International Business Machines Corporation Method of de-allocating multiple processor cores for an L2 correctable error
CN100487660C (en) * 2007-05-28 2009-05-13 中兴通讯股份有限公司 A dynamic memory management system and method for a multi-threaded processor
US8537832B2 (en) * 2010-03-12 2013-09-17 Lsi Corporation Exception detection and thread rescheduling in a multi-core, multi-thread network processor
US8463887B2 (en) * 2009-12-23 2013-06-11 Citrix Systems, Inc. Systems and methods for server surge protection in a multi-core system
CN102508717B (en) * 2011-11-17 2013-07-10 大唐移动通信设备有限公司 Memory scheduling method and memory scheduling device for multi-core processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1937591A (en) * 2006-11-02 2007-03-28 杭州华为三康技术有限公司 Multi-core processor for realizing adaptive dispatching and multi-core processing method
CN101276289A (en) * 2008-05-09 2008-10-01 中兴通讯股份有限公司 The method of communication between user and multi-core in Linux system
CN101799772A (en) * 2010-02-26 2010-08-11 上海华为技术有限公司 Kernel dispatching method, kernel backup method and multi-core processor
CN101859279A (en) * 2010-05-21 2010-10-13 北京星网锐捷网络技术有限公司 Memory allocation and release method and device

Also Published As

Publication number Publication date
CN104077266B (en) 2017-07-07
CN104077266A (en) 2014-10-01

Similar Documents

Publication Publication Date Title
CN109218355B (en) Load balancing engine, client, distributed computing system and load balancing method
US8752055B2 (en) Method of managing resources within a set of processes
CN104780146B (en) Method for managing resource and device
US20170031622A1 (en) Methods for allocating storage cluster hardware resources and devices thereof
CN109564528B (en) System and method for computing resource allocation in distributed computing
US10042678B2 (en) Lock management method and system, method and apparatus for configuring lock management system
US10802753B2 (en) Distributed compute array in a storage system
WO2014154045A1 (en) Method, apparatus and system for implementing multicore operating system
CN109379448B (en) File distributed deployment method and device, electronic equipment and storage medium
CN110166507B (en) Multi-resource scheduling method and device
US20130232315A1 (en) Scalable, customizable, and load-balancing physical memory management scheme
WO2023020010A1 (en) Process running method, and related device
JP2015515076A (en) System and method for partitioning a one-way linked list for allocation of memory elements
WO2018107945A1 (en) Method and device for implementing allocation of hardware resources, and storage medium
US8892740B2 (en) Dynamic application provisioning in cloud computing environments
CN112217654B (en) Service resource license management method and related equipment
CN111240824A (en) CPU resource scheduling method and electronic equipment
US9384050B2 (en) Scheduling method and scheduling system for multi-core processor system
CN111352710B (en) Process management method and device, computing device, storage medium
US11768704B2 (en) Increase assignment effectiveness of kubernetes pods by reducing repetitive pod mis-scheduling
US20250060889A1 (en) Sharing node storage resources with the entire cluster
CN113703906B (en) A data processing method, device and system
US20240385759A1 (en) Federated management of data operators on near-memory compute nodes
US11868805B2 (en) Scheduling workloads on partitioned resources of a host system in a container-orchestration system
WO2024041140A1 (en) Data processing method, accelerator, and computing device

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: 14773321

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14773321

Country of ref document: EP

Kind code of ref document: A1