WO2019001276A1 - 一种微内核调度的方法和装置 - Google Patents

一种微内核调度的方法和装置 Download PDF

Info

Publication number
WO2019001276A1
WO2019001276A1 PCT/CN2018/091040 CN2018091040W WO2019001276A1 WO 2019001276 A1 WO2019001276 A1 WO 2019001276A1 CN 2018091040 W CN2018091040 W CN 2018091040W WO 2019001276 A1 WO2019001276 A1 WO 2019001276A1
Authority
WO
WIPO (PCT)
Prior art keywords
microkernel
event message
thread
software platform
proxy
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/CN2018/091040
Other languages
English (en)
French (fr)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2019001276A1 publication Critical patent/WO2019001276A1/zh
Priority to US16/725,880 priority Critical patent/US11954520B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30098Register arrangements
    • 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/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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
    • 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/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • 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/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a method for micro-kernel scheduling and a device for micro-kernel scheduling.
  • the MCU Micro Controller Unit
  • the development and debugging work for the MCU software becomes more and more important.
  • the traditional way of logging (log) is no longer applicable to the current IoT development; on the other hand, due to the limitations of MCU device resources, some complicated debugging tools cannot be run directly on the MCU. . Therefore, by running the IoT microkernel on a Linux system, it is a wise choice to use the development tools of the multiplexed Linux system for software development and debugging.
  • each microkernel corresponds to a Linux thread, and the scheduling of the microkernel is mixed with the thread scheduling of the Linux, and the switching between the microkernels is controlled by the Linux system.
  • the switching cost is high and the real-time performance is poor.
  • embodiments of the present application have been made in order to provide a microkernel scheduling method and a corresponding microkernel scheduling apparatus that overcome the above problems or at least partially solve the above problems.
  • the present application discloses a method for micro-kernel scheduling, which is applied to a software platform, and the method includes:
  • the software platform runs with a main thread and/or a kernel-based virtual machine KVM running in the main thread and/or the KVM.
  • each microkernel has a corresponding microkernel control unit, and each microkernel control unit has a corresponding control value, and the step of switching the current microkernel to the target microkernel includes:
  • the scheduling instructions include instructions for a setjmp function and a longjmp function.
  • the step of receiving a scheduling instruction for the current microkernel includes:
  • the setjmp function and the longjmp function are called.
  • it also includes:
  • it also includes:
  • the software platform further runs a main thread, and a proxy thread or an agent process, and the step of receiving the event message sent by the software platform includes:
  • the software platform sends an event message to the agent thread or the agent process
  • the proxy thread or proxy process forwards the event message to the main thread
  • the main thread converts the event message into an interrupt event
  • the step of the software platform sending an event message to the proxy thread or the proxy process includes:
  • the software platform receives information input by the external device
  • the software platform converts the information into an event message and sends it to a proxy thread or agent process.
  • it also includes:
  • the step of sending a microkernel event message to the software platform includes:
  • the proxy thread or proxy process forwards the microkernel event message to the software platform.
  • the software platform is a Linux platform.
  • the microkernel control unit is a CPU register, and the control value is a register value.
  • the proxy thread or proxy process has a corresponding entity, and the entity includes a network card or a virtual network card.
  • the present application discloses a device for micro-kernel scheduling, which is applied to a software platform, and the device includes:
  • a receiving module configured to receive a scheduling instruction for a current microkernel
  • a switching module for switching the current microkernel to the target microkernel.
  • the software platform runs with a main thread and/or a kernel-based virtual machine KVM running in the main thread and/or the KVM.
  • each microkernel has a corresponding microkernel control unit, and each microkernel control unit has a corresponding control value, and the switching module includes:
  • a replacement submodule configured to replace, by using a first control value corresponding to the target microkernel, a second control value corresponding to the current microkernel.
  • the scheduling instructions include instructions for a setjmp function and a longjmp function.
  • the receiving module includes:
  • a receiving submodule configured to receive a scheduling instruction input by an external device
  • the submodule is called, and the setjmp function and the longjmp function are called according to the scheduling instruction.
  • the device further includes:
  • the device further includes:
  • the event message receiving module is configured to receive an event message sent by the software platform.
  • the software platform is further configured to run a main process, and a proxy thread or an agent process, where the event message receiving module includes:
  • An event message forwarding submodule configured to forward the event message to the main thread by the proxy thread or the proxy process
  • a conversion submodule for the main thread to convert the event message into an interrupt event
  • the interrupt event receiving submodule is configured to receive the interrupt event sent by the main thread.
  • the event message sending submodule includes:
  • a receiving unit configured to receive, by the software platform, information input by the external device
  • the device further includes:
  • a microkernel event message sending module is configured to send a microkernel event message to the software platform.
  • microkernel event message sending module includes:
  • microkernel event message sending submodule for sending a microkernel event message to a proxy thread or an agent process
  • the software platform is a Linux platform.
  • the microkernel control unit is a CPU register, and the control value is a register value.
  • the proxy thread or proxy process has a corresponding entity, and the entity includes a network card or a virtual network card.
  • the current microkernel is switched to the target microkernel by receiving the scheduling instruction for the current microkernel, so that the target microkernel simulation software can be used to run.
  • the micro-kernel is directly switched by the scheduling instruction, and the thread is not required to complete the foregoing process, which solves the micro-core switching caused by the one-to-one correspondence between the micro-kernel and the software platform thread in the prior art. Higher cost and less real-time problems.
  • the embodiment of the present application can directly use the setjmp/longjmp function to implement scheduling of the microkernel, and ensure that the switching process is independent of the Linux thread.
  • the microkernel can autonomously complete the stack initialization and memory allocation process in the kernel processing phase, so that for example, valgrid (a software for memory debugging, memory leak detection, and performance analysis) can be used.
  • valgrid a software for memory debugging, memory leak detection, and performance analysis
  • Memory tools such as development tools detect whether memory leaks occur, locate the location of the fault in time, and improve the efficiency of software development and debugging.
  • the embodiment of the present application can also provide a newlib repository to replace the glibc repository of the Linux platform.
  • the software can directly call each interface in the newlib repository, further cutting off the microkernel and The link between Linux platform threads.
  • the embodiment of the present application runs the micro-kernel on the software platform, so that when the simulation software is running, the MCU device resources are not limited, and the simulation operation of the software can be completed under the existing resource conditions. The efficiency of the software's simulation run.
  • the embodiment of the present application can also use a proxy thread or an agent process to connect to a Linux event message to implement simulation of a network card or an external device.
  • FIG. 1 is a flow chart showing the steps of a first embodiment of a microkernel scheduling method according to the present application
  • FIG. 2 is a flow chart of steps of a second embodiment of a microkernel scheduling method according to the present application
  • FIG. 3 is a schematic diagram of microkernel scheduling of the present application.
  • FIG. 4 is a structural block diagram of an apparatus embodiment of a microkernel scheduling according to the present application.
  • FIG. 1 a flow chart of a first embodiment of a micro-kernel scheduling method of the present application is shown. The method is applied to a software platform, and specifically includes the following steps:
  • Step 101 Receive a scheduling instruction for a current microkernel
  • the software platform may be a Linux platform.
  • Linux is a free-to-use and freely distributed Unix-like operating system. It is a multi-user, multi-tasking, multi-threaded and multi-CPU based operating system based on Posix and Unix. It runs major Unix tools, applications and network protocols and supports both 32-bit and 64-bit hardware. Linux inherits the design idea of Unix with network as the core. It is a stable multi-user network operating system that can be installed in various computer hardware devices. Therefore, the Linux platform can refer to a computer device with a Linux operating system installed. For example, mobile phones, tablets, routers, video game consoles, desktop computers, mainframes, and supercomputers, to name a few.
  • this embodiment introduces a Linux platform as an example.
  • a host thread and/or a KVM are run in the Linux platform, and the microkernel can run in the main thread and/or the KVM.
  • KVM Kernel-based Virtual Machine
  • the Micro Kernel is a streamlined version of the kernel that provides the core functionality of the operating system. It is usually designed to increase portability in a small memory space, providing a modular design that allows users to install different interfaces, such as DOS. Workplace OS, Workplace Unix, etc.
  • the microkernel provides the necessary services for the operating system, including tasks, threads, IPC (Inter-Process Communication), and memory management.
  • the microkernel may be a kernel-reduced version of the RTOS operating system (Real Time Operating System).
  • the RTOS operating system means that when external events or data are generated, it can be accepted and processed at a fast enough speed. The result of the processing can control the production process or respond quickly to the processing system within a specified time. All available resources complete real-time tasks and control the operating system in which all real-time tasks run in unison. Being able to provide timely response and high reliability is a key feature of the RTOS operating system.
  • the corresponding scheduling instruction for the microkernel can be directly input into the microkernel through the external device, so that after the microkernel receives the scheduling instruction, the scheduling instruction can be executed to directly switch the microkernel. .
  • the scheduling instruction may include an instruction for the setjmp function and the longjmp function.
  • the user can input the scheduling instruction through an external device connected to the Linux platform, such as a keyboard, and call the setjmp function and the longjmp function according to the scheduling instruction, thereby implementing switching between the microkernels, and ensuring that the switching process is independent of the Linux thread.
  • Both setjmp and longjmp are computer statements, belonging to the C function library, which bear the role of non-local labels and goto. It should be noted that when setjmp is used in combination with longjmp, they must have a strict order of execution, that is, the setjmp function is called first, and then the longjmp function is called to restore to the previously saved "program execution point". Otherwise, if the longjmp function is executed before the setjmp call, it will cause the execution flow of the program to become unpredictable, which will easily cause the program to crash and exit. Second, longjmp must be within the scope of setjmp. Specifically, use setjmp to initialize a global label in a function, and then as long as the function has not returned, it can be jumped to the next statement of setjmp by longjmp call anywhere else.
  • step 102 the current microkernel is switched to the target microkernel.
  • each microkernel has a corresponding microkernel control unit, and each microkernel control unit has a respective control value.
  • the microkernel control unit may be a CPU register, and accordingly, the control value in the microkernel control unit may be a register value.
  • this embodiment introduces a micro-core control unit as a CPU register and a control value as a register value.
  • the CPU registers are part of the CPU and are a high-speed storage unit with limited storage capacity that can be used to temporarily store instructions, data, and addresses.
  • the switching between microkernels is the switching of the CPU registers corresponding to the microkernel.
  • the switch of the CPU register can be directly controlled by the setjmp function and the longjmp function, thereby bypassing the Linux thread to directly schedule the microkernel.
  • the first control value corresponding to the target microkernel may be first determined according to the scheduling instruction, and then the second control value corresponding to the current microkernel is replaced by the first control value corresponding to the target microkernel.
  • the target microkernel simulation software may also be used to run.
  • a microkernel is connected to a software stack, and each software in the software stack can run in a microkernel environment.
  • the target microkernel after switching to the target microkernel, can be used to simulate the operation of the corresponding software.
  • a newlib repository can be provided to replace the glibc repository of the Linux platform, so that the software can directly call each interface in the newlib repository during the running process.
  • Both the newlib repository and the glibc repository are one of the C standard libraries.
  • the C standard library is a set of C built-in functions, constants, and header files, such as ⁇ stdio.h>, ⁇ stdlib.h>, ⁇ math.h>.
  • the newlib repository and the glibc repository have corresponding binding relationships to the microkernel and Linux platform, respectively, that is, the newlib repository is applied to the microkernel, and the glibc repository is applied to the Linux platform.
  • the current microkernel is switched to the target microkernel by receiving the scheduling instruction for the current microkernel, so that the target microkernel simulation software can be used to run.
  • the micro-kernel is directly switched by the scheduling instruction, and the thread is not required to complete the foregoing process, which solves the micro-core switching caused by the one-to-one correspondence between the micro-kernel and the software platform thread in the prior art. Higher cost and less real-time problems.
  • the embodiment of the present application can directly use the setjmp/longjmp function to implement scheduling of the microkernel, and ensure that the switching process is independent of the Linux thread.
  • the microkernel can autonomously complete the stack initialization and memory allocation process in the kernel processing phase, so that for example, valgrid (a software for memory debugging, memory leak detection, and performance analysis) can be used.
  • valgrid a software for memory debugging, memory leak detection, and performance analysis
  • Memory tools such as development tools detect whether memory leaks occur, locate the location of the fault in time, and improve the efficiency of software development and debugging.
  • the embodiment of the present application can also provide a newlib repository to replace the glibc repository of the Linux platform.
  • the software can directly call each interface in the newlib repository, further cutting off the microkernel and The link between Linux platform threads.
  • FIG. 2 a flow chart of a second embodiment of a micro-kernel scheduling method of the present application is shown.
  • the method is applied to a software platform, and specifically includes the following steps:
  • Step 201 Receive a scheduling instruction for a current microkernel
  • this embodiment introduces a Linux platform as an example.
  • a host thread and/or a KVM are run in the Linux platform, and the microkernel can run in the main thread and/or the KVM.
  • the scheduling instruction for the current microkernel may include instructions for the setjmp function and the longjmp function. Both setjmp and longjmp are computer statements, belonging to the C function library, which bear the role of non-local labels and goto.
  • the Linux platform can be connected to an external device such as a keyboard or the like.
  • the user can input a scheduling instruction through an external device, and according to the scheduling instruction, call the setjmp function and the longjmp function.
  • setjmp when used in combination with longjmp, they must have a strict order of execution, that is, the setjmp function is called first, and then the longjmp function is called.
  • Step 202 Determine a first control value corresponding to the target microkernel
  • the switching between microkernels is the switching of the microkernel control unit corresponding to the microkernel.
  • the first control value corresponding to the target microkernel to be switched may be determined first, and the first control value is the control value corresponding to the microkernel control unit corresponding to the target microkernel.
  • Step 203 Replace, by using a first control value corresponding to the target microkernel, a second control value corresponding to the current microkernel;
  • the second control value corresponding to the current microkernel is the control value corresponding to the microkernel control unit corresponding to the current microkernel.
  • the second control value in the microkernel control unit may be modified to a first control value corresponding to the target microkernel, thereby completing switching between the microkernels.
  • this embodiment introduces a micro-core control unit as a CPU register and a control value as a register value.
  • the first register value corresponding to the target microkernel may be first determined, and then the second register value corresponding to the current microkernel is replaced by the first register value corresponding to the target microkernel.
  • the setjmp function and the longjmp function directly act on the switching of the CPU register corresponding to the microkernel, so that the switching between the microkernels is independent of the Linux thread, and no scheduling of the Linux thread is required, and the microkernel switching is reduced. Switching costs and improving real-time performance.
  • Step 204 Run with the target microkernel simulation software
  • the microkernel is connected with a software stack, and each software in the software stack can be run in a microkernel environment. Therefore, after switching to the target microkernel, the target microkernel can be used to simulate the operation of the corresponding software.
  • Step 205 Receive an event message sent by the software platform.
  • the microkernel runs independently on the Linux platform, at the same time, the microkernel can also communicate with the Linux platform. For example, receiving an event message sent by the Linux platform, that is, a Linux event message.
  • agent World can emulate external devices such as network cards, virtual network cards, or other external devices.
  • the software platform may send an event message to the proxy thread or the proxy process, and the proxy thread or the proxy process forwards the event message to the main thread, and then the main thread may convert the event message into an interrupt event, and the microkernel may receive the event message.
  • the above interrupt event sent by the main thread to learn about the software platform.
  • the main thread when the main thread converts the received station event message into an interrupt event, it can be implemented by a signal() function.
  • the prototype of the signal() function can be expressed as:
  • the signal() function sets the processing function of the signal according to the signal number specified by the parameter signum. When the specified signal arrives, it will jump to the function execution specified by the parameter handler.
  • a signal processing function of a signal is executed, if the process receives the signal again, the signal is automatically stored without interrupting the execution of the signal processing function until the signal processing function is executed and the corresponding processing function is recalled. However, if the process receives other types of signals while the signal processing function is executing, the execution of the function is interrupted, resulting in an interrupt event.
  • the function of the analog peripheral can also be implemented, that is, the Linux event message can be generated due to information input by the external device.
  • the Linux platform can receive the information input by the external device, and then the Linux platform can convert the information into a Linux event message, and the Linux The event message is sent to the proxy thread or the proxy process, and is forwarded by the proxy thread or the proxy process to the main thread, so that the main thread can receive the interrupt event after the Linux event converts the Linux event message into an interrupt event.
  • the proxy thread or the proxy process may have a corresponding entity, and the entity may be a network card or a virtual network card, that is, a corresponding function of the proxy thread or the proxy process is implemented by using a network card or a virtual network card.
  • the Linux event message received by the microkernel may be network data of the Linux platform, and the network data may be transmitted to the network protocol stack of the microkernel, thereby realizing Simulate the functionality of the network stack.
  • Step 206 sending a microkernel event message to the software platform.
  • the microkernel can not only receive the event message sent by the software platform, but also send its own microkernel event message to the software platform.
  • the microkernel may send a microkernel event message to the proxy thread or the proxy process, and then the proxy thread or the proxy process forwards the microkernel event message to the software platform, so that the software platform can timely understand the microkernel. information.
  • microkernel scheduling of the present application is described below with a specific example.
  • FIG. 3 a schematic diagram of microkernel scheduling of the present application is shown, which is a Linux platform.
  • the Linux platform 301 runs an Agent World 302 and a Host Thread 303.
  • the Agent World 302 can implement simulation of the network protocol stack and simulation of external devices to provide a proxy thread or proxy process, while the main thread 303
  • There is a microkernel platform 304 running the microkernel platform 304 includes a plurality of microkernels, and the microkernel platform 304 is also connected to the software stack 305.
  • the software stack 305 includes a plurality of software, each software corresponding to the microkernel. Running in the environment.
  • the user can input the scheduling instruction through the external device, call the setjmp function and the longjmp function, and control the switching of the specific value in the microkernel control unit (for example, the CPU register) corresponding to the microkernel, thereby realizing the switching between the microkernels.
  • the microkernel control unit for example, the CPU register
  • the scheduling between the microkernels is independent of the Linux thread without the scheduling of the Linux thread, which reduces the switching cost of the microkernel switching and improves the real-time performance.
  • the switched target microkernel can be used by the corresponding software in the software stack, enabling the software to run in the target microkernel environment.
  • the microkernel can also communicate with the Linux platform. Taking the microkernel to apply for a clock from the Linux platform, the microkernel can use the application information as a microkernel event message to send the microkernel event to the proxy thread or the proxy process (a thread or process in Agent World) through the main thread. The message is then forwarded by the proxy thread or proxy process to the Linux platform.
  • the Linux platform may send the response message to the proxy thread or the proxy process in the form of a Linux event message, and then the proxy thread or the proxy process may forward the Linux event message to the main thread, in the main thread.
  • the microkernel can receive the interrupt event in time, thereby completing communication between the microkernel and the Linux platform.
  • FIG. 4 a structural block diagram of an apparatus embodiment of a microkernel scheduling according to the present application is shown.
  • the device is applied to a software platform, and specifically includes the following modules:
  • the receiving module 401 is configured to receive a scheduling instruction for the current microkernel
  • the switching module 402 is configured to switch the current microkernel to the target microkernel.
  • the software platform runs a main thread and/or a kernel-based virtual machine KVM, and the micro-core runs in the main thread and/or the KVM.
  • each microkernel has a corresponding microkernel control unit, and each microkernel control unit has a corresponding control value, and the switching module 402 may specifically include the following submodules:
  • a replacement submodule configured to replace, by using a first control value corresponding to the target microkernel, a second control value corresponding to the current microkernel.
  • the scheduling instruction may include a setjmp instruction and a longjmp instruction.
  • the receiving module 401 may specifically include the following submodules:
  • a receiving submodule configured to receive a scheduling instruction input by an external device
  • the submodule is called, and the setjmp function and the longjmp function are called according to the scheduling instruction.
  • the device may further include the following modules:
  • the event message receiving module is configured to receive an event message sent by the software platform.
  • the device may further include the following modules:
  • the software platform is further configured with a main thread, and a proxy thread or an agent process.
  • the event message receiving module may specifically include the following sub-modules:
  • An event message forwarding submodule configured to forward the platform event message to the main thread by the proxy thread or the proxy process
  • a conversion submodule for the main thread to convert the event message into an interrupt event
  • the interrupt event receiving submodule is configured to receive the interrupt event sent by the main thread.
  • the event message sending sub-module may specifically include the following units:
  • a receiving unit configured to receive, by the software platform, information input by the external device
  • a conversion unit for the software platform to convert the information into an event message and send it to a proxy thread or an agent process.
  • the device may further include the following modules:
  • a microkernel event message sending module is configured to send a microkernel event message to the software platform.
  • microkernel event message sending module may specifically include the following submodules:
  • microkernel event message sending submodule for sending a microkernel event message to a proxy thread or an agent process
  • the software platform may be a Linux platform;
  • the microkernel control unit may be a CPU register, and the control value is a register value.
  • the proxy thread or the proxy process may have a corresponding entity, and the entity may be a network card or a virtual network card.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include non-persistent computer readable media (Transitory Media) such as modulated data signals and carrier waves.
  • Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device
  • Means are provided for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the instruction device implements the functions specified in one or more blocks of the flow or in a flow or block diagram of the flowchart.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请实施例提供了一种微内核调度的方法和装置,所述方法应用于软件平台,包括:接收针对当前微内核的调度指令;将当前微内核切换为目标微内核。本实施例通过调度指令直接对微内核进行切换,而不需要通过软件平台的线程来完成上述过程,解决了现有技术中将微内核与软件平台的线程一一对应所带来的微内核切换成本较高,实时性较差的问题。

