WO2024221468A1 - 嵌入式系统的运行方法和装置、嵌入式系统及芯片 - Google Patents
嵌入式系统的运行方法和装置、嵌入式系统及芯片 Download PDFInfo
- Publication number
- WO2024221468A1 WO2024221468A1 PCT/CN2023/091876 CN2023091876W WO2024221468A1 WO 2024221468 A1 WO2024221468 A1 WO 2024221468A1 CN 2023091876 W CN2023091876 W CN 2023091876W WO 2024221468 A1 WO2024221468 A1 WO 2024221468A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- operating system
- resource
- allocated
- processing resources
- services
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5077—Logical partitioning of resources; Management or configuration of virtualized resources
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4406—Loading of operating system
- G06F9/441—Multiboot arrangements, i.e. selecting an operating system to be loaded
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4418—Suspend and resume; Hibernate and awake
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5033—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering data affinity
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5055—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering software capabilities, i.e. software resources associated or available to the machine
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/81—Threshold
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5011—Pool
Definitions
- the embodiments of the present application relate to the field of computers, and more specifically, to an operating method and device for an embedded system, an embedded system, and a chip.
- multi-core processors have become important computing units in many fields.
- the multi-core processor can be used to carry services that are not sensitive to response speed, while the acceleration hardware can carry services that are sensitive to response speed.
- the above-mentioned service processing method has a low overall utilization rate of processing resources because most of the processing resources (for example, core resources) of the multi-core processor are idle.
- the embodiments of the present application provide an embedded system operation method and device, an embedded system and a chip, so as to at least solve the problem in the related art that the overall utilization rate of processing resources is low due to the fact that most of the processing resources of a multi-core processor are in an idle state.
- a method for operating an embedded system comprising: allocating a group of to-be-allocated services to corresponding operating systems in the embedded system according to a dynamic resource allocation rule, wherein the dynamic resource allocation rule comprises dynamically allocating resources according to at least one of the following: service response speed, service resource occupancy rate, service coupling degree, and service importance, the embedded system comprises a first operating system and a second operating system, the first operating system and the second operating system running on a processor, and the response speed of the first operating system is higher than that of the second operating system; determining a resource allocation result corresponding to the group of to-be-allocated services, wherein the resource allocation result is used to indicate the processing resources of the processor corresponding to each to-be-allocated service in the group of to-be-allocated services, the processing resources of the processor comprising a processor core; allocating the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each to-be-
- an embedded system including: a first operating system and a second operating system, the first operating system and the second operating system running on a processor, the response speed of the first operating system being higher than that of the second operating system; a service management module, used to allocate a group of to-be-allocated services to corresponding operating systems according to a resource dynamic allocation rule, wherein the resource dynamic allocation rule includes dynamic resource allocation according to at least one of the following: service response speed, service resource occupancy rate; a resource dynamic allocation module, used to determine a resource allocation result corresponding to the group of to-be-allocated services, wherein the resource allocation result is used to indicate the processing resources of the processor corresponding to each to-be-allocated service in the group of to-be-allocated services, and the processing resources of the processor include a processor core; a resource adaptive scheduling module, used to allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each to-be-alloc
- an embedded system including: a chip and at least two operating systems, wherein the chip includes a processor, a hardware controller, a first bus and a second bus, wherein the bandwidth of the first bus is higher than the bandwidth of the second bus, and the first bus is configured as a multi-master and multi-slave mode, and the second bus is configured as a one-master and multi-slave mode; the at least two operating systems run based on the processor, wherein the processing resources of the processor are dynamically allocated to the at least two operating systems, and the processing resources of the processor include a processor core; the at least two operating systems communicate through the first bus; and the at least two operating systems control the hardware controller through the second bus.
- an operating device for an embedded system comprising: a first allocation unit, configured to allocate a group of services to be allocated to a corresponding operating system in the embedded system according to a resource dynamic allocation rule, wherein the resource dynamic allocation rule comprises dynamically allocating resources according to at least one of the following: service response speed, service resource occupancy rate, service coupling degree, service importance, the embedded
- the embedded system includes a first operating system and a second operating system, wherein the first operating system and the second operating system run on a processor, and the response speed of the first operating system is higher than that of the second operating system; a first determining unit, used to determine a resource allocation result corresponding to the group of services to be allocated, wherein the resource allocation result is used to indicate the processing resources of the processor corresponding to each service to be allocated in the group of services to be allocated, and the processing resources of the processor include a processor core; a second allocating unit, used to allocate the processing resources of the processor to the first operating system and the second operating system
- a chip is further provided, wherein the chip includes at least one of a programmable logic circuit and an executable instruction, and the chip runs in an electronic device to implement the steps in any of the above method embodiments.
- a BMC chip is further provided, which includes: a storage unit and a processing unit connected to the storage unit, the storage unit is used to store a program, and the processing unit is used to run the program to execute the steps in any one of the above method embodiments.
- a mainboard which includes: at least one processor; at least one memory for storing at least one program; when the at least one program is executed by the at least one processor, the at least one processor implements the steps in any one of the above method embodiments.
- a server which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement the steps of any one of the above method embodiments when executing the program stored in the memory.
- a computer-readable storage medium in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
- an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
- a method of running different operating systems of an embedded system on different processing resources of a processor is to allocate a group of to-be-allocated services to corresponding operating systems in the embedded system according to a resource dynamic allocation rule, wherein the resource dynamic allocation rule includes dynamically allocating resources according to at least one of the following: service response speed, service resource occupancy rate, service coupling degree, and service importance.
- the embedded system includes a first operating system and a second operating system, and the first operating system and the second operating system run on the processor, and the response speed of the first operating system is higher than that of the second operating system; determining a resource allocation result corresponding to a group of to-be-allocated services, wherein the resource allocation result is used to indicate the processing resources in the processing resources of the processor corresponding to each to-be-allocated service in the group of to-be-allocated services, and the processing resources of the processor include a processor core; allocating the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each to-be-allocated service and the resource allocation result, because in the processing At least two operating systems of the embedded system are run on the processor, and different operating systems have different response speeds, which can be used to run services with different response speed requirements.
- the processor's to-be-executed services are allocated to different operating systems based on a dynamic resource allocation rule, and the to-be-executed services are allocated to different processing resources, so that the processor's processing resources can be dynamically allocated to different operating systems based on the correspondence between the to-be-executed services and the operating systems, and the correspondence between the to-be-executed services and the processing resources.
- FIG1 is a schematic diagram of a hardware environment of an embedded system operation method according to an embodiment of the present application.
- FIG2 is a flow chart of an optional embedded system operation method according to an embodiment of the present application.
- FIG3 is a schematic diagram of an optional operating method of an embedded system according to an embodiment of the present application.
- FIG4 is a schematic diagram of another optional operating method of an embedded system according to an embodiment of the present application.
- FIG5 is a schematic diagram of another optional operating method of an embedded system according to an embodiment of the present application.
- FIG6 is a schematic diagram of another optional operating method of an embedded system according to an embodiment of the present application.
- FIG7 is a schematic diagram of another optional operating method of an embedded system according to an embodiment of the present application.
- FIG8 is a flow chart of another optional embedded system operation method according to an embodiment of the present application.
- FIG9 is a schematic flow chart of another optional embedded system operation method according to an embodiment of the present application.
- FIG10 is a schematic diagram of an optional embedded system according to an embodiment of the present application.
- FIG11 is a schematic diagram of another optional embedded system according to an embodiment of the present application.
- FIG. 12 is a structural block diagram of an optional operating device of an embedded system according to an embodiment of the present application.
- FIG. 1 is a schematic diagram of the hardware environment of an operation method of an embedded system according to an embodiment of the present application.
- the server may include one or more (only one is shown in FIG. 1) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data.
- the above-mentioned server may also include a transmission device 106 and an input-output device 108 for communication functions.
- FIG. 1 is only for illustration, and it does not limit the structure of the above-mentioned server.
- the server may also include more or fewer components than those shown in FIG. 1, or have different configurations with equivalent functions as shown in FIG. 1 or more functions than those shown in FIG. 1.
- the memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the operation method of the embedded system in the embodiment of the present application.
- the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented.
- the memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
- the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
- the transmission device 106 is used to receive or send data via a network.
- the specific example of the above network may include a wireless network provided by a communication provider of the server.
- the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet.
- the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
- RF Radio Frequency
- FIG. 2 is a method for operating an embedded system according to an embodiment of the present application.
- the schematic diagram of the operation method of the selected embedded system is shown in FIG2 , and the process includes the following steps:
- Step S202 Allocate a group of services to be allocated to corresponding operating systems in the embedded system according to a resource dynamic allocation rule.
- the operation method of the embedded system in this embodiment can be applied to the scenario of running services on the processing resources of the processor and dynamically balancing the processing resources.
- the above-mentioned embedded system can be an embedded multi-system, which refers to running multiple operating systems (for example, a first operating system, a second operating system, etc.) in a multi-core processor of the embedded system, and these operating systems are simultaneously running in the same embedded system.
- the multiple operating systems can be the same type of operating system, or different types of operating systems, for example, heterogeneous operating systems (different types of operating systems with different architectures).
- the execution of the service on the processor can be executed in parallel by the processing resources on multiple cores of the processor.
- the processor here can be a multi-core processor, for example, an 8-core processor, or a processor containing other numbers of cores. In this embodiment, the number of cores contained in the multi-core processor is not limited.
- multi-core processors have become important computing units in cloud computing, AI (Artificial Intelligence), big data, industrial Internet, and 5G (5th Generation Mobile Communication Technology).
- AI Artificial Intelligence
- 5G 5th Generation Mobile Communication Technology
- virtualization technology can be introduced to improve the utilization of multi-core processors, that is, multiple virtual machines are virtualized based on the processor hardware platform, and each virtual machine runs an independent operating system.
- the acceleration hardware may include but is not limited to: FPGA (Field Programmable Gate Array), CPLD (Complex Programmable Logic Device) or dedicated ASIC (Application Specific Integrated Circuit) chips, etc.
- a method of running different operating systems of the embedded system on different processing resources of the processor is adopted. Different operating systems have different response speeds and can be used to run services with different response speed requirements.
- the processor's to-be-executed services are allocated to different operating systems based on dynamic resource allocation rules, and the to-be-executed services are allocated to different processing resources. Therefore, the processor's processing resources can be dynamically allocated to different operating systems based on the correspondence between the to-be-executed services and the operating systems, and the correspondence between the to-be-executed services and the processing resources.
- the embedded system includes a first operating system and a second operating system.
- the response speed of the first operating system is higher than that of the second operating system.
- the first operating system and the second operating system run on a processor, that is, run on different processing resources of the processor.
- the processing resources of the processor may include at least one of the following: processing resources of the first operating system (processing resources scheduled to the first operating system), processing resources of the second operating system (processing resources scheduled to the second operating system), and unallocated processing resources.
- the processor may be a multi-core processor (for example, an octa-core processor).
- the processing resources of the processor ie, processor resources
- a group of services to be allocated can be obtained, that is, services to be allocated to the first operating system and the second operating system. Since different services to be allocated may differ in terms of response speed, service resource occupancy rate, service coupling degree with other services, service importance, etc., a resource dynamic allocation rule can be pre-configured, and the resource dynamic allocation rule can include a rule for performing service allocation, and the service is allocated to the corresponding operating system so that the processing resources of the corresponding operating system execute the service allocated to itself.
- the resource dynamic allocation rule may include dynamically allocating resources according to at least one of the following: service response speed, service resource occupancy rate, service coupling degree, service importance, and different allocation rules may have corresponding priorities, for example, the priorities are in descending order: service importance, service coupling degree, service response speed, and service resource occupancy rate.
- a group of services to be allocated (or tasks to be allocated, and different services to be allocated may correspond to different processes) can be allocated to the corresponding operating system in the embedded system to obtain a service allocation result.
- the first operating system can be an operating system with clear and fixed time constraints. All processing processes (task scheduling) need to be completed within the fixed time constraints, otherwise the system will fail. It can be a real-time operating system (RTOS), such as FreeRTOS, RTLinux, etc., and can also be a real-time operating system in other embedded systems.
- RTOS real-time operating system
- the second operating system does not have this feature.
- the second operating system generally adopts a fair task scheduling algorithm. When the number of threads/processes increases, it is necessary to share CPU time. Task debugging is uncertain.
- Non-real-time operating system such as contiki, HeliOS, Linux (full name GNU/Linux, a set of freely disseminable Unix-like operating systems), etc.
- Linux full name GNU/Linux, a set of freely disseminable Unix-like operating systems
- non-real-time operating system in other embedded systems.
- the Linux system is a multi-user, multi-tasking, multi-threaded and multi-CPU operating system based on POSIX (Portable Operating System Interface).
- the business assigned to the first operating system is usually a real-time business.
- Real-time business refers to business that needs to be scheduled within a specified time. The business requires the processor to process it at a fast enough speed, and the processing result can control the production process or respond quickly to the processing system within the specified time.
- the control of the robot arm in industrial control is a real-time business. The system needs to take timely measures before detecting the robot arm's misoperation, otherwise it may cause serious consequences.
- the business assigned to the second operating system is usually a non-real-time business.
- Non-real-time business refers to business that is not sensitive to scheduling time and has a certain tolerance for scheduling delays, for example, reading sensor data from a temperature sensor in a server.
- a real-time operating system is an operating system that can accept and process external events or data at a fast enough speed when they occur, and its processing results can control the production process or respond quickly to the processing system within the specified time, dispatch all available resources to complete real-time business, and control all real-time business to run in a coordinated and consistent manner. It has the characteristics of timely response and high reliability.
- allocating a group of services to be allocated to the corresponding operating system may be performed by a service management module, as shown in FIG3 , the service management module may be a software module running on the first operating system or the second operating system, and taking running on the second operating system as an example, the service management module may be implemented by software in a Linux system.
- the service management module may allocate a group of services to be allocated to the corresponding operating system in the embedded system according to a resource dynamic allocation rule.
- Step S204 determining a resource allocation result corresponding to a group of services to be allocated, wherein the resource allocation result is used to indicate a processing resource in the processing resources of the processor corresponding to each service to be allocated in the group of services to be allocated.
- corresponding processing resources can be allocated to each to-be-allocated service according to the service allocation result, and a resource allocation result corresponding to a group of to-be-allocated services can be obtained.
- the services allocated to the first operating system can be allocated processing resources of the first operating system
- the services allocated to the second operating system can be allocated processing resources of the second operating system.
- the unallocated processing resources can be allocated to some services.
- the processing resources of the processor can be dynamically allocated in units of time slices. Considering the frequent switching of the operating systems to which the processing resources belong and the fact that the service processing time is not necessarily an integer multiple of the time slice, which leads to the extension of the response time of some services, the processing resources can be allocated to the first operating system and the second operating system in units of processor cores, that is, the processor cores of the processor are allocated to the corresponding operating systems in units of the entire processor core, the number of processor cores allocated to each operating system is an integer, and the processor cores allocated to different operating systems are mutually exclusive. Not the same.
- the resource dynamic allocation module can be a software module running on the first operating system or the second operating system. Taking running on the second operating system as an example, the resource dynamic allocation module can be implemented by a software module in the second operating system, which can dynamically allocate processing resources for the service based on the output of the service management module.
- the software module can be a program module with preset functions. For example, for the resource dynamic allocation module, it can be a program module with a resource dynamic allocation function.
- the service management module it can be a program module with a service management function.
- Each software module can be deployed and adjusted as a whole and can be applied in different application projects.
- Step S206 Allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each service to be allocated and the resource allocation result.
- the processing resources of the processor can be allocated to the first operating system and the second operating system.
- the unallocated processing resources of the processor can be allocated to the operating system corresponding thereto, and the unallocated processing resources can be determined based on the correspondence between the unallocated processing resources and the to-be-allocated service and the correspondence between the to-be-allocated service and the operating system.
- the allocation of the processing resources of the processor to the first operating system and the second operating system can be performed by a resource adaptive scheduling module (e.g., a core adaptive scheduling module), which can be a software module running on the first operating system or the second operating system.
- the resource adaptive scheduling module can be implemented by software in the Linux system, which can complete the actual scheduling action of the processing resources of the processor (e.g., the processor hard core resources) according to the output of the business management module and the output of the resource dynamic allocation module.
- M cores of the (M+N) cores are scheduled to the real-time operating system, and N cores are scheduled to the non-real-time operating system.
- heterogeneous operating systems can be run on different hard cores of the same processor, so that the entire processor system has the ability to process real-time and non-real-time services in parallel.
- processor hard core resources for example, processor cores
- the processor resource utilization rate can be significantly improved.
- heterogeneous means that the types of operating systems running on the same multi-core processor of the embedded system are different, and multi-system means that there are multiple operating systems running on the same multi-core processor of the embedded system, and these operating systems are running simultaneously in the time dimension.
- servers must at least have the characteristics of high scalability and high stability.
- the server since the enterprise network cannot remain unchanged for a long time, in today's network information age, if the server does not have a certain degree of scalability, it will affect the use of the server in the enterprise, and then affect the future development of the enterprise. Therefore, scalability has become the most basic feature required by the server. Only with high scalability can better utilization in the future be guaranteed.
- scalability also includes software scalability. Since the functions of the server are still very complex compared to computers, not only the hardware configuration, but also the software configuration is also very important. If you want to achieve more functions, it is impossible to imagine it without comprehensive software support.
- the server since the server needs to process a large amount of data to support the continuous operation of the business, the server also has a very important feature, such as high stability. If the data transmission of the server cannot run stably, it will undoubtedly have a great impact on the business development.
- the solution of the present application utilizes the high scalability of the server, introduces a first operating system and a second operating system dual software system for generating hardware interface signals, and can also introduce hardware devices such as GPLD and BMC chips for adjusting the transmission voltage of the hardware interface signal and monitoring the operating status of other devices inside the server.
- the present application adopts a method in which the hardware interface signal corresponding to the request command is generated by the first operating system. First, the request command is obtained through the first operating system, and then the multiple logical bit information corresponding to the request command is determined, and finally the hardware interface signal corresponding to the request command is generated according to the multiple logical bit information and the timer.
- the present application generates the hardware interface signal corresponding to the request command through the first operating system, thereby realizing the technical effect of simulating the generation of the hardware interface signal using software, and then achieving the purpose of hardware logic design without the chip itself having the relevant hardware interface signal, which can not only reduce the chip design difficulty, but also reduce the chip design cost.
- the present application achieves the purpose of using the software system to generate the hardware interface signal on the basis of not needing to perform hardware logic design of the hardware interface signal on the chip, thereby reducing the chip design difficulty, and then solving the technical problem of the high chip design cost caused by the hardware logic design of the controller required in the related technology.
- the introduction of the first operating system and the second operating system dual software system can also ensure the stability of the server. Since the business response speed of the second operating system is lower than that of the first operating system, the first operating system with a faster business response speed is used to generate hardware interface signals, which can ensure that the generation of hardware interface signals will not be interrupted, thereby ensuring that the hardware interface signals can be output continuously and stably.
- a group of to-be-allocated services are allocated to the corresponding operating systems in the embedded system according to the dynamic resource allocation rule, wherein the dynamic resource allocation rule includes dynamically allocating resources according to at least one of the following: service response speed, service resource occupancy rate, service coupling degree, service importance, and the embedded system includes a first operating system and a second operating system, the first operating system and the second operating system are run on a processor, and the response speed of the first operating system is higher than that of the second operating system; a resource allocation result corresponding to a group of to-be-allocated services is determined, wherein the resource allocation result is used to indicate the processing resources of the processor corresponding to each to-be-allocated service in the group of to-be-allocated services, and the processing resources of the processor include a processor core; according to the operating system corresponding to each to-be-allocated service and the resource allocation result, the processing resources of the processor are allocated to the first operating system and the second operating system, thereby solving the problem of low overall
- the method further comprises:
- the resource dynamic allocation rules can be configured based on the rule configuration file.
- a rule structure for recording the resource dynamic allocation rules can be generated.
- the rule configuration file can be a load balancing policy file (payload_balance.config).
- the load balancing policy file can be used to configure the classification method of various running services (or processes), the evaluation principle of the real-time level, etc. Different parameters can be used to configure the resource dynamic allocation rules in the load balancing policy file.
- An example of a load balancing policy configuration file is as follows:
- classification kinds 2 //A value of 1 means that the processes are classified according to attributes such as important and non-important. Otherwise, the processes are classified according to the preset classification method (such as real-time and non-real-time);
- real-time grade evaluation 2//A value of 1 means that the average CPU usage in the past statistical minutes is used as the process real-time grade evaluation principle; otherwise, it means that the preset priority is used as the process real-time grade evaluation principle;
- the resource dynamic allocation rules can be stored in a load balancing policy module, where the load balancing policy module can be a software module running under the first operating system or the second operating system (for example, a software module running under the Linux system), which can provide policy guidance for the service management module, including the classification method of various services (or processes) running in the system, the evaluation principle of the real-time level, etc.
- the service management module can divide and manage the services in the system according to the real-time level, and further guide the resource adaptive scheduling module to reallocate processor resources. Exemplarily, it can perform actual classification of services based on the output of the load balancing policy module to generate a list containing real-time services and non-real-time services.
- the rules based on which the business management module performs business management can be dynamically configured, and further rules can be set on the basis of existing rules. Multiple rules with the same function can be set in the business management module, but there is no contradiction between the rules, that is, the current rule in use can be determined among the rules with the same function based on the rule selection conditions such as the configuration time of the rule and the priority of the rule, so as to avoid contradictions between the rules.
- the above configuration file load_balance.config describes a possible situation.
- the classification_kinds variable indicates the specific classification standard (for example, according to the importance or real-time nature of the business) and the classification category (for example, important business and general business, real-time business and non-real-time business, etc.), and the real-time_grade_evaluation variable indicates the real-time evaluation standard (which can be the average CPU occupancy rate in the past statistic_minutes minutes or the preset business priority).
- the real-time grade type is defined by the user and can be defined as high, normal, and low, or it can be subdivided into more types.
- the output of the load balancing strategy module is the configured classification method, real-time level evaluation principle, etc. When implemented in software, it can be a specific configuration file (such as the load_balance.config file) or a structure variable. These files or structure variables can eventually be accessed by the business management module to obtain the specific load balancing strategy.
- the method further comprises:
- the rule structure can be in a fixed format, that is, it is not allowed to be modified during the operation of the embedded system, or it can be in a flexibly configurable format, that is, it can be configured and changed through a configuration file in a specific format.
- a rule update configuration file can be obtained, and the rule update configuration file is used to update the configured resource dynamic allocation rules; using the rule update configuration file, the rule structure can be updated, thereby updating the resource dynamic allocation rules recorded in the rule structure.
- the configuration file in a specific format can be read through the external interface of the first operating system or the second operating system.
- the second operating system can be responsible for the dynamic resource scheduling of the embedded system.
- the rule update configuration file can be obtained through the external interface of the second operating system.
- the load balancing policy module may be in a fixed format, or may be configured through an external interface of the Linux system.
- a configuration file (load_balance.config) in a specific format as described above may be defined, and configuration changes may be made through file reading and writing.
- the external interface is the external interface of the multi-core processor, which can be a network interface, SPI (Serial Peripheral Interface) controller interface, UART (Universal Asynchronous Receiver/Transmitter) serial port, etc., as long as it can obtain data from the outside world.
- SPI Serial Peripheral Interface
- UART Universal Asynchronous Receiver/Transmitter
- the configuration file can be loaded from the Web (World Wide Web) interface through the network interface; the configuration file can be read from the SPI Flash (flash memory) of the board through the SPI controller; the configuration file can be obtained from the serial port data receiving and sending software tool on another PC (Personal Computer) through the UART serial port.
- allocating a group of services to be allocated to corresponding operating systems in an embedded system according to a resource dynamic allocation rule includes:
- the pending services can be allocated to the corresponding operating system based on the service response speed requirements of the pending services.
- the service response speed can be used to evaluate the real-time level of the service. The higher the service response speed requirement, the more sensitive it is to the scheduling time and response speed of the operating system. The higher the real-time level, the higher the service response speed requirement.
- the service needs the operating system to process it at a sufficiently fast speed, and the processing results can control the production process or respond quickly to the processing system within the specified time.
- the service with low service response speed requirements has a certain tolerance for scheduling delays.
- the services to be allocated whose service response speed requirement is greater than or equal to the set response speed threshold they are sensitive to the scheduling time and response speed of the operating system. Therefore, such services to be allocated can be allocated to the first operating system (for example, real-time services are allocated to the real-time operating system). For the services to be allocated whose service response speed requirement is less than the set response speed threshold, they are not sensitive to the response speed and scheduling time. Therefore, such services to be allocated can be allocated to the second operating system (for example, non-real-time services are allocated to the non-real-time operating system).
- the service response speed requirement can be indicated by an indication parameter of the service response speed
- the set response speed threshold can be a millisecond-level response speed threshold or a second-level response speed threshold.
- the response speed threshold for example, 100ms, 200ms, 1s, etc., is not limited in this embodiment.
- a first service list corresponding to the first operating system and a second service list corresponding to the second operating system can be output, the first service list being used to record services allocated to the first operating system, and the second service list being used to record services allocated to the second operating system, that is, the service allocation result includes the first service list and the second service list, and the output first service list and the second service list can be used to perform a dynamic scheduling process of the processor's processing resources.
- the real-time level of system services is classified to obtain a list of real-time services and non-real-time services. Assume that there are 20 services in total, of which real-time services are services 1 and 2, and non-real-time services are services 3 to 20.
- the business management module can classify the current business to be executed.
- the business management module classifies these businesses according to the output of the load balancing module.
- different businesses will be assigned to different operating systems (RTOS system and Linux system) for execution.
- RTOS system and Linux system operating systems
- the business management module will continue to divide the business and divide and manage the existing businesses in real time according to the load balancing strategy.
- the business management module can be a resident process in the Linux system. It is always running and manages and divides the currently running processes.
- allocating a group of services to be allocated to corresponding operating systems in an embedded system according to a resource dynamic allocation rule includes:
- the services to be allocated can be allocated to the corresponding operating system based on the service resource occupancy rate of the services to be allocated.
- the service resource occupancy rate can be the average proportion of the services to the processing resources per unit time (for example, the CPU occupancy rate per minute).
- the service resource occupancy rate affects the response speed of the service and the response speed of subsequent services. Therefore, the real-time level of the service can be evaluated based on the service resource occupancy rate. The higher the service resource occupancy rate, the greater the impact on the scheduling time and response speed of the operating system, and the lower the real-time level. For services with low service resource occupancy rate, the impact on the scheduling time and response speed of the operating system is not large, and the real-time level is higher.
- the impact on the scheduling time and response speed of the operating system is not significant, and such services to be allocated can be allocated to the first operating system.
- the impact on the scheduling time and response speed of the operating system is greater, and therefore, such services to be allocated can be allocated to the second operating system.
- the first occupancy rate threshold can be configured as needed, and it can be 10%, 15%, 20% or other thresholds, and at the same time, the first occupancy rate threshold can be dynamically adjusted.
- allocating a group of services to be allocated to corresponding operating systems in an embedded system according to a resource dynamic allocation rule includes at least one of the following:
- S52 Allocate to-be-allocated services whose service coupling degree with the services allocated to the second operating system is greater than or equal to a second coupling degree threshold value among a group of to-be-allocated services to the second operating system.
- the services to be allocated can be allocated to the corresponding operating systems based on the service coupling degree of the services to be allocated.
- the service coupling degree can be used to indicate the degree of association between the services to be allocated and the allocated services in each operating system. If the service coupling degree of a service to be allocated is high with the allocated services of a certain operating system, it is not appropriate to allocate it to another operating system. Therefore, the services to be allocated can be allocated to the corresponding operating systems based on the service coupling degree between the services to be allocated and the allocated services in each operating system.
- the business coupling can be evaluated by the association between the input and output of the business.
- the business coupling can be represented by different coupling levels. If there is no relationship between the input and output of the business, the coupling level is low (or other coupling levels indicating no association between the businesses). If the execution of a business depends on the output of another application (the business cannot start without the output as input), the coupling level between the businesses is high. If the execution of a business uses the output of another application, but the output does not hinder the normal execution of the business (the output can be obtained when the business executes the corresponding operation, and the corresponding operation is not a core operation), the coupling level between the businesses is medium.
- the business coupling can also be represented by a numerical value. The business coupling can be evaluated by one or more coupling conditions (for example, the association between input and output), and the numerical value corresponding to the satisfied coupling condition is determined as the numerical value of the business coupling.
- to-be-allocated businesses in a group of to-be-allocated businesses whose business coupling degree with the allocated businesses of the first operating system is greater than or equal to a first coupling degree threshold then such to-be-allocated businesses can be allocated to the first operating system; and if there are to-be-allocated businesses in a group of to-be-allocated businesses whose business coupling degree with the allocated businesses of the second operating system is greater than or equal to the first coupling degree threshold, then such to-be-allocated businesses can be allocated to the second operating system.
- the service management module is also responsible for service decoupling evaluation and management, that is, finding out from all real-time services the services that can be separated out and handed over to the real-time operating system for running, so that the hardware resource dynamic allocation module can reallocate processor resources. For services that cannot be separated out and handed over to the real-time operating system for running, if they have a high degree of service coupling with non-real-time services, they can be allocated to the non-real-time operating system.
- the reallocation strategy is open.
- One possible strategy is: when the system runs for the first time, processor cores are allocated according to the ratio of the number of services allocated to the real-time operating system and the non-real-time operating system by the business management module. During subsequent operations, resource allocation is adjusted according to the core resource occupancy rate of each system in the dual system. From this perspective, the reallocation process and the core preemption and release process are mutually coordinated processes.
- the service running on the first operating system may include, but is not limited to, a service for generating a hardware interface signal.
- a process for generating a hardware interface signal is provided, and the process includes the following steps:
- Step 1 obtain a request command through the first operating system.
- the request command can be a command to generate a hardware interface signal.
- the hardware interface signal can be a PECI signal, and the request command is a PECI request command based on the PECI protocol.
- the hardware interface signal can also be a hardware interface signal of other protocol types, for example, HDMI (high definition multimedia interface) signal, RGMII (reduced gigabit media independent interface, parallel bus) signal, SGMII (serial gigabit media independent interface, single-channel serial bus) signal, GPIO (general purpose input/output, general input and output port) signal, SPI (serial peripheral interface, serial peripheral interface) signal, etc.
- the request command can also be a request command of other protocol types.
- the hardware interface signal is a GPIO signal
- the request command is a GPIO request command. This application does not specifically limit the specific types of request commands and hardware interface signals.
- Step 2 determine multiple logical bit information corresponding to the request command.
- the first operating system can analyze and obtain multiple logical bit information corresponding to the request command, wherein there is a sequence between the multiple logical bit information.
- the first operating system can generate a waveform signal (i.e., a hardware interface signal) corresponding to the request command through the multiple logical bit information corresponding to the request command, thereby transmitting the information contained in the request command to other devices through the hardware interface signal.
- the request command includes at least one field, each field can be represented by a logical bit 0 or 1, on this basis, the corresponding conversion relationship between each field and the logical bit 1 or 0 is the logical bit information corresponding to the field, and in the case where the request command corresponds to multiple fields, the request command corresponds to multiple logical bit information.
- each logical bit can be represented by a combination of a high-level signal and a low-level signal. For example, for a logical bit 0, a high-level signal of a first preset duration and a low-level signal of a second preset duration can be used to represent it in combination.
- a high-level signal of a second preset duration and a low-level signal of a first preset duration can be used to represent it in combination, wherein the first preset duration and the second preset duration are respectively a high-level signal and a low-level signal of a first preset duration.
- the preset duration is different.
- each logic bit contains both a high-level signal and a low-level signal, each logic bit is actually represented by a waveform signal (the transformation between the high-level and low-level signals is presented as a waveform).
- the hardware interface signal corresponding to the request command is a waveform signal obtained by combining the waveform signals corresponding to each logic bit information.
- Step 3 Generate a hardware interface signal corresponding to the request command according to the multiple logic bit information and the timer.
- the timer in step 3 may be a timing program in the first operating system, or a register on the chip where the first operating system is located, wherein the timer may at least provide a timing function and a counting function.
- the present application uses the timing function and the counting function of the timer, and combines multiple logic bit information to generate a hardware interface signal corresponding to the request command.
- the related art in order to realize the PECI communication between the BMC chip and components such as the CPU, the related art requires the BMC chip itself to have the hardware logic design of the PECI controller, which leads to the problem of high design cost of the BMC chip.
- the hardware logic design of the PECI controller in order to generate a PECI signal on the BMC chip, the hardware logic design of the PECI controller must be implemented on the BMC chip in advance, while in the present application, only the first operating system is required to generate a PECI signal on the BMC chip, and there is no need to implement the hardware logic design of the PECI controller on the BMC chip, thereby reducing the design difficulty and design cost of the BMC chip.
- the method of generating a hardware interface signal corresponding to a request command by the first operating system is adopted.
- the request command is obtained through the first operating system, and then multiple logical bit information corresponding to the request command is determined.
- the hardware interface signal corresponding to the request command is generated based on the multiple logical bit information and the timer.
- the hardware interface signal corresponding to the request command is generated by the first operating system, thereby realizing the technical effect of simulating the generation of the hardware interface signal by software, and then achieving the purpose of using the software system to generate the hardware interface signal without the need for hardware logic design of the hardware interface signal of the chip, which can not only reduce the difficulty of chip design, but also reduce the design cost of the chip.
- request data is obtained, wherein the first operating system and the second operating system run on the same processor, the request data is generated by the second operating system, and the service response speed of the second operating system is lower than the service response speed of the first operating system.
- the first operating system parses the request data to obtain a request command.
- the requested data can be stored in the target memory (i.e., the storage space on the processor) through the second operating system, and after the requested data is stored, the first request is triggered through the second operating system, wherein the first request is used to notify the first operating system to read the requested data from the target memory, and the target memory is a memory that can be accessed by both the first operating system and the second operating system.
- the target memory i.e., the storage space on the processor
- the first operating system may also receive response data corresponding to the hardware interface signal, wherein the transmission form of the response data is the same as the transmission form of the hardware interface signal. Secondly, the first operating system also adjusts the data structure of the response data to a second data structure.
- a second request is triggered through the first operating system, wherein the second request is used to notify the second operating system to read the response data.
- PECI signal Take the first operating system as RTOS system, the second operating system as Linux system, and the hardware interface signal as PECI signal as an example.
- the upper-layer application involved in PECI business in the Linux system (such as fault diagnosis, CPU temperature acquisition, etc.) firstly initiates PECI request commands according to the needs.
- These request commands include but are not limited to the basic Ping() command, the command to obtain CPU temperature and the command to read MSR register information, etc.
- the code implementation of different PECI request commands is completed by the corresponding interface function.
- the Linux system writes the target address, read/write length, command code, para parameter and other request data of each request command into the target memory according to the PECI protocol specification, and after all the request data are written into the target memory, the Linux system generates a first request to notify the RTOS system.
- the first request may be an SGI interrupt request (software generated interrupt, a communication interrupt request between processor cores).
- the second operating system stores the request data in the target memory in the form of a first data structure, wherein the first data structure at least includes a device address, a write length, a read length, a command code, and a request parameter, the device address is used to characterize the address of the target device, the target device is a device that generates response data based on a hardware interface signal, the command code is used to distinguish different request commands, the write length is used to characterize the number of bytes from the command code to the end of the request data, and the read length is used to characterize the request.
- the request data contains the number of bytes including the completion code and the read data.
- the request parameters are used to represent the parameters of the request command.
- the RTOS system receives the response data from the PECI bus, and then completes the data parsing to convert the signal form of the response data from the form of the hardware interface signal to the form of the software signal, for example, identifying the waveform changes between the high-level signal and the low-level signal in the hardware interface signal, thereby obtaining the corresponding logical bit information, and obtaining the software signal data based on the logical information.
- the parsed response data is adjusted by the command parameter structuring module and written into the target memory.
- the RTOS system triggers the second request to notify the Linux system.
- the Linux system detects the second request, actively reads the parsed response data stored in the target memory, and returns the data to the upper application after processing.
- the second request can be an SGI interrupt request.
- the target memory can also be other memories, such as random access memory (RAM), flash memory, etc.
- RAM random access memory
- flash memory etc.
- the first operating system may convert the voltage of the hardware interface signal to obtain a target hardware interface signal.
- the first operating system can input the hardware interface signal into the voltage conversion device to obtain the target hardware interface signal output by the voltage conversion device.
- the above-mentioned voltage conversion device can be a CPLD, and the CPLD can be connected to the target device, wherein the target device can be a CPU in a server. It should be noted that in addition to being applied to replacing the PECI interface to generate the PECI signal, the above-mentioned service can also be applied to other hardware interfaces.
- the first operating system and the second operating system of the combined embedded system realize the interaction of data in the embedded system through inter-core interrupts and shared memory, build a waveform generation function module for request commands in the RTOS system, and realize the communication of hardware interface signals between the embedded system and external devices through software simulation.
- the high real-time characteristics of the RTOS system are fully utilized to ensure the accuracy of the timing when simulating the request command waveform, which is flexible and efficient. It can significantly reduce the difficulty of chip design.
- the hardware interface signal is generated by software simulation, it provides more possibilities for the optimized design between the communication function and other business functions in the embedded system.
- the controller in the chip specifically used to realize the hardware interface signal communication is omitted, the design cost and manufacturing cost of the chip can be reduced.
- the service running on the first operating system may include, but is not limited to, a serial port switching service.
- a serial port switching process is provided, which includes the following steps:
- Step 1 When it is detected that the second operating system receives a serial port switching instruction, the second operating system sends the serial port switching instruction to the first operating system.
- the second operating system can detect whether the serial port switching instruction initiated by the user is received.
- the serial port switching instruction needs to include information of the target serial port to be switched to, for example, the serial port switching instruction includes the serial port number of the target serial port to be switched to.
- the format of the serial port switching command can be ⁇ switch_command_app-n number-t sleep_time>, where switch_command_app represents the switching command program, -n represents the target serial port number for switching, number can take the value of 1, 2, or 3, -t represents how long to sleep after the command is initiated before executing the switching action, and sleep_time is in seconds.
- serial ports that can currently be switched can be numbered so that when switching serial ports is subsequently performed, the target serial port can be switched by the serial port number.
- the serial ports that can currently be switched include: BMC Linux system serial port, server BIOS (Basic Input Output System) serial port and SMART NIC (network interface controller) serial port.
- BMC Linux system serial port server BIOS (Basic Input Output System) serial port
- SMART NIC network interface controller
- 1 can represent the BMC Linux system serial port
- 2 represents the server BIOS serial port
- 3 represents the SMART NIC serial port.
- Step 2 Execute serial port switching according to the serial port switching instruction through the first operating system.
- the second operating system when detecting that the second operating system receives the serial port switching instruction, the second operating system will immediately send the serial port switching instruction to the first operating system.
- the first operating system and the second operating system can be run in two processor cores respectively, and then the first operating system and the second operating system use inter-core communication, which can help improve the reliability of signal transmission.
- the response speed of the first operating system to instructions is much faster than the response speed of the second operating system to instructions, so the first operating system can quickly respond to the serial port switching instruction and complete the switching work in a very short time.
- the serial port switching software function is implemented by replacing CPLD or FPGA with the first operating system and the second operating system running in the same processor.
- the second operating system receives a serial port switching instruction
- the second operating system forwards the serial port switching instruction to the first operating system
- the first operating system implements serial port switching according to the serial port switching instruction, thereby avoiding the need to connect various serial ports through CPLD or FPGA in the related technology, and then use the switch structure in CPLD or FPGA to implement serial port switching, reducing hardware costs
- the technical method proposed in this solution can not only effectively reduce the serial port switching cost, but also effectively improve the efficiency of serial port switching.
- the serial port switching instruction at least includes: the serial port number of the target serial port.
- the following steps are included: obtaining the parsing rules of the serial port switching instruction from the target memory through the first operating system; parsing the serial port number of the target serial port in the serial port switching instruction according to the parsing rules, and determining the device corresponding to the serial port number, wherein the target serial port is the serial port of the device, and the target serial port is connected to the chip.
- Executing serial port switching according to the serial port switching instruction through the first operating system includes: determining the serial port address of the device through the first operating system; and mapping the target serial port to the target output interface of the chip according to the serial port address.
- the first operating system may parse the serial port switching instruction, and then obtain the device corresponding to the target serial port.
- the parsing rules for the serial port switching instructions can be customized according to the different chips or server motherboards, and the parsing rules can be stored in the target memory, which can be a storage medium such as an electrically erasable programmable read-only memory (EEPROM) or a non-volatile memory (Flash). It should be noted that the target memory can be deployed in the chip or not. By storing the parsing rules in the target memory, the security of the data is improved, and the parsing rules can be customized according to the different chips or server motherboards, so that the programmability and scalability are better.
- EEPROM electrically erasable programmable read-only memory
- Flash non-volatile memory
- the first operating system After the first operating system receives the serial port switching instruction, it reads the parsing rule of the serial port switching instruction from the target memory, and then uses the parsing rule to parse the serial port number of the target serial port in the serial port switching instruction to obtain the device corresponding to the serial port number.
- the first operating system can map the target serial port to the target output interface of the chip through the serial port address of the device. After mapping the serial port address of the device to the target output interface, the device can be accessed through the target output interface. It should be noted that the serial port switching instruction and parsing rules can be set according to the model of the chip used and the type of the first operating system and the second operating system.
- the chip includes: a serial data bus. Before determining the serial port address of the device through the first operating system, the method also includes: determining multiple devices connected to the serial port of the serial data bus; mapping the serial port of each device to the memory of the chip through the serial data bus to obtain the serial port address of each device.
- the above chip also includes a serial data bus, and the TX and RX of the serial ports of multiple devices are currently connected to the serial data bus.
- the current serial ports include the BMC Linux system serial port (UART1), the server BIOS serial port (UART2), and the SMART NIC serial port (UART3).
- UART Universal Asynchronous Receiver/Transmitter.
- the serial port data bus will map the TX and RX data of different serial ports of UART1, UART2 and UART3 to different address spaces of the BMC memory, that is, the above-mentioned mapping of the serial port of each device to the memory of the chip through the serial data bus.
- UART1 TX and RX buffer are the serial port address of serial port UART1
- UART2 TX and RX buffer are the serial port address of serial port UART2
- UART3 TX and RX buffer are the serial port address of serial port UART3.
- the first operating system selects three different memory segments mapped by UART (one out of three), and exchanges the data of one of the memory segments to the customer, so as to achieve the purpose of simulating the CPLD hardware serial port switching circuit. It should be noted that if the serial ports of different devices cannot be distinguished, the developer cannot accurately locate which device's serial port has a problem during maintenance. Therefore, it is necessary to locate the abnormal problem through serial port switching.
- the smart network card connection includes: detecting, by means of the smart network card, whether an access request to a target serial port is received; and if an access request to the target serial port is received, forwarding the access request to the target serial port by means of the smart network card.
- the target output interface of the chip can also be connected to a target smart network card, and then the smart network card detects whether a user's access request to the target serial port is received. If an access request to the target serial port is received, the serial port of the device can be directly accessed through the target smart network card to realize the SOL (Serial over LAN, a specification of a data packet format and protocol) function. Through the above steps, the efficiency of serial port access to the device is improved.
- SOL Serial over LAN, a specification of a data packet format and protocol
- the following steps are also included: obtaining the execution result of the serial port switching instruction through the first operating system, wherein the execution result is one of the following: switching success and switching failure; sending the execution result to the second operating system through the first operating system.
- the execution result of the serial port switching instruction is received through the second operating system, wherein the execution result is sent from the first operating system to the second operating system, and the execution result is one of the following: serial port switching success and serial port switching failure.
- the first operating system switches the serial port, it will obtain the execution result of the serial port switching instruction, and then feed back the execution result of the serial port switching instruction to the second operating system, informing the second operating system of the serial port success or failure.
- the second operating system after receiving the execution result of the serial port switching instruction through the second operating system, it also includes: if the execution result is execution failure, repeatedly executing the step of sending the serial port switching instruction to the first operating system through the second operating system until the execution result is successful, or the number of serial port switching executions exceeds the preset number. If the number of serial port switching executions exceeds the preset number, a prompt signal is triggered through the second operating system, wherein the prompt signal is used to prompt that the serial port switching fails.
- the execution result of the serial port switching instruction is execution failure, then it is necessary to repeat the step of sending the serial port switching instruction to the first operating system through the second operating system until the execution result is successful, or the number of serial port switching executions exceeds the preset number of times, which can be set to 3 times. If the number of serial port switching executions exceeds the preset number of times, the corresponding second operating system triggers a prompt signal to prompt that the serial port switching has failed, so that this situation can be handled in a timely manner.
- the method Before detecting that the first operating system has received a serial port switching instruction, the method also includes: after the second operating system is started, the second processor core triggers a first interrupt and sends a first signal to the first operating system; the first operating system detects the operating status of multiple serial ports in the chip according to the first signal to obtain a detection result; the first processor core triggers a second interrupt and sends the detection result to the second operating system through a second signal; and the second operating system receives the detection result to determine the number of serial ports in the chip that are operating normally.
- the second processor core After the second processor core triggers the first interrupt and sends the first signal to the first operating system, it detects whether the first operating system receives the first signal; if the first operating system receives the first signal, the first operating system detects the operating status of multiple serial ports in the chip to obtain a detection result.
- the second processor core triggers the first interrupt (IPI interrupt, IPI, inter processor interrupts) to send a first signal to the first operating system.
- the first operating system can know from the first signal that the second operating system has been started normally and can interact normally with the second operating system.
- the first operating system will detect the operating status of multiple serial ports in the chip according to the first signal to determine whether all serial ports are operating normally.
- the first processor core triggers a second interrupt to send the detection result to the second operating system through a second signal.
- the second operating system determines the number of switchable serial ports (i.e., the number of serial ports that are operating normally) through the detection result, so as to subsequently switch the serial ports.
- the first operating system starts to block and wait for the serial port switching instruction issued by the second operating system.
- the first operating system is RTOS
- the second operating system is Linux
- the first operating system runs on CPU0
- the second operating system runs on CPU1.
- the preparation steps before serial port switching include: when the Linux system on CPU1 is started to a specific stage, CPU1 will trigger an IPI interrupt to notify the RTOS system on CPU0 that Linux has been started normally and can interact normally with Linux on CPU1. After the RTOS system receives the IPI interrupt from CPU1, it will start the serial port switching controller program to check whether UART1, UART2, and UART3 are normal.
- CPU0 triggers another IPI interrupt to notify the Linux operating system on CPU1 that the RTOS system has been started and reports
- the information includes the number of switchable serial ports that the RTOS operating system on CPU0 has, and then the RTOS operating system on CPU0 starts to block and wait for the switching instruction issued by the operating system on CPU1.
- a serial port switching instruction is sent to the first operating system through the service terminal; and the first operating system executes the serial port switching according to the serial port switching instruction.
- the second operating system Since the second operating system has many functions and a large business volume, it may run abnormally or need to be restarted.
- the serial port switching instruction can be directly sent to the first operating system through the service terminal to ensure that the first operating system performs the serial port switching normally.
- the service terminal can be a terminal on the server where the chip is located.
- the first operating system and the second operating system running in the same processor are used to replace the CPLD or FPGA to implement the serial port switching software function.
- the second operating system receives the serial port switching instruction
- the second operating system forwards the serial port switching instruction to the first operating system.
- the first operating system implements the serial port switching according to the serial port switching instruction, thereby avoiding the use of hardware to implement serial port switching and reducing hardware costs.
- the serial port switching can be completed quickly in a very short time. Therefore, the above process can not only effectively reduce the serial port switching cost, but also effectively improve the efficiency of serial port switching.
- allocating a group of services to be allocated to corresponding operating systems in an embedded system according to a resource dynamic allocation rule includes:
- the to-be-allocated business containing sensitive data for example, sensitive information such as passwords
- sensitive data for example, sensitive information such as passwords
- the target operating system is the operating system between the first operating system and the second operating system that has a low frequency of interaction with the user object, or an operating system with a fast response speed, for example, the first operating system.
- the business processing module is responsible for further isolating the system business at the hard-core level of security protection, that is, dividing important sensitive businesses (not wanting to be exposed to users) into real-time businesses, and ultimately achieving the unloading of these businesses from non-real-time operating systems to real-time operating systems, thereby achieving the effect of security protection.
- the different businesses divided by the business processing module can be organized in the form of structures during software implementation.
- sensitive businesses refer to: security-related businesses, such as user passwords, identity information, and other businesses involving user personal privacy.
- the hard-core level means that the business is isolated at the processor core level, that is, sensitive business is allocated to the real-time operating system (the core occupied by the real-time operating system is different from that of the non-real-time operating system, so it belongs to the core level isolation).
- the frequency and degree of interaction between the real-time operating system and the user are relatively weak, so it is difficult for users as users to "detect" the sensitive data generated by the business running on it.
- user identity authentication management, security encryption and other businesses belong to the above-mentioned important sensitive businesses.
- the above-mentioned businesses are forcibly divided into real-time businesses. When the hardware resources are dynamically allocated later, the above-mentioned businesses can be realized in the real-time operating system, which has a safe isolation effect.
- determining a resource allocation result corresponding to a group of services to be allocated includes:
- the allocation result of a group of services to be allocated is used to indicate the corresponding relationship between the services to be allocated and the operating system.
- the services to be executed allocated to an operating system are usually executed using the processing resources of the operating system. If the amount of services allocated to a certain operating system is too large and there are currently unallocated processing resources, the unallocated processing resources can also be allocated to the services to be allocated to the certain operating system. Therefore, according to the allocation result of a group of services to be allocated, combined with the resource utilization of the processing resources of the first operating system and the resource utilization of the processing resources of the second operating system, a resource mapping table of a group of services to be allocated and the processing resources of the processor can be generated to indicate the processing resources allocated to each service to be allocated.
- each service to be allocated has a mapping relationship with only one processor core, while the same processor core can have a mapping relationship with multiple services to be allocated, and different services can have a mapping relationship with the same processor core by occupying different time slices of the same processor core.
- the same processor core is occupied by only one service, that is, it is only used to execute one service.
- Different services allocated to an operating system can determine the time slices that occupy the same processor resource according to the allocation time, service response speed requirements or other methods.
- the resource dynamic allocation module dynamically adjusts the processor resources according to the output results of the business management module, forms a resource mapping table between different businesses and actual hardware resources, and optimizes the deployment structure of different hardware resources under heterogeneous operating systems to achieve the purpose of improving the utilization rate of hardware resources in the whole system.
- the above resource dynamic allocation process is managed and configured by the software in the second operating system.
- the processor cores that have been scheduled to the first operating system include: core 1
- the processor cores that have been scheduled to the second operating system include: core 2, core 3 and core 4, there are 6 services to be allocated, the real-time services are service 1 and service 2, and the non-real-time services are service 3 to service 6.
- the corresponding processor cores are allocated to the 6 services, core 1 is allocated to service 1, core 5 is allocated to service 2, core 2 is allocated to service 3, core 3 is allocated to service 4, core 4 is allocated to service 5, and core 6 is allocated to service 6.
- allocating processing resources of a processor to a first operating system and a second operating system according to an operating system corresponding to each service to be allocated and a resource allocation result includes:
- the unallocated processing resources are allocated to the operating system to which the to-be-allocated business corresponding to the unallocated processing resources is allocated.
- the unallocated processing resources can be allocated to the operating system to which the unallocated business corresponding to the unallocated processing resources is allocated.
- the resource adaptive scheduling module can complete the actual scheduling action of the processing resources of the processor according to the result of the dynamic allocation of hardware resources.
- the resource adaptive scheduling module schedules a part of the processor cores to execute the services assigned to the first operating system, such as the M cores of the core group 1 shown in FIG4, and schedules the remaining processor cores to run the services assigned to the second operating system, such as the N cores of the core group 2 shown in FIG4.
- the unallocated core 4 can be allocated to the first operating system, and the unallocated cores 5 and 6 can be allocated to the Linux system.
- the entire scheduling process can be dominated by the second operating system.
- unallocated processor resources are scheduled to the corresponding operating system based on the resource allocation result, so that the utilization rate of the processor resources can be improved.
- the method further comprises:
- the first operating system and the second operating system may preempt and release processing resources based on the usage status (load status) of the processing resources of the operating system.
- the dynamic allocation of processing resources may be based on a resource scheduling method executed by other control logic modules other than the first operating system and the second operating system, and the preemption and release of processing resources is a resource scheduling method actively initiated by the first operating system and the second operating system.
- the preemption and release of processing resources may be performed by a core preemption and release module, which may be A software module running on the first operating system and/or the second operating system.
- the core preemption and release module mainly completes the dynamic preemption and release of the processor core by the heterogeneous operating system during the real-time operation of the system to achieve the goal of maximizing the processor resource utilization.
- the successful resource preemption of one operating system means the successful resource release of another operating system.
- the failure of resource preemption of one operating system means the failure of resource release of another operating system.
- P cores out of (M+N) cores are scheduled to the real-time operating system, and (M+NP) cores are scheduled to the non-real-time operating system.
- the core preemption and release module can be used to complete the real-time operation of the heterogeneous operating system.
- the heterogeneous operating system dynamically preempts and releases processing resources such as processor cores to achieve the goal of maximizing processor resource utilization.
- processing resources can be dynamically adjusted based on the load conditions of the operating systems during their operation, thereby improving the rationality of resource utilization and, at the same time, improving the efficiency of business processing.
- preempting and releasing processing resources between a first operating system and a second operating system includes:
- the communication bus rate between the processor and the acceleration hardware (for example, CPU and FPGA/CPLD) is low, and the overall performance is not high.
- the preemption and release of processing resources are performed between the first operating system and the second operating system through the inter-core communication interface, that is, one operating system can send a request for preempting processing resources or a request for requesting the release of processing resources to another operating system through the inter-core communication interface to realize the preemption or release of processing resources.
- interacting through the inter-core communication interface inside the processor has a higher communication rate, which improves the overall performance of communication.
- the inter-core communication interface module can be used to complete the communication and interaction functions between the first operating system and the second operating system.
- the preempting party and the releasing party can inform each other of their respective states (such as busy and idle states) through the inter-core communication interface, and specific signal events are also required to characterize the behavior of the heterogeneous operating system (such as preemption behavior). Therefore, by performing core preemption and release through the inter-core communication interface module, the hard core resource balance of the heterogeneous operating system can be maintained, ensuring that the processor has a high occupancy rate.
- inter-core interrupts for example, SGI (Software Generated Interrupt, software-triggered interrupt, inter-core interrupt in Linux system)
- one operating system can send a resource preemption request (for example, core preemption request) or a resource release request (for example, core release request) to another operating system through IPI (Inter Processor Interrupt, inter-processor interrupt) to request the preemption or release of processing resources.
- IPI Inter Processor Interrupt, inter-processor interrupt
- IPI is an interrupt triggered between multiple cores in a SOC (System on Chip, also known as a system on chip), which is different from common peripheral interrupts, so the core can reserve some interrupt numbers specifically for IPI, which are 16 interrupt numbers 0-15 on the ARM 64 architecture (a CPU architecture).
- the preemption and release process depends on the real-time load conditions of the heterogeneous operating systems. For example, when the load of the second operating system increases rapidly and more processor cores are needed to support it, it can send a core preemption request to the first operating system via IPI to preempt the processor core of the first operating system. If the first operating system is idle at this time (for example, no task scheduling) or at least some of the core resources are idle, it will release the core resources to the second operating system. At this time, the second operating system core preemption is successful, which also means that the first operating system core is successfully released.
- the core preemption and release process is a dynamic and cyclic process. Each core preemption and release is accompanied by the adjustment of the processor hard core resources. As shown in Figure 5, after one preemption and release, the number of cores in core group 1 becomes P, and the number of cores in the core group becomes M+N-P.
- the core preemption and release process can coordinate with load balancing strategy, business management, resource adaptive scheduling (for example, core adaptive scheduling) and other modules to jointly determine the final core adjustment result.
- different modules jointly determine the core adjustment result means that when a system needs to seize more core resources, the final success of the seizure needs to be jointly determined by modules such as load balancing strategy, business management, and core adaptive adjustment.
- modules such as load balancing strategy, business management, and core adaptive adjustment.
- the first operating system will soon wake up and run an important business thread, and the thread also needs a lot of resources when running.
- the first operating system cannot release core resources to the second operating system.
- the criteria for judging the importance of services and the final resource allocation to the second operating system will involve the participation of modules such as load balancing strategy, service management, and core adaptive adjustment.
- the strategies of each of these modules also contain the characteristics of openness, which determines that the final core adjustment result determined by them together is also the result of the joint action of these strategies.
- the processing resources between different operating systems are preempted and released through the inter-core communication interface, which can increase the communication rate and improve the overall performance of communication.
- preempting and releasing processing resources between a first operating system and a second operating system through an inter-core communication interface includes:
- S112 Obtain, through the inter-core communication interface, a first interaction response returned by the second operating system in response to the first interaction request, wherein the first interaction response is used to instruct the first operating system to perform resource interaction with the second operating system according to the first interaction response.
- the service volume of the services processed by the first operating system is usually small, so the first operating system can request to seize the processing resources of the second operating system through the inter-core communication interface or actively release the processing resources occupied by it to the second operating system.
- the seizure and release of processing resources can be performed in a request-response interaction manner.
- the first operating system can transmit the first interaction request of the first operating system to the second operating system through the inter-core communication interface to request a resource interaction of resource seizure and resource release with the second operating system.
- the second operating system can determine whether to allow the first operating system to occupy at least part of its processing resources or whether to accept the processing resources released by the first operating system based on its own load conditions, and return the first interaction response to the first operating system through the inter-core communication interface, so that the first operating system can interact with the second operating system for resources according to the first interaction response.
- preemption and release of processing resources is the scheduling of processing resources at the operating system level (that is, the negotiation of processing resource scheduling is completed between the first operating system and the second operating system), and is not the actual scheduling of processing resources.
- the actual scheduling of processing resources is performed, the actual scheduling of processing resources is completed by the resource adaptive scheduling module.
- resource interaction between different operating systems is performed in a request-response manner, and an operating system with a fast response speed is allowed to actively release processing resources to an operating system with a slow response speed, thereby improving the utilization rate of processing resources.
- the method further comprises:
- S122 When it is determined, based on the resource utilization of the processing resources of the first operating system, that the first operating system is to perform resource interaction with the second operating system, trigger transmission of a first interaction request to the second operating system through an inter-core communication interface.
- the process of preempting and releasing processing resources may depend on the real-time load of heterogeneous operating systems.
- a load detection module for detecting the load of the system may be run, which may belong to the system control module in the system.
- a first system control module may be run thereon.
- the load detection module in the system control module may detect the resource utilization of the processing resources of the first operating system.
- the resource utilization of the processing resources of the first operating system may be used to indicate the load of the first operating system. The higher the resource utilization of the processing resources, the heavier the system load. Conversely, the lower the resource utilization of the processing resources, the lighter the system load.
- the first operating system Based on the resource utilization of the processing resources of the first operating system, it can be determined whether the first operating system needs to interact with the second operating system for resources. For example, if the current resource utilization of an operating system (e.g., the first operating system) is too high (reaches a specified utilization threshold), or based on a pending business of an operating system, it is determined that the future resource utilization of the operating system is too high (reaches a specified utilization threshold), it can be determined that the operating system needs to seize the processing resources of another operating system (e.g., the second operating system). If the resource utilization is too low (lower than another specified utilization threshold), it can be determined that the operating system needs to release processing resources to the other operating system. Optionally, if it is determined that the first operating system is to interact with the second operating system for resources, the execution of transmitting the first interaction request to the second operating system through the inter-core communication interface can be triggered. System steps.
- resource interaction between different operating systems is performed in a request-response manner, and an operating system with a fast response speed is allowed to actively release processing resources to an operating system with a slow response speed, thereby improving the utilization rate of processing resources.
- the method further includes at least one of the following:
- S132 When the processing resources of the first operating system are in an idle state and there is no business to be executed by the first operating system, determine that the processing resources of the first operating system are to be released to the second operating system.
- a threshold value of the resource utilization of the processing resources of the first operating system can be set in advance. If the resource utilization of the processing resources of the first operating system is greater than or equal to the first utilization threshold value, it can be determined that the current load of the first operating system is too heavy and needs to seize the processing resources of the second operating system to meet its own business needs.
- the response speed of the first operating system is higher than that of the second operating system, it is usually used in some specific services, but the triggering of the specific services is random and the service frequency is usually low, so the processing resources of the first operating system are likely to be idle and there is no service to be executed by the first operating system. In this case, it can be determined that the first operating system is to release at least part of the processing resources to the second operating system.
- the queue of pending services corresponding to the first operating system can be searched. If the queue of pending services is empty (i.e., there is no pending service), it is determined that there is no pending service in the first operating system within a certain time range. If the queue of pending services is not empty (i.e., it contains pending services), even if the first operating system is not currently executing any service, it will not release processing resources to the second operating system.
- the method further comprises:
- the first operating system may run periodically based on the processor; or, the first operating system runs based on the processor in response to a received wake-up request; or, the first operating system runs based on the processor according to the matching degree between the current operating business generated on the processor and the first operating system.
- the first operating system may go into hibernation after the operation ends; the second operating system adds the processor resources (e.g., processor cores) used by the first operating system to the scheduling resource pool (i.e., available resource pool) of the second operating system during the hibernation period of the first operating system.
- the active hibernation of the first operating system can be triggered, that is, the first operating system actively enters the hibernation state.
- the core resources of the first operating system can be first released to the second operating system (resource release can be performed by way of an interrupt request); the system field data of the first operating system can also be saved, for example, the above data can be pushed into the stack, so that after the first operating system is awakened, it can be restored to the previous operating state based on the saved system field data.
- the first operating system when the first operating system has no task scheduling (ie, is in an idle state), the first operating system sends a core release request to the second operating system. At this time, the core resources of the first operating system will be taken over by the second operating system, and the first operating system enters a dormant state.
- a first operating system e.g., RTOS
- the first operating system and the second operating system alternately occupy and schedule the same processing resource (which may be a processor core, for example, CPU core 0).
- the same processor resource may be the first processing resource, and correspondingly, the processing resource of the second operating system may be the second processing resource.
- the second operating system generates an interrupt at a first moment to take over the first processing resource, causing the first operating system to have to sleep.
- the first operating system saves the scene in the stack, sleeps, and then releases the first processing resource to the second operating system to take over.
- an interrupt will be generated at a second moment for the first operating system to preempt the first processing resource to wake up the first operating system.
- the first operating system will be awakened from that moment. It starts to enter the round-robin mode again and occupies the first processing resource of the scheduling.
- the first operating system is in a dormant state.
- the first operating system may be awakened due to an interrupt event reported by the hardware.
- the second operating system will retain the process running on the first processing resource on site.
- the first operating system occupies the first processing resource, and after processing the interrupt event reported by the hardware, it enters a dormant state again at the fourth moment.
- the first operating system reports the interrupt of releasing the first processing resource to the second operating system, and the second operating system continues to schedule the first processing resource according to the set period and resumes the on-site running process.
- the duration of a single operation cycle and the interval duration between two operation cycles may be the same or different.
- the first operating system may be, but is not limited to, in a dormant state, and the processing resources allocated to the first operating system are used by the second operating system. If the duration of a single operation cycle is the same as the interval duration between two operation cycles, the first operating system and the second operating system alternately occupy the same duration of the processing resources allocated to the first operating system. If the duration of a single operation cycle is different from the interval duration between two operation cycles, the first operating system and the second operating system alternately occupy different durations of the processing resources allocated to the first operating system.
- the duration occupied by the first operating system may be greater than the duration occupied by the second operating system, or the duration occupied by the second operating system may be greater than the duration occupied by the first operating system.
- a wake-up strategy for the first operating system (such as RTOS) in a trigger mode.
- the trigger mode can be started by an interrupt initiated by a device in the first operating system bus domain.
- the first operating system bus domain connects device 0 to device N.
- device 0 triggers an interrupt to the first operating system at a certain moment, and the first operating system is immediately awakened.
- the first operating system first triggers an interrupt to seize the first processing resource to the second operating system.
- the second operating system first releases the first processing resource and saves the scene (pushes the running data into the stack). Then the first operating system schedules the first processing resource to process the operation business indicated by the interrupt triggered by device 0. If it is currently in polling mode, the subsequent processing process is the same as the above polling mode, which will not be repeated here.
- the operating system when all processing resources (for example, core resources) of one operating system have been released to another operating system and the occupied processing resources are zero, the operating system is controlled to enter a sleep state. Since the operating system is allowed to release all processing resources to another operating system, the utilization rate of the processing resources is improved.
- processing resources for example, core resources
- transmitting the first interaction request of the first operating system to the second operating system through the inter-core communication interface includes at least one of the following:
- S152 Transmitting a resource release request with the second interrupt number as the interrupt number to the second operating system through the inter-core communication interface, wherein the resource release request is used to request to release the processing resources occupied by the resource release system to the second operating system.
- the preemption and release of processing resources between different operating systems can be completed through inter-core interrupts.
- Different interrupt events can be defined for different resource interaction types, and different interrupt events can correspond to different interrupt numbers, wherein the interrupt number assigned to the first interrupt event in which the first operating system applies to the second operating system for preempting processing resources is the first interrupt number, and the interrupt number assigned to the second interrupt event in which the first operating system actively releases processing resources to the second operating system is the second interrupt number.
- the first interaction request may be a first preemption request, i.e., a request for preempting the processing resources of the second operating system.
- the first operating system may transmit the first preemption request with the interrupt number being the first interrupt number to the second operating system through the inter-core communication interface, i.e., the trigger source of the inter-core communication interrupt with the interrupt number being the first interrupt number is the first operating system, and the response source is the second operating system.
- the inter-core communication interrupt is that the first operating system preempts the processing resources of the second operating system.
- the first interaction request may be a resource release request, i.e., a request for releasing the processing resources occupied by the first operating system to the second operating system.
- the first operating system may transmit the resource release request with the interrupt number being the second interrupt number to the second operating system through the inter-core communication interface, i.e., the trigger source of the inter-core communication interrupt with the interrupt number being the second interrupt number is the first operating system, and the response source is the second operating system.
- the inter-core communication interrupt is that the first operating system actively releases the processing resources to the second operating system.
- preempting and releasing processing resources between a first operating system and a second operating system through an inter-core communication interface includes:
- S162 Obtain, through the inter-core communication interface, a second interaction response returned by the first operating system in response to the second interaction request, wherein the second interaction response is used to indicate whether the first operating system allows the second operating system to preempt processing resources of the first operating system.
- the second operating system considering that most of the services processed by the processor are services that do not require high service response speed, correspondingly, the service volume of the services processed by the second operating system is usually large, so the second operating system can request to seize the processing resources of the first operating system through the inter-core communication interface.
- the preemption of processing resources can be performed in a request-response interaction manner.
- the second operating system can transmit the second interaction request of the second operating system to the first operating system through the inter-core communication interface to request to interact with the first operating system for resource seizure.
- the first operating system can determine whether to allow the second operating system to occupy at least part of its processing resources based on its own load conditions, and return the second interaction response to the second operating system through the inter-core communication interface, so that the second operating system can interact with the first operating system for resources according to the second interaction response.
- preemption of processing resources is the scheduling of processing resources at the operating system level (that is, the negotiation of processing resource scheduling is completed between the first operating system and the second operating system), and is not the actual scheduling of processing resources.
- the actual scheduling of processing resources is performed, the actual scheduling of processing resources is completed by the resource adaptive scheduling module.
- the utilization rate of processing resources can be improved, and at the same time, the response speed of business processing can also be improved.
- the method further comprises:
- S172 When it is determined, based on the resource utilization of the processing resources of the second operating system, that the second operating system is to preempt the processing resources of the first operating system, trigger transmission of a second interaction request to the first operating system through the inter-core communication interface.
- the preemption process of processing resources may depend on the real-time load of the heterogeneous operating system.
- a load detection module for detecting the load of the system may be run, which may belong to the system control module in the system.
- a second system control module may be run thereon.
- the load detection module in the system control module may detect the resource utilization rate of the processing resources of the second operating system.
- the resource utilization rate of the processing resources of the second operating system may be used to indicate the load of the second operating system. The higher the resource utilization rate of the processing resources, the heavier the system load. Conversely, the lower the resource utilization rate of the processing resources, the lighter the system load.
- the second operating system it can be determined whether the second operating system needs to interact with the first operating system for resources. For example, if the current resource utilization is too high (reaches a specified utilization threshold) or the future resource utilization is determined to be too high (reaches a specified utilization threshold) according to the business to be executed, it can be determined that the second operating system needs to seize the processing resources of the first operating system. If it is determined that the second operating system is to interact with the first operating system for resources, the step of transmitting the second interaction request to the first operating system through the inter-core communication interface can be triggered.
- resource interaction between different operating systems is performed in a request-response manner, and an operating system with a slow response speed is allowed to actively seize processing resources of an operating system with a fast response speed, thereby improving the utilization rate of processing resources.
- the method further includes at least one of the following:
- the second operating system can comprehensively consider its own resource utilization, its to-be-allocated businesses, to-be-executed businesses and other factors to determine whether it needs to preempt the processing resources of the first operating system.
- a threshold for the resource utilization of the processing resources of the second operating system i.e., a second utilization threshold, can be pre-set. If the resource utilization of the processing resources of the second operating system is greater than or equal to the second utilization threshold, it can be determined that the second operating system is currently overloaded and needs to seize the processing resources of the first operating system to meet its own business needs.
- a threshold for the resource utilization of the processing resources of the second operating system can be pre-set, that is, a third utilization threshold. If it is determined that the resource utilization of the processing resources of the second operating system is greater than or equal to the third utilization threshold based on the executing business of the second operating system and the pending business of the second operating system, it can be determined that the second operating system is about to preempt the processing resources of the first operating system. It can be determined that the second operating system is about to be in an overloaded state and needs to preempt the processing resources of the first operating system to meet its own business needs.
- the second operating system may also process the business currently to be allocated (i.e., the newly added business to be allocated) that has a high business coupling degree with its allocated business. Therefore, the threshold of the resource utilization rate of the processing resources of the second operating system, i.e., the fourth utilization threshold, and the threshold of the business coupling degree between the newly added business to be allocated and the allocated business, i.e., the third coupling threshold, can be set in advance.
- the second operating system is about to be in an overloaded state and needs to seize the processing resources of the first operating system to meet its own business needs.
- the second utilization threshold and the third utilization threshold may be the same or different, for example, both may be 50%, 60% or other values, and the fourth utilization threshold may be a value smaller than the second utilization threshold and the third utilization threshold, for example, 40%, or other utilization thresholds.
- no limitation is imposed on the various utilization thresholds.
- the resource scheduling requirements of the operating system are determined based on the currently executing business of the operating system, the currently executing business and the allocated business, or the currently executing business and the allocated business and the newly added business to be allocated, which can improve the flexibility of resource scheduling and at the same time, improve the utilization rate of processing resources.
- the method further comprises:
- S192 When the service priority of the service being executed by the first operating system is lower than the service priority of the service to be executed by the second operating system, determine whether the first operating system allows the second operating system to preempt processing resources of the first operating system.
- the first operating system For the first operating system, if it is currently in an idle state and there is no assigned business to be executed, or there is no to-be-assigned business that must be assigned to the first operating system, the first operating system can directly determine to allow the second operating system to occupy its own processing resources. If the first operating system is currently processing a business, there is an assigned business to be executed, or there is an to-be-assigned business that must be assigned to the first operating system, it is necessary to comprehensively consider factors such as the business priority of the above-mentioned business to determine whether to allow the second operating system to occupy the processing resources of the first operating system.
- the service priority of the business being executed by the first operating system is not lower than the service priority of the business to be executed by the second operating system, it means that the urgency of the business being executed by the first operating system is not lower than the urgency of the business to be executed by the second operating system, and the first operating system refuses the second operating system to preempt the processing resources of the first operating system. If the service priority of the business being executed by the first operating system is lower than the service priority of the business to be executed, it means that the urgency of the business being executed by the first operating system is lower than the urgency of the business to be executed by the second operating system, and it is determined that the first operating system allows the second operating system to preempt the processing resources of the first operating system.
- resource preemption can be determined based on service priority. It can also be considered that preemption of processing resources is allowed only when the service priorities of the executing services and pending services of the first operating system are not lower than the service priorities of the pending services of the second operating system.
- transmitting the second interaction request of the second operating system to the first operating system through the inter-core communication interface includes:
- the preemption and release of processing resources between different operating systems can be accomplished through inter-core interrupts, and different interrupt events can be defined for different resource interaction types, and different interrupt events can correspond to different interrupt numbers, wherein the interrupt number assigned to the third interrupt event in which the second operating system applies to the first operating system for preempting processing resources is the third interrupt number.
- the second interaction request may be a second preemption request, that is, in a request to preempt the processing resources of the first operating system
- the second operating system may transmit the second preemption request with the interrupt number being a third interrupt number to the first operating system through the inter-core communication interface, that is, the trigger source of the inter-core communication interrupt with the interrupt number being the third interrupt number is the second operating system, and the response source is the first operating system, and the meaning of this inter-core communication interrupt is that the second operating system preempts the processing resources of the first operating system.
- obtaining, through the inter-core communication interface, a second interactive response returned by the first operating system in response to the second interactive request includes at least one of the following:
- the preemption and release of processing resources between different operating systems can be accomplished through inter-core interrupts, and different interrupt events can be defined for different resource interaction types, and different interrupt events can correspond to different interrupt numbers, wherein the interrupt number assigned to the fourth interrupt event and the fifth interrupt time for the second operating system to apply to the second operating system to return a resource preemption response is the fifth interrupt number, wherein the fourth interrupt event is an interrupt event that allows resource preemption, and the fifth interrupt event is an interrupt event that rejects resource preemption.
- the first operating system may transmit a resource release allowing response with interrupt number being the fourth interrupt number to the second operating system through the inter-core communication interface, that is, the trigger source of the inter-core communication interrupt with interrupt number being the fourth interrupt number is the first operating system, and the response source is the second operating system.
- the inter-core communication interrupt is that the first operating system passively releases processing resources to the second operating system.
- the first operating system may transmit a resource release refusal response with the interrupt number being the fifth interrupt number to the second operating system through the inter-core communication interface, that is, the trigger source of the inter-core communication interrupt with the interrupt number being the fifth interrupt number is the first operating system, and the response source is the second operating system.
- the inter-core communication interrupt is that the first operating system refuses to release processing resources to the second operating system.
- resource scheduling between operating systems is performed through inter-core communication interrupts, thereby improving the accuracy of resource scheduling.
- inter-core communication can be achieved based on a custom interrupt vector table and interrupt events between heterogeneous operating systems.
- the Linux operating system makes full use of the undefined bit numbers of SGI to customize terminal signals and reduce the cost of inter-core communication.
- the undefined bit numbers can be 8-15.
- 8-15 (a total of 8 interrupts) are used to represent the inter-core interrupt vector table.
- Table 1 A feasible allocation scheme for the vector table is shown in Table 1:
- the aforementioned first interrupt number corresponds to interrupt number 12
- the aforementioned second interrupt number corresponds to interrupt number 8
- the aforementioned third interrupt number corresponds to interrupt number 9
- the aforementioned fourth interrupt number corresponds to interrupt number 10
- the aforementioned fifth interrupt number corresponds to interrupt number 11.
- active release means when the RTOS system has no business scheduling (i.e., it is in an idle state), an SGI interrupt with an interrupt number of 8 is sent to the Linux system. At this time, the core resources of the RTOS will be taken over by the Linux system, and the RTOS system enters a dormant state.
- Passive release means when the business load of the Linux system increases sharply, an SGI interrupt with an interrupt number of 9 is sent to the RTOS system. If the process being executed by the RTOS system at this time allows interruption (the processes on the RTOS system have priorities, which can be configured according to actual conditions.
- the RTOS system will send an SGI interrupt with an interrupt number of 10 to the Linux system and passively release its occupied CPU core resources for Linux system scheduling. After that, the RTOS system enters a dormant state. If the RTOS system does not allow interruption at this time, it will send an SGI interrupt with an interrupt number of 11 to the Linux system to inform the Linux system that the core resources of the RTOS cannot be released at this time. At this time, the Linux system will continue to execute according to the current operation strategy without change.
- inter-core communication vector table is not unique and is not limited to the inter-core communication vector table defined in Table 1 above.
- a method for inter-core communication comprises the following steps:
- Step 1 The first operating system sends target data (which may be business data) to a target virtual channel (which may be storage space) in the processor memory.
- target data which may be business data
- target virtual channel which may be storage space
- the target data is data to be sent
- the target virtual channel is a free storage space in the memory
- the first operating system sending the target data to the target virtual channel in the processor memory means that the CPU core of the first operating system writes the data to be sent into the target virtual channel.
- Step 2 The first operating system sends an interrupt notification message (which may be the aforementioned inter-core interrupt request) to the second operating system.
- the CPU core of the first operating system sends an interrupt notification message to the CPU core of the second operating system.
- the interrupt notification message may carry the address of the target virtual channel to notify the second operating system to obtain the target data from the target virtual channel.
- the interrupt notification message may be triggered by software or hardware.
- Step 3 The second operating system responds to the interrupt notification message and obtains the target data from the target virtual channel in the memory.
- the CPU core of the second operating system responds to the interrupt notification message, parses the address of the target virtual channel from the interrupt notification message, and then locates the target virtual channel in the memory according to the parsed address, and obtains the target data from the target virtual channel, thereby realizing data interaction between the first operating system and the second operating system.
- the first operating system sending data sends the target data to the target virtual channel in the processor memory, and sends an interrupt notification message to the second operating system.
- the second operating system receiving the data responds to the interrupt notification message to obtain the target data from the target virtual channel, thereby solving the problem of waste of resources and strong dependence on the operating system in the inter-core communication process, and achieving the effect of reducing the waste of resources and dependence on the operating system in the inter-core communication process.
- the memory includes a data storage area and a metadata storage area.
- the data storage area is divided into multiple storage units, each storage unit is used to store business data, and the metadata storage area is used to store the size and occupancy status of each storage unit in the data storage area.
- the target virtual channel is composed of one or more storage units in the data storage area
- the metadata storage area can be divided into storage slices with the same number as the storage units, each storage slice is used to record the size and occupied status of a storage unit
- the size of the storage unit can be represented by the first address and the last address of the storage unit, or by the first address and the length of the storage unit
- the occupied status includes the occupied state and the unoccupied state, and can be represented by the value of the free flag.
- the first operating system sends the target data to the target virtual channel in the processor memory, including: the first operating system The system reads records in the metadata storage area, determines at least one storage unit in the data storage area that is in an idle state and has a total space greater than or equal to the length of the target data according to the read records, and obtains a target virtual channel; sets the state of at least one storage unit corresponding to the target virtual channel in the metadata storage area to an occupied state, and stores the target data in the target virtual channel.
- the target virtual channel to be written needs to be free and have storage space that is greater than or equal to the length of the target data. Since the memory is divided into a metadata storage area and a data storage area, the occupancy status of each storage unit recorded in the metadata storage area can be read to find out the storage unit that is free and can meet the data storage requirements.
- each storage unit is equal. If the length of the target data is greater than the length of a storage space, the number of storage units required is determined based on the length of the target data, and multiple storage units that are idle, continuous, and meet the data storage requirements are found to form a target virtual channel.
- each storage unit is equal, and the data storage area has pre-combined the storage units to obtain multiple virtual channels of different sizes.
- Each virtual channel is composed of one or more storage units.
- the occupancy status of each virtual channel recorded in the metadata storage area can be read to find the virtual channel that is in an idle state and has a length greater than the length of the target data, that is, the target virtual channel.
- the system software needs to apply for shared memory space, it will determine whether the length of the data to be applied is greater than the maximum length of the virtual channel to store data. If it is greater than the maximum length of the virtual channel to store data, the system software can send the data to be sent in multiple times to ensure that the length of each sent data is less than or equal to the maximum length of the virtual channel to store data, thereby ensuring smooth communication.
- the second operating system responds to an interrupt notification message and obtains target data from a target virtual channel in the memory, including: the second operating system reads a record in a metadata storage area and determines the target virtual channel based on the read record; obtains the target data from at least one storage unit corresponding to the target virtual channel, and sets the state of the at least one storage unit to an idle state.
- the state of the storage unit corresponding to the target virtual channel is set to an idle state.
- the first operating system sends target data to a target virtual channel in a processor memory, including: a driver layer of the first operating system receives the target data, determines a virtual channel in an idle state in the memory, and obtains the target virtual channel; sets the state of the target virtual channel to an occupied state, and stores the target data in the target virtual channel.
- both the real-time operating system and the non-real-time operating system have a driver layer.
- the driver layer After the driver layer receives the target data to be sent, it calls an interface to search for a target virtual channel in the memory.
- the state of the target virtual channel is set to an occupied state, and then the target data is written to the target virtual channel.
- the application layer when the first operating system includes an application layer, the application layer is provided with a human-computer interaction interface. Before the driver layer of the first operating system determines a virtual channel in an idle state in the memory, the application layer of the first operating system can receive the data to be sent input by the user through the human-computer exchange interface, encapsulate the data to be sent in a preset format, obtain the target data, and call the data write function to pass the target data to the driver layer through the preset communication interface, wherein the preset communication interface is provided on the driver layer.
- the application layer fills the data to be sent according to a preset format to obtain the target data, and then generates a device file ipidev in the system's /dev path.
- the application layer needs to read and write data from the driver layer, it can first use the system's built-in open function to open the device file /dev/ipidev, and then use the system's built-in write function to send the target data from the application layer to the driver layer.
- the driver layer then puts the data in the target virtual channel in the shared memory, and then triggers an interrupt to notify the second operating system to fetch the data.
- the second operating system responds to the interrupt notification message and obtains target data from the target virtual channel in the memory, including: the second operating system triggers an interrupt processing function based on the interrupt notification message, determines the target virtual channel from the memory through the interrupt processing function, and obtains the target data from the target virtual channel.
- determining the target virtual channel from the memory through the interrupt processing function and obtaining target data from the target virtual channel includes: calling the target task through the interrupt processing function, and the target task determining the target virtual channel from the memory and obtaining target data from the target virtual channel.
- the interrupt handler sends a task notification to wake up the target task responsible for data extraction.
- the target task first calls the interface in the shared memory. Find the target virtual channel, then read the target data from the target virtual channel and perform data analysis.
- a function identifier is stored in the memory, the function identifier indicates a target function, and a target virtual channel is determined from the memory through an interrupt processing function, and target data is obtained from the target virtual channel, including: determining the function identifier and the target virtual channel from the memory through an interrupt processing function, and sending the address information of the target virtual channel to a target application matched by the function identifier, wherein the target application is a target application in the application layer; the target application calls a data reading function to pass the address information to the driver layer through a preset communication interface, the driver layer obtains the target data from the target virtual channel, and passes the target data to the target application layer program, wherein the preset communication interface is set at the driver layer, and the target application processes the target data according to the processing function matched by the function identifier to execute the target function.
- the application layer calls the corresponding interrupt processing function to search the target virtual channel from the memory, obtains the address information of the target virtual channel, and then generates a device file ipidev in the system's /dev path.
- the application layer needs to read and write data from the driver layer, it can first use the system's built-in open function to open the device file /dev/ipidev, and then use the system's built-in read function to read the target data in the target virtual channel. That is, the driver layer finds the corresponding target data in the shared memory according to the address information of the target virtual channel, and returns the target data and the length of the target data to the application layer.
- the state of the target virtual channel is set to idle.
- Function identifiers are stored in the memory, indicating the target functions implemented by the application through the target data.
- the function identifier can be Net or Cmd.
- the driver layer can find the PID of the application based on the received NetFn and Cmd, and send the data to the corresponding application based on the PID.
- an array will be initialized.
- the array has three columns, the first column is NetFn, the second column is Cmd, and the third column corresponds to the processing function of NetFn and Cmd is recorded as xxCmdHandler.
- a data storage area includes multiple memory channels, each memory channel is composed of one or more storage units, a metadata storage area stores multiple records, each record is used to record metadata of a memory channel, and the metadata of each memory channel at least includes a channel ID of the memory channel, a size of the memory channel, and an occupied state of the memory channel.
- a first operating system reads the records in the metadata storage area, and determines at least one storage unit in the data storage area that is in an idle state and has a total space greater than or equal to the length of target data based on the read records.
- Obtaining the target virtual channel includes: traversing the records stored in the metadata storage area, and determining whether there is a first target record indicating that the memory channel is in an idle state and the size of the memory channel is greater than or equal to the length of the target data; if the first target record exists, determining the memory channel indicated by the channel ID recorded in the first target record as the target virtual channel.
- the data storage area can be divided into n virtual memory channels, and the size of each memory channel can be different, that is, the sizes of the n virtual channels are 20*m, 21*m, 22*m, 23*m...2n-1*m, where m is the size of a storage unit, and the following structure is set as metadata to manage the memory channel:
- uint32_t Flag represents the status of the memory channel. For example, 0xA5A5A5A5 means that this channel is not empty, otherwise it is empty; uint16_t ChannelId represents the channel ID; uint8_t SrcId represents the source CPU ID, and the source CPU is the CPU that writes data to the memory channel; uint8_t NetFn and uint8_t Cmd are function parameters; uint32_t Len is the length of the data stored in the memory channel; uint32_t ChannelSize represents the size of the memory channel; uint8_t*pData refers to the first address of the memory channel; uint8_t CheckSum refers to the checksum.
- Each virtual memory channel corresponds to a structure record, which will be stored at the beginning of the shared memory in ascending order of channel ID. These structure records will be initialized after the system is powered on.
- the initialization Flag is 0 to indicate that the channel is empty.
- the initialization ChannelId is 0, 1, 2...n-1 in sequence.
- the initialization ChannelSize is the size of the corresponding virtual memory channel.
- the initialization pData points to the first address of the corresponding virtual memory channel.
- the first operating system uses the interface GetEmptyChannel to search for a virtual channel that meets the following two conditions in all memory channels according to the size of the target data to be sent: the idle flag Flag in the channel structure IpiHeader is not equal to 0xA5A5A5A5 (that is, the channel is in an idle state), and the channel size ChannelSize in the channel structure IpiHeader is greater than or equal to the size of the target data (that is, the memory size can meet the storage requirements of the target data).
- the metadata of the memory channel when a memory channel is occupied, the metadata of the memory channel also includes the ID of the source CPU core of the target data and the ID of the destination CPU core of the target data, and the second operating system reads the records in the metadata storage area, and determines the target virtual channel according to the read records, including: traversing the records stored in the metadata storage area, and determining whether there is a second target record, wherein the second target record indicates that the memory channel is in an occupied state, and the ID of the destination CPU core is the ID of the CUP core of the second operating system, and the ID of the source CPU core is not the ID of the CUP core of the second operating system; when the second target record exists, the memory channel indicated by the channel ID recorded in the second target record is determined as the target virtual channel.
- the target virtual channel is the virtual channel among all channels that meets the following three conditions: first, the idle flag Flag in the channel structure IpiHeader is equal to 0xA5A5A5A5 (that is, indicating that the channel is occupied); second, the TargetId in the channel structure is equal to the ID of the current CPU (that is, indicating that the destination CUP of the target data is the CPU of the second operating system); third, the TargetId in the channel structure is not equal to SrcId (that is, indicating that the target data is not sent by the CPU of the second operating system).
- the idle flag Flag is set to a multi-bit special character, for example, 0xA5A5A5A5. Since the probability of multiple bits mutating to special characters at the same time is much smaller than the probability of a single bit mutation, it can prevent the storage medium bit mutation from affecting the Flag value, thereby improving the security of communication.
- a metadata storage area stores a state mapping table, wherein the state mapping table contains a plurality of records, each record being used to record the occupied state of a storage unit, and a first operating system reads the records in the metadata storage area, and determines at least one storage unit in the data storage area that is in an idle state and whose total space is greater than or equal to the length of the target data based on the read records, and obtaining the target virtual channel comprises: determining a preset number of storage units to be occupied by the target data; scanning each record in sequence from an initial position in the state mapping table; when a preset number of consecutive target records are scanned, determining the consecutive storage units indicated by the preset number of target records, wherein the target records indicate that the storage unit is in an idle state; and determining the consecutive storage units as the target virtual channel.
- the first operating system traverses the records from an index position in the state mapping table, where the index position may be the starting position of the state mapping table.
- the index position may be the starting position of the state mapping table.
- each record of the state mapping table is queried in turn to determine whether there are continuous records of free memory pages greater than or equal to numb. If there are records that meet the above conditions, the continuous storage unit in the processor is determined through the correspondence between the record and the memory page, and the continuous storage unit is determined as the target virtual channel to write data to the target virtual channel.
- the interrupt notification message includes the starting address and a preset number of continuous storage units
- the second operating system reads the records in the metadata storage area, and determines the target virtual channel based on the read records, including: scanning each record in sequence from the initial position of the status mapping table; when the starting address of the continuous storage unit is scanned, the storage unit indicated by the scanned address and the preset number minus one of the continuous storage units are determined as the target virtual channel.
- a continuous storage unit refers to a continuous storage unit whose number is equal to numb, and each record in the status mapping table also records the first address of the corresponding storage unit.
- the second operating system scans a record of the first address of a continuous storage unit whose number is equal to numb in the mapping table, it indicates that the first address of the target virtual channel has been scanned, and the storage unit indicated by the first address and numb-1 continuous storage units after the storage unit constitute the target virtual channel.
- the second operating system obtains data from the target virtual channel to complete data interaction with the first operating system.
- the scanned continuous target records are recorded by a counter.
- the control counter is increased by one, and when the non-target record is currently scanned, the control counter is cleared.
- the relationship between the value of the counter and the number of required storage units is used to determine whether there are a preset number of continuous target records, that is, whether there are a preset number of continuous storage units.
- the count of the counter is recorded as cntr. If a scanned storage unit is empty, cntr is incremented by 1.
- cntr If the scanned storage unit is not empty, the accumulated number of continuous and idle storage units cntr is cleared, and the search for continuous and idle storage units continues from the address after the storage unit; until cntr is equal to numb, it means that continuous and idle storage units that meet the memory requirements have been found; if after scanning the entire state mapping table, cntr does not exist that is greater than or equal to numb, it indicates that this dynamic memory application has failed and the preset number of continuous storage units does not exist.
- the method before the first operating system reads records in the metadata storage area and determines at least one storage unit in the data storage area that is in an idle state and has a total space greater than or equal to the length of the target data based on the read records, and obtains the target virtual channel, the method also includes: the first operating system sends a memory request instruction and performs a locking operation on the processor's memory, wherein the memory request instruction is used to apply for the use of the processor's memory; when the memory is locked successfully, read the records in the status mapping table.
- the memory request instruction is an instruction issued by the operating system running on the processor to request the use of the processor's memory.
- a locking operation is first performed on the processor's memory. Only when the locking is successful can an application be made to use the memory.
- the locking operation refers to an exclusive operation on memory application. After the current operating system successfully locks, if the lock is not released, other servers do not have the right to apply to use the processor's memory.
- performing a locking operation on the memory of a processor includes: determining whether the memory is currently in a locked state, wherein the locked state indicates that the memory is in a state where it is requested for use; if the memory is not currently in a locked state, performing a locking operation on the memory; if the memory is currently in a locked state, determining that locking of the memory has failed, and applying to lock the memory of the processor again after a preset time, until the memory is successfully locked, or until the number of lock applications is greater than a preset number.
- the processor Before the processor runs, it is necessary to initialize the metadata storage area and the data storage area in the processor.
- the records stored in the state mapping table in the metadata storage area are initialized, and the memory management information is initialized.
- the member variable MemLock of the structure MallocMemInfo_T indicates whether the shared memory has been initialized, and the variable MemReady is 0xA5A5A5A5 indicates that the initialization operation has been completed and memory can be dynamically allocated and released normally; the member variable MemReady of the structure MallocMemInfo_T indicates whether it is locked.
- variable MemLock if the variable MemLock is read as 0, it means that no system or task is applying for memory at this time, that is, the memory is not currently locked. If the variable MemLock is read as 0xA5A5A5A5, it means that a system or task is applying for memory and needs to wait until the current application is completed before applying again. The current application for locking fails.
- the memory lock if the memory lock fails, the memory lock is applied again after waiting for a preset time until the lock is successful.
- the preset time may be 100 microseconds.
- the lock application fails and the number of repeated applications exceeds a preset number, indicating that the memory in the processor is in an unallocated state during the current time period, the application operation is stopped.
- the preset number of times may be 3 times, and if the number of lock applications is greater than 3 times, a message indicating that the current memory is unavailable may be returned to the operating system that sent the application.
- the first operating system stores the target data to be transmitted in the corresponding target virtual channel.
- the occupancy status of the processor's memory space is updated according to the data writing status of the first operating system, that is, the target continuous memory space is changed from an unoccupied state to an occupied state.
- the lock on the memory is released.
- the method further includes: releasing the lock on the memory when a preset number of consecutive target records are not scanned.
- an interrupt notification message is sent to the second operating system by means of a software interrupt.
- sending an interrupt notification message to the second operating system by means of a software interrupt includes: writing an interrupt number and an ID of a CPU core of the second operating system into a preset register of a processor, and generating an interrupt notification message based on the interrupt number and the ID of the CPU core of the second operating system.
- a soft interrupt is an interrupt generated by software.
- Software can send an interrupt to the CPU core executing itself or to other CPU cores.
- the preset register can be the GICD_SGIR register.
- Software can write the SGI (Software Generated Interrupts) interrupt number and the destination CPU ID to the GICD_SGIR register to generate a software interrupt.
- the SGI interrupt number is a soft interrupt number reserved for inter-core communication.
- a hardware interrupt refers to an interrupt generated by a hardware device, which may be a private peripheral interrupt or a shared peripheral interrupt.
- a hard interrupt is an interrupt introduced by hardware outside the CPU and is random.
- a soft interrupt is an interrupt introduced by software running in the CPU executing an interrupt instruction and is pre-set. This embodiment does not limit the method of generating an interrupt notification message.
- a method for sharing memory comprises the following steps:
- Step 1 Receive a memory application instruction and perform a locking operation on the memory of the processor, wherein the memory application instruction is used to apply for the use of the memory of the processor.
- the memory application instruction is an instruction issued by the operating system running on the processor to apply for the use of the processor's memory, which may be sent by the first operating system.
- the operating system sends the memory application instruction, it first performs a locking operation on the processor's memory. Only when the locking is successful can the memory be applied for.
- the locking operation refers to an exclusive operation of the memory application. After the current operating system successfully locks, if the lock is not released, other servers do not have the right to apply for the use of the processor's memory.
- the method before performing a locking operation on the memory of the processor, the method also includes: determining whether the memory is currently in a locked state, wherein the locked state represents that the memory is in a state where it is requested for use; and if the memory is not currently in a locked state, performing a locking operation on the memory.
- the processor's memory is used in the same time period. It can only be locked by one system or task. Therefore, the current operating system can only lock the memory when it detects that the current memory is not in a locked state.
- whether the memory is in a locked state is determined by determining whether a preset variable stored in the memory is a preset value. If the preset variable is not a preset parameter value, it indicates that the memory is not in a locked state, and no other system or task is applying for memory space, and the locking is successful; otherwise, if the preset variable is a preset parameter, it indicates that the memory is in a locked state at the current moment, and there are other systems or tasks other than the operating system applying for memory space, and the locking fails.
- the shared memory method after determining whether the memory is currently in a locked state, it also includes: if the memory is currently in a locked state, determining that locking the memory has failed; if locking the memory has failed, applying to lock the processor's memory again after a preset time period until the memory is successfully locked, or until the number of lock applications is greater than a preset number.
- the memory locking is applied for again after waiting for a preset time until the locking is successful.
- the preset time may be 100 microseconds.
- the lock application fails and the number of repeated applications exceeds a preset number, indicating that the memory in the processor is in an unallocated state during the current time period, the application operation is stopped.
- the preset number of times may be 3 times. If the number of lock applications is greater than 3 times, a message indicating that the current memory is unavailable may be returned to the operating system that sent the application.
- Step 2 when the memory is locked successfully, read the memory occupied state, and determine whether there is free target memory space in the memory according to the memory occupied state, wherein the size of the target memory space is greater than or equal to the size of the memory requested by the memory request instruction.
- the operating system applies for the memory in the processor.
- the information used to record the memory occupied state is scanned to determine whether there is a target memory space, that is, to determine whether there is an unoccupied, continuous memory space in the processor that can meet the memory usage requirements.
- Meeting the memory usage requirements means that the size of the memory space is greater than or equal to the memory size applied by the operating system.
- discontinuous memory space can also be used when applying for memory, and a pointer can be added after a non-minimum memory block to point to the next minimum memory block obtained by the application.
- a pointer can be added after a non-minimum memory block to point to the next minimum memory block obtained by the application.
- data reading and writing across data blocks can be realized according to the storage address and the pointer. This embodiment does not limit the form of the target memory space.
- Step 3 when the target memory space exists in the memory, the address information of the target memory space is fed back to the sender of the memory application instruction, the occupied state of the memory is updated, and the lock on the memory is released.
- the sender refers to the operating system (for example, the first operating system) that sends the memory application instruction. It should be noted that, since the operating system sends and receives data by using shared memory during inter-core communication, and uses the address returned by the applied memory to access data during the process of sending and receiving data, it is necessary to determine the address information of the applied memory space.
- the address information of the target continuous space is sent to the operating system, and the operating system stores the data to be transmitted in the corresponding memory space according to the address information.
- the occupancy status of the processor's memory space is updated according to the data writing status of the operating system, that is, the target memory space is changed from an unoccupied state to an occupied state, and the locking operation before the dynamic memory application is released so that other operating systems can apply to use the processor's memory space.
- the memory includes a metadata storage area and a data storage area
- the data storage area is used to store business data
- the metadata storage area stores a state mapping table
- the state mapping table is used to record the occupied state of the data storage area, reading the occupied state of the memory, and judging whether there is free target memory space in the memory according to the occupied state of the memory includes: reading records in the state mapping table from the metadata storage area, and judging whether there is target memory space in the data storage area according to the records in the state mapping table.
- the memory usage status is queried by querying the records in the status mapping table, and optionally, the metadata storage stored in the processor is obtained.
- the data storage area is used to store data in a continuous and idle state, and the state mapping table in the metadata storage area is identified. By traversing the records in the state mapping table, the occupied state of the data storage area is read to determine whether there is a continuous and idle memory space in the data storage area that meets the memory usage requirements.
- a data storage area is composed of multiple memory pages
- a status mapping table contains multiple records
- each record is used to record the occupied status of a memory page
- the records in the status mapping table are read from the metadata storage area, and it is judged whether there is a target memory space in the data storage area according to the records in the status mapping table, including: determining a preset number of memory pages applied for by a memory application instruction; scanning each record in turn from an initial position of the status mapping table; when a continuous preset number of target records are scanned, determining that there is a target memory space in the memory, wherein the target record indicates that the memory page is in an idle state.
- the data storage area is divided into multiple allocation units according to the same memory size, and each allocation unit is recorded as a memory page.
- the memory space of the data storage area is A bytes
- the divided allocation unit is B bytes
- the data storage area contains a total of A/B memory pages
- the records in the status mapping table are also memory page records.
- Each memory page record is used to record the occupied status of a memory page.
- the number of memory page records in the status mapping table is the same as the number of memory pages in the data storage area.
- Figure 6 is a schematic diagram of the relationship between the state mapping table and the memory page in the shared memory method according to an embodiment of the present application.
- the data storage area is a dynamically allocated memory block area
- the metadata storage area includes a dynamically allocated memory mapping table area, wherein the mapping table area is divided into the same number of records according to the number of memory pages divided into the data storage area, and the record is recorded as a memory page record, and all memory page records are combined into a state mapping table, and all memory page records in the state mapping table have a one-to-one correspondence with all memory pages in the data storage area, and each memory page record indicates the allocation status of the corresponding memory page, that is, whether the memory page is occupied.
- the business data for collaboration with the operating system needs to occupy consecutive memory pages in the processor, it is necessary to first determine the preset number of memory pages in the memory request instruction. Since the memory space of each memory page is the same, the preset number of consecutive memory pages required can be calculated based on the required memory space size, which is recorded as numb.
- the memory page records are traversed from the index position in the state mapping table, and the index position may be the starting position of the state mapping table.
- the index position may be the starting position of the state mapping table.
- each memory page record in the state mapping table is queried in turn to determine whether there are continuous memory page records that record free memory pages greater than or equal to numb. When there are memory page records that meet the above conditions, it is determined that there is a target memory space in the processor through the correspondence between the memory page records and the memory pages.
- the method after scanning each record in sequence from the initial position of the state mapping table, the method also includes: after scanning all records in the state mapping table and there are no continuous preset number of target records, determining that there is no target memory space in the memory.
- the memory page record of the state mapping table starting from the starting position of the state mapping table, query the memory page record of the state mapping table to determine whether there is continuous space with a number of memory pages greater than or equal to numb. If no continuous, preset number of free memory pages are found after scanning the entire state mapping table, it indicates that the target memory space does not exist.
- the number of scanned target records is recorded by a counter.
- the control counter is increased by one.
- the control counter is cleared, wherein the non-target record indicates that the memory page is in an occupied state.
- cntr the count of the counter is recorded as cntr. If a scanned memory page is empty, cntr is incremented by 1.
- cntr the accumulated number of continuous and idle memory pages cntr is cleared, and the search for continuous empty memory pages continues from the address after the memory page; until cntr is equal to numb, it indicates that continuous and idle memory pages that meet the memory requirements have been found; if cntr is less than numb during the process of scanning the entire state mapping table, it indicates that this dynamic memory application has failed and the target memory space does not exist.
- the address information of the target memory space is fed back to the sender of the memory application instruction, including: determining the last scanned target record among a continuous preset number of target records, and feeding back the first address of the memory page indicated by the last scanned target record to the sender.
- the scanning method can be selected to scan from the first position of the state mapping table or from the last position of the state mapping table.
- the scanning method is to scan from the last position of the state mapping table, when the value cntr displayed by the counter is greater than or equal to the preset number numb, the first address of the memory page corresponding to the last memory page scanned is recorded, and the status of these memory pages is set to non-empty in the memory page record, and the first address is used as the first address of the entire continuous memory page of this memory application instruction.
- the address is fed back to an operating system that issues a memory request instruction, and the operating system performs a data write operation on the memory according to the address information.
- the initial position is the first position in the state mapping table
- the address information of the target memory space is fed back to the sender of the memory application instruction, including: determining the first scanned target record among a continuous preset number of target records, and feeding back the first address of the memory page indicated by the first scanned target record to the sender.
- the scanning method is to scan from the first position of the state mapping table
- the value cntr displayed by the counter is greater than or equal to the preset number numb
- the address of the first memory page record scanned is used as the first address and sent to the operating system that issues the memory request instruction.
- the operating system writes data to the memory according to the address information.
- the first target record in the scanned continuous target records is stored through a preset variable.
- the preset variable refers to a variable in the state mapping table used to store the address information of the initial position, and it is recorded as offset.
- the value cntr displayed by the counter is increased by 1.
- the address information currently stored in offset is used as the address of the first target record.
- the method further includes: releasing the lock on the memory if there is no free target memory space in the memory.
- the state mapping table After scanning the memory page records in the state mapping table, if it is detected that the preset number of continuous and free memory pages is not included, that is, the target memory space is not included, it indicates that there is not enough space memory pages in the processor's memory for the operating system to use, and this dynamic memory application fails, and the lock on the memory is released.
- the memory includes a metadata storage area and a data storage area, the data storage area is used to store business data, and the metadata storage area stores memory management information.
- Determining whether the memory is currently in a locked state includes: reading the memory management information stored in the metadata storage area, and determining whether the memory management information includes preset information, wherein the preset information indicates that the memory is in a locked state; if the memory management information includes the preset information, determining that the memory is not currently in a locked state; if the memory management information does not include the preset information, determining that the memory is currently in a locked state.
- the memory management information of the metadata storage area it is used to determine whether the memory management information contains preset information, wherein the preset information is used to characterize whether the memory is in a locked state; if the memory management information does not contain the preset information, it indicates that the current memory is in an unlocked state, otherwise it is in a locked state.
- memory management information includes first field information and second field information, the first field information is used to describe whether the memory is in a locked state, and the second field is used to describe whether the memory is initialized.
- the method Before receiving the memory application instruction, the method also includes: initializing the first field information and the second field information stored in the data storage area.
- the metadata storage area and the data storage area in the processor need to be initialized.
- the memory page records stored in the state mapping table in the metadata storage area are initialized, and the memory management information is initialized.
- the memory management information consists of first field information and second field information, the first field information indicates whether it is locked, and the second field information is used to indicate whether initialization is completed.
- updating the occupied state of the memory includes: changing the state of the memory page corresponding to the target memory space recorded in the state mapping table to an occupied state.
- the memory page record of the state mapping table area of the metadata storage area is updated according to the correspondence between the memory page and the memory page record, so that it changes from an unoccupied state to an occupied state.
- the occupation state of the processor's memory space is updated according to the data writing status of the operating system, that is, the target memory space is changed from an unoccupied state to an occupied state, and the locking operation before the dynamic memory application is released.
- the target data is stored in a target memory space, and address information of the continuous memory space is sent to a second operating system; an acquisition instruction sent by the second operating system based on the address information is received, and the target data stored in the target memory space is sent to the second operating system.
- the first operating system will apply for the target memory space for the target data storage value to be transferred, and send the address information of the target memory space to the second operating system cooperating with the first operating system, informing the second operating system to obtain the data.
- the second operating system receives the address information of the target memory space, it issues a data acquisition instruction, and the embedded system receives the instruction and sends the target data stored in the target memory space to the second operating system.
- a memory application instruction of the first operating system is received, and a locking operation is performed on the memory of the processor, wherein the memory application instruction is used to apply for the use of the processor's memory; when the memory is locked successfully, the occupied state of the memory is read, and it is determined whether there is a free target memory space in the memory according to the occupied state of the memory, wherein the size of the target memory space is greater than or equal to the size of the memory applied for by the memory application instruction; when the target memory space exists in the memory, the address information of the target memory space is fed back to the sending end of the memory application instruction, the occupied state of the memory is updated, and the lock on the memory is released; in response to the storage operation of the first operating system, the target data is stored in the target memory space, and the address information of the continuous memory space is sent to the second operating system; the acquisition instruction sent by the second operating system based on the address information is received, and the target data stored in the target memory space is sent to the second operating system, so as to solve the problems
- the second operating system when the first operating system uses physical addresses to perform data read and write operations and the second operating system uses virtual addresses to perform data read and write operations, the second operating system converts the address information of the target memory space into a virtual address, and uses the virtual address to access the memory to read the target data from the target memory space.
- the address returned by the dynamic memory application When using shared memory to send and receive data in inter-core communication, the address returned by the dynamic memory application will be used.
- different systems may use different address systems.
- the real-time operating system is the first operating system and the non-real-time operating system is the second operating system.
- the physical address can be directly used to access the shared memory.
- the non-real-time operating system the physical address cannot be directly used to access the shared memory. In this case, the mapped virtual address needs to be used.
- the second operating system After the second operating system receives the address information of the target memory space, it is converted through the address information offset, mapped to a virtual address, and operated according to the virtual address.
- the shared memory virtual base address vBase under the non-real-time operating system (the real physical address of the shared memory is assumed to be 0x96000000); the shared memory physical base address pBase under the real-time operating system (i.e., 0x96000000).
- the address returned by the dynamically requested memory in the non-real-time operating system is also the virtual address vData.
- the memory includes a metadata storage area and a data storage area, and the metadata storage area and the data storage area are similar to those in the aforementioned embodiment and are not described in detail here.
- the metadata storage area stored in the processor is obtained, and the state mapping table in the metadata storage area is identified, each memory page record is traversed from the index position in the state mapping table, and each memory page record in the state mapping table is queried in turn to determine whether there are continuous memory page records that record free memory pages greater than or equal to a preset number.
- the corresponding relationship between the memory page record and the memory page is used to determine whether there is a target memory space in the processor, and the corresponding relationship between the memory page record and the memory page is used to determine whether there is a target memory space in the processor.
- a method for sharing memory includes: before the operating system issues a memory application instruction, in order to prevent multiple operating systems from applying for the memory space of the processor at the same time and causing application conflicts, it is necessary to apply for a locking operation and determine whether the locking is successful;
- the dynamic application for memory lock is successful, the number of consecutive memory pages that need to be allocated is calculated based on the memory size in the issued memory application instruction, and recorded as nmemb; if the judgment result indicates that the application for lock fails, the application is reissued after waiting for a period of time (which can be 100 microseconds) until the application is successful. If the number of failed lock applications is greater than the preset number (the preset number can be three times), the memory application is exited.
- the metadata storage area of the processor is initialized, and the last position of the state mapping table is recorded as offset, and the number of required continuous memory pages is calculated according to the space size of the required memory in the memory application instruction, and the number of memory pages is recorded as nmemb, and a counter for recording the number of memory pages is set, recorded as cmemb, and then the state mapping table of the metadata storage area in the processor is obtained, and the entire state mapping table is scanned from the offset position of the state mapping table, and the continuous memory pages are found through the correspondence between the memory page records stored in the state mapping table and the memory pages in the data storage area.
- memory pages that meet the requirements are marked as occupied in the corresponding status mapping table, the first address of the last memory page found is used as the first address of the entire continuous memory page dynamically applied for, the lock of the dynamically applied memory is released, and this dynamic memory application is successful.
- the size can be dynamically adjusted.
- the updated memory application instruction can be issued again, and the memory can be locked. If the locking is successful, if the updated memory application instruction requires an increase in the memory space applied for, it is determined whether the required memory space exists after the applied target continuous memory. If so, the application is successful. If the updated memory application instruction requires a decrease in the memory space applied for, part of the memory space is released.
- This embodiment divides the storage area into multiple storage areas, uses the index position to dynamically apply for the space according to the actual required size, releases it after use, and can dynamically adjust the size when it is found that the space is insufficient after the dynamic application, so as to improve the flexibility and efficiency of shared memory.
- the method further includes at least one of the following:
- S222 Merge the processing resources of the first operating system that are preempted by the second operating system or the processing resources that the first operating system actively releases to the second operating system into an available resource pool of the second operating system.
- the scheduling of processing resources can be achieved by merging the corresponding processing resources into the available resource pool of the corresponding operating system.
- the processing resources of the second operating system preempted by the first operating system can be merged into the available resource pool of the first operating system.
- the processing resources of the first operating system preempted by the second operating system or the processing resources actively released by the first operating system can be merged into the available resource pool of the first operating system.
- the resource adaptive scheduling module can cooperate with the processor framework of the first operating system and the processor framework of the second operating system to configure and implement the processor hard-core resource pool, such as the SMP (Symmetrical Multi-Processing) framework of the Linux system.
- SMP Symmetrical Multi-Processing
- a group of processors are gathered on a computer, and each CPU shares a memory subsystem and a bus structure.
- SMP scheduling is the process of arranging/migrating processes to the appropriate CPU to maintain load balance on each CPU.
- the Linux system for an operating system, its CPU scheduling method is as follows: tasks (i.e., services) in the Linux system are generally maintained by task queues, and the process scheduler determines which processes (corresponding to tasks) in the queue can be executed by the CPU.
- the dispatching program module in the system gives the control of the CPU to the process selected by the process scheduler.
- the selected CPU comes from the CPU resource pool in the Linux system (that is, the aforementioned available resource pool), which means that the Linux system can schedule these CPUs in the resource pool to participate in the actual operation of the process.
- the process scheduler can pause a running process and transfer it to the running queue to start executing another process. It determines which process in the ready queue and in the main memory can be executed by the CPU (giving CPU control to this process) after a clock interrupt, I/O (Input/Output) interrupt, system call or other types of signals.
- the method further comprises:
- the first operating system is booted and run on the first initial processing resource through the boot loader
- the second operating system is booted and run on the second initial processing resource through the boot loader
- the first initial processing resource is the initial processing resource in the processing resources of the processor corresponding to the first operating system
- the second initial processing resource is the initial processing resource in the processing resources of the processor corresponding to the second operating system
- the entire system can be divided into two stages according to the working period, namely, the initial startup stage and the real-time operation stage.
- the aforementioned dynamic scheduling of processing resources and other processes are performed in the real-time operation stage.
- the initial startup stage starts when the system is powered on, that is, the chip where the processor is located is powered on.
- a core will be awakened to execute the boot action of the operating system, and the remaining cores are temporarily in a dormant state.
- the system will first execute a preset core scheduling strategy (boot boot strategy), that is, a core of the processor executes the core scheduling strategy.
- boot boot strategy a preset core scheduling strategy
- the core scheduling strategy is stored in the RAM or Norflash (non-volatile flash memory) on the SOC chip.
- the scheduling strategy can be flexibly configured according to different design requirements. Its main functions include: specifying the initial processing resources that different operating systems need to run (for example, specifying the initial cores that the first operating system and the second operating system need to run), and determining the boot process of heterogeneous operating systems.
- the initial processing resources corresponding to the first operating system are the first initial processing resources
- the initial processing resources corresponding to the second operating system are the second initial processing resources.
- the first operating system can be booted and run on the first initial processing resources through the boot loader
- the second operating system can be booted and run on the second initial processing resources through the boot loader.
- the boot loader is located on a computer or other computer application and refers to a program that boots the operating system to load.
- the chip can be a BMC (Baseboard Management Controller, baseboard management controller, management control chip in the server platform) chip, which refers to a SOC chip based on the ARM multi-core architecture, integrating a variety of peripheral hardware IPs (Intelligent Peripheral, intelligent peripherals).
- the BMC chip is placed on the motherboard (server motherboard), and chip power-on refers to power-on at the SOC chip level.
- the boot loader is a program used to guide the loading of the operating system, for example, the inherent program in the Bootrom (ROM on the CPU chip).
- the inherent program refers to the code that guides the startup of the operating system and belongs to the BootLoader program.
- each operating system is guided to start up on the initial processing resources corresponding to each operating system through the boot loader, which can improve the success rate of operating system startup and prepare for the real-time operation phase.
- the first initial processing resource is a designated processor core among processor cores of the processor
- the second initial processing resource is other processor cores among processor cores of the processor except the designated processor core.
- the initial processing resource may include an initial processor core
- the first initial processing resource may be at least one processor core among the processor cores of the processor
- the second initial processing resource may be at least some processor cores of other processor cores except the first initial processing resource.
- the first initial processing resource may be a designated processor core among the processor cores of the processor
- the second initial processing resource may be other processor cores among the processor cores of the processor except the designated processor core.
- the designated processor core may be CPU0 (or another processor core), that is, the initial processing resource of the first operating system is CPU0, and the initial processing resource of the second operating system is CPU1-CPU7.
- booting and running a first operating system on a first initial processing resource through a boot loader includes:
- the operating system can be started and guided by the Second Program Loader (SPL).
- SPL belongs to the code executed in the first stage of uboot, which can move the second stage code of uboot to the memory for execution and is mainly responsible for loading the operating system into the program code in RAM.
- uboot is a boot loader for embedded systems, mainly used for embedded systems, and can support a variety of different computer system structures, such as PPC, ARM, AVR32, MIPS, x86, 68k, Nios and MicroBlaze.
- the corresponding operating system is guided to run on the initial processing resources through the secondary program loader, which can be compatible with the existing system startup process and improve the efficiency of system startup.
- the method further comprises:
- a preset program in the boot chip embedded in the device motherboard can be used to perform a security boot check on the code of the secondary program loader to determine whether the secondary program loader is normal. If the result of the secondary program loader security boot check is normal, the operating system can be booted through the secondary program loader. If the result of the secondary program loader security boot check is abnormal, an abnormal prompt will be given and the boot process of the operating system will be terminated.
- the SPL code is checked for security startup through the Bootrom program (a set of programs solidified in the ROM chip on the device motherboard). If the check result is normal, the SPL code is executed.
- Bootrom program a set of programs solidified in the ROM chip on the device motherboard.
- booting and running a second operating system on a second initial processing resource by a boot loader includes:
- the second initial processing resource can be first awakened by the secondary program loader, and then the universal loader can be guided to run the second operating system.
- SPL boots and runs the first operating system on some cores (for example, core 1, CPU0), and on the other hand, wakes up other cores (for example, core 2 to core M+N, CPU1 to CPU M+N-1) to guide and execute uboot code (a boot loader mainly used for embedded systems) to boot and run the second operating system.
- uboot code a boot loader mainly used for embedded systems
- the first operating system is an RTOS system
- the second operating system is a Linux system (it can also be other non-real-time operating systems)
- the processing resource is a processor core.
- this optional example provides a method for dynamic balanced scheduling of processor resources among embedded heterogeneous multi-systems.
- a core adaptive scheduling i.e., resource adaptive scheduling
- system architecture designs such as business management, load balancing, dynamic resource allocation, and inter-core communication interfaces are integrated to achieve the effect of real-time and non-real-time embedded heterogeneous operating systems running in parallel on multiple cores of the same processor, which can improve the overall utilization of the processor core and greatly reduce the investment in hardware acceleration resources introduced to cope with real-time services.
- the processor multi-core adopts a high-speed internal bus, and the communication performance is greatly improved, which can significantly reduce the design cost and improve the computing performance.
- the operation method of the embedded system in this optional example can be divided into two stages, namely, the initial startup stage and the real-time operation stage. See the implementation architecture of dynamic balanced scheduling of processor resources among embedded heterogeneous multi-systems shown in FIG7 , wherein the CPU balanced scheduling process in the initial startup phase may be as shown in FIG8 , and the above process may include the following steps:
- Step S802 configuring a part of the core to boot the inherent program in Bootrom
- Step S804 a secure boot check is performed on the SPL (stored in Norflash) through the Bootrom program (i.e., the aforementioned inherent program) (the secure boot check mainly performs hash verification on the uboot, Linux, and RTOS images to be booted, and the obtained results are compared with the stored results. If the comparison is consistent, the boot is normal, and if it is inconsistent, the boot fails; the SPL configures some CPU registers to select which cores to wake up and from which address to load the system image);
- the Bootrom program i.e., the aforementioned inherent program
- Step S806 determine whether the security check is passed, if the security check is passed, execute step S808, if the security check is not passed, execute step S810;
- Step S808 executing the SPL code.
- the SPL boots and runs the RTOS system on some cores, and wakes up other cores to boot and execute the uboot code, thereby booting and running the Linux system.
- Step S810 end.
- the system enters the real-time operation stage.
- the real-time operation stage is completed by the collaboration of functional modules such as load balancing strategy, service management, dynamic resource allocation, core adaptive scheduling (i.e., resource adaptive scheduling), core preemption and release, and inter-core communication.
- the process of the operation method of the embedded system in this optional example may include the following steps:
- Step S902 The service management module performs actual classification of services to be allocated according to the output of the load balancing strategy module, and generates a list including real-time services and a list including non-real-time services.
- the load balancing strategy module provides policy guidance for the service management module, including the classification method of various services (or processes) running in the system, the real-time level evaluation principle, etc.
- the service management module After the RTOS system and the Linux system are booted, the service management module performs the actual classification of the services to be allocated according to the output of the load balancing strategy module, and generates a list containing real-time services and a list containing non-real-time services.
- the two lists output by the load balancing strategy module are used to represent the correspondence between the services and the operating system.
- a feasible classification method is to classify services such as server health status monitoring, IPMI (Intelligent Platform Management Interface) interaction, component monitoring, serial port redirection, asset information management, and Web access as non-real-time services; and fan control, PECI (Platform Environment Control Interface) communication and other services as real-time services.
- IPMI Intelligent Platform Management Interface
- component monitoring component monitoring
- serial port redirection asset information management
- Web access non-real-time services
- PECI Platinum Environment Control Interface
- Step S904 The dynamic resource allocation module dynamically adjusts the processor resources (including processor hard cores and controller logic units, etc.) according to the output results of the service management module to form a resource mapping table between different services and actual hardware resources.
- processor resources including processor hard cores and controller logic units, etc.
- the mapping table formed by the resource dynamic allocation module is a resource mapping table of services and processor resources, that is, it includes processor resources that have been allocated to various operating systems, as well as processor resources that have not been allocated to any operating system.
- mapping services to actual hardware resources real-time services are given priority in being allocated to processor cores of the RTOS system. If the processor cores of the RTOS system have been allocated to one or more services, then consider allocating unallocated processor cores to real-time services; non-real-time services are allocated to processor cores of the Linux system. If the processor cores of the Linux system have been allocated to one or more services, then consider allocating unallocated processor cores to real-time services. Therefore, there is a situation where unallocated processor cores are allocated to real-time services or non-real-time services.
- hardware resources such as the BMC processor core and peripheral controllers are dynamically mapped to the actual BMC services.
- core 1 in the BMC runs the RTOS system to control PWM (Pulse Width Modulation) and PECI peripheral controllers to implement fan speed regulation and fault diagnosis services
- cores 2 to N run the Linux system to control I2C (Inter-Integrated Circuit) and other controllers to implement component monitoring services.
- I2C Inter-Integrated Circuit
- the output resource mapping table can be: real-time service X cores and xxx controllers (certain types of controllers), non-real-time service Y Cores and xxxx controllers (certain types of controllers).
- Some services not only rely on computing resources (corresponding to processor cores), but also rely on specific hardware interfaces (corresponding to controllers on SOC). For example, services that require network ports need to be divided into the same operating system (RTOS system or Linux system) with the corresponding network controller.
- Step S906 the core adaptive scheduling module completes the actual scheduling action of the processor hard core resources according to the result of the dynamic allocation of hardware resources.
- the core adaptive scheduling module performs actual scheduling of processor hard core resources according to the output results of the service management module and the output results of the resource dynamic allocation module. For example, it schedules a part of the processor hard cores to execute real-time services, such as the M cores of core group 1 in Figure 6; and schedules the remaining processor hard cores to run non-real-time services, such as the N cores of core group 2 in Figure 6.
- the entire scheduling process is dominated by the Linux system, and the processor hard core resource pool can be configured and implemented in conjunction with the Linux SMP framework.
- the total number of available cores of the processor is M+N, where M ⁇ 1 and N ⁇ 1.
- Step S908 During the real-time operation of the system, the core preemption and release module dynamically preempts and releases the processor cores between the heterogeneous operating systems.
- the preemption and release process depends on the real-time load of the heterogeneous operating system to achieve the goal of maximizing the utilization of processor resources. For example, when the number of users accessing the BMC remotely increases from 1 to 20, the Web access business volume of the BMC increases sharply, which will cause the Linux system to require more processor hard cores to support it. In this case, the Linux system will send a core preemption request to the RTOS system through IPI. If the RTOS system is idle at this time (that is, no task scheduling), it will release core resources to the Linux system. At this time, the Linux system core preemption is successful, that is, Linux obtains more processor resources to cope with the new business needs. Through the core preemption and release mechanism, the user experience of remote server management is significantly improved.
- the core preemption and release process is a dynamic and cyclic process. Each core preemption and release is accompanied by the adjustment of the processor hard core resources. As shown in Figure 6, after one preemption and release, the number of cores in core group X becomes P, and the number of cores in core group Y becomes M+N-P. In addition, the core preemption and release process needs to coordinate load balancing strategy, business management, core adaptive adjustment and other modules to jointly determine the final core adjustment result.
- the above cycle means that during the normal operation of the system, there will be constant resource grabbing and releasing behaviors in the RTOS system and the Linux system due to insufficient resources on one side.
- This cycle operation process will involve the coordinated operation of modules such as "business management (business management is a dynamic division process) - dynamic allocation of hardware resources - core adaptive scheduling”.
- the above modules are all under the non-real-time system (Linux system). Considering that most of the main businesses are under the Linux system, it is more convenient to obtain and perceive more information and status.
- the above-mentioned multiple modules jointly determine the core adjustment result, which means that when a system needs to seize more core resources, the final success of the seizure needs to be jointly determined by modules such as load balancing strategy, business management, and core adaptive adjustment.
- modules such as load balancing strategy, business management, and core adaptive adjustment.
- load balancing strategy for example, in one possible situation, when the Linux system needs more resources, although the RTOS system is in a dormant idle state at this time, the RTOS system will soon wake up and run an important business thread, and the thread also requires a lot of resources when running. At this time, the RTOS system cannot release core resources to the Linux system.
- the above-mentioned resource scheduling process involves the criteria for judging the importance of the business, and the operation that the final resources are not allocated to the Linux system, which will involve the participation of modules such as load balancing strategy, business management, and core adaptive adjustment.
- the strategies of each of these modules also contain the characteristics of openness, which determines that the final core adjustment result determined by them is also the result of the joint action of these strategies.
- the RTOS system does not occupy any CPU core resources after sleeping.
- it When it is awakened (for example, an interrupt is generated by a peripheral or wake-up timer to trigger a wake-up action), it will regain control of the specified core resources (for example, core 0) through an inter-core interrupt.
- the RTOS system does not require the participation of the core.
- the following uses an eight-core processor (core 1 to core 8) as an example to explain the dynamic balanced scheduling of processor resources among embedded heterogeneous multi-systems.
- the dynamic balanced scheduling process of processor resources may include the following steps:
- Step 1 the system is powered on, and the preset boot strategy is run, the RTOS system is booted based on core 1 (CPU0), and the Linux system is booted based on core 8 (CPU7).
- Step 2 The service management module of the Linux system implements the real-time level classification of the system services based on the load balancing strategy module, and obtains a list of real-time services and non-real-time services. Assume that there are 20 services in total, of which real-time services are services 1 and 2, and non-real-time services are services 3 to 20.
- Step 3 start the resource dynamic allocation module and the core adaptive scheduling module according to the service list output by the service management module, and divide the 8 processor cores into processor core group 1 (assuming it includes cores 1 and 2) and core group 2 (assuming it includes cores 3 to 8) through the SMP framework of the Linux system.
- the system allocates the resources of core group 1 to the RTOS operating system and executes services 1 and 2, and allocates the resources of core group 2 to the Linux system and executes services 3 to 20.
- Step 4 During system operation, both the RTOS operating system and the Linux operating system will monitor their respective load conditions. When the business load of one party is too heavy, it will initiate a core preemption action through the inter-core communication interface; when the other party receives the core preemption request, it will determine whether to release hard core resources to the other party based on its own load conditions.
- the Linux system monitors that its own load has increased dramatically, and before its own computing resources are exhausted, it initiates a core preemption interrupt request to the RTOS system through the inter-core communication interface (corresponding to the SGI interrupt with interrupt number 9 in Table 1). After receiving the core preemption interrupt request, the RTOS system checks the busy and idle status of the core it occupies. If it finds that there is an idle core at this time (for example, core 2 is idle), it releases core 2 and sends a core release interrupt response signal (corresponding to the SGI interrupt with interrupt number 10 in Table 1) to the Linux system through the inter-core communication interface. After receiving the interrupt response signal, the Linux system merges core 2 into the available resource pool through the SMP framework. At this time, the processor hard core implements a new adjustment, that is, the RTOS system occupies core 1, and the remaining 7 cores are occupied by the Linux system.
- Step 5 Update the system load and return to step 2.
- the method provided in this optional example dynamically allocates different hardware processor cores to real-time operating systems and non-real-time operating systems according to actual business needs, and realizes the dynamic scheduling design of processor resources between embedded heterogeneous multi-systems based on processor hard cores from the hardware and software system architecture level.
- the heterogeneous operating systems coexisting in the system can obtain reasonable processor computing resources according to their own business load conditions, which enhances the processor's processing ability for real-time business on the one hand, and comprehensively improves the utilization rate of the processor core, improves computing performance, and achieves the purpose of saving hardware costs.
- the operation method of the embedded system in this embodiment is explained below in conjunction with an application scenario in which two operating systems alternately control the operation status of the same device (i.e., the target device), wherein the processing system of the first operating system includes a first processor core of a processor, and the processing resources of the second operating system include a second processor core of the processor.
- a startup control process of an operating system is provided, which includes the following steps:
- Step A Controlling the hardware controller of the target device via the second bus through the first operating system running on the first processor core of the processor to control the operating state of the target device.
- some specific devices can be equipped to perform operations related to the operation of the devices.
- these specific devices usually start working after the system is powered on. However, after the system is powered on, it will take some time for the operating system running on the processor to normally take over the specific device and control the operation status of the specific device. During the startup of the operating system, the specific device is uncontrollable.
- the fan starts working after the system is powered on. Since it takes some time for the operating system running on the CPU to take over the fan normally and set the fan speed after the system is powered on, the fan is uncontrollable during the operating system startup process.
- the server adopts the control method of BMC combined with CPLD
- the personal computer adopts the control method of EC chip (the EC chip has the function of adjusting the fan speed according to the temperature)
- the industrial computer adopts the control method of customized chip.
- a multi-core multi-system for example, a multi-core dual system
- startup control method can be adopted to run different operating systems of the embedded system on different processor cores of the processor.
- Different operating systems have different response speeds.
- the first operating system with a higher response speed than the second operating system can control the operating status of the specific device, which can reduce the situation where the operating status of the specific device is uncontrollable.
- no additional cost since no additional cost is required, it also has good scalability.
- the hardware controller of the target device can be controlled by the first operating system via the second bus to control the operating state of the target device.
- the target device here can be a fan, or other device that needs to be running when the system starts.
- the corresponding hardware controller is a fan controller, such as a PWM (Pulse Width Modulation) controller or a FanTach (fan speed) controller.
- the first operating system for example, an RTOS system
- RTOS system is used instead of traditional CPLD, EC chips, and custom chips.
- RTOS system For example, dual systems, RTOS system and Linux system are implemented based on BMC dual-core, and fans are implemented based on multi-core dual systems.
- the RTOS system can replace the CPLD, EC chip, and customized chip to control the fan, that is, take over the control of the fan and control the operating status of the fan at a fast enough speed.
- Step B booting a second operating system on a second processor core of the processor.
- the second operating system can be guided to start on the second processor core of the processor so that the second operating system runs on the second processor core.
- starting the second operating system on the second processor core means scheduling the second processor core to the second operating system, and the system file or image file of the operating system can be stored in a memory on the chip where the processor is located or outside the chip, for example, in an external RAM.
- Step C after the second operating system is started, the second operating system takes over the hardware controller via the second bus to take over the control of the target device.
- the first operating system can always control the running state of the target device.
- the second operating system can also take over the control of the target device.
- the hardware controller can be taken over by the second operating system via the second bus.
- the way in which the second operating system takes over the control of the target device can be: after the second operating system is started, the second operating system sends a device takeover request to the first operating system, for example, sending an interrupt request through the first bus to request to take over the hardware controller of the target device.
- the first operating system can receive the device takeover request sent by the second operating system, transfer the control of the target device to the second operating system, and can also perform operations related to the handover of the control of the target device, for example, stop running the service (process) used to control the running state of the target device.
- the RTOS system transfers the control right of the fan to the Linux system, and the Linux system controls the fan.
- the above process can be executed after the system is powered on, that is, the multi-core dual system startup mode is adopted, and the RTOS system is started first, which is conducive to earlier intervention in fan control, and after the Linux system is fully started, the RTOS system transfers the control right of the fan to the Linux system for control.
- the first operating system running on the first processor core of the processor controls the hardware controller of the target device via the second bus, it also includes: after the chip where the processor is located is powered on, waking up the first processor core through the processor; running the boot loader of the first operating system through the first processor core to guide the first operating system to start on the first processor core.
- the entire system can be divided into two stages according to the working period, the initial startup stage and the real-time operation stage.
- the startup control method in this embodiment can be executed in the initial startup stage or the real-time operation stage.
- the initial startup stage starts when the system is powered on, that is, the chip where the processor is located is powered on.
- a core will be awakened to execute the boot action of the operating system, and the remaining cores are temporarily in a dormant state.
- the awakened core can be the first processor core.
- the system will first execute a preset core scheduling strategy (boot strategy), that is, a processor core of the processor executes the core scheduling strategy.
- the core scheduling strategy can be stored in the RAM or Norflash (non-volatile flash memory) on the SOC chip.
- the scheduling strategy can be flexibly configured according to different design requirements. Its main functions include: specifying the initial processing resources (processor cores) required to run different operating systems, and determining the boot process of heterogeneous operating systems.
- Chip power-on can refer to power-on at the SOC chip level.
- the first operating system can be booted and run on the first processor core through the boot loader: Yes, the first operating system can be booted and started on the first processor core by the first processor core through the boot loader.
- the boot loader (BootLoader) program can be located on a computer or other computer application, which refers to a program used to boot the operating system to load, for example, the inherent program in BootRom, the inherent program refers to the code for booting the operating system to start, and belongs to the BootLoader program.
- BootRom is a small mask ROM (Read-Only Memory) or write-protected flash memory embedded in the processor chip on the CPU chip.
- the boot loader is used to guide the operating system to start on the processor core corresponding to the operating system, which can improve the success rate of the operating system startup and prepare for the real-time operation phase.
- a hardware controller of a target device is controlled via a second bus by a first operating system running on a first processor core of a processor, including: executing a first control task of the first operating system on the first processor core, wherein the first control task is used to control the hardware controller; reading sensor data of a designated sensor corresponding to the target device via the first processor core; and sending a device control instruction to the hardware controller via the second bus according to the sensor data of the designated sensor by the first control task, so that the hardware controller controls the operating state of the target device according to the device control instruction.
- the operating system controls the hardware controller of the target device by a control task (business) on the processor core on which the operating system runs.
- the control task here may refer to a corresponding control task.
- a first control task (first control process) of a first operating system may be executed on a first processor core, and the hardware controller is controlled by the first control task.
- the control of the hardware controller can be based on the sensor data of the sensor.
- the parameters that affect their operation may be different, and correspondingly, the sensor data required to be obtained may also be different.
- the target device it can be a device that runs after the chip is powered on, and the sensor corresponding to it is a designated sensor.
- designated sensors There can be many types of designated sensors, which may include but are not limited to at least one of the following: temperature sensor, humidity sensor, noise sensor, etc. Since the first control task runs on the first processor core, the sensor data of the designated sensor can be read by the first processor core.
- the sensor data of the designated sensor can be stored in the storage space within the designated sensor, and can be transmitted from the designated sensor to the designated storage space. In this embodiment, the reading position of the sensor data of the designated sensor is not limited.
- the sensor data of the designated sensor read may be sensor data within a time period, or may be all sensor data since the target device was started, or may be sensor data that meets other time constraints.
- the first control task may control the operating state of the target device according to the sensor data of the designated sensor. Controlling the operating state of the target device may be achieved in the following manner: sending a device control instruction to a hardware controller of the target device through the first control task, so that the hardware controller controls the operating state of the target device according to the device control instruction.
- the first control task can determine the expected operating state of the target device based on the sensor data of the designated sensor; when the current operating state of the target device is different from the expected operating state, the above-mentioned device control instruction can be generated, and the device control instruction can control the operating state of the target device to be adjusted to the expected operating state.
- the above-mentioned device control instruction can be sent to the hardware controller of the target device via the second bus.
- the second bus is similar to the above-mentioned embodiment and will not be described in detail here.
- the operating state of the target device is controlled, thereby improving the utilization of resources.
- a device control instruction is sent to a hardware controller via a second bus according to sensor data of a designated sensor by a first control task, including: determining a target parameter value of a device operating parameter of a target device according to sensor data of a designated sensor by the first control task, wherein the device operating parameter is a parameter for controlling the operating state of the target device; and sending the device control instruction carrying the target parameter value to the hardware controller via the second bus by the first control task.
- the first control task may determine the expected operating state of the target device based on the sensor data of the designated sensor.
- the expected operating state may be represented by the parameter value of the device operating parameter.
- the device operating parameter may be a parameter for controlling the operating state of the target device.
- the corresponding device operating parameters may be different.
- the corresponding device operating parameter may be the speed, and for For other types of devices, the device operating parameters may be other operating parameters.
- the expected operating state may correspond to a target parameter value of the device operating parameter of the target device.
- the target parameter value can be carried in the above-mentioned device control instruction, that is, the device control instruction carrying the target parameter value is sent to the hardware controller through the first control task.
- the method of sending the device control instruction to the hardware controller can be similar to that in the aforementioned embodiment, and will not be repeated here.
- the accuracy of device control can be improved.
- a target parameter value of a device operating parameter of a target device is determined according to sensor data of a designated sensor through a first control task, including: when the target device is a fan, a target parameter value of a fan operating parameter of the fan is determined according to sensor data of the designated sensor through the first control task.
- the target device may be a fan, which may be a fan for cooling the server or other device, that is, a cooling fan.
- the device operating parameter may be a fan operating parameter
- the fan operating parameter may include one or more, including but not limited to at least one of the following: rotation speed, rotation cycle, cycle switching time, and other operating parameters. This is not limited in this embodiment.
- determining the target parameter value of the device operating parameter of the target device according to the sensor data of the designated sensor by the first control task may be: determining the target parameter value of the fan operating parameter of the fan according to the sensor data of the designated sensor by the first control task.
- the first control task sends the device control instruction carrying the target parameter value to the hardware controller of the fan via the second bus, thereby controlling the operating state of the fan.
- the running status of the fan can be quickly controlled in scenarios such as system power-on, system restart or other scenarios, thereby improving the timeliness of fan control.
- a target parameter value of a fan operating parameter of the fan is determined according to sensor data of a designated sensor through a first control task, including: when the target device is a fan and the designated sensor is a temperature sensor, a target speed value of the fan speed is determined according to sensor data of the temperature sensor through a first control task, wherein the speed of the fan is positively correlated with the temperature detected by the temperature sensor.
- the designated sensor may be a temperature sensor, the number of which may be one or more, and the location of the temperature sensor may be configured as required, and different temperature sensors may be located at different locations.
- the sensor data of the temperature sensor is used to represent the temperature detected by the temperature sensor, and in this regard, the first control task may determine a target speed value of the fan's speed based on the sensor data of the temperature sensor, where the fan's speed is positively correlated with the temperature detected by the temperature sensor.
- the highest temperature detected by the multiple temperature sensors can be determined based on the sensor data of each temperature sensor, and the fan speed can be determined based on the highest temperature detected by the multiple temperature sensors. Compared with determining the fan speed based on the average temperature detected by the multiple temperature sensors, the safety of device operation can be ensured.
- the speed of each fan can also be determined based on the highest temperature or average temperature detected by the temperature sensor matching each fan.
- the first operating system (for example, RTOS system) can be used to replace the processing units such as CPLD, EC chip, custom chip to control the fan speed (BMC fan control can be performed in real time).
- the first processor core for example, CPU0, the first processor core can be awakened by hardware
- the first processor core runs the boot loader (for example, the specified program in BootRom), loads the first operating system to start, and the first processor core will read various temperature-related sensor (Sensor) data to perform fan control (for example, fan speed control), completely simulating the above-mentioned processing unit to complete the fan regulation function.
- the first operating system can calculate the PWM value according to the temperature sensor, and then adjust the fan speed. In the above manner, the fan speed can be controlled by the first operating system during the startup of the second operating system.
- booting a second operating system on a second processor core of a processor includes: executing a secondary program loader through a first processor core to wake up the second processor core by the secondary program loader; and running a universal boot loader of the second operating system through the second processor core to boot the second operating system on the first processor core.
- the secondary program loader when the operating system is started, can be loaded into the internal memory, for example, the static random access memory (Static RAM, SRAM) inside the SOC, and the SPL can be responsible for loading the universal boot loader (Universal Boot Loader, referred to as U-Boot) into the random access memory.
- the secondary program loader can boot load the second operating system and can also boot load the first operating system.
- the secondary program loader can be executed by the first processor core to wake up the second processor core by the secondary program loader; the universal boot loader (universal boot loader) of the second operating system can be run by the second processor core, thereby guiding the second operating system to start on the first processor core.
- the boot program of the second operating system is loaded by the secondary program loader, and the boot program of the second operating system may include the universal boot loader.
- the secondary program loader is the code executed in the first stage of the universal boot loader, which is responsible for moving the second stage code of the universal boot loader to the system memory (System RAM, also called off-chip memory) for execution.
- the universal boot loader is an open source software that complies with the GPL (General Public License) agreement and can be regarded as a bare metal integrated routine.
- the processor will first wake up the CPU0 core so that the RTOS system can run as quickly as possible; then use the program in BootRom to boot the RTOS system; during the startup of the RTOS system, it will continue to load U-Boot through SPL, and U-Boot will boot the second operating system on CPU1 until the Linux system starts normally.
- Boot Rom is the internal ROM solidification program of the chip (for example, SOC chip), which is the boot code of uboot.
- Boot Rom reads the startup information of the hardware (for example, the setting of the dip switch), and reads the uboot-spl code (that is, SPL) from the specified startup medium (for example, SD, MMC, etc.).
- SPL is mainly responsible for initializing the external RAM and environment, and loading the real uboot image into the external RAM for execution.
- the external RAM can be DDR (Double Data Rate Synchronous Dynamic RAM, double-rate synchronous dynamic random access memory) or other RAM.
- the second processor core is awakened by the secondary program loader, and then the second processor core runs the universal boot loader to boot the second operating system on the corresponding processor core, which can improve the convenience and success rate of operating system startup.
- the startup process of a multi-core dual system is explained below by taking an RTOS system and a Linux system as examples.
- the startup process of the multi-core dual system can include the following steps:
- Step 1 wake up CPU0 when the system is just powered on
- Step 2 CPU0 runs the specified program in BootRom and loads the RTOS system to start;
- Step 3 during the startup of the RTOS system, wake up CPU1 to boot u-boot and start the fan control program (FanCtrl_RTOS_APP) in the first operating system;
- Step 4 CPU1 boots u-boot, which may include the SPL stage and the Uboot stage, and enters the SPL stage by calling SPL;
- Step 5 In the SPL stage, SPL guides Uboot to start;
- Step 6 In the Uboot stage, the Linux kernel (CPU1-CPUN) is loaded, and the BMC service program and the fan control program (FanCtrl_Linux_APP) in the second operating system are started.
- the Linux kernel CPU1-CPUN
- the BMC service program and the fan control program FeanCtrl_Linux_APP
- the fan is controlled by first starting the RTOS system, and after the Linux system is started, the second operating system takes over the control of the fan. This ensures that the fan can be quickly controlled when the system is powered on, thereby improving the efficiency of fan control.
- the second operating system after the second operating system takes over the hardware controller via the second bus, it also includes: when the second operating system is to be restarted, the first operating system is awakened by the second operating system via the first bus, and the first operating system takes over the hardware controller via the second bus to take over control of the target device; and the second operating system is controlled to restart the system.
- the second operating system may first wake up the first operating system, and the first operating system takes over the hardware controller to take over the control of the target device. Waking up the first operating system may be performed via the first bus, and the first operating system taking over the hardware controller may be performed via the second bus.
- the reliability of device control can be improved by waking up the first operating system to take over the control of the target device.
- waking up the first operating system through the second operating system via the first bus includes: when the second operating system is to be restarted, initiating a system wake-up interrupt to the first operating system through the second operating system via the first bus, wherein the system wake-up interrupt is used to wake up the first operating system.
- Waking up the first operating system may be achieved through an inter-core interrupt. If the second operating system is to be restarted (for example, the system crashes, a reboot command is received), the second operating system may initiate a system wake-up interrupt to the first operating system to wake up the first operating system.
- the system wake-up interrupt may be an active wake-up interrupt.
- the second operating system may be controlled to restart the system, and after the second operating system restarts, the hardware controller may be taken over again. The process of taking over the hardware controller is similar to that in the aforementioned embodiment, and will not be described in detail here.
- the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
- the technical solution of the present application, or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
- a storage medium such as ROM/RAM, magnetic disk, optical disk
- a terminal device which can be a mobile phone, computer, server, or network device, etc.
- an embedded system for implementing the operating method of the above-mentioned embedded system is also provided, and the above-mentioned embedded system can be run on the above-mentioned BMC chip, wherein the above-mentioned embedded system may include:
- a first operating system and a second operating system are run on the processor, and the response speed of the first operating system is higher than that of the second operating system;
- a service management module configured to allocate a group of services to be allocated to corresponding operating systems according to a resource dynamic allocation rule, wherein the resource dynamic allocation rule includes dynamically allocating resources according to at least one of the following: service response speed, service resource occupancy rate;
- a resource dynamic allocation module used to determine a resource allocation result corresponding to a group of services to be allocated, wherein the resource allocation result is used to indicate a processing resource corresponding to each service to be allocated in the group of services to be allocated in the processing resources of the processor, and the processing resources of the processor include a processor core;
- the resource adaptive scheduling module is used to allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each service to be allocated and the resource allocation result.
- the first operating system and the second operating system may be similar to those in the aforementioned embodiment and will not be elaborated here.
- the business management module, the resource dynamic allocation module and the resource adaptive scheduling module may be software modules running under the first operating system or the second operating system.
- the embedded system includes: a first operating system and a second operating system, the first operating system and the second operating system run on a processor, and the response speed of the first operating system is higher than that of the second operating system; a business management module, which is used to allocate a group of to-be-allocated businesses to corresponding operating systems according to a resource dynamic allocation rule, wherein the resource dynamic allocation rule includes dynamic resource allocation according to at least one of the following: business response speed, business resource occupancy rate; a resource dynamic allocation module, which is used to determine a resource allocation result corresponding to a group of to-be-allocated businesses, wherein the resource allocation result is used to indicate the processing resources of the processor corresponding to each to-be-allocated business in the group of to-be-allocated businesses, and the processing resources of the processor include processor cores; a resource adaptive scheduling module, which is used to allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each to-be-
- the embedded system further comprises:
- the load balancing strategy module is used to generate a rule structure by reading a rule configuration file, wherein the rule structure is used to record dynamic resource allocation rules.
- the load balancing strategy module in this embodiment is similar to that in the previous embodiment, and will not be described in detail here.
- the software module under the first operating system or the second operating system can conveniently and flexibly adjust the load balancing policy by configuring the load balancing policy to be stored by a separate software module.
- the load balancing strategy module is also used to
- a rule update configuration file is obtained through an external interface of the second operating system, wherein the rule update configuration file is used to update the configured dynamic resource allocation rules; and a rule structure is updated using the rule update configuration file to update the dynamic resource allocation rules recorded in the rule structure.
- the resource dynamic allocation rules stored in the load balancing policy module can be flexibly configured through the external interface of the second operating system.
- the configuration method is similar to that in the above-mentioned embodiment and will not be described in detail here.
- the service management module is used to allocate a group of services to be allocated to the corresponding operating system according to the allocation rule corresponding to the service response speed in the dynamic resource allocation rule by executing the following steps:
- a group of services to be allocated whose service response speed requirements are greater than or equal to a set response speed threshold are allocated to the first operating system, and a group of services to be allocated whose service response speed requirements are less than the set response speed threshold are allocated to the second operating system.
- the manner in which the service management module allocates the services to be allocated according to the service response speed is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the service management module is used to allocate a group of services to be allocated to the corresponding operating system according to the allocation rule corresponding to the service resource occupancy rate in the dynamic resource allocation rule by executing the following steps:
- a group of services to be allocated whose service resource occupancy rate is less than a first occupancy rate threshold is allocated to the first operating system, and a group of services to be allocated whose service resource occupancy rate is greater than or equal to the first occupancy rate threshold is allocated to the second operating system.
- the manner in which the service management module allocates the services to be allocated according to the service resource occupancy rate is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the service management module is further configured to allocate a group of services to be allocated to the corresponding operating system by performing at least one of the following steps:
- the services to be allocated which have a service coupling degree with the allocated services of the second operating system greater than or equal to a second coupling degree threshold, in a group of services to be allocated, are allocated to the second operating system.
- the manner in which the service management module allocates the services to be allocated according to the service coupling degree is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the service management module is further configured to allocate a group of services to be allocated to the corresponding operating system by executing the following steps:
- the manner in which the service management module allocates the to-be-allocated service containing sensitive information to the first operating system is similar to that in the aforementioned embodiment, and is not described in detail here.
- the allocation of services to be allocated by the business management module based on the business response speed and the business resource occupancy rate is executed based on the dynamic resource allocation rules stored in the load balancing strategy module, while the allocation of services to be allocated based on the business coupling degree and the business importance (for example, whether sensitive information is contained) can be executed by the business management module based on the configuration information preset thereon.
- the dynamic resource allocation rules for dynamically allocating resources according to at least one of the business response speed and the business resource occupancy rate are stored in a separate software module, which can take into account the flexibility and simplicity of the rule configuration.
- the resource dynamic allocation module is used to determine the resource allocation result corresponding to a group of services to be allocated by executing the following steps:
- a resource mapping table of a group of services to be allocated and the processing resources of the processor is generated in combination with the resource utilization of the processing resources of the first operating system and the resource utilization of the processing resources of the second operating system.
- the way in which the resource dynamic allocation module generates a resource mapping table of a group of services to be allocated and processing resources of the processor is similar to that in the above-mentioned embodiment, and is not described in detail here.
- the resource dynamic allocation module allocates the processing resources of the processor to the first operating system and the second operating system in units of processor cores.
- the resource adaptive scheduling module is used to allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each service to be allocated and the resource allocation result by executing the following steps:
- the unallocated processing resources are allocated to the operating system to which the to-be-allocated business corresponding to the unallocated processing resources is allocated.
- the resource adaptive scheduling module allocates the unallocated processing resources to the operating system in a manner similar to that in the aforementioned embodiment, which will not be described in detail here.
- the embedded system further comprises:
- the resource preemption and release module is used to preempt and release processing resources between the first operating system and the second operating system.
- the resource preemption and release module performs preemption and release of processing resources between different operating systems in a similar manner as in the above-mentioned embodiment, and will not be described in detail here.
- the resource preemption and release module preempts and releases processing resources between the first operating system and the second operating system through an inter-core communication interface.
- the resource preemption and release module is used to implement the preemption and release of processing resources between the first operating system and the second operating system through the inter-core communication interface by executing the following steps:
- a first interaction response returned by the second operating system in response to the first interaction request is obtained through the inter-core communication interface, wherein the first interaction response is used to instruct the first operating system to perform resource interaction with the second operating system according to the first interaction response.
- the resource preemption and release module performs resource interaction between the first operating system and the second operating system through the inter-core communication interface in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the embedded system further comprises:
- the first system control module is used to detect the resource utilization of the processing resources of the first operating system, and when it is determined based on the resource utilization of the processing resources of the first operating system that the first operating system is to interact with the second operating system for resources, the resource preemption and release module is triggered to transmit the first interaction request to the second operating system through the inter-core communication interface.
- the manner in which the first system control module triggers resource interaction based on the resource utilization of the processing resources of the first operating system is similar to that in the aforementioned embodiment, and is not described in detail herein.
- the first system control module is also used to perform at least one of the following steps: when the resource utilization of the processing resources of the first operating system is greater than or equal to the first utilization threshold, determine that the first operating system is to preempt the processing resources of the second operating system; when the processing resources of the first operating system are in an idle state and there is no business to be executed by the first operating system, determine that the first operating system is to release the processing resources to the second operating system.
- the manner in which the first system control module determines the type of resource interaction to be performed by the first operating system is similar to that in the aforementioned embodiment, and is not described in detail herein.
- the first system control module is further configured to control the first operating system to enter a dormant state when there is no service scheduled by the first operating system and no service to be allocated to the first operating system.
- the way in which the first system control module controls the first operating system to enter the dormant state is similar to that in the above-mentioned embodiment, and will not be described here. Elaborate.
- the resource preemption and release module is used to transmit the first interaction request of the first operating system to the second operating system through the inter-core communication interface by performing at least one of the following steps:
- a resource release request with the second interrupt number is transmitted to the second operating system through the inter-core communication interface, wherein the resource release request is used to request to release the processing resources occupied by the first operating system to the second operating system.
- the resource preemption and release module performs resource interaction through inter-core interrupts in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the resource preemption and release module is used to implement the preemption and release of processing resources between the first operating system and the second operating system through the inter-core communication interface by executing the following steps:
- a second interaction response returned by the first operating system in response to the second interaction request is obtained through the inter-core communication interface, wherein the second interaction response is used to indicate whether the first operating system allows the second operating system to preempt processing resources of the first operating system.
- the resource preemption and release module performs resource interaction between the first operating system and the second operating system through the inter-core communication interface in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the embedded system further comprises:
- the second system control module is used to detect the resource utilization of the processing resources of the second operating system. When it is determined that the second operating system is to preempt the processing resources of the first operating system based on the resource utilization of the processing resources of the second operating system, the resource preemption and release module is triggered to transmit the second interaction request to the first operating system through the inter-core communication interface.
- the manner in which the second system control module triggers resource interaction based on the resource utilization of the processing resources of the second operating system is similar to that in the above-mentioned embodiment, and is not described in detail here.
- the second system control module is further configured to perform at least one of the following steps:
- the manner in which the second system control module determines the resource interaction to be performed by the second operating system is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the first operating system is also used to determine that the first operating system refuses the second operating system to preempt the processing resources of the first operating system when the business priority of the business being executed by the first operating system is not lower than the business priority of the business to be executed by the second operating system; and to determine that the first operating system allows the second operating system to preempt the processing resources of the first operating system when the business priority of the business being executed by the first operating system is lower than the business priority of the business to be executed by the second operating system.
- the embedded system determines whether the first operating system allows the second operating system to occupy the processing resources in a manner similar to that in the above-mentioned embodiment, which will not be described in detail here.
- the resource preemption and release module is used to transmit the second interaction request of the second operating system to the first operating system through the inter-core communication interface by executing the following steps:
- a second preemption request whose interrupt number is the third interrupt number is transmitted to the first operating system through the inter-core communication interface, wherein the second preemption request is used to request to preempt the processing resources of the first operating system.
- the resource grabbing and releasing module performs resource interaction through inter-core interrupts in a similar manner to that in the above-mentioned embodiment, and will not be repeated here. State.
- the resource preemption and release module is used to obtain the second interactive response returned by the first operating system in response to the second interactive request through the inter-core communication interface by performing at least one of the following steps:
- the resource release rejection response with the interrupt number of the fifth interrupt number is transmitted to the second operating system through the inter-core communication interface, wherein the resource release rejection response is used to instruct the first operating system to reject the second operating system from preempting the processing resources of the first operating system.
- the resource preemption and release module performs resource interaction through inter-core interrupts in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the resource adaptive scheduling module is also used to perform at least one of the following steps: merging the processing resources of the second operating system preempted by the first operating system into the available resource pool of the first operating system; merging the processing resources of the first operating system preempted by the second operating system or the processing resources actively released by the first operating system to the second operating system into the available resource pool of the second operating system.
- the resource adaptive scheduling module processes resource scheduling between different operating systems in a manner similar to that in the aforementioned embodiment, which will not be described in detail here.
- the embedded system further comprises:
- a system startup module is used to boot and run a first operating system on a first initial processing resource through a boot loader after the chip where the processor is located is powered on, and to boot and run a second operating system on a second initial processing resource through a boot loader, wherein the first initial processing resource is an initial processing resource in the processing resources of the processor corresponding to the first operating system, and the second initial processing resource is an initial processing resource in the processing resources of the processor corresponding to the second operating system.
- the way in which the system startup module boots and runs each operating system on the corresponding initial processing resource through the boot loader is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the first initial processing resource is a designated processor core among processor cores of the processor
- the second initial processing resource is other processor cores among processor cores of the processor except the designated processor core.
- system startup module is used to boot and run the first operating system on the first initial processing resource through the boot loader by executing the following steps:
- the first operating system is booted and executed on the first initial processing resource through the secondary program loader.
- system startup module boots and runs the operating system on the initial processing resources through the secondary program loader is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- system startup module is also used to perform a security startup check on the code of the secondary program loader through a preset program in the startup chip solidified on the device motherboard, wherein the secondary program loader is executed after the check result of the security startup check is normal.
- system startup module performs a security startup check on the code of the secondary program loader.
- system startup module is used to boot and run the second operating system on the second initial processing resource through the boot loader by executing the following steps:
- the second initial processing resource is awakened by the secondary program loader, and the universal boot loader is guided to execute so as to guide and run the second operating system.
- the way in which the system startup module boots the second operating system through the secondary program loader is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- an embedded system for implementing the operating method of the above-mentioned embedded system is also provided, and the above-mentioned embedded system can be run on the above-mentioned BMC chip, wherein the above-mentioned embedded system may include:
- a first operating system and a second operating system are run on the processor, and the response speed of the first operating system is higher than that of the second operating system;
- a service management module configured to allocate a group of services to be allocated to corresponding operating systems according to a resource dynamic allocation rule, wherein the resource dynamic allocation rule includes dynamically allocating resources according to at least one of the following: service response speed, service resource occupancy rate;
- a resource dynamic allocation module used to determine a resource allocation result corresponding to a group of services to be allocated, wherein the resource allocation result is used to indicate a processing resource corresponding to each service to be allocated in the group of services to be allocated in the processing resources of the processor, and the processing resources of the processor include a processor core;
- the resource adaptive scheduling module is used to allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each service to be allocated and the resource allocation result.
- the first operating system and the second operating system may be similar to those in the aforementioned embodiment and will not be elaborated here.
- the business management module, the resource dynamic allocation module and the resource adaptive scheduling module may be software modules running under the first operating system or the second operating system.
- the embedded system includes: a first operating system and a second operating system, the first operating system and the second operating system run on a processor, and the response speed of the first operating system is higher than that of the second operating system; a business management module, which is used to allocate a group of to-be-allocated businesses to corresponding operating systems according to a resource dynamic allocation rule, wherein the resource dynamic allocation rule includes dynamic resource allocation according to at least one of the following: business response speed, business resource occupancy rate; a resource dynamic allocation module, which is used to determine a resource allocation result corresponding to a group of to-be-allocated businesses, wherein the resource allocation result is used to indicate the processing resources of the processor corresponding to each to-be-allocated business in the group of to-be-allocated businesses, and the processing resources of the processor include processor cores; a resource adaptive scheduling module, which is used to allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each to-be-
- the embedded system further comprises:
- the load balancing strategy module is used to generate a rule structure by reading a rule configuration file, wherein the rule structure is used to record dynamic resource allocation rules.
- the load balancing strategy module in this embodiment is similar to that in the above embodiment and will not be described in detail here.
- the load balancing strategy module can be a software module under the first operating system or the second operating system. By configuring the load balancing strategy to be stored by a separate software module, the load balancing strategy can be flexibly adjusted.
- the load balancing strategy module is also used to
- a rule update configuration file is obtained through an external interface of the second operating system, wherein the rule update configuration file is used to update the configured dynamic resource allocation rules; and a rule structure is updated using the rule update configuration file to update the dynamic resource allocation rules recorded in the rule structure.
- the resource dynamic allocation rules stored in the load balancing policy module can be flexibly configured through the external interface of the second operating system.
- the configuration method is similar to that in the above-mentioned embodiment and will not be described in detail here.
- the service management module is used to allocate a group of services to be allocated to the corresponding operating system according to the allocation rule corresponding to the service response speed in the dynamic resource allocation rule by executing the following steps:
- a group of services to be allocated whose service response speed requirements are greater than or equal to a set response speed threshold are allocated to the first operating system, and a group of services to be allocated whose service response speed requirements are less than the set response speed threshold are allocated to the second operating system.
- the manner in which the service management module allocates the services to be allocated according to the service response speed is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the service management module is used to allocate a group of services to be allocated to the corresponding operating system according to the allocation rule corresponding to the service resource occupancy rate in the dynamic resource allocation rule by executing the following steps:
- a group of services to be allocated whose service resource occupancy rate is less than a first occupancy rate threshold is allocated to the first operating system, and a group of services to be allocated whose service resource occupancy rate is greater than or equal to the first occupancy rate threshold is allocated to the second operating system.
- the manner in which the service management module allocates the services to be allocated according to the service resource occupancy rate is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the service management module is further configured to allocate a group of services to be allocated to the corresponding operating system by performing at least one of the following steps:
- the services to be allocated which have a service coupling degree with the allocated services of the second operating system greater than or equal to a second coupling degree threshold, in a group of services to be allocated, are allocated to the second operating system.
- the manner in which the service management module allocates the services to be allocated according to the service coupling degree is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the service management module is further configured to allocate a group of services to be allocated to the corresponding operating system by executing the following steps:
- the manner in which the service management module allocates the to-be-allocated service containing sensitive information to the first operating system is similar to that in the aforementioned embodiment, and is not described in detail here.
- the allocation of services to be allocated by the business management module based on the business response speed and the business resource occupancy rate is executed based on the dynamic resource allocation rules stored in the load balancing strategy module, while the allocation of services to be allocated based on the business coupling degree and the business importance (for example, whether sensitive information is contained) can be executed by the business management module based on the configuration information preset thereon.
- the dynamic resource allocation rules for dynamically allocating resources according to at least one of the business response speed and the business resource occupancy rate are stored in a separate software module, which can take into account the flexibility and simplicity of the rule configuration.
- the resource dynamic allocation module is used to determine the resource allocation result corresponding to a group of services to be allocated by executing the following steps:
- a resource mapping table of a group of services to be allocated and the processing resources of the processor is generated in combination with the resource utilization of the processing resources of the first operating system and the resource utilization of the processing resources of the second operating system.
- the way in which the resource dynamic allocation module generates a resource mapping table of a group of services to be allocated and processing resources of the processor is similar to that in the above-mentioned embodiment, and is not described in detail here.
- the resource dynamic allocation module allocates the processing resources of the processor to the first operating system and the second operating system in units of processor cores.
- the resource adaptive scheduling module is used to allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each service to be allocated and the resource allocation result by executing the following steps:
- the unallocated processing resources are allocated to the operating system to which the to-be-allocated business corresponding to the unallocated processing resources is allocated.
- the resource adaptive scheduling module allocates the unallocated processing resources to the operating system in a manner similar to that in the aforementioned embodiment, which will not be described in detail here.
- the embedded system further comprises:
- the resource preemption and release module is used to preempt and release processing resources between the first operating system and the second operating system.
- the resource preemption and release module performs preemption and release of processing resources between different operating systems in a similar manner as in the above-mentioned embodiment, and will not be described in detail here.
- the resource preemption and release module preempts and releases processing resources between the first operating system and the second operating system through an inter-core communication interface.
- the resource preemption and release module is used to implement the following steps through the inter-core communication interface in the first operating system:
- the system and the second operating system preempt and release processing resources:
- a first interaction response returned by the second operating system in response to the first interaction request is obtained through the inter-core communication interface, wherein the first interaction response is used to instruct the first operating system to perform resource interaction with the second operating system according to the first interaction response.
- the resource preemption and release module performs resource interaction between the first operating system and the second operating system through the inter-core communication interface in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the embedded system further comprises:
- the first system control module is used to detect the resource utilization of the processing resources of the first operating system, and when it is determined based on the resource utilization of the processing resources of the first operating system that the first operating system is to interact with the second operating system for resources, the resource preemption and release module is triggered to transmit the first interaction request to the second operating system through the inter-core communication interface.
- the manner in which the first system control module triggers resource interaction based on the resource utilization of the processing resources of the first operating system is similar to that in the aforementioned embodiment, and is not described in detail herein.
- the first system control module is also used to perform at least one of the following steps: when the resource utilization of the processing resources of the first operating system is greater than or equal to the first utilization threshold, determine that the first operating system is to preempt the processing resources of the second operating system; when the processing resources of the first operating system are in an idle state and there is no business to be executed by the first operating system, determine that the first operating system is to release the processing resources to the second operating system.
- the manner in which the first system control module determines the type of resource interaction to be performed by the first operating system is similar to that in the aforementioned embodiment, and is not described in detail herein.
- the first system control module is further configured to control the first operating system to enter a dormant state when there is no service scheduled by the first operating system and no service to be allocated to the first operating system.
- the manner in which the first system control module controls the first operating system to enter the sleep state is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the resource preemption and release module is used to transmit the first interaction request of the first operating system to the second operating system through the inter-core communication interface by performing at least one of the following steps:
- a resource release request with the second interrupt number is transmitted to the second operating system through the inter-core communication interface, wherein the resource release request is used to request to release the processing resources occupied by the first operating system to the second operating system.
- the resource preemption and release module performs resource interaction through inter-core interrupts in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the resource preemption and release module is used to implement the preemption and release of processing resources between the first operating system and the second operating system through the inter-core communication interface by executing the following steps:
- a second interaction response returned by the first operating system in response to the second interaction request is obtained through the inter-core communication interface, wherein the second interaction response is used to indicate whether the first operating system allows the second operating system to preempt processing resources of the first operating system.
- the resource preemption and release module performs resource interaction between the first operating system and the second operating system through the inter-core communication interface in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the embedded system further comprises:
- the second system control module is used to detect the resource utilization rate of the processing resources of the second operating system, and Resource utilization, when determining that the second operating system is about to preempt the processing resources of the first operating system, triggering the resource preemption and release module to transmit the second interaction request to the first operating system through the inter-core communication interface.
- the manner in which the second system control module triggers resource interaction based on the resource utilization of the processing resources of the second operating system is similar to that in the above-mentioned embodiment, and is not described in detail here.
- the second system control module is further configured to perform at least one of the following steps:
- the manner in which the second system control module determines the resource interaction to be performed by the second operating system is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the embedded system is also used to determine that the first operating system refuses the second operating system to preempt the processing resources of the first operating system when the business priority of the business being executed by the first operating system is not lower than the business priority of the business to be executed by the second operating system; and determine that the first operating system allows the second operating system to preempt the processing resources of the first operating system when the business priority of the business being executed by the first operating system is lower than the business priority of the business to be executed by the second operating system.
- the embedded system determines whether the first operating system allows the second operating system to occupy the processing resources in a manner similar to that in the above-mentioned embodiment, which will not be described in detail here.
- the resource preemption and release module is used to transmit the second interaction request of the second operating system to the first operating system through the inter-core communication interface by executing the following steps:
- a second preemption request whose interrupt number is the third interrupt number is transmitted to the first operating system through the inter-core communication interface, wherein the second preemption request is used to request to preempt the processing resources of the first operating system.
- the resource preemption and release module performs resource interaction through inter-core interrupts in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the resource preemption and release module is used to obtain the second interactive response returned by the first operating system in response to the second interactive request through the inter-core communication interface by performing at least one of the following steps:
- the resource release rejection response with the interrupt number of the fifth interrupt number is transmitted to the second operating system through the inter-core communication interface, wherein the resource release rejection response is used to instruct the first operating system to reject the second operating system from preempting the processing resources of the first operating system.
- the resource preemption and release module performs resource interaction through inter-core interrupts in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the resource adaptive scheduling module is also used to perform at least one of the following steps: merging the processing resources of the second operating system preempted by the first operating system into the available resource pool of the first operating system; merging the processing resources of the first operating system preempted by the second operating system or the processing resources actively released by the first operating system to the second operating system into the available resource pool of the second operating system.
- the resource adaptive scheduling module processes resource scheduling between different operating systems in a manner similar to that in the aforementioned embodiment, which will not be described in detail here.
- the embedded system further comprises:
- a system startup module is used to boot and run a first operating system on a first initial processing resource through a boot loader after the chip where the processor is located is powered on, and to boot and run a second operating system on a second initial processing resource through a boot loader, wherein the first initial processing resource is an initial processing resource in the processing resources of the processor corresponding to the first operating system, and the second initial processing resource is an initial processing resource in the processing resources of the processor corresponding to the second operating system.
- the way in which the system startup module boots and runs each operating system on the corresponding initial processing resource through the boot loader is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the first initial processing resource is a designated processor core among processor cores of the processor
- the second initial processing resource is other processor cores among processor cores of the processor except the designated processor core.
- system startup module is used to boot and run the first operating system on the first initial processing resource through the boot loader by executing the following steps:
- the first operating system is booted and executed on the first initial processing resource through the secondary program loader.
- system startup module boots and runs the operating system on the initial processing resources through the secondary program loader is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- system startup module is also used to perform a security startup check on the code of the secondary program loader through a preset program in the startup chip solidified on the device motherboard, wherein the secondary program loader is executed after the check result of the security startup check is normal.
- system startup module performs a security startup check on the code of the secondary program loader.
- system startup module is used to boot and run the second operating system on the second initial processing resource through the boot loader by executing the following steps:
- the second initial processing resource is awakened by the secondary program loader, and the universal boot loader is guided to execute so as to guide and run the second operating system.
- the way in which the system startup module boots the second operating system through the secondary program loader is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- FIG. 10 is a schematic diagram of an optional embedded system according to the embodiment of the present application.
- the above embedded system may include:
- the chip includes a processor 1002, a hardware controller 1004, a first bus 1006 and a second bus 1008, wherein:
- the bandwidth of the first bus 1006 is higher than that of the second bus 1008 , and the first bus 1006 is configured in a multi-master and multi-slave mode, and the second bus 1008 is configured in a one-master and multi-slave mode;
- At least two operating systems are run based on the processor 1002, wherein processing resources of the processor are dynamically allocated to the at least two operating systems, and the processing resources of the processor include a processor core;
- At least two operating systems communicate via the first bus 1006;
- At least two operating systems control the hardware controller via the second bus 1008 .
- the above-mentioned chip can be the above-mentioned BMC chip;
- the above-mentioned processor can be the above-mentioned multi-core processor, and the above-mentioned hardware controller can be used to control external devices connected to the corresponding external interface;
- the above-mentioned first bus is configured as a multi-master and multi-slave mode, which can be a bus used for communication between multiple processor cores of the processor, for example, AHB (Advanced High Performance Bus), and the above-mentioned second bus is configured as a one-master and multiple-slave mode, which can be a bus used by the processor to control the hardware controllers, for example, APB (Advanced Peripheral Bus), and the bandwidth of the first bus is higher than the bandwidth of the second bus.
- APB Advanced Peripheral Bus
- the first bus is configured as a multi-master multi-slave mode, which means that the first bus can be used for data communication between multiple master devices (Master) and multiple slave devices (Slave), that is, the first bus can be connected to multiple master devices and multiple slave devices, and the first bus can be used for data communication between master devices and between master devices and slave devices.
- the data transmission on the entire first bus is sent by the master device, and the slave device is responsible for responding.
- the second bus is configured as a master multi-slave mode, which means that the second bus can be used for data communication between a master device and multiple slave devices, that is, the second bus can be connected to a master device and multiple slave devices, and the master device and the slave device can use the second bus for data communication.
- Data requests can only be sent from the master device to the slave device. After receiving the request, the slave device returns the corresponding response data to the master device. This process can achieve one-to-many access.
- a multi-master and multi-slave mode bus for data communication between operating systems, it is convenient for each operating system to actively initiate data requests based on demand, and the hardware controller mainly controls the corresponding hardware based on the control of the operating system. Therefore, a master-multiple-slave mode bus is used for communication between the operating system and the hardware controller, and data requests are all sent by the operating system to the hardware controller, which can improve the control efficiency of the hardware controller.
- the aforementioned AHB bus has been defined in AMBA (Advanced Microcontroller Bus Architecture) 2.
- the AHB bus is mainly used as a system high-speed bus and is suitable for high-performance, low-power system design. It can be used to connect high-performance modules.
- the high-performance modules can be CPU, DMA (Direct Memory Access) and DSP (Digital Signal Processing), etc.
- AHB is mainly designed for system-level high-bandwidth and high-performance system interconnection.
- the AHB system consists of the following three parts: the master module (i.e., the master device), the slave module (i.e., the slave device) and the infrastructure.
- the transmission on the entire AHB bus is initiated by the master module and responded by the slave module.
- the infrastructure includes an arbiter, a multiplexer from the master module to the slave module, a multiplexer from the slave module to the master module, a decoder, a dummy Slave module and a dummy Master module.
- APB is mainly used for connecting low-bandwidth peripherals, such as UART, 1284, etc. Its bus architecture does not support multiple master modules like AHB. The only master module in APB is the APB bridge. Its features include:
- 3Synchronous bus All transactions (read and write operations) on the bus depend on the rising edge of the clock;
- APB is connected to the AHB bus system, and the transactions are converted between AHB bus systems through the AHB-APB Bridge.
- the Bridge is the master of APB, and other peripheral devices are slaves;
- peripheral devices can be connected, for example, peripheral devices that can be controlled by the aforementioned hardware controller.
- the AHB bus For the APB bus, data requests can only be sent from the Master to the Slave. After receiving the request, the Slave returns the corresponding response data to the Master. This process can achieve one-to-many access, and the access does not involve arbitration and Decoder parsing operations in the AHB bus.
- the AHB bus has high bandwidth characteristics and is used for interconnection between high-performance modules (CPU, DMA, etc.) in the system.
- the APB bus has a lower bandwidth and is used for connection between peripherals (UART, I2C, etc.) in the system.
- the AHB bus logic circuit and bus protocol are complex, while the APB bus interface circuit and bus protocol are relatively simple.
- the embedded system may include at least two operating systems, at least two operating systems run based on a processor, and the processing resources of the processor are dynamically allocated to the at least two operating systems.
- the processing resources of the processor include a processor core.
- the at least two operating systems communicate through a first bus, and at least two operating systems control a hardware controller through a second bus.
- the hardware controller may include one or more controllers corresponding to chip peripherals, including but not limited to at least one of the following: I2C, USB (Universal Serial Bus), UART, ADC (Analog to Digital Converter), JTAG (Joint Test Action Group), RTC (Real_Time Clock), GPIO (General Purpose Input/Output), WDT (Watch
- the external interface may include one or more external interfaces, including but not limited to external interfaces corresponding to any of the above controllers.
- a BMC chip can be shown in FIG11
- the hardware of the BMC chip can include, but is not limited to, a SOC submodule and a BMC out-of-band submodule, wherein the SOC submodule mainly includes an ARM core (ARM Core 1, ARM Core 2, ..., ARM Core X), and it can also include, but is not limited to, Including DDR (Double Data Rate) 4 controller (memory controller), MAC (Media Access Control Address) controller (network controller), SD (Secure Digital) Card/eMMC (Embedded Multi Media Card) controller (storage controller), PCIe RC (Root Complex) controller, SRAM (Static Random-Access Memory) and SPI controller.
- DDR Double Data Rate
- MAC Media Access Control Address
- SD Secure Digital
- Card/eMMC Embedded Multi Media Card
- PCIe RC Root Complex
- SRAM Static Random-Access Memory
- SPI controller Static Random-Access Memory
- the cores and controllers are interconnected through the first bus to achieve interaction between the cores and controllers.
- the ARM cores are connected to the first bus (for example, they can be connected through an AXI (Advanced eXtensible Interface) bridge), and the communication between the cores is achieved through the first bus.
- the SOC submodule also implements the interconnection and intercommunication between the first bus and the second bus (for example, through the conversion of the APB bridge), which provides a physical path for the SOC submodule to access the peripherals on the second bus.
- the DDR4 controller can be connected to other components or devices through the DDR4PHY (Physical Layer) interface, the MAC controller is connected to other components or devices through the RGMII (Reduced Gigabit Media Independent Interface), the SD card/eMMC controller is connected to other components or devices through the SD interface, and the PCIe RC controller is connected to other components or devices through the PCIe PHY interface.
- DDR4PHY Physical Layer
- RGMII Reduced Gigabit Media Independent Interface
- the SD card/eMMC controller is connected to other components or devices through the SD interface
- the PCIe RC controller is connected to other components or devices through the PCIe PHY interface.
- the BMC out-of-band submodule mainly includes controllers corresponding to chip peripherals such as PWM, GPIO, FanTech (fan speed control), mailbox, etc., through which PECI communication with BMC (such as using GPIO to simulate PECI), fan control and other out-of-band management functions can be realized.
- the BMC out-of-band submodule can, but is not limited to, interact with the SOC submodule through the second bus.
- the BMC chip realizes the interconnection between the ARM core, storage unit and controller hardware resources on the chip through the first and second buses.
- the dynamic balanced scheduling of processor resources mainly involves the scheduling of the ARM core resources of the BMC chip, and inter-core communication refers to the communication between ARM cores.
- the Linux system first sends an inter-core interrupt (interrupt number 9) to core 1 through the first on-chip bus on a core from cores 2 to N. If the RTOS system is in an idle state and allows preemption at this time, core 1 replies to the inter-core interrupt (interrupt number 10) through the first bus and releases the peripheral controller resources (such as PWM/PECI) currently mapped by core 1.
- the Linux system receives the inter-core interrupt 10, initiates the preemption process, adds core 1 to the Linux SMP scheduling, and obtains control of the PWM/PECI peripherals, which can be controlled through the second bus.
- At least two operating systems include a first operating system and a second operating system, wherein the chip loads a communication value into a first bus, and the first bus sends a communication signal carrying the communication value to a communication register corresponding to the second operating system to achieve communication between the first operating system and the second operating system, wherein the communication value is used to indicate the communication content between the first operating system and the second operating system.
- the chip loads the control value to the second bus, and the second bus sends the control signal carrying the control value to the register corresponding to the hardware controller to realize the operating system's control over the hardware controller, wherein the control value is used to indicate the operating system's control content over the hardware controller.
- the operating system controls the hardware controller by accessing (such as performing read and write operations) the registers of each hardware controller.
- the operating system accesses the registers of the hardware controller by, but not limited to, reading or writing the register addresses of each hardware controller, and the addresses of these registers may be, but not limited to, unique and determined during chip design.
- the operating system can implement a specific function (such as the communication function between the above-mentioned operating systems or the control function of the operating system on the hardware controller) by writing a specific value (i.e., the above-mentioned communication register or the register corresponding to the hardware controller) to a specific address (i.e., the above-mentioned communication register or the register corresponding to the hardware controller).
- control value of 00 means that the air conditioner accelerates by one gear
- control value of 01 means that the air conditioner decelerates by one gear
- the various operating systems and the operating systems and hardware controllers can communicate, control, etc. through the bus, but are not limited to interactions.
- the read and write operations of the operating system on the registers of the hardware controllers will eventually be converted into control signals of the first bus (or the second bus) on the hardware controllers.
- This part of the conversion work and the control process of the first bus (or the second bus) on the hardware controllers can be, but are not limited to, automatically implemented by the internal hardware of the chip.
- the implementation process follows the bus specification. Among them, during the operation of the first bus (or the second bus), on the one hand, physical signals related to the control and bus protocol can be transmitted, and on the other hand, valid data can be transmitted to each hardware controller through its physical data channel.
- the embedded system includes: a chip and at least two operating systems, wherein the chip includes a processor, a hardware controller, a first bus and a second bus, wherein the bandwidth of the first bus is higher than the bandwidth of the second bus, and the first bus is configured as a multi-master multi-slave mode, and the second bus is configured as a one-master multi-slave mode; at least two operating systems run based on the processor, wherein the processing resources of the processor are dynamically allocated to At least two operating systems are provided, and the processing resources of the processor include the processor core; at least two operating systems communicate through a first bus; at least two operating systems control the hardware controller through a second bus, thereby solving the problem of low overall utilization of core resources due to the fact that most of the processing resources of the multi-core processor are in an idle state in the related art, and improving the utilization of processing resources.
- the at least two operating systems include a first operating system running on at least one processor core of a processor and a second operating system running on at least one processor core, and the response speed of the first operating system is higher than that of the second operating system; wherein the second operating system includes:
- a service management module configured to allocate a group of services to be allocated to corresponding operating systems according to a resource dynamic allocation rule, wherein the resource dynamic allocation rule includes dynamically allocating resources according to at least one of the following: service response speed, service resource occupancy rate;
- a resource dynamic allocation module used to determine a resource allocation result corresponding to a group of services to be allocated, wherein the resource allocation result is used to indicate a processing resource in the processing resources of the processor corresponding to each service to be allocated in the group of services to be allocated;
- the resource adaptive scheduling module is used to allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each service to be allocated and the resource allocation result.
- At least two operating systems include a first operating system and a second operating system, and each operating system runs on at least one processor core.
- the first operating system and the second operating system may be similar to those in the above embodiment, and will not be described in detail in this embodiment.
- the second operating system further includes:
- the load balancing strategy module is used to generate a rule structure by reading a rule configuration file, wherein the rule structure is used to record dynamic resource allocation rules.
- the load balancing strategy module generates a rule structure in a manner similar to that in the aforementioned embodiment, which will not be described in detail here.
- the load balancing policy module is also used to obtain a rule update configuration file through the external interface of the second operating system, wherein the rule update configuration file is used to update the configured resource dynamic allocation rules; and use the rule update configuration file to update the rule structure to update the resource dynamic allocation rules recorded in the rule structure.
- the resource dynamic allocation rules stored in the load balancing policy module can be flexibly configured through the external interface of the second operating system.
- the configuration method is similar to that in the above-mentioned embodiment and will not be described in detail here.
- the service management module is used to allocate a group of services to be allocated to the corresponding operating system according to the allocation rule corresponding to the service response speed in the dynamic resource allocation rule by executing the following steps:
- a group of services to be allocated whose service response speed requirements are greater than or equal to a set response speed threshold are allocated to the first operating system, and a group of services to be allocated whose service response speed requirements are less than the set response speed threshold are allocated to the second operating system.
- the manner in which the service management module allocates the services to be allocated according to the service response speed is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the service management module is used to allocate a group of services to be allocated to the corresponding operating system according to the allocation rule corresponding to the service resource occupancy rate in the dynamic resource allocation rule by executing the following steps:
- a group of services to be allocated whose service resource occupancy rate is less than a first occupancy rate threshold is allocated to the first operating system, and a group of services to be allocated whose service resource occupancy rate is greater than or equal to the first occupancy rate threshold is allocated to the second operating system.
- the manner in which the service management module allocates the services to be allocated according to the service resource occupancy rate is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the service management module is further configured to allocate a group of services to be allocated to the corresponding operating system by performing at least one of the following steps:
- the services to be allocated which have a service coupling degree with the allocated services of the second operating system greater than or equal to a second coupling degree threshold, in a group of services to be allocated, are allocated to the second operating system.
- the manner in which the service management module allocates the services to be allocated according to the service coupling degree is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the service management module is further configured to allocate a group of services to be allocated to the corresponding operating system by executing the following steps:
- the manner in which the service management module allocates the to-be-allocated service containing sensitive information to the first operating system is similar to that in the aforementioned embodiment, and is not described in detail here.
- the resource dynamic allocation module is used to determine the resource allocation result corresponding to a group of services to be allocated by executing the following steps:
- a resource mapping table of a group of services to be allocated and the processing resources of the processor is generated in combination with the resource utilization of the processing resources of the first operating system and the resource utilization of the processing resources of the second operating system.
- the way in which the resource dynamic allocation module generates a resource mapping table of a group of services to be allocated and processing resources of the processor is similar to that in the above-mentioned embodiment, and is not described in detail here.
- the resource dynamic allocation module allocates the processing resources of the processor to the first operating system and the second operating system in units of processor cores.
- the resource adaptive scheduling module is used to allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each service to be allocated and the resource allocation result by executing the following steps:
- the unallocated processing resources are allocated to the operating system to which the to-be-allocated business corresponding to the unallocated processing resources is allocated.
- the resource adaptive scheduling module allocates the unallocated processing resources to the operating system in a manner similar to that in the aforementioned embodiment, which will not be described in detail here.
- the embedded system further comprises:
- the resource preemption and release module is used to preempt and release processing resources between the first operating system and the second operating system.
- the resource preemption and release module performs preemption and release of processing resources between different operating systems in a similar manner as in the above-mentioned embodiment, and will not be described in detail here.
- the resource preemption and release module preempts and releases processing resources between the first operating system and the second operating system through a first bus, where the first bus is a bus for communication between different processor cores of a processor.
- the resource preemption and release module is used to implement the preemption and release of processing resources between the first operating system and the second operating system through the first bus by executing the following steps:
- a first interaction response returned by the second operating system in response to the first interaction request is obtained through the first bus, wherein the first interaction response is used to instruct the first operating system to perform resource interaction with the second operating system according to the first interaction response.
- the resource preemption and release module performs resource interaction between the first operating system and the second operating system through the inter-core communication interface in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the first operating system includes:
- the first system control module is used to detect the resource utilization of the processing resources of the first operating system, and when it is determined based on the resource utilization of the processing resources of the first operating system that the first operating system is to interact with the second operating system for resources, the resource preemption and release module is triggered to transmit the first interaction request to the second operating system through the first bus.
- the first system control module triggers the resource interaction mode based on the resource utilization rate of the processing resources of the first operating system.
- the first system control module is also used to perform at least one of the following steps: when the resource utilization of the processing resources of the first operating system is greater than or equal to the first utilization threshold, determine that the first operating system is to preempt the processing resources of the second operating system; when the processing resources of the first operating system are in an idle state and there is no business to be executed by the first operating system, determine that the first operating system is to release the processing resources to the second operating system.
- the manner in which the first system control module determines the type of resource interaction to be performed by the first operating system is similar to that in the aforementioned embodiment, and is not described in detail herein.
- the first system control module is further configured to control the first operating system to enter a dormant state when there is no service scheduled by the first operating system and no service to be allocated to the first operating system.
- the manner in which the first system control module controls the first operating system to enter the sleep state is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the resource preemption and release module is used to transmit the first interaction request of the first operating system to the second operating system through the first bus by performing at least one of the following steps:
- a resource release request with the second interrupt number is transmitted to the second operating system through the first bus, wherein the resource release request is used to request to release the processing resources occupied by the first operating system to the second operating system.
- the resource preemption and release module performs resource interaction through inter-core interrupts in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the resource preemption and release module is used to implement the preemption and release of processing resources between the first operating system and the second operating system through the first bus by executing the following steps:
- a second interactive response returned by the first operating system in response to the second interactive request is obtained through the first bus, wherein the second interactive response is used to indicate whether the first operating system allows the second operating system to preempt processing resources of the first operating system.
- the resource preemption and release module performs resource interaction between the first operating system and the second operating system through the inter-core communication interface in a manner similar to that in the aforementioned embodiment, and will not be described in detail here.
- the second operating system includes:
- the second system control module is used to detect the resource utilization of the processing resources of the second operating system, and when it is determined that the second operating system is to preempt the processing resources of the first operating system based on the resource utilization of the processing resources of the second operating system, the resource preemption and release module is triggered to transmit the second interaction request to the first operating system through the first bus.
- the manner in which the second system control module triggers resource interaction based on the resource utilization of the processing resources of the second operating system is similar to that in the above-mentioned embodiment, and is not described in detail here.
- the second system control module is further configured to perform at least one of the following steps:
- the manner in which the second system control module determines the resource interaction to be performed by the second operating system is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the first operating system is further configured to ensure that the service priority of the service in the execution of the first operating system is not lower than that of the second operating system. In the case of the business priority of the system's pending business, it is determined that the first operating system refuses the second operating system to preempt the processing resources of the first operating system; in the case where the business priority of the business being executed by the first operating system is lower than the business priority of the pending business of the second operating system, it is determined that the first operating system allows the second operating system to preempt the processing resources of the first operating system.
- the manner in which the first operating system determines whether to allow the second operating system to occupy the processing resources is similar to that in the above-mentioned embodiment, and is not described in detail here.
- the resource preemption and release module is used to transmit the second interaction request of the second operating system to the first operating system through the first bus by executing the following steps:
- a second preemption request whose interrupt number is the third interrupt number is transmitted to the first operating system through the first bus, wherein the second preemption request is used to request to preempt the processing resources of the first operating system.
- the resource grabbing and releasing module performs resource interaction through the first bus in a manner similar to that in the above-mentioned embodiment, which will not be described in detail here.
- the resource preemption and release module is used to obtain the second interactive response returned by the first operating system in response to the second interactive request through the first bus by performing at least one of the following steps:
- a resource release rejection response with the interrupt number being the fifth interrupt number is transmitted to the second operating system via the first bus, wherein the resource release rejection response is used to instruct the first operating system to reject the second operating system from preempting the processing resources of the first operating system.
- the resource grabbing and releasing module performs resource interaction through the first bus in a manner similar to that in the above-mentioned embodiment, which will not be described in detail here.
- the resource adaptive scheduling module is also used to perform at least one of the following steps: merging the processing resources of the second operating system preempted by the first operating system into the available resource pool of the first operating system; merging the processing resources of the first operating system preempted by the second operating system or the processing resources actively released by the first operating system to the second operating system into the available resource pool of the second operating system.
- the resource adaptive scheduling module processes resource scheduling between different operating systems in a manner similar to that in the aforementioned embodiment, which will not be described in detail here.
- a processor is used to boot and run a first operating system on a first initial processing resource through a boot loader after the chip is powered on, and to boot and run a second operating system on a second initial processing resource through a boot loader, wherein the first initial processing resource is an initial processing resource among the processing resources of the processor corresponding to the first operating system, and the second initial processing resource is an initial processing resource among the processing resources of the processor corresponding to the second operating system.
- the way in which the processor boots and runs each operating system on the corresponding initial processing resource through the boot loader is similar to that in the above-mentioned embodiment, and will not be described in detail here.
- the first initial processing resource is a designated processor core among processor cores of the processor
- the second initial processing resource is other processor cores among processor cores of the processor except the designated processor core.
- the processor is configured to implement booting and running a first operating system on a first initial processing resource through a boot loader by executing the following steps:
- the first operating system is booted and executed on the first initial processing resource through the secondary program loader.
- the way in which the processor boots and runs the operating system on the initial processing resources through the secondary program loader is similar to that in the aforementioned embodiment, and is not described in detail here.
- the processor is also used to perform a security boot check on the code of the secondary program loader through a preset program in a boot chip embedded in a mainboard of the device, wherein the secondary program loader is executed after the security boot check result is normal.
- the way in which the processor performs a security boot check on the code of the secondary program loader is similar to that in the aforementioned embodiment and will not be described in detail here.
- the processor is configured to implement booting and running the second operating system on the second initial processing resource through the boot loader by executing the following steps:
- the second initial processing resource is awakened by the secondary program loader, and the universal boot loader is guided to execute so as to guide and run the second operating system.
- the way in which the processor boots and runs the second operating system through the secondary program loader is similar to that in the aforementioned embodiment, and is not described in detail here.
- FIG12 is a structural block diagram of an optional operating device of an embedded system according to an embodiment of the present application. As shown in FIG12, the above-mentioned device may include:
- the first allocation unit 1202 is used to allocate a group of to-be-allocated services to corresponding operating systems in the embedded system according to a dynamic resource allocation rule, wherein the dynamic resource allocation rule includes dynamically allocating resources according to at least one of the following: service response speed, service resource occupancy rate, service coupling degree, and service importance, and the embedded system includes a first operating system and a second operating system, the first operating system and the second operating system run on a processor, and the response speed of the first operating system is higher than that of the second operating system;
- a first determining unit 1204 connected to the first allocating unit 1202, is used to determine a resource allocation result corresponding to a group of services to be allocated, wherein the resource allocation result is used to indicate a processing resource corresponding to each service to be allocated in the group of services to be allocated in the processing resources of the processor, and the processing resources of the processor include a processor core;
- the second allocation unit 1206 is connected to the first determination unit 1204, and is used to allocate the processing resources of the processor to the first operating system and the second operating system according to the operating system corresponding to each service to be allocated and the resource allocation result.
- first allocation unit 1202 in this embodiment can be used to execute the above step S202
- first determination unit 1204 in this embodiment can be used to execute the above step S204
- second allocation unit 1206 in this embodiment can be used to execute the above step S206.
- a group of to-be-allocated services are allocated to the corresponding operating systems in the embedded system according to the dynamic resource allocation rule, wherein the dynamic resource allocation rule includes dynamically allocating resources according to at least one of the following: service response speed, service resource occupancy rate, service coupling degree, service importance, and the embedded system includes a first operating system and a second operating system, the first operating system and the second operating system are running on a processor, and the response speed of the first operating system is higher than that of the second operating system; determining the resource allocation result corresponding to the group of to-be-allocated services, wherein the resource allocation result is used to indicate the processing resources corresponding to each to-be-allocated service in the group of to-be-allocated services in the processing resources of the processor, and the processing resources of the processor include a processor core; according to the operating system corresponding to each to-be-allocated service and the resource allocation result, the processing resources of the processor are allocated to the first operating system and the second operating system,
- the above device further comprises:
- the generating unit is used to generate a rule structure by reading a rule configuration file, wherein the rule structure is used to record a resource dynamic allocation rule.
- the above device further comprises:
- An acquisition unit configured to acquire a rule update configuration file through an external interface of the second operating system, wherein the rule update configuration file is used to update a configured resource dynamic allocation rule;
- the updating unit is used to update the rule structure using the rule update configuration file, so as to update the resource dynamic allocation rule recorded in the rule structure.
- the first allocation unit includes at least one of the following:
- the first allocation module is used to allocate the to-be-allocated businesses whose business response speed requirements are greater than or equal to the set response speed threshold in a group of to-be-allocated businesses to the first operating system, and to allocate the to-be-allocated businesses whose business response speed requirements are less than the set response speed threshold in a group of to-be-allocated businesses to the second operating system.
- the second allocation module is used to allocate the to-be-allocated services whose service resource occupancy rate is less than the first occupancy rate threshold in the group of to-be-allocated services to the first operating system, and to allocate the to-be-allocated services whose service resource occupancy rate is greater than or equal to the first occupancy rate threshold in the group of to-be-allocated services to the second operating system. system;
- the third allocation module is used to allocate the to-be-allocated services containing sensitive information in a group of to-be-allocated services to a target operating system, wherein the target operating system is an operating system of the first operating system and the second operating system that interacts less frequently with the user object.
- the first allocation unit includes at least one of the following:
- a fourth allocation module configured to allocate services to be allocated, whose service coupling degree with services allocated to the first operating system is greater than or equal to a first coupling degree threshold, from a group of services to be allocated, to the first operating system;
- the fifth allocation module is used to allocate to the second operating system services to be allocated, the services to be allocated having a service coupling degree greater than or equal to a second coupling degree threshold value among a group of services to be allocated.
- the first determining unit includes:
- the generation module is used to generate a resource mapping table of a group of services to be allocated and the processing resources of the processor according to the allocation results of a group of services to be allocated, combined with the resource utilization of the processing resources of the first operating system and the resource utilization of the processing resources of the second operating system.
- processing resources of a processor are allocated to the first operating system and the second operating system in units of processor cores.
- the second allocation unit comprises:
- the sixth allocation module is used to allocate the unallocated processing resources to the operating system to which the to-be-allocated business corresponding to the unallocated processing resources is allocated when it is determined according to the resource allocation result that there are corresponding to-be-allocated businesses in the unallocated processing resources of the processor.
- the above device further comprises:
- the first execution unit is used to preempt and release processing resources between the first operating system and the second operating system.
- the first execution unit includes:
- the execution module is used to preempt and release processing resources between the first operating system and the second operating system through the inter-core communication interface.
- the execution module includes:
- a first transmission submodule is used to transmit a first interaction request of the first operating system to the second operating system through the inter-core communication interface, wherein the first interaction request is used to request resource interaction with the second operating system, and the resource interaction includes one of the following: resource preemption and resource release;
- the first acquisition submodule is used to acquire, through the inter-core communication interface, a first interaction response returned by the second operating system in response to the first interaction request, wherein the first interaction response is used to instruct the first operating system to perform resource interaction with the second operating system according to the first interaction response.
- the above device further comprises:
- a first detection unit configured to detect resource utilization of processing resources of the first operating system
- the second determining unit is used to trigger the transmission of the first interaction request to the second operating system through the inter-core communication interface when it is determined that the first operating system is to interact with the second operating system for resources according to the resource utilization of the processing resources of the first operating system.
- the device further comprises at least one of the following:
- a third determining unit configured to determine, when a resource utilization rate of the processing resources of the first operating system is greater than or equal to a first utilization rate threshold, that the first operating system is to preempt the processing resources of the second operating system;
- the fourth determining unit is configured to determine that the processing resources of the first operating system are to be released to the second operating system when the processing resources of the first operating system are in an idle state and there is no business to be executed by the first operating system.
- the above device further comprises:
- the control unit is used to control the first operating system to enter a dormant state when there is no service scheduling for the first operating system and no service to be allocated to the first operating system.
- the first transmission submodule includes:
- a first transmission subunit is used to transmit a first preemption request whose interrupt number is the first interrupt number to the second operating system through the inter-core communication interface, wherein the first preemption request is used to request to preempt the processing resources of the second operating system;
- the second transmission subunit is used to transmit a resource release request with the second interrupt number to the second operating system through the inter-core communication interface, wherein the resource release request is used to request to release the processing resources occupied by the first operating system to the second operating system.
- the execution module includes:
- a second transmission submodule used to transmit a second interaction request of the second operating system to the first operating system through the inter-core communication interface, wherein the second interaction request is used to request to seize processing resources of the first operating system;
- the second acquisition submodule is used to acquire, through the inter-core communication interface, a second interaction response returned by the first operating system in response to the second interaction request, wherein the second interaction response is used to indicate whether the first operating system allows the second operating system to preempt processing resources of the first operating system.
- the above device further comprises:
- a second detection unit used to detect resource utilization of processing resources of the second operating system
- the fifth determining unit is used to trigger the transmission of the second interaction request to the first operating system through the inter-core communication interface when it is determined that the second operating system is to preempt the processing resources of the first operating system according to the resource utilization rate of the processing resources of the second operating system.
- the device further comprises at least one of the following:
- a sixth determining unit configured to determine, when a current resource utilization rate of the processing resources of the second operating system is greater than or equal to a second utilization rate threshold, that the second operating system is to preempt the processing resources of the second operating system;
- the seventh determination unit is used to determine the processing resources of the second operating system to be preempted by the second operating system when it is determined that the resource utilization of the processing resources of the second operating system is greater than or equal to a third utilization threshold based on the executing business of the second operating system and the pending business of the second operating system.
- the above device further comprises:
- an eighth determining unit configured to determine that the first operating system refuses the second operating system to preempt processing resources of the first operating system if the service priority of the service being executed by the first operating system is not lower than the service priority of the service to be executed by the second operating system;
- the ninth determining unit is configured to determine that the first operating system allows the second operating system to preempt processing resources of the first operating system when the service priority of the service being executed by the first operating system is lower than the service priority of the service to be executed by the second operating system.
- the second transmission submodule includes:
- the third transmission subunit is used to transmit a second preemption request with an interrupt number of the third interrupt number to the first operating system through the inter-core communication interface, wherein the second preemption request is used to request to preempt the processing resources of the first operating system.
- the second acquisition submodule includes:
- a fourth transmission subunit configured to transmit a resource release permission response whose interrupt number is a fourth interrupt number to the second operating system through an inter-core communication interface, wherein the resource release permission response is used to instruct the first operating system to allow the second operating system to preempt processing resources of the first operating system;
- the fifth transmission subunit is used to transmit a resource release rejection response with the fifth interrupt number to the second operating system through the inter-core communication interface, wherein the resource release rejection response is used to instruct the first operating system to reject the second operating system from preempting the processing resources of the first operating system.
- the device further comprises at least one of the following:
- a second execution unit configured to merge the processing resources of the second operating system preempted by the first operating system into an available resource pool of the first operating system
- the third execution unit is used to merge the processing resources of the first operating system preempted by the second operating system or the processing resources actively released by the first operating system to the second operating system into the available resource pool of the second operating system.
- the above device further comprises:
- a boot unit is used to boot and run a first operating system on a first initial processing resource through a boot loader after the chip where the processor is located is powered on, and to boot and run a second operating system on a second initial processing resource through a boot loader, wherein the first initial processing resource is an initial processing resource in the processing resources of the processor corresponding to the first operating system, and the second initial processing resource is an initial processing resource in the processing resources of the processor corresponding to the second operating system.
- the first initial processing resource is a designated processor core among processor cores of the processor
- the second initial processing resource is other processor cores among processor cores of the processor except the designated processor core.
- the guiding unit comprises:
- the boot module is used to boot and run the first operating system on the first initial processing resource through the secondary program loader.
- the above device further comprises:
- the checking unit is used to perform a security boot check on the code of the secondary program loader through a preset program in the boot chip solidified on the mainboard of the device, wherein the secondary program loader is executed after the check result of the security boot check is normal.
- the guiding unit further comprises:
- the execution module is used to wake up the second initial processing resource through the secondary program loader and guide the execution of the universal boot loader to guide the running of the second operating system.
- the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
- An embodiment of the present application further provides a chip, wherein the chip includes at least one of a programmable logic circuit and an executable instruction, and the chip runs in an electronic device to implement the steps in any of the above method embodiments.
- the embodiment of the present application further provides a BMC chip, wherein the BMC chip may include: a storage unit and a processing unit connected to the storage unit.
- the storage unit is used to store a program
- the processing unit is used to run the program to execute the steps in any of the above method embodiments.
- An embodiment of the present application also provides a mainboard, wherein the mainboard includes: at least one processor; at least one memory for storing at least one program; when the at least one program is executed by the at least one processor, the at least one processor implements the steps in any one of the above method embodiments.
- An embodiment of the present application also provides a server, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus, and the memory is used to store computer programs; the processor is used to implement the steps in any of the above method embodiments when executing the program stored in the memory to achieve the same technical effect.
- the communication bus of the above-mentioned server may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc.
- the communication bus may be divided into an address bus, a data bus, a control bus, etc.
- the communication interface is used for communication between the above-mentioned server and other devices.
- the memory may include RAM, or may include NVM (Non-Volatile Memory), such as at least one disk storage.
- the memory may also be at least one storage device located away from the aforementioned processor.
- the aforementioned processor may be a general-purpose processor, including a CPU, NP (Network Processor), etc.; it may also be a DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component.
- An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
- the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.
- An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
- the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
- modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation.
- the present application is not limited to any specific combination of hardware and software.
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)
- Multi Processors (AREA)
- Computer Hardware Design (AREA)
- Hardware Redundancy (AREA)
Abstract
Description
Claims (77)
- 一种嵌入式系统,其特征在于,包括:第一操作系统和第二操作系统,所述第一操作系统和所述第二操作系统运行于处理器上,所述第一操作系统的响应速度高于所述第二操作系统;业务管理模块,用于根据资源动态分配规则将一组待分配业务分配给对应的操作系统,其中,所述资源动态分配规则包括根据以下至少之一进行资源动态分配:业务响应速度,业务资源占用率;资源动态分配模块,用于确定与所述一组待分配业务对应的资源分配结果,其中,所述资源分配结果用于指示所述处理器的处理资源中与所述一组待分配业务中的每个待分配业务对应的处理资源,所述处理器的处理资源包括处理器核心;资源自适应调度模块,用于根据与所述每个待分配业务对应的操作系统以及所述资源分配结果,将所述处理器的处理资源分配给所述第一操作系统和所述第二操作系统。
- 根据权利要求1所述的嵌入式系统,其特征在于,所述嵌入式系统还包括:负载均衡策略模块,用于通过读取规则配置文件,生成规则结构体,其中,所述规则结构体用于记录所述资源动态分配规则。
- 根据权利要求2所述的嵌入式系统,其特征在于,所述负载均衡策略模块,还用于通过所述第二操作系统的对外接口获取规则更新配置文件,其中,所述规则更新配置文件用于更新已配置的所述资源动态分配规则;使用所述规则更新配置文件更新所述规则结构体,以更新所述规则结构体所记录的所述资源动态分配规则。
- 根据权利要求1所述的嵌入式系统,其特征在于,所述业务管理模块用于通过执行以下至少之一的步骤实现根据所述资源动态分配规则中与业务响应速度对应的分配规则将所述一组待分配业务分配给对应的操作系统:将所述一组待分配业务中业务响应速度要求大于或者等于设定响应速度阈值的待分配业务分配给所述第一操作系统,以及,将所述一组待分配业务中业务响应速度要求小于设定响应速度阈值的待分配业务分配给所述第二操作系统;将所述一组待分配业务中业务资源占用率小于第一占用率阈值的待分配业务分配给所述第一操作系统,以及,将所述一组待分配业务资源占用率大于或者等于第一占用率阈值的待分配业务分配给所述第二操作系统;将所述一组待分配业务中包含敏感信息的待分配业务,分配给目标操作系统,其中,所述目标操作系统是所述第一操作系统和所述第二操作系统中,与使用对象交互频率低的操作系统。
- 根据权利要求1所述的嵌入式系统,其特征在于,所述业务管理模块还用于通过执行以下至少之一的步骤实现将所述一组待分配业务分配给对应的操作系统:将所述一组待分配业务中与所述第一操作系统的已分配业务的业务耦合度大于或者等于第一耦合度阈值的待分配业务,分配给所述第一操作系统;将所述一组待分配业务中与所述第二操作系统的已分配业务的业务耦合度大于或者等于第二耦合度阈值的待分配业务,分配给所述第二操作系统。
- 根据权利要求1所述的嵌入式系统,其特征在于,所述资源动态分配模块用于通过执行以下步骤实现确定与所述一组待分配业务对应的资源分配结果:根据所述业务管理模块的分配结果,结合所述第一操作系统的处理资源的资源利用情况和所述第二操作系统的处理资源的资源利用情况,生成所述一组待分配业务与所述处理器的处理资源的资源映射表。
- 根据权利要求1所述的嵌入式系统,其特征在于,所述资源动态分配模块以处理器核心为单位将所述处理器的处理资源分配给所述第一操作系统和所述第二操作系统。
- 根据权利要求1所述的嵌入式系统,其特征在于,所述资源自适应调度模块用于通过执行以下步骤 实现根据与所述每个待分配业务对应的操作系统以及所述资源分配结果,将所述处理器的处理资源分配给所述第一操作系统和所述第二操作系统:在根据所述资源分配结果确定所述处理器的处理资源中的未分配处理资源存在对应的待分配业务的情况下,将所述未分配处理资源分配给与所述未分配处理资源对应的待分配业务所分配给的操作系统。
- 根据权利要求1所述的嵌入式系统,其特征在于,所述嵌入式系统还包括:资源抢占与释放模块,用于在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放。
- 根据权利要求9所述的嵌入式系统,其特征在于,所述资源抢占与释放模块通过核间通信接口在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放。
- 根据权利要求10所述的嵌入式系统,其特征在于,所述资源抢占与释放模块用于通过执行以下步骤实现通过核间通信接口在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放:通过核间通信接口将所述第一操作系统的第一交互请求传输至所述第二操作系统,其中,所述第一交互请求用于请求与所述第二操作系统进行资源交互,所述资源交互包括以下之一:资源抢占,资源释放;通过所述核间通信接口获取所述第二操作系统响应所述第一交互请求返回的第一交互响应,其中,所述第一交互响应用于指示所述第一操作系统根据所述第一交互响应与所述第二操作系统进行所述资源交互。
- 根据权利要求11所述的嵌入式系统,其特征在于,所述嵌入式系统还包括:第一系统控制模块,用于检测所述第一操作系统的处理资源的资源利用率,在根据所述第一操作系统的处理资源的资源利用率,确定所述第一操作系统待与所述第二操作系统进行所述资源交互的情况下,触发所述资源抢占与释放模块通过所述核间通信接口将所述第一交互请求传输至所述第二操作系统。
- 根据权利要求12所述的嵌入式系统,其特征在于,所述第一系统控制模块,还用于执行以下至少之一的步骤:在所述第一操作系统的处理资源的资源利用率大于或者等于第一利用率阈值的情况下,确定所述第一操作系统待抢占所述第二操作系统的处理资源;在所述第一操作系统的处理资源处于空闲状态且不存在待所述第一操作系统执行的业务的情况下,确定所述第一操作系统待释放处理资源给所述第二操作系统。
- 根据权利要求12所述的嵌入式系统,其特征在于,所述第一系统控制模块,还用于在所述第一操作系统没有业务调度、且没有待分配给所述第一操作系统的业务的情况下,控制所述第一操作系统进入休眠状态。
- 根据权利要求11所述的嵌入式系统,其特征在于,所述资源抢占与释放模块用于通过执行以下至少之一的步骤实现通过核间通信接口将所述第一操作系统的第一交互请求传输至所述第二操作系统:通过核间通信接口将中断号为第一中断号的第一抢占请求传输至所述第二操作系统,其中,所述第一抢占请求用于请求抢占所述第二操作系统的处理资源;通过核间通信接口将中断号为第二中断号的资源释放请求传输至所述第二操作系统,其中,所述资源释放请求用于请求将所述第一操作系统所占用的处理资源释放给所述第二操作系统。
- 根据权利要求10所述的嵌入式系统,其特征在于,所述资源抢占与释放模块用于通过执行以下步骤实现通过核间通信接口在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放:通过核间通信接口将所述第二操作系统的第二交互请求传输至所述第一操作系统,其中,所述第二交互请求用于请求抢占所述第一操作系统的处理资源;通过所述核间通信接口获取所述第一操作系统响应所述第二交互请求返回的第二交互响应,其中,所述第二交互响应用于指示所述第一操作系统是否允许所述第二操作系统抢占所述第一操作系统的处理资源。
- 根据权利要求16所述的嵌入式系统,其特征在于,所述嵌入式系统还包括:第二系统控制模块,用于检测所述第二操作系统的处理资源的资源利用率,在根据所述第二操作系统的处理资源的资源利用率,确定所述第二操作系统待抢占所述第一操作系统的处理资源的情况下,触发所述资源抢占与释放模块通过所述核间通信接口将所述第二交互请求传输至所述第一操作系统。
- 根据权利要求17所述的嵌入式系统,其特征在于,所述第二系统控制模块,还用于执行以下至少之一的步骤:在所述第二操作系统的处理资源当前的资源利用率大于或者等于第二利用率阈值的情况下,确定所述第二操作系统待抢占所述第二操作系统的处理资源;在根据所述第二操作系统的执行中业务和所述第二操作系统的待执行业务确定所述第二操作系统的处理资源的资源利用率大于或者等于第三利用率阈值的情况下,确定所述第二操作系统待抢占所述第二操作系统的处理资源。
- 根据权利要求18所述的嵌入式系统,其特征在于,所述嵌入式系统还用于在所述第一操作系统的执行中业务的业务优先级不低于所述第二操作系统的待执行业务的业务优先级的情况下,确定所述第一操作系统拒绝所述第二操作系统抢占所述第一操作系统的处理资源;在所述第一操作系统的执行中业务的业务优先级低于所述第二操作系统的待执行业务的业务优先级的情况下,确定所述第一操作系统允许所述第二操作系统抢占所述第一操作系统的处理资源。
- 根据权利要求16所述的嵌入式系统,其特征在于,所述资源抢占与释放模块用于通过执行以下步骤实现通过核间通信接口将所述第二操作系统的第二交互请求传输至所述第一操作系统:通过核间通信接口将中断号为第三中断号的第二抢占请求传输至所述第一操作系统,其中,所述第二抢占请求用于请求抢占所述第一操作系统的处理资源。
- 根据权利要求16所述的嵌入式系统,其特征在于,所述资源抢占与释放模块用于通过执行以下至少之一的步骤实现通过所述核间通信接口获取所述第一操作系统响应所述第二交互请求返回的第二交互响应:通过核间通信接口将中断号为第四中断号的允许资源释放响应传输至所述第二操作系统,其中,所述允许资源释放响应用于指示所述第一操作系统允许所述第二操作系统抢占所述第一操作系统的处理资源;通过核间通信接口将中断号为第五中断号的拒绝资源释放响应传输至所述第二操作系统,其中,所述拒绝资源释放响应用于指示所述第一操作系统拒绝所述第二操作系统抢占所述第一操作系统的处理资源。
- 根据权利要求9所述的嵌入式系统,其特征在于,资源自适应调度模块,还用于执行以下至少之一的步骤:将所述第一操作系统抢占的所述第二操作系统的处理资源合并到所述第一操作系统的可用资源池中;将所述第二操作系统抢占的所述第一操作系统的处理资源或者所述第一操作系统主动释放给所述第二操作系统的处理资源合并到所述第二操作系统的可用资源池中。
- 根据权利要求1至22中任一项所述的嵌入式系统,其特征在于,所述嵌入式系统还包括:系统启动模块,用于在所述处理器所在的芯片上电之后,通过引导加载程序在第一初始处理资源上引导运行所述第一操作系统,以及通过所述引导加载程序在第二初始处理资源上引导运行所述第二操作系统,其中,所述第一初始处理资源是所述处理器的处理资源中与所述第一操作系统对应的初始处理资源,所述第二初始处理资源是所述处理器的处理资源中与所述第二操作系统对应的初始处理资源。
- 根据权利要求23所述的嵌入式系统,其特征在于,所述第一初始处理资源为所述处理器的处理器核心中的一个指定处理器核心,所述第二初始处理资源为所述处理器的处理器核心中除了所述指定处理器核心以外的其他处理器核心。
- 根据权利要求23所述的嵌入式系统,其特征在于,所述系统启动模块用于通过执行以下步骤实现通过引导加载程序在第一初始处理资源上引导运行所述第一操作系统:通过二级程序加载器在第一初始处理资源上引导运行所述第一操作系统。
- 根据权利要求25所述的嵌入式系统,其特征在于,所述系统启动模块,还用于通过固化在设备主 板上的启动芯片内的预设程序对所述二级程序加载器的代码进行安全启动检查,其中,所述二级程序加载器是在安全启动检查的检查结果正常之后执行的。
- 根据权利要求25所述的嵌入式系统,其特征在于,所述系统启动模块用于通过执行以下步骤实现通过引导加载程序在所述第二初始处理资源上引导运行所述第二操作系统:通过所述二级程序加载器唤醒所述第二初始处理资源,并引导执行通用引导加载程序,以引导运行所述第二操作系统。
- 一种嵌入式系统,其特征在于,包括:芯片和至少两个操作系统,其中,所述芯片包括处理器、硬件控制器、第一总线和第二总线,其中,所述第一总线的带宽高于所述第二总线带宽,且所述第一总线被配置为多主多从模式,所述第二总线被配置为一主多从模式;所述至少两个操作系统基于所述处理器运行,其中,所述处理器的处理资源被动态分配给所述至少两个操作系统,所述处理器的处理资源包括处理器核心;所述至少两个操作系统通过所述第一总线进行通信;所述至少两个操作系统通过所述第二总线实现对所述硬件控制器的控制。
- 根据权利要求28所述的嵌入式系统,其特征在于,所述至少两个操作系统包括运行于所述处理器的至少一个处理器核心上的第一操作系统和至少一个处理器核心上的第二操作系统,所述第一操作系统的响应速度高于所述第二操作系统;其中,所述第二操作系统包括:业务管理模块,用于根据资源动态分配规则将一组待分配业务分配给对应的操作系统,其中,所述资源动态分配规则包括根据以下至少之一进行资源动态分配:业务响应速度,业务资源占用率;资源动态分配模块,用于确定与所述一组待分配业务对应的资源分配结果,其中,所述资源分配结果用于指示所述处理器的处理资源中与所述一组待分配业务中的每个待分配业务对应的处理资源;资源自适应调度模块,用于根据与所述每个待分配业务对应的操作系统以及所述资源分配结果,将所述处理器的处理资源分配给所述第一操作系统和所述第二操作系统。
- 根据权利要求29所述的嵌入式系统,其特征在于,所述第二操作系统还包括:负载均衡策略模块,用于通过读取规则配置文件,生成规则结构体,其中,所述规则结构体用于记录所述资源动态分配规则。
- 根据权利要求30所述的嵌入式系统,其特征在于,所述负载均衡策略模块,还用于通过所述第二操作系统的对外接口获取规则更新配置文件,其中,所述规则更新配置文件用于更新已配置的所述资源动态分配规则;使用所述规则更新配置文件更新所述规则结构体,以更新所述规则结构体所记录的所述资源动态分配规则。
- 根据权利要求29所述的嵌入式系统,其特征在于,所述业务管理模块用于通过执行以下至少之一的步骤实现根据所述资源动态分配规则中与业务响应速度对应的分配规则将所述一组待分配业务分配给对应的操作系统:将所述一组待分配业务中业务响应速度要求大于或者等于设定响应速度阈值的待分配业务分配给所述第一操作系统,以及,将所述一组待分配业务中业务响应速度要求小于设定响应速度阈值的待分配业务分配给所述第二操作系统;将所述一组待分配业务中业务资源占用率小于第一占用率阈值的待分配业务分配给所述第一操作系统,以及,将所述一组待分配业务资源占用率大于或者等于第一占用率阈值的待分配业务分配给所述第二操作系统;将所述一组待分配业务中包含敏感信息的待分配业务,分配给目标操作系统,其中,所述目标操作系统是所述第一操作系统和所述第二操作系统中,与使用对象交互频率低的操作系统。
- 根据权利要求29所述的嵌入式系统,其特征在于,所述业务管理模块还用于通过执行以下至少之 一的步骤实现将所述一组待分配业务分配给对应的操作系统:将所述一组待分配业务中与所述第一操作系统的已分配业务的业务耦合度大于或者等于第一耦合度阈值的待分配业务,分配给所述第一操作系统;将所述一组待分配业务中与所述第二操作系统的已分配业务的业务耦合度大于或者等于第二耦合度阈值的待分配业务,分配给所述第二操作系统。
- 根据权利要求29所述的嵌入式系统,其特征在于,所述资源动态分配模块用于通过执行以下步骤实现确定与所述一组待分配业务对应的资源分配结果:根据所述业务管理模块的分配结果,结合所述第一操作系统的处理资源的资源利用情况和所述第二操作系统的处理资源的资源利用情况,生成所述一组待分配业务与所述处理器的处理资源的资源映射表。
- 根据权利要求29所述的嵌入式系统,其特征在于,所述资源动态分配模块以处理器核心为单位将所述处理器的处理资源分配给所述第一操作系统和所述第二操作系统。
- 根据权利要求29所述的嵌入式系统,其特征在于,所述资源自适应调度模块用于通过执行以下步骤实现根据与所述每个待分配业务对应的操作系统以及所述资源分配结果,将所述处理器的处理资源分配给所述第一操作系统和所述第二操作系统:在根据所述资源分配结果确定所述处理器的处理资源中的未分配处理资源存在对应的待分配业务的情况下,将所述未分配处理资源分配给与所述未分配处理资源对应的待分配业务所分配给的操作系统。
- 根据权利要求29所述的嵌入式系统,其特征在于,所述嵌入式系统还包括:资源抢占与释放模块,用于在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放。
- 根据权利要求37所述的嵌入式系统,其特征在于,所述资源抢占与释放模块通过所述第一总线在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放,所述第一总线是所述处理器的不同处理器核心之间进行通信的总线。
- 根据权利要求38所述的嵌入式系统,其特征在于,所述资源抢占与释放模块用于通过执行以下步骤实现通过所述第一总线在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放:通过所述第一总线将所述第一操作系统的第一交互请求传输至所述第二操作系统,其中,所述第一交互请求用于请求与所述第二操作系统进行资源交互,所述资源交互包括以下之一:资源抢占,资源释放;通过所述第一总线获取所述第二操作系统响应所述第一交互请求返回的第一交互响应,其中,所述第一交互响应用于指示所述第一操作系统根据所述第一交互响应与所述第二操作系统进行所述资源交互。
- 根据权利要求39所述的嵌入式系统,其特征在于,所述第一操作系统包括:第一系统控制模块,用于检测所述第一操作系统的处理资源的资源利用率,在根据所述第一操作系统的处理资源的资源利用率,确定所述第一操作系统待与所述第二操作系统进行所述资源交互的情况下,触发所述资源抢占与释放模块通过所述第一总线将所述第一交互请求传输至所述第二操作系统。
- 根据权利要求40所述的嵌入式系统,其特征在于,所述第一系统控制模块,还用于执行以下至少之一的步骤:在所述第一操作系统的处理资源的资源利用率大于或者等于第一利用率阈值的情况下,确定所述第一操作系统待抢占所述第二操作系统的处理资源;在所述第一操作系统的处理资源处于空闲状态且不存在待所述第一操作系统执行的业务的情况下,确定所述第一操作系统待释放处理资源给所述第二操作系统。
- 根据权利要求40所述的嵌入式系统,其特征在于,所述第一系统控制模块,还用于在所述第一操作系统没有业务调度、且没有待分配给所述第一操作系统的业务的情况下,控制所述第一操作系统进入休眠状态。
- 根据权利要求39所述的嵌入式系统,其特征在于,所述资源抢占与释放模块用于通过执行以下至少之一的步骤实现通过所述第一总线将所述第一操作系统的第一交互请求传输至所述第二操作系统:通过所述第一总线将中断号为第一中断号的第一抢占请求传输至所述第二操作系统,其中,所述第一抢占请求用于请求抢占所述第二操作系统的处理资源;通过所述第一总线将中断号为第二中断号的资源释放请求传输至所述第二操作系统,其中,所述资源释放请求用于请求将所述第一操作系统所占用的处理资源释放给所述第二操作系统。
- 根据权利要求39所述的嵌入式系统,其特征在于,所述资源抢占与释放模块用于通过执行以下步骤实现通过所述第一总线在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放:通过所述第一总线将所述第二操作系统的第二交互请求传输至所述第一操作系统,其中,所述第二交互请求用于请求抢占所述第一操作系统的处理资源;通过所述第一总线获取所述第一操作系统响应所述第二交互请求返回的第二交互响应,其中,所述第二交互响应用于指示所述第一操作系统是否允许所述第二操作系统抢占所述第一操作系统的处理资源。
- 根据权利要求44所述的嵌入式系统,其特征在于,所述第二操作系统包括:第二系统控制模块,用于检测所述第二操作系统的处理资源的资源利用率,在根据所述第二操作系统的处理资源的资源利用率,确定所述第二操作系统待抢占所述第一操作系统的处理资源的情况下,触发所述资源抢占与释放模块通过所述第一总线将所述第二交互请求传输至所述第一操作系统。
- 根据权利要求45所述的嵌入式系统,其特征在于,所述第二系统控制模块,还用于执行以下至少之一的步骤:在所述第二操作系统的处理资源当前的资源利用率大于或者等于第二利用率阈值的情况下,确定所述第二操作系统待抢占所述第二操作系统的处理资源;在根据所述第二操作系统的执行中业务和所述第二操作系统的待执行业务确定所述第二操作系统的处理资源的资源利用率大于或者等于第三利用率阈值的情况下,确定所述第二操作系统待抢占所述第二操作系统的处理资源。
- 根据权利要求46所述的嵌入式系统,其特征在于,所述第一操作系统还用于在所述第一操作系统的执行中业务的业务优先级不低于所述第二操作系统的待执行业务的业务优先级的情况下,确定所述第一操作系统拒绝所述第二操作系统抢占所述第一操作系统的处理资源;在所述第一操作系统的执行中业务的业务优先级低于所述第二操作系统的待执行业务的业务优先级的情况下,确定所述第一操作系统允许所述第二操作系统抢占所述第一操作系统的处理资源。
- 根据权利要求46所述的嵌入式系统,其特征在于,所述资源抢占与释放模块用于通过执行以下步骤实现通过所述第一总线将所述第二操作系统的第二交互请求传输至所述第一操作系统:通过所述第一总线将中断号为第三中断号的第二抢占请求传输至所述第一操作系统,其中,所述第二抢占请求用于请求抢占所述第一操作系统的处理资源。
- 根据权利要求44所述的嵌入式系统,其特征在于,所述资源抢占与释放模块用于通过执行以下至少之一的步骤实现通过所述第一总线获取所述第一操作系统响应所述第二交互请求返回的第二交互响应:通过所述第一总线将中断号为第四中断号的允许资源释放响应传输至所述第二操作系统,其中,所述允许资源释放响应用于指示所述第一操作系统允许所述第二操作系统抢占所述第一操作系统的处理资源;通过所述第一总线将中断号为第五中断号的拒绝资源释放响应传输至所述第二操作系统,其中,所述拒绝资源释放响应用于指示所述第一操作系统拒绝所述第二操作系统抢占所述第一操作系统的处理资源。
- 根据权利要求37所述的嵌入式系统,其特征在于,资源自适应调度模块,还用于执行以下至少之一的步骤:将所述第一操作系统抢占的所述第二操作系统的处理资源合并到所述第一操作系统的可用资源池中;将所述第二操作系统抢占的所述第一操作系统的处理资源或者所述第一操作系统主动释放给所述第二操作系统的处理资源合并到所述第二操作系统的可用资源池中。
- 根据权利要求29至50中任一项所述的嵌入式系统,其特征在于,所述处理器,用于在所述芯片上电之后,通过引导加载程序在第一初始处理资源上引导运行所述第一操作系统,以及通过所述引导加载程 序在第二初始处理资源上引导运行所述第二操作系统,其中,所述第一初始处理资源是所述处理器的处理资源中与所述第一操作系统对应的初始处理资源,所述第二初始处理资源是所述处理器的处理资源中与所述第二操作系统对应的初始处理资源。
- 根据权利要求51所述的嵌入式系统,其特征在于,所述第一初始处理资源为所述处理器的处理器核心中的一个指定处理器核心,所述第二初始处理资源为所述处理器的处理器核心中除了所述指定处理器核心以外的其他处理器核心。
- 根据权利要求51所述的嵌入式系统,其特征在于,所述处理器用于通过执行以下步骤实现通过引导加载程序在第一初始处理资源上引导运行所述第一操作系统:通过二级程序加载器在第一初始处理资源上引导运行所述第一操作系统。
- 根据权利要求53所述的嵌入式系统,其特征在于,所述处理器,还用于通过固化在设备主板上的启动芯片内的预设程序对所述二级程序加载器的代码进行安全启动检查,其中,所述二级程序加载器是在安全启动检查的检查结果正常之后执行的。
- 根据权利要求53所述的嵌入式系统,其特征在于,所述处理器用于通过执行以下步骤实现通过所述引导加载程序在所述第二初始处理资源上引导运行所述第二操作系统:通过所述二级程序加载器唤醒所述第二初始处理资源,并引导执行通用引导加载程序,以引导运行所述第二操作系统。
- 根据权利要求29至50中任一项所述的嵌入式系统,其特征在于,所述至少两个操作系统包括第一操作系统和第二操作系统,其中,所述芯片,还用于将通信值装载至所述第一总线;所述第一总线,用于将携带有所述通信值的通信信号发送至所述第二操作系统对应的通信寄存器,以实现所述第一操作系统和所述第二操作系统之间的通信,其中,所述通信值用于指示所述第一操作系统和所述第二操作系统之间的通信内容。
- 根据权利要求29至50中任一项所述的嵌入式系统,其特征在于,所述芯片,还用于将控制值装载至所述第二总线;所述第二总线,用于将携带有所述控制值的控制信号发送至所述硬件控制器对应的寄存器,以实现操作系统对所述硬件控制器的控制,其中,所述控制值用于指示操作系统对所述硬件控制器的控制内容。
- 一种嵌入式系统的运行方法,其特征在于,包括:根据资源动态分配规则将一组待分配业务分配给所述嵌入式系统中对应的操作系统,其中,所述资源动态分配规则包括根据以下至少之一进行资源动态分配:业务响应速度,业务资源占用率,业务耦合度,业务重要性,所述嵌入式系统包括第一操作系统和第二操作系统,所述第一操作系统和所述第二操作系统运行于处理器上,所述第一操作系统的响应速度高于所述第二操作系统;确定与所述一组待分配业务对应的资源分配结果,其中,所述资源分配结果用于指示所述处理器的处理资源中与所述一组待分配业务中的每个待分配业务对应的处理资源,所述处理器的处理资源包括处理器核心;根据与所述每个待分配业务对应的操作系统以及所述资源分配结果,将所述处理器的处理资源分配给所述第一操作系统和所述第二操作系统。
- 根据权利要求58所述的方法,其特征在于,所述方法还包括:通过读取规则配置文件,生成规则结构体,其中,所述规则结构体用于记录所述资源动态分配规则。
- 根据权利要求58所述的方法,其特征在于,所述根据资源动态分配规则将一组待分配业务分配给所述嵌入式系统中对应的操作系统,包括以下至少之一:将所述一组待分配业务中业务响应速度要求大于或者等于设定响应速度阈值的待分配业务分配给所述第一操作系统,以及,将所述一组待分配业务中业务响应速度要求小于设定响应速度阈值的待分配业务分 配给所述第二操作系统;将所述一组待分配业务中业务资源占用率小于第一占用率阈值的待分配业务分配给所述第一操作系统,以及,将所述一组待分配业务资源占用率大于或者等于第一占用率阈值的待分配业务分配给所述第二操作系统;将所述一组待分配业务中包含敏感信息的待分配业务,分配给目标操作系统,其中,所述目标操作系统是所述第一操作系统和所述第二操作系统中,与使用对象交互频率低的操作系统。
- 根据权利要求58所述的方法,其特征在于,所述根据资源动态分配规则将一组待分配业务分配给所述嵌入式系统中对应的操作系统,包括以下至少之一:将所述一组待分配业务中与所述第一操作系统的已分配业务的业务耦合度大于或者等于第一耦合度阈值的待分配业务,分配给所述第一操作系统;将所述一组待分配业务中与所述第二操作系统的已分配业务的业务耦合度大于或者等于第二耦合度阈值的待分配业务,分配给所述第二操作系统。
- 根据权利要求58所述的方法,其特征在于,所述确定与所述一组待分配业务对应的资源分配结果,包括:根据所述一组待分配业务的分配结果,结合所述第一操作系统的处理资源的资源利用情况和所述第二操作系统的处理资源的资源利用情况,生成所述一组待分配业务与所述处理器的处理资源的资源映射表。
- 根据权利要求58所述的方法,其特征在于,所述根据与所述每个待分配业务对应的操作系统以及所述资源分配结果,将所述处理器的处理资源分配给所述第一操作系统和所述第二操作系统,包括:在根据所述资源分配结果确定所述处理器的处理资源中的未分配处理资源存在对应的待分配业务的情况下,将所述未分配处理资源分配给与所述未分配处理资源对应的待分配业务所分配给的操作系统。
- 根据权利要求58所述的方法,其特征在于,所述方法还包括:通过核间通信接口在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放。
- 根据权利要求64所述的方法,其特征在于,所述通过核间通信接口在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放,包括:通过核间通信接口将所述第一操作系统的第一交互请求传输至所述第二操作系统,其中,所述第一交互请求用于请求与所述第二操作系统进行资源交互,所述资源交互包括以下之一:资源抢占,资源释放;通过所述核间通信接口获取所述第二操作系统响应所述第一交互请求返回的第一交互响应,其中,所述第一交互响应用于指示所述第一操作系统根据所述第一交互响应与所述第二操作系统进行所述资源交互。
- 根据权利要求64所述的方法,其特征在于,所述通过核间通信接口在所述第一操作系统和所述第二操作系统之间进行处理资源的抢占和释放,包括:通过核间通信接口将所述第二操作系统的第二交互请求传输至所述第一操作系统,其中,所述第二交互请求用于请求抢占所述第一操作系统的处理资源;通过所述核间通信接口获取所述第一操作系统响应所述第二交互请求返回的第二交互响应,其中,所述第二交互响应用于指示所述第一操作系统是否允许所述第二操作系统抢占所述第一操作系统的处理资源。
- 根据权利要求66所述的方法,其特征在于,所述方法还包括:检测所述第二操作系统的处理资源的资源利用率;在根据所述第二操作系统的处理资源的资源利用率,确定所述第二操作系统待抢占所述第一操作系统的处理资源的情况下,触发通过所述核间通信接口将所述第二交互请求传输至所述第一操作系统。
- 根据权利要求67所述的方法,其特征在于,所述方法还包括以下至少之一:在所述第二操作系统的处理资源当前的资源利用率大于或者等于第二利用率阈值的情况下,确定所述 第二操作系统待抢占所述第二操作系统的处理资源;在根据所述第二操作系统的执行中业务和所述第二操作系统的待执行业务确定所述第二操作系统的处理资源的资源利用率大于或者等于第三利用率阈值的情况下,确定所述第二操作系统待抢占所述第二操作系统的处理资源。
- 根据权利要求68所述的方法,其特征在于,所述方法还包括:在所述第一操作系统的待执行业务的业务优先级不低于所述第二操作系统的待分配业务的业务优先级的情况下,确定所述第一操作系统拒绝所述第二操作系统抢占所述第一操作系统的处理资源;在所述第一操作系统的待执行业务的业务优先级低于所述第二操作系统的待执行业务的业务优先级的情况下,确定所述第一操作系统允许所述第二操作系统抢占所述第一操作系统的处理资源。
- 根据权利要求58至69中任一项所述的方法,其特征在于,所述方法还包括:在所述处理器所在的芯片上电之后,通过引导加载程序在第一初始处理资源上引导运行所述第一操作系统,以及通过所述引导加载程序在第二初始处理资源上引导运行所述第二操作系统,其中,所述第一初始处理资源是所述处理器的处理资源中与所述第一操作系统对应的初始处理资源,所述第二初始处理资源是所述处理器的处理资源中与所述第二操作系统对应的初始处理资源。
- 一种嵌入式系统的运行装置,其特征在于,包括:第一分配单元,用于根据资源动态分配规则将一组待分配业务分配给所述嵌入式系统中对应的操作系统,其中,所述资源动态分配规则包括根据以下至少之一进行资源动态分配:业务响应速度,业务资源占用率,业务耦合度,业务重要性,所述嵌入式系统包括第一操作系统和第二操作系统,所述第一操作系统和所述第二操作系统运行于处理器上,所述第一操作系统的响应速度高于所述第二操作系统;第一确定单元,用于确定与所述一组待分配业务对应的资源分配结果,其中,所述资源分配结果用于指示所述处理器的处理资源中与所述一组待分配业务中的每个待分配业务对应的处理资源,所述处理器的处理资源包括处理器核心;第二分配单元,用于根据与所述每个待分配业务对应的操作系统以及所述资源分配结果,将所述处理器的处理资源分配给所述第一操作系统和所述第二操作系统。
- 一种芯片,其特征在于,所述芯片包括可编程逻辑电路以及可执行指令中的至少之一,所述芯片在电子设备中运行,用于实现权利要求58至70中任一项所述的方法。
- 一种BMC芯片,其特征在于,包括:存储单元以及与所述存储单元连接的处理单元,所述存储单元用于存储程序,所述处理单元用于运行所述程序,以执行如权利要求58至70中任一项所述的方法。
- 一种主板,其特征在于,包括:至少一个处理器;至少一个存储器,用于存储至少一个程序;当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现如权利要求58至70中任一项所述的方法。
- 一种服务器,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;存储器,用于存放计算机程序;处理器,用于执行存储器上所存放的程序时,实现权利要求58至70中任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被处理器执行时实现所述权利要求58至70中任一项中所述的方法的步骤。
- 一种电子设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现所述权利要求58至70中任一项中所述的方法的步骤。
Priority Applications (9)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP23825349.6A EP4474989B1 (en) | 2023-04-28 | 2023-04-28 | Method and device for operating embedded system, embedded system, and chip |
| KR1020257006679A KR20250035609A (ko) | 2023-04-28 | 2023-04-28 | 임베디드 시스템의 실행 방법 및 장치, 임베디드 시스템 및 칩 |
| US18/574,657 US12293238B2 (en) | 2023-04-28 | 2023-04-28 | Embedded system running method and apparatus, and embedded system and chip |
| KR1020237045014A KR102776397B1 (ko) | 2023-04-28 | 2023-04-28 | 임베디드 시스템의 실행 방법 및 장치, 임베디드 시스템 및 칩 |
| PCT/CN2023/091876 WO2024221468A1 (zh) | 2023-04-28 | 2023-04-28 | 嵌入式系统的运行方法和装置、嵌入式系统及芯片 |
| JP2023580598A JP7776542B2 (ja) | 2023-04-28 | 2023-04-28 | 組み込みシステムの動作方法及び装置、組み込みシステム及びチップ |
| CN202380009072.XA CN116868170A (zh) | 2023-04-28 | 2023-04-28 | 嵌入式系统的运行方法和装置、嵌入式系统及芯片 |
| US19/169,568 US20250278312A1 (en) | 2023-04-28 | 2025-04-03 | Embedded system running method and apparatus, and embedded system and chip |
| US19/169,499 US20250278311A1 (en) | 2023-04-28 | 2025-04-03 | Embedded system running method and apparatus, and embedded system and chip |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2023/091876 WO2024221468A1 (zh) | 2023-04-28 | 2023-04-28 | 嵌入式系统的运行方法和装置、嵌入式系统及芯片 |
Related Child Applications (3)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US18/574,657 A-371-Of-International US12293238B2 (en) | 2023-04-28 | 2023-04-28 | Embedded system running method and apparatus, and embedded system and chip |
| US19/169,568 Division US20250278312A1 (en) | 2023-04-28 | 2025-04-03 | Embedded system running method and apparatus, and embedded system and chip |
| US19/169,499 Division US20250278311A1 (en) | 2023-04-28 | 2025-04-03 | Embedded system running method and apparatus, and embedded system and chip |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024221468A1 true WO2024221468A1 (zh) | 2024-10-31 |
Family
ID=88223857
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/091876 Ceased WO2024221468A1 (zh) | 2023-04-28 | 2023-04-28 | 嵌入式系统的运行方法和装置、嵌入式系统及芯片 |
Country Status (6)
| Country | Link |
|---|---|
| US (3) | US12293238B2 (zh) |
| EP (1) | EP4474989B1 (zh) |
| JP (1) | JP7776542B2 (zh) |
| KR (2) | KR102776397B1 (zh) |
| CN (1) | CN116868170A (zh) |
| WO (1) | WO2024221468A1 (zh) |
Families Citing this family (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116643892B (zh) * | 2023-07-25 | 2023-10-27 | 北京芯驰半导体科技有限公司 | 内存管理方法、装置、芯片及交通设备 |
| CN117319716B (zh) * | 2023-11-28 | 2024-02-27 | 苏州元脑智能科技有限公司 | 基板管理控制芯片的资源调度方法及基板管理控制芯片 |
| CN118277033A (zh) * | 2024-04-11 | 2024-07-02 | 北京经纬恒润科技股份有限公司 | 一种仿真调度方法、装置、设备及介质 |
| CN118444645B (zh) * | 2024-05-09 | 2025-11-25 | 中国核动力研究设计院 | 核安全级dcs现场控制站的仿真装置、仿真方法及存储介质 |
| CN119806630A (zh) * | 2024-11-21 | 2025-04-11 | 南方电网数字电网科技(广东)有限公司 | 基于核心板的多平台操作系统兼容系统 |
| CN119602480A (zh) * | 2024-11-29 | 2025-03-11 | 中国南方电网有限责任公司 | 一种低压配电轻量级控制芯片 |
| CN119201255B (zh) * | 2024-11-29 | 2026-04-17 | 浪潮电子信息产业股份有限公司 | 命令处理方法、装置、基板管理控制器、程序产品和介质 |
| CN119322684B (zh) * | 2024-12-19 | 2025-05-06 | 杭州宇泛智能科技股份有限公司 | 芯片平台资源动态调度方法 |
| CN121029256B (zh) * | 2025-10-27 | 2026-01-30 | 浪潮计算机科技有限公司 | 一种ai服务器的bmc优化方法、系统、电子设备及存储介质 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106469283A (zh) * | 2016-08-30 | 2017-03-01 | 乐视控股(北京)有限公司 | 一种车载系统 |
| CN115413337A (zh) * | 2021-03-29 | 2022-11-29 | 华为技术有限公司 | 电子装置、系统级芯片和物理核分配方法 |
| CN115421871A (zh) * | 2022-09-26 | 2022-12-02 | 科东(广州)软件科技有限公司 | 一种对系统的硬件资源动态分配的方法、装置及计算设备 |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR101557995B1 (ko) * | 2008-10-08 | 2015-10-19 | 엘지전자 주식회사 | 다중 운영체제를 지원하는 단말기 및 그 단말기에 대한시스템 자원 할당 방법 |
| KR20130104958A (ko) * | 2012-03-16 | 2013-09-25 | 삼성전자주식회사 | 다중 운영체제들을 실행하는 장치 및 방법 |
| KR101934293B1 (ko) * | 2012-08-03 | 2019-01-02 | 엘지전자 주식회사 | 이동 단말기의 이동 단말기 및 그의 nfc결제 방법 |
| KR20140076185A (ko) * | 2012-12-12 | 2014-06-20 | (주)한국산업정보기술 | 복수의 운영체제 동시구동이 가능한 모바일 디바이스와 그 구동방법 |
| CN105988872B (zh) * | 2015-02-03 | 2020-02-18 | 阿里巴巴集团控股有限公司 | 一种cpu资源分配的方法、装置及电子设备 |
| CN113391821B (zh) * | 2021-05-11 | 2023-03-10 | 中国电力科学研究院有限公司 | 一种非对称多处理器嵌入式操作系统 |
| CN115964150A (zh) * | 2022-12-30 | 2023-04-14 | 济南浪潮数据技术有限公司 | 一种基于双实时内核的业务处理方法、系统、设备及介质 |
-
2023
- 2023-04-28 JP JP2023580598A patent/JP7776542B2/ja active Active
- 2023-04-28 WO PCT/CN2023/091876 patent/WO2024221468A1/zh not_active Ceased
- 2023-04-28 EP EP23825349.6A patent/EP4474989B1/en active Active
- 2023-04-28 KR KR1020237045014A patent/KR102776397B1/ko active Active
- 2023-04-28 KR KR1020257006679A patent/KR20250035609A/ko active Pending
- 2023-04-28 US US18/574,657 patent/US12293238B2/en active Active
- 2023-04-28 CN CN202380009072.XA patent/CN116868170A/zh active Pending
-
2025
- 2025-04-03 US US19/169,568 patent/US20250278312A1/en active Pending
- 2025-04-03 US US19/169,499 patent/US20250278311A1/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106469283A (zh) * | 2016-08-30 | 2017-03-01 | 乐视控股(北京)有限公司 | 一种车载系统 |
| CN115413337A (zh) * | 2021-03-29 | 2022-11-29 | 华为技术有限公司 | 电子装置、系统级芯片和物理核分配方法 |
| CN115421871A (zh) * | 2022-09-26 | 2022-12-02 | 科东(广州)软件科技有限公司 | 一种对系统的硬件资源动态分配的方法、装置及计算设备 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4474989A4 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116868170A (zh) | 2023-10-10 |
| US12293238B2 (en) | 2025-05-06 |
| EP4474989A4 (en) | 2024-12-11 |
| US20250278311A1 (en) | 2025-09-04 |
| JP7776542B2 (ja) | 2025-11-26 |
| US20250278312A1 (en) | 2025-09-04 |
| JP2025518991A (ja) | 2025-06-24 |
| US20240362083A1 (en) | 2024-10-31 |
| KR102776397B1 (ko) | 2025-03-04 |
| KR20240159790A (ko) | 2024-11-06 |
| KR20250035609A (ko) | 2025-03-12 |
| EP4474989B1 (en) | 2026-04-22 |
| EP4474989A1 (en) | 2024-12-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP4481563B1 (en) | Start control method and apparatus for embedded system, and storage medium and electronic device | |
| EP4474989B1 (en) | Method and device for operating embedded system, embedded system, and chip | |
| JP7813305B2 (ja) | オペレーティングシステムの実行制御方法、装置、組み込みシステム及びチップ | |
| CN116541227B (zh) | 故障诊断方法、装置、存储介质、电子装置及bmc芯片 | |
| CN116243995B (zh) | 通信方法、装置、计算机可读存储介质以及电子设备 | |
| CN116244229B (zh) | 硬件控制器的访问方法、装置、存储介质和电子设备 | |
| CN116257364B (zh) | 系统间的资源占用方法、装置、存储介质及电子装置 | |
| US20260037466A1 (en) | Method and apparatus for generating hardware interface signal, and electronic device | |
| CN116627520A (zh) | 基板管理控制器的系统运行方法以及基板管理控制器 | |
| CN116302617A (zh) | 共享内存的方法、通信方法、嵌入式系统以及电子设备 | |
| CN118885307A (zh) | 共享资源的访问控制方法及装置、存储介质及电子设备 | |
| CN117149471B (zh) | 通信方法、装置、嵌入式系统、存储介质以及电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| WWE | Wipo information: entry into national phase |
Ref document number: 2023580598 Country of ref document: JP |
|
| ENP | Entry into the national phase |
Ref document number: 2023825349 Country of ref document: EP Effective date: 20231228 |
|
| WWD | Wipo information: divisional of initial pct application |
Ref document number: 1020257006679 Country of ref document: KR |
|
| WWP | Wipo information: published in national office |
Ref document number: 1020257006679 Country of ref document: KR |
|
| WWG | Wipo information: grant in national office |
Ref document number: 18574657 Country of ref document: US |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWG | Wipo information: grant in national office |
Ref document number: 2023825349 Country of ref document: EP |