Description

一种微内核调度的方法和装置
本申请要求2017年06月26日递交的申请号为201710495861.5、发明名称为“一种微内核调度的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,特别是涉及一种微内核调度的方法和一种微内核调度的装置。
背景技术
随着物联网(Internet of Things,简称IoT)的兴起,应用于物联网的MCU(Micro Controller Unit,微控制单元)软件越来越复杂,针对MCU软件的开发调试工作也就显得越来越重要。但是,传统的打log(日志)的方式已经不再适用于当前的物联网开发;另一方面,由于受到MCU设备资源的限制,一些复杂的程序调试(debug)工具也无法直接在MCU上运行。因此,通过将IoT微内核运行在Linux系统上,复用Linux系统的开发工具进行软件的开发调试便成为了一个明智的选择。
现有技术中,当微内核在Linux系统上运行时,每一个微内核对应一个Linux线程,微内核的调度与Linux的线程调度混合在一起,统一由Linux系统控制各个微内核之间的切换,切换成本较高,实时性较差。
发明内容
鉴于上述问题,提出了本申请实施例以便提供一种克服上述问题或者至少部分地解决上述问题的一种微内核调度的方法和相应的一种微内核调度的装置。
为了解决上述问题,本申请公开了一种微内核调度的方法,应用于软件平台,所述方法包括:
接收针对当前微内核的调度指令;
将当前微内核切换为目标微内核。
可选地,所述软件平台运行有主线程和/或基于内核的虚拟机KVM,所述微内核运行于所述主线程和/或所述KVM中。
可选地,各个微内核具有对应的微内核控制单元,各个微内核控制单元分别具有相应的控制数值,所述将当前微内核切换为目标微内核的步骤包括:
确定目标微内核对应的第一控制数值;
采用所述目标微内核对应的第一控制数值替换所述当前微内核对应的第二控制数值。
可选地,所述调度指令包括针对setjmp函数和longjmp函数的指令。
可选地,所述接收针对当前微内核的调度指令的步骤包括:
接收由外部设备输入的调度指令;
依据所述调度指令,调用setjmp函数和longjmp函数。
可选地,还包括:
采用所述目标微内核模拟软件运行。
可选地,还包括:
接收软件平台发送的事件消息。
可选地,所述软件平台还运行有主线程,以及代理线程或代理进程,所述接收软件平台发送的事件消息的步骤包括:
软件平台发送事件消息至代理线程或代理进程;
所述代理线程或代理进程转发所述事件消息至主线程;
所述主线程将所述事件消息转换为中断事件;
接收所述主线程发送的所述中断事件。
可选地,所述软件平台发送事件消息至代理线程或代理进程的步骤包括:
软件平台接收外部设备输入的信息;
所述软件平台将所述信息转换为事件消息并发送至代理线程或代理进程。
可选地,还包括:
向软件平台发送微内核事件消息。
可选地,所述向软件平台发送微内核事件消息的步骤包括:
向代理线程或代理进程发送微内核事件消息;
所述代理线程或代理进程将所述微内核事件消息转发至所述软件平台。
可选地,所述软件平台为Linux平台。
可选地,所述微内核控制单元为CPU寄存器,所述控制数值为寄存器数值。
可选地,所述代理线程或代理进程具有对应的实体,所述实体包括网卡或虚拟网卡。
为了解决上述问题,本申请公开了一种微内核调度的装置,应用于软件平台,所述装置包括:
接收模块,用于接收针对当前微内核的调度指令;
切换模块,用于将当前微内核切换为目标微内核。
可选地,所述软件平台运行有主线程和/或基于内核的虚拟机KVM,所述微内核运行于所述主线程和/或所述KVM中。
可选地,各个微内核具有对应的微内核控制单元,各个微内核控制单元分别具有相应的控制数值,所述切换模块包括:
确定子模块,用于确定目标微内核对应的第一控制数值;
替换子模块,用于采用所述目标微内核对应的第一控制数值替换所述当前微内核对应的第二控制数值。
可选地,所述调度指令包括针对setjmp函数和longjmp函数的指令。
可选地,所述接收模块包括:
接收子模块,用于接收由外部设备输入的调度指令;
调用子模块,依据所述调度指令,调用setjmp函数和longjmp函数。
可选地,所述装置还包括:
模拟模块,用于采用所述目标微内核模拟软件运行。
可选地,所述装置还包括:
事件消息接收模块,用于接收软件平台发送的事件消息。
可选地,所述软件平台还运行有主进程,以及代理线程或代理进程,所述事件消息接收模块包括:
事件消息发送子模块,用于软件平台发送事件消息至代理线程或代理进程;
事件消息转发子模块,用于所述代理线程或代理进程转发所述事件消息至所述主线程;
转换子模块,用于所述主线程将所述事件消息转换为中断事件;
中断事件接收子模块,用于接收所述主线程发送的所述中断事件。
可选地,所述事件消息发送子模块包括:
接收单元,用于软件平台接收外部设备输入的信息;
转换单元,用于所述软件平台将所述信息转换为事件消息并发送至代理线程或代理 进程。
可选地,所述装置还包括:
微内核事件消息发送模块,用于向软件平台发送微内核事件消息。
可选地,所述微内核事件消息发送模块包括:
微内核事件消息发送子模块,用于向代理线程或代理进程发送微内核事件消息;
微内核事件消息转发子模块,用于所述代理线程或代理进程将所述微内核事件消息转发至所述软件平台。
可选地,所述软件平台为Linux平台。
可选地,所述微内核控制单元为CPU寄存器,所述控制数值为寄存器数值。
可选地,所述代理线程或代理进程具有对应的实体,所述实体包括网卡或虚拟网卡。
本申请实施例包括以下优点:
本申请实施例,通过接收针对当前微内核的调度指令,将当前微内核切换为目标微内核,从而可以采用该目标微内核模拟软件运行。本实施例通过调度指令直接对微内核进行切换,而不需要通过软件平台的线程来完成上述过程,解决了现有技术中将微内核与软件平台的线程一一对应所带来的微内核切换成本较高,实时性较差的问题。
其次,本申请实施例可以直接使用setjmp/longjmp函数实现微内核的调度,保证切换过程与Linux线程无关。并且,通过将微内核与软件平台分离,使得微内核能够自主地完成内核处理阶段的堆栈初始化以及内存分配过程,从而可以使用例如valgrid(一款用于内存调试、内存泄漏检测以及性能分析的软件开发工具)等内存泄露工具检测是否发生内存泄露,及时定位故障发生的位置,提高软件开发调试的效率。另一方面,本申请实施例为了将微内核与Linux平台分离,还可以提供newlib仓库替换Linux平台的glibc仓库,软件在运行过程中可以直接调用newlib仓库中的各个接口,进一步切断了微内核与Linux平台线程之间的联系。
第三,本申请实施例通过将微内核运行于软件平台上,使得在进行模拟软件运行时,不会受到MCU设备资源的限制,能够在现有的资源条件下,完成软件的模拟运行,提高了软件的模拟运行的效率。
第四,本申请实施例还可以使用代理线程或代理进程对接Linux事件消息,实现对网卡或外部设备的模拟。
附图说明
图1是本申请的一种微内核调度的方法实施例一的步骤流程图;
图2是本申请的一种微内核调度的方法实施例二的步骤流程图;
图3是本申请的微内核调度的示意图;
图4是本申请的一种微内核调度的装置实施例的结构框图。
具体实施方式
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
参照图1,示出了本申请的一种微内核调度的方法实施例一的步骤流程图,所述方法应用于软件平台,具体可以包括如下步骤:
步骤101,接收针对当前微内核的调度指令;
在本申请实施例中,软件平台可以是Linux平台。Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于Posix和Unix的多用户、多任务、支持多线程和多CPU的操作系统。它能运行主要的Unix工具软件、应用程序和网络协议,支持32位和64位硬件。Linux继承了Unix以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统,可安装在各种计算机硬件设备中,因此,Linux平台可以是指安装有Linux操作系统的计算机设备。例如,手机、平板电脑、路由器、视频游戏控制台、台式计算机、大型机和超级计算机等等。
为了便于理解,本实施例以Linux平台为例进行介绍。
在本申请实施例中,在Linux平台中运行有主线程(Host thread)和/或KVM,微内核可以运行于该主线程和/或KVM中。
KVM(Kernel-based Virtual Machine,基于内核的虚拟机)是Linux下x86硬件平台上的一种全功能虚拟化解决方案,包含一个可加载的内核模块,能够提供和虚拟化核心架构和处理器规范。微内核(Micro kernel)是提供操作系统核心功能的内核的精简版本,它通常被设计成在很小的内存空间内增加移植性,提供模块化设计,以使用户安装不同的接口,如DOS、Workplace OS、Workplace Unix等。微内核能够提供操作系统的必要的服务,这些必要的服务包括任务、线程、IPC(Inter-Process Communication,进程间通信)以及内存管理等等。
在本申请实施例中,微内核可以是RTOS操作系统(Real Time Operating System,实时操作系统)的内核精简版本。
RTOS操作系统是指当外界事件或数据产生时,能够接受并以足够快的速度予以处理,其处理的结果又能在规定的时间之内来控制生产过程或对处理系统做出快速响应,调度一切可利用的资源完成实时任务,并控制所有实时任务协调一致运行的操作系统。能够提供及时响应和高可靠性是RTOS操作系统的主要特点。
为了模拟微内核在Linux平台上的运行情况,需要确保微内核的切换或调度与Linux线程无关,即不通过Linux线程来实现对微内核的切换或调度。
在本申请实施例中,可以通过外部设备输入相应的针对微内核的调度指令,直接作用于微内核中,从而当微内核接收到该调度指令后,可以执行调度指令,直接对微内核进行切换。
在本申请实施例中,调度指令可以包括针对setjmp函数和longjmp函数的指令。用户可以通过与Linux平台连接的外部设备,例如键盘,输入调度指令,并依据该调度指令,调用setjmp函数和longjmp函数,从而实现微内核之间的切换,保证切换过程与Linux线程无关。
setjmp和longjmp均是一种计算机语句,属于C函数库,分别承担非局部标号和goto作用。需要说明的是,setjmp与longjmp结合使用时,它们必须有严格的先后执行顺序,即先调用setjmp函数,之后再调用longjmp函数,以恢复到先前被保存的“程序执行点”。否则,如果在setjmp调用之前,执行longjmp函数,将导致程序的执行流变得不可预测,容易导致程序崩溃而退出。其次,longjmp必须在setjmp的作用域之内。具体来说,在一个函数中使用setjmp来初始化一个全局标号,然后只要该函数未曾返回,那么在其他任何地方都可以通过longjmp调用来跳转到setjmp的下一条语句执行。
步骤102,将当前微内核切换为目标微内核。
通常,各个微内核具有对应的微内核控制单元,各个微内核控制单元分别具有相应的控制数值。
在本申请实施例中,微内核控制单元可以为CPU寄存器,相应地,微内核控制单元中的控制数值可以为寄存器数值。
为了便于理解,本实施例以微内核控制单元为CPU寄存器、控制数值为寄存器数值为例进行介绍。
CPU寄存器是CPU内的组成部分,是一种有限存储容量的高速存储部件,可以用来 暂存指令、数据和地址。
通常,微内核之间的切换即是微内核对应的CPU寄存器的切换。
因此,在本申请实施例中,可以通过setjmp函数和longjmp函数,直接控制CPU寄存器的切换,从而绕过Linux线程直接对微内核进行调度。
在具体实现中,可以依据调度指令,首先确定目标微内核对应的第一控制数值,然后采用该目标微内核对应的第一控制数值替换当前微内核对应的第二控制数值。
在本申请实施例中,在将当前微内核切换为目标微内核后,还可以采用所述目标微内核模拟软件运行。
通常,微内核连接有软件栈,软件栈中的各个软件可以在微内核的环境中运行。
在具体实现中,在切换到目标微内核后,可以采用该目标微内核模拟对应的软件的运行。
在本申请实施例中,为了将微内核与软件平台分离,还可以提供newlib仓库替换Linux平台的glibc仓库,从而软件在运行过程中可以直接调用newlib仓库中的各个接口。
newlib仓库和glibc仓库均是C标准库的一种,C标准库是一组C内置函数、常量和头文件,比如<stdio.h>、<stdlib.h>、<math.h>。newlib仓库和glibc仓库分别与微内核和Linux平台具有对应的绑定关系,即newlib仓库应用于微内核,而glibc仓库则应用于Linux平台。
在本申请实施例中,通过接收针对当前微内核的调度指令,将当前微内核切换为目标微内核,从而可以采用该目标微内核模拟软件运行。本实施例通过调度指令直接对微内核进行切换,而不需要通过软件平台的线程来完成上述过程,解决了现有技术中将微内核与软件平台的线程一一对应所带来的微内核切换成本较高,实时性较差的问题。
其次,本申请实施例可以直接使用setjmp/longjmp函数实现微内核的调度,保证切换过程与Linux线程无关。并且,通过将微内核与软件平台分离,使得微内核能够自主地完成内核处理阶段的堆栈初始化以及内存分配过程,从而可以使用例如valgrid(一款用于内存调试、内存泄漏检测以及性能分析的软件开发工具)等内存泄露工具检测是否发生内存泄露,及时定位故障发生的位置,提高软件开发调试的效率。另一方面,本申请实施例为了将微内核与Linux平台分离,还可以提供newlib仓库替换Linux平台的glibc仓库,软件在运行过程中可以直接调用newlib仓库中的各个接口,进一步切断了微内核与Linux平台线程之间的联系。
第三,本实施例通过将微内核运行于软件平台上,使得在进行模拟软件运行时,不 会受到MCU设备资源的限制,能够在现有的资源条件下,完成软件的模拟运行,提高了模拟软件运行的效率。
参照图2,示出了本申请的一种微内核调度的方法实施例二的步骤流程图,所述方法应用于软件平台,具体可以包括如下步骤:
步骤201,接收针对当前微内核的调度指令;
为了便于理解,本实施例以Linux平台为例进行介绍。
在本申请实施例中,在Linux平台中运行有主线程(Host thread)和/或KVM,微内核可以运行于该主线程和/或KVM中。
在本申请实施例中,针对当前微内核的调度指令可以包括针对setjmp函数和longjmp函数的指令。setjmp和longjmp均是一种计算机语句,属于C函数库,分别承担非局部标号和goto作用。
在具体实现中,Linux平台可以连接有外部设备,例如键盘等等。用户可以通过外部设备输入调度指令,并依据该调度指令,调用setjmp函数和longjmp函数。
需要说明的是,setjmp与longjmp结合使用时,它们必须有严格的先后执行顺序,即先调用setjmp函数,之后再调用longjmp函数。
步骤202,确定目标微内核对应的第一控制数值;
通常,微内核之间的切换即是微内核对应的微内核控制单元的切换。
因此,在进行微内核的切换时,可以首先确定出要切换的目标微内核对应的第一控制数值,该第一控制数值即是目标微内核对应的微内核控制单元对应的控制数值。
步骤203,采用所述目标微内核对应的第一控制数值替换所述当前微内核对应的第二控制数值;
当前微内核对应的第二控制数值即是当前微内核对应的微内核控制单元对应的控制数值。
在具体实现中,可以将微内核控制单元中的第二控制数值修改为目标微内核对应的第一控制数值,从而完成微内核之间的切换。
为了便于理解,本实施例以微内核控制单元为CPU寄存器、控制数值为寄存器数值为例进行介绍。
因此,在具体实现中,可以首先确定目标微内核对应的第一寄存器数值,然后采用该目标微内核对应的第一寄存器数值替换当前微内核对应的第二寄存器数值。
在本申请实施例中,通过setjmp函数和longjmp函数直接作用于微内核对应的CPU寄存器的切换,能够使得微内核之间的切换与Linux线程无关,无需Linux线程的调度,减少了微内核切换的切换成本,提高了实时性。
步骤204,采用所述目标微内核模拟软件运行;
在本申请实施例中,微内核连接有软件栈,软件栈中的各个软件可以在微内核环境中运行。因此,在切换到目标微内核后,可以采用该目标微内核模拟对应的软件的运行。
步骤205,接收软件平台发送的事件消息;
在本申请实施例中,微内核虽然是独立运行于Linux平台中,但同时,微内核也可以与Linux平台之间互相通信。例如,接收Linux平台发送的事件消息,即Linux事件消息。
需要说明的是,微内核与软件平台之间不能直接通信,需要通过其他线程或设备进行中转,例如,代理线程或代理进程,该代理线程或代理进程可以是Agent World中的一个线程或进程,Agent World可以模拟外部设备,如网卡、虚拟网卡或其他的外部设备等。
在具体实现中,软件平台可以发送事件消息至代理线程或代理进程,由代理线程或代理进程转发该事件消息至主线程,然后主线程可以将该事件消息转换为中断事件,微内核可以接收到主线程发送的上述中断事件,从而了解软件平台的相关信息。
在本申请实施例中,主线程在将接收到的台事件消息转换为中断事件时,可以通过signal()函数来实现。signal()函数的原型可以表示为:
void(*signal(int signum,void(*handler)(int)))(int)
signal()函数会依参数signum指定的信号编号来设置该信号的处理函数。当指定的信号到达时就会跳转到参数handler指定的函数执行。当一个信号的信号处理函数执行时,如果进程又接收到了该信号,该信号会自动被储存而不会中断信号处理函数的执行,直到信号处理函数执行完毕再重新调用相应的处理函数。但是如果在信号处理函数执行时进程收到了其它类型的信号,该函数的执行就会被中断,从而形成一中断事件。
作为本申请的一种示例,当微内核运行于Linux平台中时,还可以实现模拟外设的功能,即Linux事件消息可以是由于外部设备输入的信息而产生的。例如,当用户在与Linux平台连接的外部设备(如键盘)上输入信息时,Linux平台可以接收到该外部设备输入的信息,然后Linux平台可以将该信息转换为Linux事件消息,并将该Linux事件消息发送至代理线程或代理进程,由代理线程或代理进程转发至主线程,从而主线程在 将该Linux事件消息转换为一中断事件后,微内核可以接收到该中断事件。
在本申请实施例中,所述代理线程或代理进程可以具有对应的实体,所述实体可以为网卡或虚拟网卡,即通过网卡或虚拟网卡来实现代理线程或代理进程的相应功能。
当通过网卡或虚拟网卡来实现代理线程或代理进程的功能时,微内核接收到的Linux事件消息可以是Linux平台的网络数据,该网络数据可以被传输至微内核的网络协议栈中,从而实现模拟网络协议栈的功能。
当然,本领域技术人员还可以选择其他通信手段来实现微内核与Linux平台之间的通信,例如阻塞调用,本申请实施例对此不作限定。
步骤206,向软件平台发送微内核事件消息。
在本申请实施例中,微内核不仅可以接收到软件平台发送的事件消息,还可以向软件平台发送自身的微内核事件消息。
在具体实现中,微内核可以向代理线程或代理进程发送微内核事件消息,然后由代理线程或代理进程将该微内核事件消息转发至软件平台,使得软件平台能及时地了解到微内核中的信息。
为了便于理解,下面以一个具体的示例对本申请的微内核调度的方法作一介绍。
参照图3,示出了本申请的微内核调度的示意图,该软件平台为Linux平台。在图3中Linux平台301中运行有Agent World 302和主线程(Host Thread)303,Agent World302可以实现对网络协议栈的模拟以及对外部设备的模拟以提供代理线程或代理进程,而主线程303中运行有微内核平台304,该微内核平台304包括有多个微内核,微内核平台304还与软件栈305连接,该软件栈305中包括有多个软件,每个软件在对应的微内核环境中运行。
一方面,用户可以通过外部设备输入调度指令,调用setjmp函数和longjmp函数,控制微内核对应的微内核控制单元(例如,CPU寄存器)中特定数值的切换,从而实现对微内核之间的切换。由于上述切换过程是直接作用于微内核对应的微内核控制单元,无需通过Linux线程的调度,使得微内核之间的切换与Linux线程无关,减少了微内核切换的切换成本,提高了实时性。在完成微内核的切换后,切换后的目标微内核可以被软件栈中对应的软件使用,使得该软件能够在目标微内核的环境中运行。
另一方面,微内核还可以与Linux平台之间进行通信。以微内核向Linux平台申请一个时钟为例,微内核可以将该申请信息作为一个微内核事件消息,通过主线程向代理 线程或代理进程(Agent World中的一个线程或进程)发送该微内核事件消息,然后由代理线程或代理进程将该微内核事件消息转发至Linux平台。同时,Linux平台在接收到上述消息后,可以以一个Linux事件消息的形式将回应消息发送至代理线程或代理进程,然后代理线程或代理进程可以将该Linux事件消息转发至主线程,在主线程将接收到的该Linux事件消息转换为中断事件后,微内核可以及时地接收到上述中断事件,从而完成微内核与Linux平台之间的通信。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
参照图4,示出了本申请的一种微内核调度的装置实施例的结构框图,所述装置应用于软件平台,具体可以包括如下模块:
接收模块401,用于接收针对当前微内核的调度指令;
切换模块402,用于将当前微内核切换为目标微内核。
在本申请实施例中,所述软件平台运行有主线程和/或基于内核的虚拟机KVM,所述微内核而已运行于所述主线程和/或所述KVM中。
在本申请实施例中,各个微内核具有对应的微内核控制单元,各个微内核控制单元分别具有相应的控制数值,所述切换模块402具体可以包括如下子模块:
确定子模块,用于确定目标微内核对应的第一控制数值;
替换子模块,用于采用所述目标微内核对应的第一控制数值替换所述当前微内核对应的第二控制数值。
在本申请实施例中,所述调度指令可以包括setjmp指令和longjmp指令。
在本申请实施例中,所述接收模块401具体可以包括如下子模块:
接收子模块,用于接收由外部设备输入的调度指令;
调用子模块,依据所述调度指令,调用setjmp函数和longjmp函数。
在本申请实施例中,所述装置还可以包括如下模块:
事件消息接收模块,用于接收软件平台发送的事件消息。
在本申请实施例中,所述装置还可以包括如下模块:
模拟模块,用于采用所述目标微内核模拟软件运行。
在本申请实施例中,所述软件平台还运行有主线程,以及代理线程或代理进程,所述事件消息接收模块具体可以包括如下子模块:
事件消息发送子模块,用于软件平台发送事件消息至代理线程或代理进程;
事件消息转发子模块,用于所述代理线程或代理进程转发所述平台事件消息至所述主线程;
转换子模块,用于所述主线程将所述事件消息转换为中断事件;
中断事件接收子模块,用于接收所述主线程发送的所述中断事件。
在本申请实施例中,所述事件消息发送子模块具体可以包括如下单元:
接收单元,用于软件平台接收外部设备输入的信息;
转换单元,用于所述软件平台将所述信息转换为事件消息并发送至代理线程或代理进程。
在本申请实施例中,所述装置还可以包括如下模块:
微内核事件消息发送模块,用于向软件平台发送微内核事件消息。
在本申请实施例中,所述微内核事件消息发送模块具体可以包括如下子模块:
微内核事件消息发送子模块,用于向代理线程或代理进程发送微内核事件消息;
微内核事件消息转发子模块,用于所述代理线程或代理进程将所述微内核事件消息转发至所述软件平台。
在本申请实施例中,所述软件平台可以为Linux平台;所述微内核控制单元可以为CPU寄存器,所述控制数值为寄存器数值。
在本申请实施例中,所述代理线程或代理进程可以具有对应的实体,所述实体可以为网卡或虚拟网卡。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算 机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
在一个典型的配置中,所述计算机设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非持续性的电脑可读媒体(Transitory Media),如调制的数据信号和载波。
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程 和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本申请所提供的一种微内核调度的方法和一种微内核调度的装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (28)

  1. 一种微内核调度的方法,其特征在于,应用于软件平台,所述方法包括:
    接收针对当前微内核的调度指令;
    将当前微内核切换为目标微内核。
  2. 根据权利要求1所述的方法,其特征在于,所述软件平台运行有主线程和/或基于内核的虚拟机KVM,所述微内核运行于所述主线程和/或所述KVM中。
  3. 根据权利要求1所述的方法,其特征在于,各个微内核具有对应的微内核控制单元,各个微内核控制单元分别具有相应的控制数值,所述将当前微内核切换为目标微内核的步骤包括:
    确定目标微内核对应的第一控制数值;
    采用所述目标微内核对应的第一控制数值替换所述当前微内核对应的第二控制数值。
  4. 根据权利要求1或2或3所述的方法,其特征在于,所述调度指令包括针对setjmp函数和longjmp函数的指令。
  5. 根据权利要求4所述的方法,其特征在于,所述接收针对当前微内核的调度指令的步骤包括:
    接收由外部设备输入的调度指令;
    依据所述调度指令,调用setjmp函数和longjmp函数。
  6. 根据权利要求1所述的方法,其特征在于,还包括:
    采用所述目标微内核模拟软件运行。
  7. 根据权利要求1所述的方法,其特征在于,还包括:
    接收软件平台发送的事件消息。
  8. 根据权利要求7所述的方法,其特征在于,所述软件平台还运行有主线程,以及代理线程或代理进程,所述接收软件平台发送的事件消息的步骤包括:
    软件平台发送事件消息至代理线程或代理进程;
    所述代理线程或代理进程转发所述事件消息至主线程;
    所述主线程将所述事件消息转换为中断事件;
    接收所述主线程发送的所述中断事件。
  9. 根据权利要求8所述的方法,其特征在于,所述软件平台发送事件消息至代理线程或代理进程的步骤包括:
    软件平台接收外部设备输入的信息;
    所述软件平台将所述信息转换为事件消息并发送至代理线程或代理进程。
  10. 根据权利要求7或8或9所述的方法,其特征在于,还包括:
    向软件平台发送微内核事件消息。
  11. 根据权利要求10所述的方法,其特征在于,所述向软件平台发送微内核事件消息的步骤包括:
    向代理线程或代理进程发送微内核事件消息;
    所述代理线程或代理进程将所述微内核事件消息转发至所述软件平台。
  12. 根据权利要求1所述的方法,其特征在于,所述软件平台为Linux平台。
  13. 根据权利要求3所述的方法,其特征在于,所述微内核控制单元为CPU寄存器,所述控制数值为寄存器数值。
  14. 根据权利要求8所述的方法,其特征在于,所述代理线程或代理进程具有对应的实体,所述实体包括网卡或虚拟网卡。
  15. 一种微内核调度的装置,其特征在于,应用于软件平台,所述装置包括:
    接收模块,用于接收针对当前微内核的调度指令;
    切换模块,用于将当前微内核切换为目标微内核。
  16. 根据权利要求15所述的装置,其特征在于,所述软件平台运行有主线程和/或基于内核的虚拟机KVM,所述微内核运行于所述主线程和/或所述KVM中。
  17. 根据权利要求15所述的装置,其特征在于,各个微内核具有对应的微内核控制单元,各个微内核控制单元分别具有相应的控制数值,所述切换模块包括:
    确定子模块,用于确定目标微内核对应的第一控制数值;
    替换子模块,用于采用所述目标微内核对应的第一控制数值替换所述当前微内核对应的第二控制数值。
  18. 根据权利要求15或16或17所述的装置,其特征在于,所述调度指令包括针对setjmp函数和longjmp函数的指令。
  19. 根据权利要求18所述的装置,其特征在于,所述接收模块包括:
    接收子模块,用于接收由外部设备输入的调度指令;
    调用子模块,依据所述调度指令,调用setjmp函数和longjmp函数。
  20. 根据权利要求15所述的装置,其特征在于,所述装置还包括:
    模拟模块,用于采用所述目标微内核模拟软件运行。
  21. 根据权利要求15所述的装置,其特征在于,所述装置还包括:
    事件消息接收模块,用于接收软件平台发送的事件消息。
  22. 根据权利要求21所述的装置,其特征在于,所述软件平台还运行有主线程,以及代理线程或代理进程,所述事件消息接收模块包括:
    事件消息发送子模块,用于软件平台发送事件消息至代理线程或代理进程;
    事件消息转发子模块,用于所述代理线程或代理进程转发所述事件消息至所述主线程;
    转换子模块,用于所述主线程将所述事件消息转换为中断事件;
    中断事件接收子模块,用于接收所述主线程发送的所述中断事件。
  23. 根据权利要求22所述的装置,其特征在于,所述事件消息发送子模块包括:
    接收单元,用于软件平台接收外部设备输入的信息;
    转换单元,用于所述软件平台将所述信息转换为事件消息并发送至代理线程或代理进程。
  24. 根据权利要求21或22或23所述的装置,其特征在于,所述装置还包括:
    微内核事件消息发送模块,用于向软件平台发送微内核事件消息。
  25. 根据权利要求24所述的装置,其特征在于,所述微内核事件消息发送模块包括:
    微内核事件消息发送子模块,用于向代理线程或代理进程发送微内核事件消息;
    微内核事件消息转发子模块,用于所述代理线程或代理进程将所述微内核事件消息转发至所述软件平台。
  26. 根据权利要求15所述的装置,其特征在于,所述软件平台为Linux平台。
  27. 根据权利要求17所述的装置,其特征在于,所述微内核控制单元为CPU寄存器,所述控制数值为寄存器数值。
  28. 根据权利要求22所述的装置,其特征在于,所述代理线程或代理进程具有对应的实体,所述实体包括网卡或虚拟网卡。
PCT/CN2018/091040 2017-06-26 2018-06-13 一种微内核调度的方法和装置 Ceased WO2019001276A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/725,880 US11954520B2 (en) 2017-06-26 2019-12-23 Micro kernel scheduling method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710495861.5A CN109117253B (zh) 2017-06-26 2017-06-26 一种微内核调度的方法和装置
CN201710495861.5 2017-06-26

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/725,880 Continuation US11954520B2 (en) 2017-06-26 2019-12-23 Micro kernel scheduling method and apparatus

Publications (1)

Publication Number Publication Date
WO2019001276A1 true WO2019001276A1 (zh) 2019-01-03

Family

ID=64741949

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/091040 Ceased WO2019001276A1 (zh) 2017-06-26 2018-06-13 一种微内核调度的方法和装置

Country Status (3)

Country Link
US (1) US11954520B2 (zh)
CN (1) CN109117253B (zh)
WO (1) WO2019001276A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12077586B2 (en) 2018-09-19 2024-09-03 LAVA Therapeutics N.V. Bispecific antibodies for use in the treatment of hematological malignancies

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737032B (zh) * 2020-07-27 2020-11-20 腾讯科技(深圳)有限公司 一种基于微内核系统的子程序运行方法、装置和电子设备
CN114064227B (zh) * 2020-08-10 2025-05-30 阿里巴巴集团控股有限公司 应用于微内核的中断处理方法、装置、设备和存储介质
CN112286697B (zh) * 2020-11-06 2022-11-25 上海新时达机器人有限公司 基于无操作系统单片机平台的互斥资源访问方法
CN115562731B (zh) * 2021-06-30 2026-03-27 阿里云计算有限公司 微内核架构的设备驱动方法、装置、电子设备和存储介质
CN116383091B (zh) * 2023-05-29 2023-08-29 珠海妙存科技有限公司 eMMC验证平台的启动方法、启动装置及存储介质
CN119883388B (zh) * 2024-12-27 2026-02-17 镁佳(北京)科技有限公司 一种基于qnx的车载操作系统及操作方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1922576A (zh) * 2003-09-30 2007-02-28 扎鲁纳股份有限公司 操作系统
CN102880933A (zh) * 2012-09-04 2013-01-16 广东电子工业研究院有限公司 一种面向云计算的综合应急管理平台架构
CN104123265A (zh) * 2013-04-26 2014-10-29 华为技术有限公司 一种众核间通信方法及系统

Family Cites Families (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020097717A1 (en) * 2001-01-22 2002-07-25 Vinsel Peter C. Microkernel architecture-based forwarder
CN1329855C (zh) * 2003-11-14 2007-08-01 华为技术有限公司 针对包转发引擎的微内核
CN1273890C (zh) * 2004-04-30 2006-09-06 浙江大学 Arm处理器架构的微内核设计方法
CN100470485C (zh) * 2007-05-09 2009-03-18 浙江大学 多操作系统协同工作实现方法
US8763115B2 (en) * 2007-08-08 2014-06-24 Vmware, Inc. Impeding progress of malicious guest software
CN101599039B (zh) * 2008-06-03 2011-11-02 华为技术有限公司 嵌入式c语言环境下异常处理方法及装置
JP2010205085A (ja) * 2009-03-04 2010-09-16 Toyota Motor Corp プロセッサ及びプロセッサ処理方法
US8868907B2 (en) * 2009-03-18 2014-10-21 University Of Louisville Research Foundation, Inc. Device, method, and system for processing communications for secure operation of industrial control system field devices
CN101944063B (zh) * 2010-09-21 2012-06-13 南京中德保护控制系统有限公司 基于数字化微内核的实时动态调度策略测试方法
US8448022B1 (en) * 2010-10-26 2013-05-21 Vmware, Inc. Fault recovery to a call stack position stored in thread local storage
US8756548B2 (en) * 2011-05-06 2014-06-17 Xcelemor, Inc. Computing system with hardware reconfiguration mechanism and method of operation thereof
CN103136046A (zh) * 2011-11-24 2013-06-05 林振慧 操作系统
EP2972842B1 (en) * 2013-03-12 2020-05-20 Microchip Technology Incorporated Programmable cpu register hardware context swap mechanism
US9910689B2 (en) * 2013-11-26 2018-03-06 Dynavisor, Inc. Dynamic single root I/O virtualization (SR-IOV) processes system calls request to devices attached to host
CN103927227A (zh) * 2014-04-16 2014-07-16 乐视致新电子科技(天津)有限公司 多操作系统的切换方法和装置、及智能电视
US9798567B2 (en) * 2014-11-25 2017-10-24 The Research Foundation For The State University Of New York Multi-hypervisor virtual machines
CN106201566B (zh) * 2015-05-07 2019-08-23 阿里巴巴集团控股有限公司 利博伟特软件热升级方法及设备
US20160378529A1 (en) * 2015-06-29 2016-12-29 Fortinet, Inc. Utm integrated hypervisor for virtual machines
US10846117B1 (en) * 2015-12-10 2020-11-24 Fireeye, Inc. Technique for establishing secure communication between host and guest processes of a virtualization architecture
CN106502164B (zh) * 2016-12-02 2019-01-01 艾思玛新能源技术(扬中)有限公司 一种基于双微控制器的光伏逆变器装置
US10496439B1 (en) * 2016-12-15 2019-12-03 Space Sciences Corporation Finite resource allocator with intrinsically subordinate operating system
US10581859B2 (en) * 2017-08-07 2020-03-03 International Business Machines Corporation Detection and prevention of attempts to access sensitive information in real-time
US11016798B2 (en) * 2018-06-01 2021-05-25 The Research Foundation for the State University Multi-hypervisor virtual machines that run on multiple co-located hypervisors
US11347843B2 (en) * 2018-09-13 2022-05-31 King Fahd University Of Petroleum And Minerals Asset-based security systems and methods

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1922576A (zh) * 2003-09-30 2007-02-28 扎鲁纳股份有限公司 操作系统
CN102880933A (zh) * 2012-09-04 2013-01-16 广东电子工业研究院有限公司 一种面向云计算的综合应急管理平台架构
CN104123265A (zh) * 2013-04-26 2014-10-29 华为技术有限公司 一种众核间通信方法及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12077586B2 (en) 2018-09-19 2024-09-03 LAVA Therapeutics N.V. Bispecific antibodies for use in the treatment of hematological malignancies

Also Published As

Publication number Publication date
CN109117253A (zh) 2019-01-01
US11954520B2 (en) 2024-04-09
CN109117253B (zh) 2022-05-24
US20200133723A1 (en) 2020-04-30

Similar Documents

Publication Publication Date Title
WO2019001276A1 (zh) 一种微内核调度的方法和装置
US11068309B2 (en) Per request computer system instances
US10353725B2 (en) Request processing techniques
KR100537813B1 (ko) 에뮬레이션 코프로세서
US11093270B2 (en) Fast-booting application image
JP5496683B2 (ja) カスタマイズ方法及びコンピュータシステム
JP4690988B2 (ja) 持続的なユーザレベルスレッド用の装置、システムおよび方法
US20090007112A1 (en) Method for controlling a virtual machine and a virtual machine system
US20170024231A1 (en) Configuration of a computer system for real-time response from a virtual machine
US20140222410A1 (en) Hybrid emulation and kernel function processing systems and methods
CN102831006A (zh) 虚拟机实现方法与虚拟机
CN105335203B (zh) 共享库的二进制翻译执行方法和装置
US11249760B2 (en) Parameter management between programs
CN114721719A (zh) 一种在集群中容器化部署异构应用的方法和系统
CN114816672A (zh) 虚拟机的创建方法、装置、电子设备和存储介质
Ordouie et al. Developing Computer Applications without any OS or Kernel in a Multi-core Architecture
US11294695B2 (en) Termination of programs associated with different addressing modes
Benbachir et al. Hypertracing: Tracing through virtualization layers
EP4237946B1 (en) Computer system executing multiple operating systems
Mohr On-Stack Replacement Across User-Kernel Boundaries
CN121560388A (zh) 中断或异常事件处理方法、处理器和电子设备
Lu et al. A MPI-Friendly Efficient Static Binary Translator Based on QEMU
Das et al. PERSONAL COMPUTER SOFTWARE

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

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

Country of ref document: EP

Kind code of ref document: A1