Method and device for operating embedded system, embedded system, and chip

By running different operating systems on multi-core processors and dynamically allocating processing resources, the problem of idle multi-core processor resources is solved, improving overall utilization and reducing hardware costs.

WO2024221468A1PCT designated stage expired Publication Date: 2024-10-31INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/091876
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

The processing resources of multi-core processors are idle most of the time, resulting in low overall utilization. Existing solutions that add acceleration hardware to deal with response time-sensitive services are not conducive to cost control.

Method used

Run different operating systems on the processor, dynamically allocate processing resources according to business response speed, resource occupancy, coupling and importance, and use the difference in response speed of different operating systems to allocate services to corresponding processing resources to avoid adding additional Accelerated hardware.

Benefits of technology

It improves the overall utilization of processing resources, reduces hardware costs, enables business processing with different response speed requirements, and solves the problem of idle multi-core processor resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023091876_31102024_PF_FP_ABST
    Figure CN2023091876_31102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for operating an embedded system, an embedded system, and a chip. The method comprises: according to a resource dynamic allocation rule, allocating a group of services to be allocated to corresponding operating systems in an embedded system, wherein the resource dynamic allocation rule comprises performing resource dynamic allocation according to at least one of the following: the service response speed, the service resource occupancy rate, the service coupling degree, or the service importance, the embedded system comprises a first operating system and a second operating system, 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 said group of services, wherein the resource allocation result is used for indicating a processing resource, among the processing resources of a processor, corresponding to each service to be allocated in said group of services, and the processing resources of the processor comprise processor cores; and according to the operating system and the resource allocation result which correspond to each service to be allocated, allocating the processing resources of the processor to the first operating system and the second operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Embedded system operation method and device, embedded system and chip Technical Field

[0001] 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. Background Art

[0002] With the rapid development of the semiconductor industry and integrated circuit technology, multi-core processors have become important computing units in many fields. In application scenarios that are sensitive to response speed, 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. However, 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.

[0003] Summary of the Invention

[0004] 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 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.

[0005] According to one aspect of an embodiment of the present application, a method for operating an embedded system is provided, 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-allocated service and the resource allocation result.

[0006] According to another aspect of an embodiment of the present application, an embedded system is also provided, 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 dynamic resource allocation rule, wherein the dynamic resource allocation rule includes dynamic resource allocation according to at least one of the following: service response speed, service resource occupancy rate; a dynamic resource 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-allocated service and the resource allocation result.

[0007] According to another embodiment of the present application, an embedded system is also provided, comprising: a chip and at least two operating systems, wherein the chip comprises 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; 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.

[0008] According to another aspect of an embodiment of the present application, an operating device of an embedded system is also provided, including: a first allocation unit, 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 dynamic resource allocation 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 running on a processor, and the response speed of the first operating system is higher than that of the second operating system; a first determination unit, 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 second allocation unit, 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-allocated service and the resource allocation result.

[0009] According to another aspect of the embodiments of the present application, 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 of any of the above method embodiments.

[0010] According to another aspect of the embodiments of the present application, 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 of the above method embodiments.

[0011] According to another aspect of the embodiments of the present application, a mainboard is also provided, 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 of any one of the above method embodiments.

[0012] According to another aspect of the embodiments of the present application, a server is also provided, 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 of the above method embodiments when executing the program stored in the memory.

[0013] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when run.

[0014] According to another embodiment of the present application, an electronic device is provided, 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.

[0015] In an embodiment of the present application, a method of running different operating systems of an embedded system on different processing resources of a processor 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. 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 an embedded system are run on the processor, and different operating systems have different response speeds. They can be used to run businesses with different response speed requirements. Based on the dynamic resource allocation rule, the processor's to-be-executed businesses are allocated to different operating systems, and the to-be-executed businesses 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 businesses and the operating systems, and the correspondence between the to-be-executed businesses and the processing resources. Through the above-mentioned business execution method, there is no need to add additional acceleration hardware. At the same time, since all businesses are executed by the processing resources in the processor, on the basis of the businesses originally executed by the processor, additional processing of businesses originally executed by the acceleration hardware can achieve the purpose of increasing the amount of business processed by the processor, and achieve the technical effect of improving the utilization of processing resources, thereby solving the problem of low overall utilization of core resources in related technologies due to the fact that most of the processing resources of the multi-core processor are in an idle state. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0018] FIG1 is a schematic diagram of a hardware environment of an embedded system operation method according to an embodiment of the present application;

[0019] FIG2 is a flow chart of an optional method for operating an embedded system according to an embodiment of the present application;

[0020] FIG3 is a schematic diagram of an optional operating method of an embedded system according to an embodiment of the present application;

[0021] FIG4 is a schematic diagram of another optional operating method of an embedded system according to an embodiment of the present application;

[0022] FIG5 is a schematic diagram of another optional operating method of an embedded system according to an embodiment of the present application;

[0023] FIG6 is a schematic diagram of another optional operating method of an embedded system according to an embodiment of the present application;

[0024] FIG7 is a schematic diagram of another optional operating method of an embedded system according to an embodiment of the present application;

[0025] FIG8 is a flow chart of another optional embedded system operation method according to an embodiment of the present application;

[0026] FIG9 is a flow chart of another optional embedded system operation method according to an embodiment of the present application;

[0027] FIG10 is a schematic diagram of an optional embedded system according to an embodiment of the present application;

[0028] FIG11 is a schematic diagram of another optional embedded system according to an embodiment of the present application;

[0029] FIG12 is a structural block diagram of an optional operating device of an embedded system according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] The method embodiments provided in the embodiments of the present application can be executed in a server, a computer terminal, an equipment terminal or a similar computing device. Taking operation on a server as an example, FIG1 is a hardware environment schematic diagram of an operation method of an embedded system according to an embodiment of the present application. As shown in FIG1 , the server may include one or more (only one is shown in FIG1 ) 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. In an exemplary embodiment, the above-mentioned server may also include a transmission device 106 and an input / output device 108 for a communication function. It will be understood by those skilled in the art that the structure shown in FIG1 is only for illustration and does not limit the structure of the above-mentioned server. For example, the server may also include more or fewer components than those shown in FIG1 , or have different configurations with equivalent functions as shown in FIG1 or more functions than those shown in FIG1 .

[0033] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the operating 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, implementing the above method. 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. In some instances, the memory 104 may further include a memory remotely located 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.

[0034] The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned network may include a wireless network provided by the server's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0035] In this embodiment, a method for operating an embedded system is provided, which is applied to the above-mentioned server. FIG2 is a flow chart of an optional method for operating an embedded system according to an embodiment of the present application. As shown in FIG2 , the flow chart includes the following steps:

[0036] Step S202: Allocate a group of services to be allocated to corresponding operating systems in the embedded system according to a dynamic resource allocation rule.

[0037] The operating method of the embedded system in this embodiment can be applied to scenarios where services are run on the processing resources of a processor and the processing resources are dynamically and evenly scheduled. The above-mentioned embedded system can be an embedded multi-system. An embedded multi-system refers to running multiple operating systems (for example, a first operating system, a second operating system, etc.) in a multi-core processor of an embedded system, and these operating systems run simultaneously 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 services on the processor can be executed in parallel by 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, there is no limitation on the number of cores contained in the multi-core processor.

[0038] With the rapid development of the semiconductor industry and integrated circuit technology, multi-core processors have become important computing units in fields such as cloud computing, artificial intelligence (AI), big data, the industrial internet, and 5G (fifth generation mobile communication technology). To achieve shared hardware computing resources, virtualization technology can be introduced to improve the utilization of multi-core processors. Specifically, multiple virtual machines (VMs) are created based on the processor hardware platform, each running an independent operating system.

[0039] However, virtual machine-based operating systems generally cannot meet the real-time requirements of services due to the increased overhead of virtual machine management. Therefore, in application scenarios that are sensitive to response speed (related to the real-time nature of the service), the operating system is generally run directly in the form of an exclusive physical machine. This "bare metal" processor usage method can significantly reduce service processing latency. In various industries and fields of embedded system development (for example, servers, the Internet of Things, etc.), in order to achieve system management functions with increasingly powerful functional requirements, the services it carries will also be comprehensively divided according to the different degrees of response speed requirements (real-time requirements), and different hardware implementation platforms will be configured for different service types. For example, complex and diverse non-real-time services are handled by multi-core processors (Central Processing Unit, central processing unit, as the calculation and control core of the computer system, the CPU is the final execution unit for information processing and program running), while services with higher response speed requirements are implemented by specialized acceleration hardware. The acceleration hardware here 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.

[0040] However, in embedded systems, solutions that combine multi-core processors with acceleration hardware typically only run a single operating system across all of the processor's processing resources (e.g., processor cores), and most of the processing resources are idle most of the time, resulting in low overall resource utilization. Common embedded products (e.g., mobile phones and tablets) typically use multiple cores running a single operating system (e.g., Android, iOS, Windows), with CPU core load often below 30% (CPU capacity is often excessive). The CPU operates on a time-slice basis and is idle when not in use. Furthermore, increasing investment in acceleration hardware resources such as FPGAs and CPLDs to address time-sensitive services is detrimental to cost control.

[0041] In order to at least partially solve the above technical problems, in this embodiment, different operating systems of the embedded system are run on different processing resources of the processor. 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 the 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. Through the above-mentioned service execution method, there is no need to add additional acceleration hardware, which facilitates cost control. At the same time, since all services are executed by the processing resources within the processor, on the basis of the services originally executed by the processor, additional services originally executed by the acceleration hardware are processed, which increases the amount of services processed by the processor and can improve the overall utilization of processing resources.

[0042] In this embodiment, 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. Here, the processor may be a multi-core processor (for example, an octa-core processor). The processing resources of the processor (that is, processor resources) may include processor cores (processor hard cores) and may also include other types of resources, such as controller logic units, external interfaces, bus resources, etc.

[0043] During the operation of the processor, a set 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 with other services, service importance, etc., resource dynamic allocation rules can be pre-configured. The resource dynamic allocation rules may include rules for performing service allocation, allocating services to corresponding operating systems so that the processing resources of the corresponding operating systems can execute the services allocated to themselves. Optionally, the resource dynamic allocation rules may include dynamically allocating resources based on at least one of the following: service response speed, service resource occupancy rate, service coupling degree, service importance. Different allocation rules may have corresponding priorities. For example, the priorities are in the following order from high to low: service importance, service coupling degree, service response speed, service resource occupancy rate. According to the source dynamic allocation rules, a set of services to be allocated (or tasks to be allocated, different services to be allocated may correspond to different processes) can be allocated to the corresponding operating systems in the embedded system to obtain service allocation results.

[0044] Optionally, based on the response time constraint, 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., or a real-time operating system in other embedded systems. 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, the CPU time needs to be shared. Task debugging is uncertain. It can be called a non-real-time operating system, such as contiki, HeliOS, Linux (full name GNU / Linux, a freely distributable Unix-like operating system), etc. It can also be a non-real-time operating system in other embedded systems. Among them, the Linux system is a multi-user, multi-tasking operating system based on POSIX (Portable Operating System Interface) that supports multi-threading and multi-CPU.

[0045] Correspondingly, the business assigned to the first operating system is usually a real-time business. A real-time business refers to a 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 results can control the production process or respond quickly to the processing system within the specified time. As a typical scenario, the control of a robot arm in industrial control is a real-time business. The system needs to take timely measures before detecting an erroneous operation of the robot arm, otherwise serious consequences may result. The business assigned to the second operating system is usually a non-real-time business. A non-real-time business refers to a 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.

[0046] It should be noted that 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 the 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 the coordinated operation of all real-time businesses. It has the characteristics of timely response and high reliability.

[0047] Optionally, allocating the set of pending services to the corresponding operating systems can be performed by a service management module. As shown in FIG3 , the service management module can be a software module running on the first operating system or the second operating system. For example, the service management module running on the second operating system can be implemented by software in a Linux system. The service management module can allocate the set of pending services to the corresponding operating systems in the embedded system according to dynamic resource allocation rules.

[0048] 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 processor's processing resources corresponding to each service to be allocated in the group of services to be allocated.

[0049] After each to-be-allocated service is assigned to a corresponding operating system, corresponding processing resources can be allocated to each to-be-allocated service based on the service allocation results, resulting in a resource allocation result corresponding to a group of to-be-allocated services. When allocating processing resources to the to-be-allocated services, services assigned to a first operating system can be allocated the processing resources of the first operating system, while services assigned to a second operating system can be allocated the processing resources of the second operating system. Furthermore, considering load balancing, if unallocated processing resources exist, some services can be allocated the unallocated processing resources.

[0050] The processing resources of the processor can be dynamically allocated in units of time slices. Taking into account the frequent switching of the operating systems to which the processing resources belong and the fact that the business processing time is not necessarily an integer multiple of the time slice, which leads to the extension of the response time of some businesses, 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 different.

[0051] Optionally, determining the resource allocation result corresponding to a group of services to be allocated can be performed by a resource dynamic allocation module. As shown in Figure 3, 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. Here, 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. For 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.

[0052] 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.

[0053] Based on the operating system corresponding to each to-be-allocated service and the resource allocation result, the processing resources of the processor can be allocated to the first operating system and the second operating system. Optionally, the unallocated processing resources of the processor can be allocated to the corresponding operating system. The unallocated processing resources can be determined based on the correspondence between the unallocated processing resources and the to-be-allocated services, and the correspondence between the to-be-allocated services and the operating systems.

[0054] Optionally, allocating the processor's processing resources 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). This resource adaptive scheduling 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 adaptive scheduling module can be implemented by software in the Linux system. It can perform the actual scheduling of the processor's processing resources (e.g., processor hard core resources) based on the output of the service management module and the output of the dynamic resource allocation module. As shown in Figure 4, after resource scheduling by the core resource adaptive module, M cores out 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.

[0055] For example, heterogeneous operating systems (heterogeneous operating systems) can be run on different cores of the same processor, enabling the entire processor system to process both real-time and non-real-time services in parallel. Furthermore, by adaptively adjusting the processor core resources (e.g., processor cores) occupied by different operating systems, processor resource utilization can be significantly improved. Here, heterogeneity refers to the different types of operating systems running on the same multi-core processor in an embedded system, and multi-system refers to the number of operating systems running on the same multi-core processor in an embedded system, and these operating systems run simultaneously in the time dimension.

[0056] Here, it should be noted that, for servers, servers must at least have the characteristics of high scalability and high stability. Among them, since enterprise networks 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. In addition to hardware scalability, scalability also includes software scalability. Since the functions of servers are still very complex compared to computers, not only hardware configuration, but also software configuration is very important. If you want to achieve more functions, it is impossible to imagine without comprehensive software support.

[0057] In addition, 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 server's data transmission cannot run stably, it will undoubtedly have a great impact on business development.

[0058] The solution of the present application takes advantage of the high scalability of the server and introduces a dual software system of the first operating system and the second operating system for generating hardware interface signals. At the same time, hardware devices such as GPLD and BMC chip can also be introduced to adjust the transmission voltage of the hardware interface signal and monitor the operating status of other devices inside the server. On this basis, 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. Finally, the hardware interface signal corresponding to the request command is generated according to the multiple logical bit information and the timer. It can be seen from the above that the present application generates the hardware interface signal corresponding to the request command through the first operating system, thereby achieving the technical effect of simulating the generation of hardware interface signals using software, thereby achieving the purpose of hardware logic design without the chip itself having the relevant hardware interface signals. It can not only reduce the design difficulty of the chip, but also reduce the design cost of the chip. The present application achieves the purpose of using a software system to generate hardware interface signals on the basis of not having to perform hardware logic design of the hardware interface signal on the chip, thereby reducing the design difficulty of the chip, and thus solving the technical problem in the related technology that the chip itself needs to have a hardware logic design of the controller, which leads to a high design cost of the chip.

[0059] In addition, 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 slower than that of the first operating system, the first operating system with a faster business response speed is used to generate the hardware interface signal, which can ensure that the generation of the hardware interface signal will not be interrupted, thereby ensuring that the hardware interface signal can be output continuously and stably.

[0060] Through the above steps, a group of to-be-allocated businesses are allocated 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: business response speed, business resource occupancy rate, business coupling degree, and business importance, and the embedded system includes 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 a group of to-be-allocated businesses, 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 business in the group of to-be-allocated businesses, and the processing resources of the processor include a processor core; and 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 business and the resource allocation result, thereby solving the problem in the related art 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, thereby improving the utilization of processing resources.

[0061] In an exemplary embodiment, the method further includes:

[0062] S11, generating a rule structure by reading a rule configuration file, wherein the rule structure is used to record dynamic resource allocation rules.

[0063] Dynamic resource allocation rules can be configured based on a rule configuration file. By reading the rule configuration file, a rule structure for recording dynamic resource allocation rules can be generated. Here, 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. The dynamic resource allocation rules can be configured with different parameters in the load balancing policy file. An example of a load balancing policy configuration file is as follows:

[0064] classificationkinds=2 / / A value of 1 means that processes are classified according to attributes such as important and non-important. Otherwise, processes are classified according to the preset classification method (such as real-time and non-real-time);

[0065] real-time grade evaluation = 2 / / A value of 1 indicates that the average CPU usage in the past statistical minutes is used as the process real-time grade evaluation principle; otherwise, the preset priority is used as the process real-time grade evaluation principle;

[0066] statistic minutes = 5 / / represents the statistical time (in minutes) for the average occupancy of each process. This value is valid when real-time grade evaluation is 1.

[0067] Optionally, the dynamic resource allocation rules can be stored in a load balancing policy module. Here, 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 classification methods for various services (or processes) running in the system, evaluation principles for real-time levels, 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 and generate a list containing real-time services and non-real-time services.

[0068] It should be noted that the above classification methods and real-time performance evaluation principles are open-ended. Users can define their own methods or principles. The rules underlying service management in the service management module can be dynamically configured, allowing for the addition of additional rules based on existing rules. The service management module can configure multiple rules with the same functionality without conflicts between them. Specifically, rule selection criteria, such as the time of configuration and priority, can be used to determine which rule is currently in use among rules with the same function, thus avoiding conflicts between rules. The load_balance.config configuration file described above illustrates one possible scenario. In the configuration file, the classification_kinds variable indicates the specific classification criteria (e.g., service importance or real-time performance) and the classification category (e.g., critical vs. general, real-time vs. non-real-time), while the real-time_grade_evaluation variable indicates the real-time performance evaluation criteria (e.g., average CPU usage over the past statistic_minutes or a preset service priority). The real-time performance grade type is user-defined and can be defined as high, normal, or low, or further subdivided.

[0069] 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.

[0070] Through this embodiment, by reading the rule configuration file and generating a rule structure to record the dynamic resource allocation rule, the convenience of information configuration can be improved.

[0071] In an exemplary embodiment, the method further includes:

[0072] S21, obtaining 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 dynamic resource allocation rule;

[0073] S22: Use the rule update configuration file to update the rule structure, so as to update the resource dynamic allocation rule recorded in the rule structure.

[0074] The rule structure can be in a fixed format, meaning it cannot be modified while the embedded system is running, or it can be in a flexibly configurable format, meaning it can be modified via a configuration file in a specific format. In this embodiment, a rule update configuration file can be obtained, which is used to update the configured dynamic resource allocation rules. Using the rule update configuration file, the rule structure can be updated, thereby updating the dynamic resource allocation rules recorded in the rule structure.

[0075] When using a rule update configuration file to update a rule structure, you can directly generate a new rule structure based on the rule update configuration file and use the newly generated rule structure to replace the existing rule structure, or you can use the parameter values ​​of the rule parameters indicated by the rule update configuration file to update the parameter values ​​of the corresponding rule parameters in the rule structure.

[0076] Optionally, the configuration file in a specific format can be read through the external interface of the first operating system or the second operating system. Considering the volume of business to be processed, operations such as dynamic resource scheduling of the embedded system can be handled by the second operating system. When obtaining the rule update configuration file, the rule update configuration file can be obtained through the external interface of the second operating system.

[0077] For example, the load balancing policy module may be in a fixed format or may be configured through an external interface of the Linux system. For example, 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.

[0078] It should be noted that the external interface refers to the multi-core processor's external interface and can be a network interface, an SPI (Serial Peripheral Interface) controller interface, a UART (Universal Asynchronous Receiver / Transmitter) serial port, or any other means of accessing data from the outside world. The hardware used to read files and the specific file locations vary depending on the implementation. For example, a network interface can be used to load configuration files from the World Wide Web (WWW) interface; an SPI controller can be used to read configuration files from the board's SPI Flash; and a UART serial port can be used to retrieve configuration files from a serial data transmission and reception software tool on another PC (Personal Computer).

[0079] Through this embodiment, by obtaining a rule update configuration file and using the obtained rule update configuration file to update the rule structure, the flexibility of resource dynamic allocation rule configuration can be improved.

[0080] In an exemplary embodiment, allocating a group of services to be allocated to corresponding operating systems in an embedded system according to a dynamic resource allocation rule includes:

[0081] S31, 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 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.

[0082] When allocating pending services, the services can be assigned to corresponding operating systems based on their response speed requirements. Service response speed can be used to assess the real-time performance of a service. The higher the service response speed requirement, the more sensitive it is to the operating system's scheduling time and response speed. Services with high response speed requirements require the operating system to process them quickly enough, and their processing results must be sufficient to control the production process or respond quickly to the processing system within the specified timeframe. Services with lower response speed requirements, on the other hand, have a certain tolerance for scheduling delays.

[0083] For 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, and 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, and 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). Here, the service response speed requirement can be indicated by an indication parameter of the service response speed, and the set response speed threshold can be a millisecond-level response speed threshold or a second-level response speed threshold, for example, 100ms, 200ms, 1s, etc. There is no limitation on the set response speed threshold in this embodiment.

[0084] Optionally, when a group of to-be-allocated services are allocated to corresponding operating systems in an embedded system, 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 is used to record the services allocated to the first operating system, and the second service list is used to record the services allocated to the second operating system. That is, the service allocation result includes the first service list and the second service list. 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.

[0085] For example, 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.

[0086] Here, the business management module can classify the currently pending businesses. When the BMC system first runs, since all the businesses currently to be run are known to the system, the business management module classifies these businesses based on the output of the load balancing module. After classification, different businesses will be assigned to different operating systems (RTOS system and Linux system) for execution. During subsequent operations, if the number of business processes changes (for example, some processes hang or new processes are started), the business management module will continue to divide the businesses, dividing and managing 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.

[0087] Through this embodiment, by allocating the services to be allocated to the corresponding operating systems according to the service response speed requirements, the timeliness of the service response for the services that are sensitive to the scheduling time can be guaranteed.

[0088] In an exemplary embodiment, allocating a group of services to be allocated to corresponding operating systems in an embedded system according to a dynamic resource allocation rule includes:

[0089] S41, allocating to-be-allocated services whose service resource occupancy rates are less than a first occupancy rate threshold in a group of to-be-allocated services to a first operating system, and allocating to-be-allocated services whose service resource occupancy rates are greater than or equal to the first occupancy rate threshold in a group of to-be-allocated services to a second operating system.

[0090] When allocating pending services, the pending services can be allocated to the corresponding operating system based on the service resource occupancy rate of the pending services. The service resource occupancy rate can be the average proportion of the service to the processing resources per unit time (for example, the CPU occupancy rate per minute). The level of 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 rates, the impact on the scheduling time and response speed of the operating system is not significant, and the real-time level is higher.

[0091] For services to be allocated whose service resource occupancy rate is less than the first occupancy rate threshold, their 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. For services to be allocated whose service resource occupancy rate is greater than or equal to the first occupancy rate threshold, their 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. Here, the first occupancy rate threshold can be configured as needed, and can be 10%, 15%, 20% or other thresholds. At the same time, the first occupancy rate threshold can be dynamically adjusted.

[0092] Through this embodiment, by allocating the services to be allocated to the corresponding operating systems according to the service resource occupancy rates, it is possible to ensure timeliness of response to services with low service resource occupancy rates.

[0093] In an exemplary embodiment, allocating a group of services to be allocated to corresponding operating systems in an embedded system according to a dynamic resource allocation rule includes at least one of the following:

[0094] S51, allocating to-be-allocated services, whose service coupling degree with services already allocated to the first operating system is greater than or equal to a first coupling degree threshold, from a group of to-be-allocated services to the first operating system;

[0095] S52: Allocate services to be allocated, whose service coupling degree with services allocated to the second operating system is greater than or equal to a second coupling degree threshold, from a group of services to be allocated, to the second operating system.

[0096] When allocating pending services, the services can be assigned to corresponding operating systems based on their business coupling. Business coupling indicates the degree of correlation between the pending services and the already allocated services in each operating system. If a pending service has a high business coupling with an already allocated service in one operating system, it is not appropriate to allocate it to another operating system. Therefore, the pending services can be allocated to corresponding operating systems based on their business coupling with the already allocated services in each operating system.

[0097] Optionally, the business coupling degree can be evaluated by the association between the input and output of the business. The business coupling degree can be represented by different coupling degree levels. If there is no relationship between the input and output of the business, the coupling degree level is low (or other coupling degree levels indicating that there is 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 degree 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 degree level between the businesses is medium. In addition, the business coupling degree can also be represented by a numerical value. The business coupling degree can be evaluated by one or more coupling degree conditions (for example, the association relationship between input and output), and the numerical value corresponding to the satisfied coupling degree condition is determined as the numerical value of the business coupling degree.

[0098] If there is a business to be allocated in a group of businesses to be allocated whose business coupling degree with the allocated business of the first operating system is greater than or equal to the first coupling degree threshold, then such business to be allocated can be allocated to the first operating system. If there is a business to be allocated in a group of businesses to be allocated whose business coupling degree with the allocated business of the second operating system is greater than or equal to the first coupling degree threshold, then such business to be allocated can be allocated to the second operating system.

[0099] For example, in addition to generating a list of real-time services and a list of non-real-time services, the service management module is also responsible for service decoupling evaluation and management, that is, finding out from all real-time services which can be independently 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 independently 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.

[0100] Here, some services, while requiring real-time performance, frequently interact with other non-real-time services in the system (i.e., they are highly coupled). To improve overall data interaction efficiency, these services are assigned to the non-real-time operating system. However, some real-time services are relatively independent and can simply be assigned to the real-time operating system. This process is known as "decoupling." There are various criteria for determining service decoupling; they can be based on the closeness of the relationships between the aforementioned services or other user-related metrics.

[0101] 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 service management module. During subsequent operation, 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.

[0102] In an optional embodiment, the service running on the first operating system may include, but is not limited to, a service for generating a hardware interface signal. In this embodiment, a process for generating a hardware interface signal is provided, which includes the following steps:

[0103] Step 1, obtain a request command through the first operating system. Here, the request command can be a command to generate a hardware interface signal. For example, 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 purpose input and output port) signal, SPI (serial peripheral interface, serial peripheral interface) signal, etc. On this basis, the request command can also be a request command of other protocol types. For example, when 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.

[0104] Step 2: Determine multiple logical bit information corresponding to the request command.

[0105] In step 2, after receiving 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.

[0106] Optionally, the request command includes at least one field, each of which 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. In the case where the request command corresponds to multiple fields, the request command corresponds to multiple logical bit information. In addition, 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. For a logical bit 1, 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, wherein the first preset duration and the second preset duration are different. On this basis, since each logical bit contains both a high-level signal and a low-level signal, each logical bit is actually represented by a waveform signal (the conversion between the high and low level signals is presented as a waveform). Since the request command corresponds to multiple logical bit information, that is, it corresponds to multiple logical bits, the hardware interface signal corresponding to the request command is a waveform signal obtained by combining the waveform signals corresponding to each logical bit information.

[0107] Step 3: Generate a hardware interface signal corresponding to the request command according to the plurality of logic bit information and the timer.

[0108] Optionally, 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 resides, wherein the timer may at least provide a timing function and a counting function. This application utilizes the timing and counting functions of the timer, combined with multiple logic bit information, to generate a hardware interface signal corresponding to the request command.

[0109] It should be noted that, taking the BMC chip as an example and the PECI signal as the hardware interface signal, in the related art, in order to realize 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. In other words, in the related art, 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. In this 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.

[0110] Based on the above steps, in this embodiment, the first operating system is used to generate a hardware interface signal corresponding to the request command. First, the request command is obtained through the first operating system, and then multiple logical bit information corresponding to the request command is determined. Finally, the hardware interface signal corresponding to the request command is generated based on the multiple logical bit information and the timer.

[0111] From the above content, it can be seen that in this embodiment, 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 hardware interface signals using software, and then achieving the purpose of using the software system to generate hardware interface signals without the need for hardware logic design of the hardware interface signal of the chip. This can not only reduce the design difficulty of the chip, but also reduce the design cost of the chip.

[0112] Optionally, when a first request triggered by a second operating system is detected by the first operating system, 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 slower than that of the first operating system. Finally, the first operating system parses the request data to obtain a request command.

[0113] Optionally, before obtaining the requested data, 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.

[0114] In an optional embodiment, the first operating system may further receive response data corresponding to the hardware interface signal, wherein the transmission format of the response data is the same as the transmission format of the hardware interface signal. The first operating system may further adjust the data structure of the response data to a second data structure.

[0115] In addition, after the data structure of the response data is adjusted to the 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.

[0116] For example, the first operating system is an RTOS, the second operating system is Linux, and the hardware interface signal is a PECI signal. The command request process begins with the upper-layer application in the Linux system involved in PECI services (such as fault diagnosis and CPU temperature acquisition) proactively initiating PECI request commands as needed. These request commands include, but are not limited to, basic Ping() commands, commands for obtaining CPU temperature, and commands for reading MSR register information. The code implementation of different PECI request commands is completed by the corresponding interface functions.

[0117] Optionally, the Linux system writes the target address, read / write length, command code, and para parameter of each request command into the target memory according to the PECI protocol specification. After all the request data has been 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 (a software generated interrupt request, a communication interrupt request between processor cores).

[0118] It should be noted that, in the process of storing the requested data in the target memory through the second operating system, the second operating system stores the requested data in the target memory in the form of a first data structure, wherein the first data structure includes at least a device address, a write length, a read length, a command code, and a request parameter. The device address is used to represent 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 represent the number of bytes from the command code to the end of the request data. The read length is used to represent the number of bytes in the request data including the completion code and the read data. The request parameters are used to represent the parameters of the request command.

[0119] For the command response process, 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, the waveform changes between the high-level signal and the low-level signal in the hardware interface signal are identified to obtain the corresponding logical bit information, and the software signal data is obtained based on the logic information. The parsed response data is adjusted by the command parameter structuring module and written into the target memory. After all the parsed response data is written, the RTOS system triggers a 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-level application after processing. Among them, the second request can be an SGI interrupt request.

[0120] In addition to shared memory, the target memory may also be other memories, such as random access memory (RAM), flash memory, and the like.

[0121] In an optional embodiment, after generating a hardware interface signal corresponding to the request command according to the logic bit information and the timer, the first operating system may convert the voltage of the hardware interface signal to obtain a target hardware interface signal.

[0122] Optionally, the first operating system may input the hardware interface signal into a voltage conversion device to obtain a target hardware interface signal output by the voltage conversion device. The voltage conversion device may be a CPLD, and the CPLD may be connected to a target device, wherein the target device may be a CPU in a server. It should be noted that in addition to being applicable to generating PECI signals by replacing the PECI interface, the above-mentioned service may also be applied to other hardware interfaces.

[0123] As can be seen from the above, the first operating system and the second operating system of the combined embedded system realize data interaction in the embedded system through inter-core interrupts and shared memory. A waveform generation function module for request commands is constructed in the RTOS system, and hardware interface signal communication between the embedded system and external devices is realized through software simulation. In addition, 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. Since the hardware interface signals are generated by software simulation, more possibilities are provided for the optimized design between the communication function and other business functions in the embedded system. At the same time, since the controller specifically used to realize hardware interface signal communication is eliminated in the chip, the design cost and manufacturing cost of the chip can be reduced.

[0124] In an optional embodiment, the service running on the first operating system may include, but is not limited to, a serial port switching service. In this embodiment, a serial port switching process is provided, which includes the following steps:

[0125] 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.

[0126] Optionally, when the user initiates serial port switching, the second operating system can detect whether the serial port switching instruction initiated by the user is received. It should be noted that the serial port switching instruction needs to include information about 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.

[0127] In an optional embodiment, the format of the serial port switching instruction can be<switch_command_app-n number-t sleep_time> , switch_command_app represents the switching command program, -n represents the target serial port number for switching, the value of number can be 1, 2, or 3, -t represents the time after which the switching action is performed after the command is initiated, and sleep_time is in seconds.

[0128] It should be noted that, when implementing serial port switching, the currently available serial ports can be numbered so that when performing serial port switching later, the target serial port can be switched by the serial port number.

[0129] In an optional embodiment, 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, and correspondingly, 1 can represent the BMC Linux system serial port, 2 represents the server BIOS serial port, and 3 represents the SMART NIC serial port.

[0130] Step 2: Execute serial port switching according to the serial port switching instruction through the first operating system.

[0131] Optionally, upon detecting that the second operating system has received a serial port switching instruction, the second operating system immediately sends the serial port switching instruction to the first operating system. It should be noted that the first operating system and the second operating system can be run on two separate processor cores, and inter-core communication can be used between the first and second operating systems to help improve the reliability of signal transmission.

[0132] It should be noted that the first operating system responds to instructions much faster than the second operating system, so the first operating system can quickly respond to the serial port switching instruction and complete the switching work in a very short time.

[0133] In summary, the serial port switching software function is implemented by replacing the CPLD or FPGA with the first operating system and the second operating system running on the same processor. When 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, and the first operating system implements serial port switching according to the serial port switching instruction, avoiding the need in the related art to connect each serial port through the CPLD or FPGA, and then use the switch structure in the CPLD or FPGA to implement serial port switching, reducing hardware costs, and after the first operating system receives the serial port switching instruction, the serial port switching can be completed quickly in a very short time. Therefore, 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.

[0134] In order to enable the second operating system to implement serial port switching, in the serial port switching process provided in this embodiment, the serial port switching instruction includes at least: the serial port number of the target serial port. Before the serial port switching is executed by the first operating system according to the serial port switching instruction, 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.

[0135] 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.

[0136] In order to enable the first operating system to implement serial port switching, the first operating system may parse the serial port switching instruction, and then obtain the device corresponding to the target serial port.

[0137] In an optional embodiment, the parsing rules for serial port switching instructions can be customized according to the chip or server motherboard, and the parsing rules can be stored in a target memory, which can be a storage medium such as an electrically erasable programmable read-only memory (EEPROM) or non-volatile memory (Flash). It should be noted that the target memory can be deployed in the chip or not. Storing the parsing rules in the target memory improves data security, and the parsing rules can be customized according to the chip or server motherboard, which improves programmability and scalability.

[0138] After receiving the serial port switching instruction, the first operating system 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.

[0139] After obtaining the device corresponding to the serial port number, the first operating system can use the device's serial port address to map the target serial port to the chip's target output interface. After mapping the device's serial port address to the target output interface, the device can be accessed through the target output interface. It should be noted that the serial port switching instructions and parsing rules can be configured based on the chip model used and the types of the first and second operating systems.

[0140] In the serial port switching method provided in the first embodiment of the present application, 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.

[0141] Optionally, the aforementioned 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. For example, 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 maps the TX and RX data of different serial ports UART1, UART2, and UART3 to different address spaces in the BMC memory, that is, the serial port of each device is mapped to the chip's memory via the serial data bus. For example, the UART1 TX and RX buffers are the serial port addresses of serial port UART1, the UART2 TX and RX buffers are the serial port addresses of serial port UART2, and the UART3 TX and RX buffers are the serial port addresses of serial port UART3.

[0142] When the user issues a serial port switching command, the first operating system (RTOS) selects one of three different memory segments mapped by the UART and exchanges the data from one of these segments with the user, emulating the CPLD hardware serial port switching circuit. It should be noted that if the serial ports of different devices cannot be distinguished, developers cannot accurately locate the problematic serial port during maintenance. Therefore, serial port switching is necessary to locate the anomaly.

[0143] In this embodiment, after the target serial port is mapped to the target output interface of the chip according to the serial port address, if the target output interface is connected to the target smart network card, it includes: detecting through the smart network card whether an access request to the target serial port is received; if an access request to the target serial port is received, forwarding the access request to the target serial port through the smart network card.

[0144] Optionally, the target output interface of the chip can also be connected to a target smart network card. The smart network card then detects whether a user has received a request to access the target serial port. If so, the target smart network card can directly access the device's serial port, implementing SOL (Serial over LAN, a specification of data packet formats and protocols). These steps improve the efficiency of serial port access to the device.

[0145] In an optional embodiment, after mapping the target serial port to the target output interface of the chip according to the serial port address, 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.

[0146] The second operating system receives the execution result of the serial port switching instruction, wherein the execution result is sent by the first operating system to the second operating system and can be one of the following: serial port switching success or serial port switching failure. After the first operating system completes the serial port switching, it obtains the execution result of the serial port switching instruction and then feeds the execution result of the serial port switching instruction back to the second operating system, informing the second operating system of the success or failure of the serial port switching.

[0147] To improve the success rate of serial port switching, in this embodiment, after receiving the execution result of the serial port switching instruction via the second operating system, the method further includes: if the execution result is failure, repeatedly executing the step of sending the serial port switching instruction to the first operating system via the second operating system until the execution result is successful or the number of serial port switching executions exceeds a preset number. If the number of serial port switching executions exceeds the preset number, a prompt signal is triggered via the second operating system, wherein the prompt signal is used to indicate that the serial port switching has failed.

[0148] If the serial port switching instruction fails, the second operating system must repeat the step of sending the serial port switching instruction to the first operating system until the execution result is successful, or the number of serial port switching attempts exceeds a preset number, which can be set to three. If the number of serial port switching attempts exceeds the preset number, the corresponding second operating system triggers a prompt signal to indicate that the serial port switching failed, so that this situation can be handled promptly.

[0149] 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 based on 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.

[0150] 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.

[0151] After the second operating system is started, 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 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 based on the first signal to determine whether all serial ports are operating normally.

[0152] After the first operating system detects and obtains the detection result, the first processor core triggers a second interrupt to send the detection result to the second operating system via a second signal. The second operating system uses the detection result to determine the number of switchable serial ports (i.e., the number of serial ports that are operating normally) so that it can subsequently perform serial port switching on these serial ports. At the same time, in order to enable the first operating system to perform serial port switching more quickly, after the first operating system completes the detection, the first operating system begins to block and wait for the serial port switching instruction issued by the second operating system.

[0153] In an optional embodiment, the first operating system is RTOS, and when the second operating system is Linux, the first operating system runs on CPU0 and the second operating system runs on CPU1. The preparation steps before serial port switching include: when the Linux system on CPU1 starts to a specific stage, CPU1 will trigger an IPI interrupt to notify the RTOS system on CPU0 that Linux has started normally and can interact normally with the 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. Then CPU0 triggers another IPI interrupt to notify the Linux operating system on CPU1 that the RTOS system has been started. At the same time, the reported information includes the number of switchable serial ports owned by the RTOS operating system on CPU0. Then the RTOS operating system on CPU0 starts to block and wait for the switching instruction issued by the operating system on CPU1.

[0154] When an abnormality occurs in the operation of the second operating system, 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.

[0155] Because the second operating system runs many functions and handles a large amount of business, it may experience operational anomalies or require a restart. When the second operating system experiences an anomaly, a serial port switching instruction can be directly sent to the first operating system through the service terminal to ensure that the first operating system executes the serial port switching normally. It should be noted that the service terminal can be a terminal on the server where the chip is located.

[0156] Through the above steps, it is ensured that the first operating system does not rely on the second operating system to implement serial port switching, thereby improving the independence of the first operating system in executing serial port switching.

[0157] In summary, in the serial port switching process provided by this embodiment, 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. When 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, avoiding the use of hardware to implement serial port switching and reducing hardware costs. After the first operating system receives the serial port switching instruction, it can quickly complete the serial port switching 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.

[0158] Through this embodiment, by allocating the services to be allocated to the corresponding operating systems according to the service coupling degrees, the accuracy of service processing for multiple services with high service coupling degrees can be guaranteed.

[0159] In an exemplary embodiment, allocating a group of services to be allocated to corresponding operating systems in an embedded system according to a dynamic resource allocation rule includes:

[0160] S61: Allocate services to be allocated that contain sensitive information in a group of services to be allocated to a target operating system, wherein the target operating system is an operating system that interacts less frequently with a user object among the first operating system and the second operating system.

[0161] In this embodiment, for the to-be-assigned business containing sensitive data (for example, sensitive information such as passwords) (which may be an important sensitive business, such as a business that is not desired to be exposed to users), it can be assigned to the target operating system, and the to-be-assigned business containing sensitive information is isolated by the target operating system at a hard-core level of security protection. Here, the target operating system is the operating system with a low frequency of interaction with the user object between the first operating system and the second operating system, or the operating system with a fast response speed, for example, the first operating system.

[0162] For example, 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 (which do not want 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. Here, the different businesses divided by the business processing module can be organized in the form of structures during software implementation. By designing the security space between heterogeneous operating systems, sensitive businesses are unloaded from non-real-time operating systems to real-time operating systems, achieving the purpose of hard-core level security protection. Here, sensitive businesses refer to: security-related businesses, such as user passwords, identity information, and other businesses involving user personal privacy.

[0163] Here, the hard-core level refers to the isolation of services at the processor core level. Specifically, sensitive services are assigned to the real-time operating system (RTOSs occupy different cores than non-RTOSs, so this is considered core-level isolation). Compared to non-RTOSs, RTOSs interact with users less frequently and to a lesser degree, making it difficult for users to "detect" sensitive data generated by services running on them. For upper-layer applications, services such as user identity authentication management and secure encryption are considered these critical sensitive services. These services are forcibly classified as real-time services through the service management module. Subsequent dynamic allocation of hardware resources allows these services to run on the RTOS, achieving a secure isolation effect.

[0164] Through this embodiment, by allocating the to-be-assigned business containing sensitive information to an operating system with a low frequency of user interaction, the system business can be isolated for hard-core security protection, thereby improving the security of business execution.

[0165] In an exemplary embodiment, determining a resource allocation result corresponding to a group of services to be allocated includes:

[0166] S71 , generating a resource mapping table of a group of services to be allocated and processing resources of a processor according to allocation results of a group of services to be allocated and resource utilization of processing resources of the first operating system and resource utilization of processing resources of the second operating system.

[0167] In this embodiment, the allocation results for a set of pending services are used to indicate the correspondence between the pending services and operating systems. A pending service assigned to an operating system is typically executed using the processing resources of that operating system. However, if the volume of services assigned to a particular operating system is excessive and there are currently unallocated processing resources, the unallocated processing resources may be allocated to the pending services assigned to that operating system. Therefore, based on the allocation results for a set of pending services, 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 can be generated between a set of pending services and the processing resources of the processor, indicating the processing resources allocated to each pending service.

[0168] Here, each service to be assigned is mapped to only one processor core, while the same processor core can be mapped to multiple services. Different services can be mapped to the same processor core by occupying different time slices of the same processor core. At any given time, the same processor core is occupied by only one service, meaning it is used to execute only one service. Different services assigned to an operating system can determine the time slices they occupy on the same processor resource based on the allocation time, service response speed requirements, or other methods.

[0169] For example, the dynamic resource allocation module dynamically adjusts processor resources based on the output of the service management module, creating a resource mapping table between different services and actual hardware resources. This optimizes the deployment structure of different hardware resources under heterogeneous operating systems to improve overall system hardware resource utilization. This dynamic resource allocation process is managed and configured by software in the second operating system.

[0170] Taking an eight-core processor (core 1 to core 8) as an example, the processor cores scheduled to the first operating system include: core 1, and the processor cores scheduled to the second operating system include: core 2, core 3 and core 4. There are 6 services to be allocated, real-time services are services 1 and 2, and non-real-time services are services 3 to 6. 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.

[0171] Through this embodiment, based on the correspondence between services and operating systems, and in combination with the usage of processing resources of different operating systems, dynamic allocation of processing resources is performed, thereby ensuring the rationality of processing resource allocation.

[0172] In an exemplary embodiment, allocating processing resources of a processor to a first operating system and a second operating system according to an operating system corresponding to each to-be-allocated service and a resource allocation result includes:

[0173] S81 , when it is determined according to the resource allocation result that unallocated processing resources in the processor's processing resources have corresponding to services to be allocated, the unallocated processing resources are allocated to the operating system to which the services to be allocated corresponding to the unallocated processing resources are allocated.

[0174] When allocating processing resources, if there is a corresponding to-be-allocated business for the unallocated processing resources in the processor's processing resources, that is, the unallocated processing resources are allocated to the to-be-allocated business, the unallocated processing resources can be allocated to the operating system to which the to-be-allocated business corresponding to the unallocated processing resources is allocated.

[0175] Optionally, the resource adaptive scheduling module can perform actual scheduling of the processor's processing resources based on the results of the dynamic allocation of hardware resources. The resource adaptive scheduling module schedules a portion of the processor cores to execute services assigned to the first operating system, such as the M cores of core group 1 shown in Figure 4, and schedules the remaining processor cores to execute services assigned to the second operating system, such as the N cores of core group 2 shown in Figure 4.

[0176] Taking the aforementioned eight-core processor as an example, based on the service allocation and resource allocation results, unassigned core 4 can be assigned to the first operating system, and unassigned cores 5 and 6 can be assigned to the Linux system. The entire scheduling process can be led by the second operating system.

[0177] Through this embodiment, unallocated processor resources are scheduled to the corresponding operating system based on the resource allocation result, which can improve the utilization rate of the processor resources.

[0178] In an exemplary embodiment, the method further includes:

[0179] S91: Preempt and release processing resources between the first operating system and the second operating system.

[0180] In this embodiment, in addition to dynamically allocating processor resources based on the services to be allocated, during the operation of each operating system, processing resources can be preempted and released between the first operating system and the second operating system based on the usage status (load status) of the operating system's processing resources. Here, the dynamic allocation of processing resources can be based on a resource scheduling method executed by other control logic modules besides the first operating system and the second operating system, while the preemption and release of processing resources are resource scheduling methods actively initiated by the first operating system and the second operating system.

[0181] Optionally, the preemption and release of processing resources can be performed by a core preemption and release module, which can be a software module running on the first operating system and / or the second operating system. Taking the operation on the first operating system and the second operating system as an example, the core preemption and release module mainly completes the dynamic preemption and release of processor cores by heterogeneous operating systems during the real-time operation of the system to achieve the goal of maximizing processor resource utilization. The successful resource preemption of one operating system means the successful resource release of another operating system. Correspondingly, the failure of resource preemption of one operating system means the failure of resource release of another operating system. As shown in Figure 5, after core preemption and release, 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.

[0182] Here, 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.

[0183] Through this embodiment, by preempting and releasing processing resources between different operating systems, processing resources can be dynamically adjusted based on the load conditions of the operating system during its operation, thereby improving the rationality of resource utilization and, at the same time, improving the efficiency of business processing.

[0184] In an exemplary embodiment, preempting and releasing processing resources between a first operating system and a second operating system includes:

[0185] S101 , preempting and releasing processing resources between a first operating system and a second operating system through an inter-core communication interface.

[0186] In the related art, in which specialized acceleration hardware is used to execute services that require response speed, the communication bus rate between the processor and the acceleration hardware (e.g., the CPU and the FPGA / CPLD) is low, and the overall performance is not high. In this embodiment, 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 releasing processing resources to the other operating system through the inter-core communication interface to achieve the preemption or release of processing resources. Compared with the method of interacting through the communication bus, interacting through the inter-core communication interface inside the processor has a higher communication rate, thereby improving the overall performance of communication.

[0187] For example, 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. During the process of core preemption and release, the preempting party and the releasing party can inform each other of their respective states (such as busy or idle status) through the inter-core communication interface. At the same time, specific signal events are 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.

[0188] Optionally, the preemption and release of processing resources between different operating systems can be accomplished through inter-core interrupts, such as SGI (Software Generated Interrupt, software-triggered interrupt, inter-core interrupt in Linux system). One operating system can send a resource preemption request (e.g., core preemption request) or a resource release request (e.g., core release request) to another operating system through IPI (Inter Processor Interrupt, inter-processor interrupt) to request the preemption or release of processing resources. Taking the Linux system as an example, in the Linux system, inter-core communication can be achieved based on a custom interrupt vector table and interrupt events between heterogeneous operating systems. Here, IPI is an interrupt triggered between multiple cores in a SOC (System on Chip, also known as a system on chip). It is different from common peripheral interrupts, so the core can reserve some interrupt numbers specifically for IPI. On the ARM 64 architecture (a CPU architecture), these are 16 interrupt numbers 0-15.

[0189] Optionally, the preemption and release process depends on the real-time load 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 through 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 core preemption of the second operating system is successful, which also means that the core of the first operating system is successfully released.

[0190] It's important to note that the core preemption and release process is a dynamic, repetitive process. Each core preemption and release is accompanied by adjustments to the processor's 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 + NP. Furthermore, the core preemption and release process collaborates with modules such as load balancing policies, service management, and adaptive resource scheduling (for example, core adaptive scheduling) to determine the final core adjustment results.

[0191] Here, different modules jointly determining the core adjustment results means that when a system needs to seize more core resources, the ultimate success of the seizure is determined by modules such as the load balancing strategy, service management, and core adaptive adjustment. For example, in one possible scenario, when the second operating system needs more resources, and the first operating system is idle (dormant), the first operating system will soon wake up and run an important service thread, and this thread also requires a lot of resources to run. Therefore, the first operating system cannot release core resources to the second operating system. The criteria for judging the importance of the service in this process, as well as the final operation of not allocating resources to the second operating system, all involve the participation of modules such as the load balancing strategy, service management, and core adaptive adjustment. The strategies of these modules are open, which means that the final core adjustment result determined by them is also the result of the joint action of these strategies.

[0192] Through this embodiment, 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 communication performance.

[0193] In an exemplary embodiment, preempting and releasing processing resources between a first operating system and a second operating system through an inter-core communication interface includes:

[0194] S111, transmitting a first interaction request of the first operating system to the second operating system through an 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;

[0195] 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.

[0196] In this embodiment, considering that most of the services handled by the processor do not require high response speed, the first operating system typically handles a relatively small amount of services. Therefore, the first operating system can request, through the inter-core communication interface, to preempt the processing resources of the second operating system or proactively release the occupied processing resources to the second operating system. Optionally, the preemption and release of processing resources can be performed through a request-response interaction.

[0197] When it is necessary to preempt the processing resources of the second operating system or actively release processing resources to the second operating system, the first operating system can transmit a first interaction request of the first operating system to the second operating system via the inter-core communication interface, requesting a resource interaction with the second operating system, either resource preemption or resource release. After receiving the first interaction request, the second operating system can determine, based on its own load conditions, whether to allow the first operating system to occupy at least some of its processing resources or whether to accept the processing resources released by the first operating system, and return the first interaction response to the first operating system via the inter-core communication interface, thereby enabling the first operating system to interact with the second operating system based on the first interaction response.

[0198] It should be noted that the above-mentioned 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. When the actual scheduling of processing resources is carried out, the actual scheduling of processing resources is completed by the resource adaptive scheduling module.

[0199] Through this embodiment, 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.

[0200] In an exemplary embodiment, the method further includes:

[0201] S121, detecting resource utilization of processing resources of the first operating system;

[0202] 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 the inter-core communication interface.

[0203] In this embodiment, the process of preempting and releasing processing resources may depend on the real-time load of the heterogeneous operating systems. Different operating systems may run a load detection module for detecting the load of the system, which may be a system control module within the system. For a first operating system, a first system control module may run on it. 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 can 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.

[0204] 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 (reaching a specified utilization threshold), or if it is determined based on a pending business of an operating system that the future resource utilization of the operating system is too high (reaching a specified utilization threshold), it can be determined that the operating system needs to preempt the processing resources of another operating system (e.g., the second operating system). If the resource utilization is too low (below 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 step of transmitting the first interaction request to the second operating system through the inter-core communication interface can be triggered.

[0205] Through this embodiment, 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.

[0206] In an exemplary embodiment, the method further includes at least one of the following:

[0207] S131, when the resource utilization rate of the processing resources of the first operating system is greater than or equal to a first utilization rate threshold, determining that the first operating system is to preempt the processing resources of the second operating system;

[0208] 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.

[0209] In this embodiment, a threshold value of the resource utilization of the processing resources of the first operating system, i.e., the first utilization threshold value, 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 it needs to seize the processing resources of the second operating system to meet its own business needs.

[0210] Alternatively, because the first operating system has a higher response speed than the second operating system, it is typically used for certain specific services. However, the triggering of these specific services is somewhat random and the service frequency is generally low. Therefore, there is a certain probability that the processing resources of the first operating system are idle and there are no services to be executed by the first operating system. In this case, it can be determined that the first operating system will release at least some of its processing resources to the second operating system.

[0211] Here, when the processing resources of the first operating system are in an idle state, 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 on 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, the processing resources will not be released to the second operating system.

[0212] Through this embodiment, by preempting processing resources when their utilization is too high and releasing them when they are idle and there is no subsequent business to be processed, the rationality of resource scheduling can be improved and the utilization of processing resources can be improved.

[0213] In an exemplary embodiment, the method further includes:

[0214] S141 : When the first operating system has no service to be scheduled and no service to be allocated to the first operating system, control the first operating system to enter a dormant state.

[0215] In this embodiment, the first operating system may run periodically based on the processor; or the first operating system may run based on the processor in response to a received wake-up request; or the first operating system may run based on the processor based on the degree of compatibility between the current operating business generated on the processor and the first operating system. The first operating system may hibernate 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.

[0216] Optionally, if the first operating system has no business scheduling and no business to be allocated to the first operating system (for example, the resource occupancy rate of the first operating system is lower than or is about to be lower than its set lower limit of occupancy rate), the first operating system can be triggered to actively sleep, that is, actively enter the sleep state. Before controlling the first operating system to sleep, the core resources of the first operating system can first be released to the second operating system (the resource release can be performed through 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.

[0217] For example, when the first operating system has no task to schedule (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.

[0218] In an optional application scenario, the first operating system (for example, RTOS) is periodically awakened and runs, and the first operating system and the second operating system alternately occupy and schedule the same processing resource (which can be a processor core, for example, CPU core 0). The same processor resource can be the first processing resource, and correspondingly, the processing resource of the second operating system can be the second processing resource. During the time slice when the first operating system schedules the first processing resource, the second operating system generates an interrupt to take over the first processing resource at the first moment, causing the first operating system to have to sleep. At this time, the first operating system saves the scene in the stack and sleeps, and then releases the first processing resource to the second operating system to take over. After waiting for the second operating system to complete scheduling, an interrupt will be generated at the second moment for the first operating system to preempt the first processing resource to wake up the first operating system. From this moment on, the first operating system enters the round-robin mode to occupy and schedule the first processing resource.

[0219] In the above optional application scenario, during the time slice when the second operating system schedules the first processing resource, the first operating system is in a dormant state. At the third moment, 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. After processing the interrupt event reported by the hardware, it enters a dormant state again at the fourth moment. At this time, the first operating system reports the interrupt of releasing the first processing resource to the second operating system. The second operating system continues to schedule the first processing resource according to the set period and resumes the on-site running process.

[0220] Optionally, in this embodiment, when the first operating system is running periodically, the duration of a single operating cycle and the interval between two operating cycles may be the same or different. During the interval between two operating cycles, 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 operating cycle is the same as the interval between two operating cycles, the first operating system and the second operating system alternately occupy the processing resources allocated to the first operating system for the same duration. If the duration of a single operating cycle is different from the interval between two operating cycles, the first operating system and the second operating system alternately occupy the processing resources allocated to the first operating system for different durations. 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.

[0221] In an optional embodiment, taking the device triggering the first operating system to wake up and run as an example, a wake-up strategy for the first operating system (such as RTOS) in a trigger mode is provided. 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. When the first operating system is in a dormant state, it is assumed that at a certain moment device 0 triggers an interrupt to the first operating system, and the first operating system is immediately awakened. After awakening, the first operating system first triggers an interrupt to preempt the first processing resource to the second operating system. After receiving the interrupt, 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, and will not be repeated here.

[0222] Through this embodiment, when all processing resources (e.g., 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.

[0223] In an exemplary embodiment, 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:

[0224] S151, transmitting a first preemption request having an interrupt number of the first interrupt number to the second operating system through an inter-core communication interface, wherein the first preemption request is used to request to preempt processing resources of the second operating system;

[0225] S152: 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 resource release system to the second operating system.

[0226] In this embodiment, 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. Among them, 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.

[0227] As an optional implementation, the first interaction request can be a first preemption request, that is, a request for preempting the processing resources of the second operating system. The first operating system can 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, that is, 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 meaning of this inter-core communication interrupt is that the first operating system preempts the processing resources of the second operating system.

[0228] As another optional implementation, 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 meaning of this inter-core communication interrupt is that the first operating system actively releases the processing resources to the second operating system.

[0229] Through this embodiment, by allocating interrupt numbers for preempting and actively releasing processing resources between different operating systems, resource scheduling between operating systems is performed through inter-core communication interrupts, thereby improving the accuracy of resource scheduling.

[0230] In an exemplary embodiment, preempting and releasing processing resources between a first operating system and a second operating system through an inter-core communication interface includes:

[0231] S161, transmitting 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 preempt processing resources of the first operating system;

[0232] 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.

[0233] In this embodiment, the second operating system can request to preempt the processing resources of the first operating system through the inter-core communication interface, considering that most of the services processed by the processor do not require high service response speed. Accordingly, the second operating system usually handles a large amount of services. Optionally, the preemption of processing resources can be performed through a request-response interaction.

[0234] When it is necessary to preempt the processing resources of the first operating system, the second operating system may transmit a second interaction request of the second operating system to the first operating system via the inter-core communication interface, requesting resource interaction with the first operating system for the purpose of resource preemption. After receiving the second interaction request, the first operating system may determine whether to allow the second operating system to occupy at least part of its processing resources based on its own load, and return a second interaction response to the second operating system via the inter-core communication interface, thereby allowing the second operating system to interact with the first operating system for resources based on the second interaction response.

[0235] It should be noted that the above-mentioned 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. When the actual scheduling of processing resources is carried out, the actual scheduling of processing resources is completed by the resource adaptive scheduling module.

[0236] Through this embodiment, resource interaction between different operating systems is performed in a request-response manner, which can improve the utilization rate of processing resources and, at the same time, improve the response speed of business processing.

[0237] In an exemplary embodiment, the method further includes:

[0238] S171, detecting resource utilization of processing resources of the second operating system;

[0239] 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.

[0240] In this embodiment, the preemption process of processing resources may depend on the real-time load of the heterogeneous operating systems. Different operating systems may run a load detection module for detecting the load of the system, which may be part of the system control module within the system. A second operating system may run a second system control module. The load detection module in the system control module may detect the resource utilization of the processing resources of the second operating system. The resource utilization of the processing resources of the second operating system can be used to indicate the load of the second 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.

[0241] Based on the resource utilization of the processing resources of 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 (reaching a specified utilization threshold) or if future resource utilization is determined to be too high (reaching a specified utilization threshold) based on the pending business, it can be determined that the second operating system needs to preempt the processing resources of the first operating system. If it is determined that the second operating system needs to interact with the first operating system for resources, the step of transmitting the second interaction request to the first operating system via the inter-core communication interface can be triggered.

[0242] Through this embodiment, 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.

[0243] In an exemplary embodiment, the method further includes at least one of the following:

[0244] S181, when the current resource utilization rate of the second operating system is greater than or equal to a second utilization rate threshold, determining that the second operating system is to preempt the processing resources of the second operating system;

[0245] S182: When it is determined based on the executing services and pending services of the second operating system that the resource utilization of the processing resources of the second operating system is greater than or equal to a third utilization threshold, determine that the second operating system is to preempt the processing resources of the second operating system.

[0246] In this embodiment, taking into account the complexity of business processing, there may be a coupling relationship between businesses, and the importance of a business affects the operating system to which it is allowed to be allocated. In addition, there may also be differences in the priority processing levels between different businesses. The second operating system can comprehensively consider factors such as its own resource utilization, its to-be-allocated businesses, and its to-be-executed businesses to determine whether it needs to preempt the processing resources of the first operating system.

[0247] As an optional implementation, 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 current load of the second operating system is too heavy and it needs to seize the processing resources of the first operating system to meet its own business needs.

[0248] As another optional implementation, in addition to the currently executing business, the second operating system also needs to process the business that has been assigned to the second operating system. Therefore, 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 based on the executing business of the second operating system and the pending business of the second operating system that the resource utilization of the processing resources of the second operating system is greater than or equal to the third utilization threshold, 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.

[0249] In addition, in addition to executing the allocated business (which may include the currently executing business and the allocated business), 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. If the current resource utilization rate of the processing resources of the second operating system is greater than or equal to the fourth utilization threshold, and the business coupling degree between the newly added business to be allocated and the allocated business of the second operating system is greater than or equal to the third coupling threshold, it can be determined that 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.

[0250] Optionally, 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. In this embodiment, there is no limitation on the various utilization thresholds.

[0251] Through this embodiment, 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.

[0252] In an exemplary embodiment, the method further includes:

[0253] S191, determining 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;

[0254] 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.

[0255] If the first operating system is currently idle and has no assigned services to execute, or no pending services that must be assigned to the first operating system, the first operating system can directly determine whether to allow the second operating system to preempt its processing resources. If the first operating system is currently processing services, has assigned services to execute, or has pending services that must be assigned to the first operating system, the first operating system will determine whether to allow the second operating system to occupy the first operating system's processing resources based on factors such as the service priority of the aforementioned services.

[0256] Optionally, if the service priority of the first operating system's currently executing service is not lower than the service priority of the second operating system's pending service, indicating that the urgency of the service being executed by the first operating system is not lower than the urgency of the service being executed by the second operating system, the first operating system denies the second operating system from preempting the first operating system's processing resources. If, on the other hand, the service priority of the first operating system's currently executing service is lower than the service priority of the pending service, indicating that the urgency of the first operating system's currently executing service is lower than the urgency of the service being executed by the second operating system, the first operating system determines that it allows the second operating system to preempt the first operating system's processing resources.

[0257] Here, although the response speed of the first operating system is higher than that of the second operating system, usually the business with a higher business priority will be allocated to the first operating system first. However, considering the coupling relationship between the businesses, the business with a higher business priority may also be allocated to the second operating system. Therefore, when preempting resources, judgment can be made based on the business priority. It can also be considered that the business priority of the business being executed and the business to be executed in the first operating system is not lower than the business priority of the business to be executed in the second operating system, before allowing the preemption of processing resources.

[0258] Through this embodiment, the processing resources between operating systems are scheduled by integrating factors such as service priority, which can improve the flexibility and rationality of resource scheduling.

[0259] In an exemplary embodiment, transmitting the second interaction request of the second operating system to the first operating system through the inter-core communication interface includes:

[0260] S201 : Transmitting a second preemption request with a third interrupt number to a first operating system through an inter-core communication interface, wherein the second preemption request is used to request to preempt processing resources of the first operating system.

[0261] In this embodiment, similar to the aforementioned embodiment, 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.

[0262] Optionally, the second interaction request can be a second preemption request, that is, in a request to preempt the processing resources of the first operating system, the second operating system can transmit the second preemption request with the interrupt number of the 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 of the third interrupt number is the second operating system, and the response source is the first operating system. The meaning of this inter-core communication interruption is that the second operating system preempts the processing resources of the first operating system.

[0263] Through this embodiment, by allocating interrupt numbers for preempting processing resources between different operating systems, resource scheduling between operating systems is performed through inter-core communication interrupts, thereby improving the accuracy of resource scheduling.

[0264] In an exemplary embodiment, obtaining, through the inter-core communication interface, a second interaction response returned by the first operating system in response to the second interaction request includes at least one of the following:

[0265] S211, transmitting a resource release permission response with the fourth interrupt number to the second operating system through the 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 the processing resources of the first operating system;

[0266] S212: Transmitting a resource release rejection response with the interrupt number being 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.

[0267] In this embodiment, similar to the aforementioned embodiment, 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.

[0268] As an optional implementation, if the first operating system determines to allow the second operating system to occupy at least part of its processing resources, the first operating system can transmit the resource release permission response with the 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 the interrupt number being the fourth interrupt number is the first operating system, and the response source is the second operating system. The meaning of this inter-core communication interrupt is that the first operating system passively releases processing resources to the second operating system.

[0269] As another optional implementation, if the first operating system determines to refuse the second operating system to occupy its processing resources, the first operating system can 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. This inter-core communication interrupt means that the first operating system refuses to release processing resources to the second operating system.

[0270] Through this embodiment, by allocating interrupt numbers for allowing and refusing to preempt processing resources between different operating systems, resource scheduling between operating systems is performed through inter-core communication interrupts, thereby improving the accuracy of resource scheduling.

[0271] As an optional example, the following uses RTOS system and Linux system as examples to explain the inter-core communication interrupt. In the Linux system, inter-core communication can be achieved based on a customized 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. In a multi-core heterogeneous operating system, in order to maximize compatibility with the current resource allocation method, numbers 8-15 (a total of 8 interrupts) are used to represent the inter-core interrupt vector table. A feasible allocation scheme for the vector table is shown in Table 1:

[0272] Table 1

[0273] Among them, 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, and the aforementioned fifth interrupt number corresponds to interrupt number 11.

[0274] As shown in Table 1, active release means: when the RTOS system has no business to schedule (i.e., it is in an idle state), it sends an SGI interrupt with interrupt number 8 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, it sends an SGI interrupt with interrupt number 9 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. If the priority is higher than interrupt 9, it cannot be interrupted, but if it is lower, it can be interrupted), the RTOS system will send an SGI interrupt with interrupt number 10 to the Linux system and passively release the occupied CPU core resources for the Linux system to schedule. 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 interrupt number 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.

[0275] It should be noted that the inter-core communication vector table is not unique and is not limited to the inter-core communication vector table defined in Table 1 above.

[0276] In an optional embodiment, a method for inter-core communication is provided. The method includes the following steps:

[0277] Step 1: The first operating system sends target data (which may be service data) to a target virtual channel (which may be storage space) in the processor memory.

[0278] Optionally, the target data is data to be sent, the target virtual channel is a free storage space in the memory, and 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.

[0279] 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. Optionally, 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, which is used to notify the second operating system to obtain target data from the target virtual channel. The interrupt notification message may be triggered by software or hardware.

[0280] In step 3, the second operating system responds to the interrupt notification message and retrieves the target data from the target virtual channel in memory. Optionally, 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, locates the target virtual channel in memory based on the parsed address, and retrieves the target data from the target virtual channel, thereby enabling data exchange between the first operating system and the second operating system.

[0281] Through the above steps, when multiple operating systems running on the processor need to transmit data to each other, the first operating system sending the 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, which solves the problem of waste of resources and strong dependence on the operating system in the inter-core communication process, and achieves the effect of reducing the waste of resources and dependence on the operating system in the inter-core communication process.

[0282] In an exemplary embodiment, 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.

[0283] Optionally, the target virtual channel is composed of one or more storage units in the data storage area, and 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 idle flag.

[0284] In an exemplary embodiment, the first operating system sends target data to a target virtual channel in the processor memory, including: the first operating 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 based on the read records, and obtains the 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.

[0285] It should be noted that in order to ensure that the target data can be written continuously into the memory, the target virtual channel to be written needs to be idle 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 the idle storage unit that can meet the data storage requirements.

[0286] For example, the size of each storage unit is equal. If the length of the target data is greater than the length of a storage space, the number of required storage units 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.

[0287] For another example, each storage unit is of equal size, 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. It should be noted that when the system software needs to apply for shared memory space, it will determine whether the length of the data to be applied for is greater than the maximum length of the data stored in the virtual channel. If it is greater than the maximum length of the data stored in the virtual channel, the system software can send the data to be sent in multiple times to ensure that the length of the data sent each time is less than or equal to the maximum length of the data stored in the virtual channel, thereby ensuring smooth communication.

[0288] In an exemplary embodiment, 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 reads a record in the metadata storage area, 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.

[0289] That is, after extracting target data from the storage unit corresponding to the target virtual channel, the second operating system sets the state of the storage unit corresponding to the target virtual channel to an idle state in order not to affect the use of the target virtual channel by other systems or tasks.

[0290] In an exemplary embodiment, 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.

[0291] Optionally, both the real-time operating system and the non-real-time operating system have a driver layer. After the driver layer receives the target data to be sent, it calls the interface to search for the target virtual channel in the memory. To avoid other systems applying to use the target virtual channel during the data writing process, after finding the target virtual channel, the state of the target virtual channel is set to occupied, and then the target data is written to the target virtual channel.

[0292] In an exemplary embodiment, 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.

[0293] Optionally, the application layer fills the data to be sent according to the preset format to obtain the target data, and then generates a device file ipidev in the system's / dev path. When the application layer needs to read and write data from the driver layer, it can first use the system's own open function to open the device file / dev / ipidev, and then use the system's own write function to send the target data from the application layer to the driver layer. The driver layer then places 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.

[0294] In an exemplary embodiment, 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.

[0295] In an exemplary embodiment, 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.

[0296] Optionally, the interrupt processing function sends a task notification to wake up the target task responsible for data extraction. The target task first searches for the target virtual channel in the shared memory by calling the interface, and then reads the target data from the target virtual channel and performs data parsing.

[0297] In an exemplary embodiment, when the second operating system includes an application layer, 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 the 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 in 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.

[0298] Optionally, after the second application system receives the interrupt notification message, the application layer calls the corresponding interrupt handling 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. When the application layer needs to read and write data from the driver layer, it can first use the system's own open function to open the device file / dev / ipidev, and then use the system's own 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. In an exemplary embodiment, the state of the target virtual channel is set to idle.

[0299] It should be noted that different applications in the application layer can use the target data to implement different functions. Function identifiers are stored in the memory to indicate the target functions implemented by the application through the target data. Optionally, the function identifier can be Net or Cmd. When the system is initialized, Net, Cmd and the application PID will be registered to the driver. 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.

[0300] For example, if NetFn=1 and Cmd=1, the first and second operating systems send "hello word" messages to each other. At system startup, an array is initialized with three columns: NetFn in the first column, Cmd in the second column, and the corresponding processing functions for NetFn and Cmd in the third column, denoted as xxCmdHandler. For example, when the second operating system receives a message from the first operating system, it obtains NetFn and Cmd from the message, determines that NetFn=1 and Cmd=1, and executes the processing function HelloCmdHandler corresponding to "hello word" to complete the corresponding function.

[0301] In an exemplary embodiment, 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 includes at least a channel ID of the memory channel, the size of the memory channel, and the occupied status 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 the 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.

[0302] It should be noted that 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. The following structure is set as metadata to manage the memory channels:

[0303] typedef struct{

[0304] uint32_t Flag;

[0305] uint16_t ChannelId;

[0306] uint8_t SrcId;

[0307] uint8_t NetFn;

[0308] uint8_t Cmd;

[0309] uint32_t Len;

[0310] uint32_t ChannelSize;

[0311] uint8_t* pData;

[0312] uint8_t CheckSum;

[0313] }IpiHeader_T

[0314] Among them, uint32_t Flag represents the status of the memory channel. For example, 0xA5A5A5A5 indicates 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, which 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 is the starting address of the memory channel; uint8_t CheckSum is a checksum. When the first operating system needs to send data, it calculates a checksum value for the sent data using a checksum algorithm and sends the checksum value to the second operating system. When the second operating system receives the data and the checksum value, it calculates a checksum value based on the received data using the same checksum algorithm and compares the calculated checksum value with the received checksum value. If they are consistent, the received data is valid. If they are inconsistent, the received data is invalid. Each virtual memory channel corresponds to a structure record, which is stored at the beginning of the shared memory in ascending order of channel ID. These structure records are initialized after the system is powered on. The initialization Flag is 0, indicating 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, and the initialization pData points to the first address of the corresponding virtual memory channel.

[0315] In an exemplary embodiment, when determining the target virtual 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 based on 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). After finding the target virtual channel that meets the above conditions, the state of the channel is set to non-empty, that is, the idle flag Flag in the channel structure IpiHeader is set to 0xA5A5A5A5, and then the target data is copied to the target virtual channel.

[0316] In an exemplary embodiment, 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. The second operating system reads the records in the metadata storage area, and determines the target virtual channel based on the read records, including: traversing the records stored in the metadata storage area, and judging 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.

[0317] That is, the target virtual channel is a 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).

[0318] It should be noted that if a 1-bit idle flag is used, 0 indicates channel empty, and 1 indicates channel not empty, if the flag is originally 0 and then suddenly changes to 1, the system will believe the channel is not empty after reading the flag, resulting in communication anomalies. In this embodiment, the idle flag is set to a multi-bit special character, for example, 0xA5A5A5A5. Since the probability of multiple bits simultaneously changing to special characters is much lower than the probability of a single bit changing, this prevents storage medium bit changes from affecting the flag value, thereby improving communication security.

[0319] In an exemplary embodiment, a metadata storage area stores a state mapping table, wherein the state mapping table contains multiple records, each record being used to record the occupied status of a storage unit. A first operating system reads the records in the metadata storage area, and determines, based on the read records, 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, to obtain a target virtual channel, comprising: 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.

[0320] It should be noted that in order to facilitate data storage and retrieval, since the operating system needs to occupy continuous storage units in the memory when transferring business data, it is necessary to first determine the number of storage units in the memory request instruction. Since the memory space of each storage unit is the same, the preset number of continuous storage units required can be calculated according to the required memory space size, which is recorded as numb.

[0321] Optionally, the first operating system traverses the records from the index position in the state mapping table, where the index position may be the starting position of the state mapping table. Starting from 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.

[0322] In an exemplary embodiment, 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 of continuous storage units minus one are determined as the target virtual channel.

[0323] Optionally, the continuous storage unit refers to a number of continuous storage units equal to numb, and each record in the status mapping table also records the first address of the corresponding storage unit. When the second operating system scans a record of the first address of a number of continuous storage units equal to numb in the mapping table, it indicates that the first address of the target virtual channel has been scanned. The storage unit indicated by the first address and the 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.

[0324] In an exemplary embodiment, the scanned continuous target records are recorded by a counter. In the process of scanning each record in sequence from the initial position of the state mapping table according to the number of storage units, when the target record is currently scanned, the control counter is increased by one, and when the non-target record is currently scanned, the control counter is cleared.

[0325] Optionally, 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. Optionally, the count of the counter is recorded as cntr. If a scanned storage unit is empty, cntr is added by 1. 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 starts 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, there is no cntr 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.

[0326] In an exemplary embodiment, before the first operating system reads records in the metadata storage area and determines, based on the read records, 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, and obtains the target virtual channel, the method further 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 request the use of the processor's memory; and when the memory is successfully locked, reads the records in the status mapping table.

[0327] Optionally, 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. It should be noted that in order to prevent application conflicts caused by multiple operating systems applying to use the processor's memory at the same time, when the operating system sends the memory request 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 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.

[0328] In an exemplary embodiment, 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 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.

[0329] Before the processor runs, the metadata storage area and the data storage area in the processor need to be initialized. Optionally, the records stored in the state mapping table in the metadata storage area are initialized, and the memory management information is initialized.

[0330] Before applying for memory, configure the memory management information as follows:

[0331] typedef struct{

[0332] uint32_t MemReady;

[0333] uint32_t MemLock;

[0334] }MallocMemInfo_T;

[0335] Among them, the member variable MemLock of the structure MallocMemInfo_T indicates whether the shared memory has been initialized. The variable MemReady is 0xA5A5A5A5, indicating that the initialization operation is completed and the memory can be dynamically allocated and released normally. The member variable MemReady of the structure MallocMemInfo_T indicates whether it is locked.

[0336] Alternatively, if the variable MemLock is read as 0, it indicates that no system or task is currently requesting memory, meaning the memory is not currently locked. If the variable MemLock is read as 0xA5A5A5A5, it indicates that a system or task is currently requesting memory and needs to wait until the current request is completed before retrying. The current lock request has failed.

[0337] In an exemplary embodiment, if a lock fails during a memory lock operation, the memory lock is applied again after waiting for a preset time until the lock is successful. For example, the preset time may be 100 microseconds.

[0338] In one exemplary embodiment, if a lock request fails and the number of repeated requests exceeds a preset number, indicating that the memory in the processor is unallocatable during the current time period, the request is terminated. For example, the preset number of times may be three. If the number of lock requests exceeds three, a message indicating that the current memory is unavailable may be returned to the operating system that sent the request.

[0339] Optionally, after a target virtual channel exists in the memory space of the processor for use by the first operating system, the first operating system stores the target data to be transmitted in the corresponding target virtual channel. In an exemplary embodiment, 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. At the same time, in order to allow other systems or tasks to apply for memory, the lock on the memory is released.

[0340] In an exemplary embodiment, the method further includes: releasing the lock on the memory when a preset number of consecutive target records are not scanned.

[0341] Optionally, after scanning the records in the status mapping table, no preset number of continuous storage units in the idle state are detected, indicating that there is not enough space memory pages in the processor's memory for the first operating system to use. This dynamic memory application fails and the memory lock is released.

[0342] In an exemplary embodiment, an interrupt notification message is sent to the second operating system via a software interrupt. Optionally, sending the interrupt notification message to the second operating system via 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 the interrupt notification message based on the interrupt number and the ID of the CPU core of the second operating system.

[0343] Optionally, a soft interrupt is a software-generated interrupt. Software can send an interrupt to its own CPU core or to other CPU cores. The default 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.

[0344] Optionally, a hardware interrupt refers to an interrupt generated by a hardware device, which can be a private peripheral interrupt or a shared peripheral interrupt. It should be noted that 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.

[0345] In an optional embodiment, a method for sharing memory is provided. The method comprises the following steps:

[0346] Step 1: Receive a memory application instruction and perform a locking operation on the processor's memory, wherein the memory application instruction is used to apply for use of the processor's memory.

[0347] Optionally, 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, which may be sent by the first operating system. It should be noted that in order to prevent application conflicts caused by multiple operating systems applying to use the processor's memory at the same time, when the operating system sends the memory request 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 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.

[0348] In the shared memory method provided in an embodiment of the present application, 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 indicates 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.

[0349] Optionally, since multiple systems or multiple tasks will cause application conflicts when applying for memory use at the same time, the processor's memory can only be locked by one system or task in the same time period. Therefore, the current operating system can only perform a locking operation on the memory when it detects that the current memory is not in a locked state.

[0350] Optionally, whether the memory is in a locked state is determined by determining whether the 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.

[0351] In 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.

[0352] Optionally, if locking fails during the memory locking operation, the memory locking is applied for again after waiting for a preset time until the locking is successful. For example, the preset time may be 100 microseconds.

[0353] In one exemplary embodiment, if a lock request fails and the number of repeated requests exceeds a preset number, indicating that the memory in the processor is unallocatable during the current time period, the request is terminated. For example, the preset number of times may be three. If the number of lock requests exceeds three, a message indicating that the current memory is unavailable may be returned to the operating system that sent the request.

[0354] Step 2, when the memory is locked successfully, read the memory occupied status, and determine whether there is free target memory space in the memory according to the memory occupied status, 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.

[0355] After successfully applying for a lock, the operating system applies for memory in the processor. Optionally, based on the memory request instruction issued by the operating system, the operating system scans information recording the memory usage status to determine whether the target memory space exists. In other words, it determines whether there is unoccupied, continuous memory space in the processor that can meet the memory usage requirement. Meeting the memory usage requirement means that the size of the memory space is greater than or equal to the memory size requested by the operating system. In one exemplary embodiment, the determination result is obtained by determining whether the size of the unoccupied, continuous memory space is greater than or equal to the memory size requested by the operating system.

[0356] It should be noted that discontinuous memory space can also be used when applying for memory. A pointer can be added after a non-minimum memory block to point to the next minimum memory block obtained by the application. At the same time, when reading and writing data, data can be read and written across data blocks based on the storage address and pointer. This embodiment does not limit the form of the target memory space.

[0357] In step 3, if 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 request instruction, the memory occupation status is updated, and the memory lock is released. Here, the sender refers to the operating system (e.g., the first operating system) that sends the memory request instruction. It should be noted that since the operating system sends and receives data through shared memory during inter-core communication and uses the address returned by the requested memory to access data during the data transmission and reception process, it is necessary to determine the address information of the requested memory space.

[0358] Optionally, after there is a target memory space available for the operating system in the processor's memory space (which may be indicated by the above-mentioned judgment result), the address information of the target continuous space is sent to the operating system, and the operating system stores the data to be transferred in the corresponding memory space according to the address information.

[0359] In an exemplary embodiment, 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.

[0360] The above steps can solve the problems of low efficiency, poor flexibility and excessive dependence on the operating system of shared memory among multiple cores, thereby improving the flexibility and efficiency of shared memory and reducing dependence on the operating system.

[0361] In the shared memory method, 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, including: reading the record 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 record in the state mapping table.

[0362] The occupied state of the memory is queried by querying the records in the state mapping table. Optionally, the metadata storage area stored in the processor is obtained, 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 continuous, idle memory space in the data storage area that meets the memory usage requirements.

[0363] In the shared memory method provided in an embodiment of the present application, 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 whether there is a target memory space in the data storage area is judged according to the records in the status mapping table, including: determining a preset number of memory pages requested by the memory request instruction; scanning each record in sequence from the 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.

[0364] It should be noted that 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. For example, the memory space of the data storage area is A bytes, and the divided allocation unit is B bytes. Then 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.

[0365] Figure 6 is a schematic diagram of the relationship between the status mapping table and memory pages in the shared memory method according to an embodiment of the present application. As shown in Figure 6, the data storage area is a dynamically allocated memory block area, and 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 records are recorded as memory page records, and all memory page records are combined into a status mapping table. There is a one-to-one correspondence between all memory page records in the status mapping table and all memory pages in the data storage area. Each memory page record represents the allocation status of the corresponding memory page, that is, whether the memory page is occupied.

[0366] Optionally, since 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 required consecutive memory pages can be calculated based on the required memory space size, which is recorded as numb.

[0367] In an exemplary embodiment, after obtaining the state mapping table in the metadata storage area of ​​the processor, the memory page records are traversed from the index position in the state mapping table. The index position can be the starting position of the state mapping table. Starting from the starting position of the state mapping table, each memory page record of the state mapping table is queried in turn to determine whether there are continuous memory page records with a number of free memory pages greater than or equal to numb. If there are memory page records that meet the above conditions, the correspondence between the memory page records and the memory pages is used to determine whether the target memory space exists in the processor.

[0368] In the shared memory method provided in an embodiment of the present application, after scanning each record in sequence from the initial position of the status mapping table, the method also includes: after scanning all records in the status mapping table and there are no consecutive preset number of target records, determining that there is no target memory space in the memory.

[0369] Optionally, starting from the starting position of the state mapping table, query the memory page records 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.

[0370] In the shared memory method provided in an embodiment of the present application, the number of scanned target records is recorded by a counter. In the process of scanning each record in sequence from the initial position of the state mapping table, when the target record is currently scanned, the control counter is added by one. When the non-target record is currently scanned, the control counter is cleared to zero, wherein the non-target record indicates that the memory page is in an occupied state.

[0371] Optionally, by utilizing the relationship between the value of the counter and the number of required memory pages, it is determined whether there are a continuous preset number of target records, that is, whether there is a target memory space. Optionally, the count of the counter is recorded as cntr. If a scanned memory page is empty, cntr is incremented by 1. If the scanned memory page is not empty, the accumulated number of continuous, idle memory pages cntr is cleared to zero, and the search for continuous empty memory pages continues from the address after the memory page; until cntr is equal to numb, it means that continuous, idle memory pages that meet the memory requirements have been found; if cntr is less than numb in 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.

[0372] In the shared memory method provided in an embodiment of the present application, when the initial position is the last position in the state mapping table, the address information of the target memory space is fed back to the sending end 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 sending end.

[0373] Optionally, when scanning the state mapping table, 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. When 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.

[0374] In an exemplary embodiment, the address is fed back to the operating system that issues the memory request instruction, and the operating system performs a data write operation on the memory according to the address information.

[0375] In the shared memory method provided in an embodiment of the present application, the initial position is the first position in the state mapping table, and the address information of the target memory space is fed back to the sender of the memory request 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.

[0376] Optionally, when the scanning method is to scan from the first position of the status mapping table, when 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.

[0377] In the shared memory method provided in the embodiment of the present application, in the process of sequentially scanning each record from the initial position of the state mapping table, the first target record in the scanned continuous target records is stored through a preset variable.

[0378] Optionally, 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. Each time a free, continuous memory page is scanned, the value cntr displayed by the counter is increased by 1. When the value cntr displayed by the counter is greater than or equal to the preset number numb, the address information currently stored in offset is used as the address of the first target record.

[0379] In the shared memory method provided in an embodiment of the present application, after reading the occupied status of the memory and determining whether there is free target memory space in the memory based on the occupied status of the memory, the method also includes: releasing the lock on the memory if there is no free target memory space in the memory.

[0380] Optionally, after scanning the memory page records in the status mapping table, if it is detected that the memory does not contain a preset number of continuous and free memory pages, that is, does not contain the target memory space, it indicates that there is not enough space in the processor's memory for the operating system to use the memory page, the dynamic memory request fails, and the memory lock is released.

[0381] In the shared memory method provided in an embodiment of the present application, 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 contains preset information, wherein the preset information indicates that the memory is in a locked state; if the memory management information contains the preset information, determining that the memory is not currently in a locked state; if the memory management information does not contain the preset information, determining that the memory is currently in a locked state.

[0382] To determine whether the processor's memory is in a locked state, it is necessary to use the memory management information in the metadata storage area to make a judgment. Optionally, when the memory management information of the metadata storage area is obtained, it is used to determine whether the memory management information contains preset information, wherein the preset information is used to indicate 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.

[0383] In the shared memory method provided in an embodiment of the present application, 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. 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.

[0384] Before the embedded system runs, the metadata storage area and data storage area in the processor need to be initialized. Optionally, the memory page records stored in the state mapping table in the metadata storage area are initialized, and the memory management information is initialized.

[0385] Optionally, 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.

[0386] In the shared memory method provided in the embodiment of the present application, 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 the occupied state.

[0387] Optionally, when the operating system needs to occupy the target memory space, the memory page records in the state mapping table area of ​​the metadata storage area are updated by identifying the address information of multiple memory pages of the target memory space according to the correspondence between the memory pages and the memory page records, so that the memory page records are changed from an unoccupied state to an occupied state. Furthermore, the occupation state of the processor's memory space is updated based on the data written by 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 request is released.

[0388] Optionally, 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; 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.

[0389] Here, after successfully requesting memory, the first operating system stores the target data value to be transferred in the target memory space and sends the address information of the target memory space to the second operating system cooperating with the first operating system, instructing the second operating system to retrieve the data. Optionally, after receiving the address information of the target memory space, the second operating system issues a data retrieval instruction. The embedded system receives the instruction and sends the target data stored in the target memory space to the second operating system.

[0390] Through the above steps, 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 free target memory space in the memory based on 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; 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, thereby solving the problems of low utilization efficiency, poor flexibility and over-reliance on the operating system of shared memory among multiple cores, thereby improving the flexibility and utilization efficiency of shared memory and reducing the dependence on the operating system.

[0391] In an exemplary embodiment, 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.

[0392] When using shared memory to send and receive data between cores, the address returned by dynamically requested memory is used. However, different systems may use different address systems. For example, a real-time operating system is the first operating system, and a non-real-time operating system is the second operating system. In a real-time operating system, physical addresses can be used directly to access shared memory, but in a non-real-time operating system, physical addresses cannot be used directly to access shared memory. Therefore, a mapped virtual address is required. After the second operating system receives the address information of the target memory space, it converts it using the address information offset, maps it to a virtual address, and performs operations based on the virtual address. Optionally, the shared memory virtual base address vBase in a 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 in a real-time operating system (i.e., 0x96000000).

[0393] The address returned by dynamically allocated memory in a non-real-time operating system is also the virtual address vData. In a non-real-time operating system, Offset = vData - vBase. When data is sent from a non-real-time operating system to a real-time operating system, the real-time operating system uses address pData to access dynamically allocated shared memory (pData = pBase + Offset). The address returned by dynamically allocated memory in a real-time operating system is the physical address pData. In a real-time operating system, Offset = pData - pBase. When data is sent from a real-time operating system to a non-real-time operating system, the non-real-time operating system uses address vData to access dynamically allocated shared memory (vData = vBase + Offset).

[0394] In an exemplary embodiment, 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. Optionally, the metadata storage area stored in the processor is obtained, and the state mapping table in the metadata storage area is identified, and 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. In the case that there are memory page records that meet the above conditions, the corresponding relationship between the memory page record and the memory page is used to determine whether the target memory space exists in the processor. The corresponding relationship between the memory page record and the memory page is used to determine whether the target memory space exists in the processor.

[0395] In this embodiment, a method for sharing memory is also provided, which includes: before the operating system issues a memory request instruction, in order to prevent multiple operating systems from applying for the processor's memory space at the same time, a locking operation needs to be applied, and it is determined whether the locking is successful; if the judgment result indicates that the dynamic memory lock application is successful, the number of consecutive memory pages that need to be allocated is calculated according to the memory size in the issued memory request instruction, and recorded as nmemb; if the judgment result indicates that the lock application 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 lock application failures is greater than a preset number (the preset number can be three times), the memory application is exited.

[0396] In an exemplary embodiment, after the lock application is successful, the metadata storage area of ​​the processor is initialized, and the last position of the state mapping table is recorded as offset. The number of required continuous memory pages is calculated according to the size of the required memory space in the memory application instruction, and the number of memory pages is recorded as nmemb. A counter for recording the number of memory pages is set, which is recorded as cmemb. Then, the state mapping table of the metadata storage area in the processor is obtained, and the entire state mapping table is scanned starting from the offset position of the state mapping table. 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. Empty memory page. If the current memory page being scanned is in an occupied state, offset = offset - cmemb, and then the data cmemb of the continuous empty memory pages accumulated in the counter is cleared, and the search for continuous empty memory pages is restarted from the new offset position; if the scanned memory page is empty, that is, in an idle state, the value cmemb of the counter is increased by 1, and offset = offset - 1, and the next memory page is continued to be judged until cmemb is equal to nmemb, that is, when the counter data is equal to the size of the required memory space, it means that a continuous memory page that meets the requirements has been scanned.

[0397] In an exemplary embodiment, the memory page that meets the requirements is 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.

[0398] If the offset value is less than 0 during the scanning of the entire state mapping table, it indicates that there is no memory page that meets the requirements for use by the operating system, and the lock for dynamic memory application is released, and this dynamic memory application fails.

[0399] In addition, after dynamically applying for space, if it is found that the space is insufficient, 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 memory space required by the updated memory application instruction is increased, it is determined whether the required memory space exists after the applied target continuous memory. If so, the application is successful. If the memory space required by the updated memory application instruction is reduced, part of the memory space is released.

[0400] This embodiment divides the storage area into multiple storage areas, uses index positions to dynamically apply for space according to the actual required size, releases it after use, and can dynamically adjust the size if it is found that the space is insufficient after dynamic application, thereby improving the flexibility and efficiency of shared memory.

[0401] In an exemplary embodiment, the method further includes at least one of the following:

[0402] S221, 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;

[0403] 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.

[0404] In this embodiment, the scheduling of processing resources can be achieved by merging the corresponding processing resources into the available resource pool of the corresponding operating system. Correspondingly, in the scenario where the first operating system preempts the processing resources of the second operating system, if the resource preemption is successful, 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. In the scenario where the second operating system preempts the processing resources of the first operating system, and the first operating system actively releases processing resources to the second operating system, if the resource preemption is successful or the resource release is successful, 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.

[0405] For example, 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. For example, the SMP (Symmetrical Multi-Processing) framework of the Linux system, here, a group of processors (multiple CPUs) are gathered on a computer, and each CPU shares a memory subsystem and bus structure. SMP scheduling is the process of arranging / migrating processes to the appropriate CPU to maintain load balancing on each CPU.

[0406] Taking the Linux system as an example, CPU scheduling works as follows: Linux tasks (i.e., business operations) are generally maintained in a task queue. The process scheduler determines which processes (corresponding to tasks) in the queue are eligible for CPU execution. Simultaneously, the dispatcher module in the Linux system transfers control of the CPU to a process selected by the process scheduler. The selected CPU comes from the Linux system's CPU resource pool (i.e., the aforementioned available resource pool), meaning that the Linux system can schedule these CPUs in the resource pool to participate in the actual execution of the process.

[0407] 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 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.

[0408] Through this embodiment, by merging the scheduled processing resources into the available resource pool of the corresponding operating system, the scheduling of processing resources can be facilitated and the efficiency of processing resource scheduling can be improved.

[0409] In an exemplary embodiment, the method further includes:

[0410] S232, after the chip where the processor is located is powered on, boot and run the first operating system on the first initial processing resource through the boot loader, and boot and run the second operating system on the second initial processing resource through the boot loader, wherein the first initial processing resource is the initial processing resource among the processing resources of the processor corresponding to the first operating system, and the second initial processing resource is the initial processing resource among the processing resources of the processor corresponding to the second operating system.

[0411] The entire system can be divided into two phases according to the working period, namely, the initial startup phase and the real-time operation phase. The aforementioned dynamic scheduling of processing resources and other processes are performed in the real-time operation phase. For the initial startup phase, the initial startup phase starts when the system is powered on, that is, the chip where the processor is located is powered on. After the system is powered on, one core will be awakened to perform the boot action of the operating system, and the remaining cores will be temporarily in a dormant state. After powering on, the system will first execute a preset core scheduling policy (boot boot policy), that is, one core of the processor executes the core scheduling policy. The core scheduling policy is stored in the RAM or Norflash (non-volatile flash memory) on the SOC chip. The scheduling policy can be flexibly configured according to different design requirements. Its main functions include: specifying the initial processing resources required to run different operating systems (for example, specifying the initial cores required to run the first operating system and the second operating system) and determining the boot process of heterogeneous operating systems.

[0412] Among the processor's processing resources, the initial processing resources corresponding to the first operating system are referred to as first initial processing resources, and the initial processing resources corresponding to the second operating system are referred to as second initial processing resources. After the system is powered on, the first operating system can be booted and run on the first initial processing resources via a boot loader, and the second operating system can be booted and run on the second initial processing resources via a boot loader. Here, a boot loader, located on a computer or other computer application, refers to a program that loads a booting operating system.

[0413] Here, the chip can be a BMC (Baseboard Management Controller, a management control chip in the server platform) chip, which refers to a SOC chip based on the ARM multi-core architecture and integrates multiple peripheral hardware IPs (Intelligent Peripheral). The BMC chip is placed on the motherboard (server motherboard). Chip power-on refers to power-on at the SOC chip level.

[0414] After the system is powered on, a designated processor core is first awakened. This core then uses a boot loader to boot each operating system onto the corresponding initial processing resources. A boot loader is a program used to load an operating system. For example, a native program in the BootROM (on-chip ROM) of the CPU is a code that guides the operating system to start up. This native program is part of the Bootloader program.

[0415] Through this embodiment, in the initial startup phase, each operating system is guided to start up on the initial processing resources corresponding to each operating system by the boot loader, which can improve the success rate of operating system startup and prepare for the real-time operation phase.

[0416] In an exemplary embodiment, the first initial processing resource is a designated processor core among the processor cores of the processor, and the second initial processing resource is other processor cores among the processor cores of the processor except the designated processor core.

[0417] In this embodiment, the initial processing resources may include initial processor cores. The first initial processing resource may be at least one processor core among the processor cores of the processor, and the second initial processing resource may be at least some of the processor cores other than the first initial processing resource. Optionally, to ensure system startup efficiency, the first initial processing resource may be a designated processor core among the processor cores of the processor, and the second initial processing resource may be the processor cores other than the designated processor core among the processor cores of the processor.

[0418] For example, for an eight-core processor (CPU0-CPU7), the designated processor core may be CPU0 (or another processor core), that is, the initial processing resources of the first operating system are CPU0, and the initial processing resources of the second operating system are CPU1-CPU7.

[0419] Through this embodiment, by specifying the initial processing resource of a certain operating system as a specified processor core, and using other processor cores of the processor as the initial processing resources of another operating system, the convenience of booting can be improved.

[0420] In an exemplary embodiment, booting and running a first operating system on a first initial processing resource through a boot loader includes:

[0421] S241 , booting and running a first operating system on a first initial processing resource through a secondary program loader.

[0422] In this embodiment, the operating system can be booted through the Second Program Loader (SPL). The SPL is the code executed in the first stage of uboot, which can move the second stage of uboot code to memory for execution and is primarily responsible for loading the operating system into RAM. Here, uboot is a boot loader for embedded systems, mainly used for embedded systems. It can support a variety of different computer system architectures, such as PPC, ARM, AVR32, MIPS, x86, 68k, Nios, and MicroBlaze.

[0423] According to this embodiment, the corresponding operating system is booted and run on the initial processing resources through the secondary program loader, which is compatible with the existing system startup process and improves the efficiency of system startup.

[0424] In an exemplary embodiment, the method further includes:

[0425] S251, performing a security boot check on the code of the secondary program loader through a preset program in the boot chip embedded in the mainboard of the device, wherein the secondary program loader is executed after the security boot check result is normal.

[0426] Before using the secondary program loader to boot the operating system, in order to improve the success rate of the operating system startup, a preset program in the boot chip solidified on 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 operating system boot process will be terminated.

[0427] For example, after the system is powered on, some core configurations boot the inherent program in Bootrom, and the Bootrom program (a set of programs solidified in the ROM chip on the device motherboard) performs a security startup check on the SPL part of the code. If the check result is normal, the SPL code is executed.

[0428] Through this embodiment, by performing a security boot check on the secondary program loader, the security of the operating system boot can be improved.

[0429] In an exemplary embodiment, booting and running a second operating system on a second initial processing resource by a boot loader includes:

[0430] S261: Wake up the second initial processing resource through the secondary program loader, and guide the execution of the universal boot loader to boot and run the second operating system.

[0431] When booting the second operating system, the secondary program loader can first wake up the second initial processing resource, then guide the execution of the universal loader to boot the second operating system. For example, the SPL boots the first operating system on some cores (e.g., core 1, CPU0), and then wakes up other cores (e.g., core 2 to core M+N, CPU1 to CPU M+N-1) to guide the execution of uboot code (a boot loader primarily used in embedded systems) and then boot the second operating system. After this stage, the server management control unit (BMC) system will be able to achieve normal booting of the first and second operating systems based on one or more processor cores, preparing for the real-time operation stage.

[0432] Through this embodiment, by first waking up the initial processing resources and guiding the execution of the universal boot loader to boot and run the corresponding operating system, the efficiency of the system booting operation can be improved.

[0433] The operation method of the embedded system in this embodiment is explained below with reference to an optional example. In this optional example, the first operating system is an RTOS system, the second operating system is a Linux system (or other non-real-time operating systems), and the processing resource is a processor core.

[0434] In order to achieve normal operation of various types of services in embedded systems, improve the utilization of processor cores, and control server hardware costs within a reasonable range, this optional example provides a method for dynamic balanced scheduling of processor resources among embedded heterogeneous multi-systems. Based on the hard core of the multi-core processor, different business types are scheduled to different core groups for execution according to the core adaptive scheduling (i.e., resource adaptive scheduling) method; at the same time, it integrates system architecture designs such as business management, load balancing, dynamic resource allocation, and inter-core communication interfaces 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. At the same time, 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.

[0435] Taking the BMC management unit in a server platform (applicable to all embedded products using multi-core SOCs, such as mobile phones, tablets, set-top boxes, etc.) as an example, 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 the dynamic balanced scheduling of processor resources among embedded heterogeneous multi-systems shown in Figure 7. The CPU balanced scheduling process in the initial startup stage can be shown in Figure 8. The above process may include the following steps:

[0436] Step S802, configuring a portion of the core to boot the inherent program in BootROM;

[0437] 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 a hash check on the uboot, Linux, and RTOS images to be booted, and compares the obtained results with the stored results. If the comparison is consistent, the boot is normal, otherwise 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.

[0438] Step S806, determining whether the security check has passed. If the security check has passed, executing step S808; if the security check has not passed, executing step S810;

[0439] Step S808: Execute 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.

[0440] Step S810, end.

[0441] After the heterogeneous operating system is booted, the system enters the real-time operation phase. Referring to FIG7 , the real-time operation phase 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. In conjunction with FIG7 and FIG9 , during the real-time operation phase, the process of the embedded system operation method in this optional example may include the following steps:

[0442] Step S902 : The service management module performs actual classification of services to be allocated based on the output of the load balancing strategy module, and generates a list including real-time services and a list including non-real-time services.

[0443] The load balancing policy module provides policy guidance to the service management module, including methods for classifying various services (or processes) running in the system and principles for assessing real-time performance. After the RTOS and Linux systems boot, the service management module performs the actual classification of services to be assigned based on the output of the load balancing policy module, generating a list containing real-time services and a list containing non-real-time services. These two lists output by the load balancing policy module represent the correspondence between services and the operating system.

[0444] For BMC applications, robust and comprehensive server platform management requires a large number of business processes. The business management module rationally categorizes these services. One feasible categorization approach 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, while classifying services such as fan control and PECI (Platform Environment Control Interface) communication as real-time services.

[0445] Step S904 : The resource dynamic allocation module dynamically adjusts the processor resources (including processor cores and controller logic units, etc.) according to the output of the service management module, and forms a resource mapping table between different services and actual hardware resources.

[0446] The mapping table formed by the dynamic resource allocation module is a resource mapping table for 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. When mapping services to actual hardware resources, priority is given to allocating processor cores of the RTOS system to real-time services. 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. For non-real-time services, it is allocated 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.

[0447] In practical applications, the BMC's hardware resources, such as processor cores and peripheral controllers, are dynamically mapped to actual BMC services. For example, after the server is powered on, BMC core 1 runs an RTOS system to control PWM (Pulse Width Modulation) and PECI peripheral controllers for fan speed regulation and fault diagnosis. Cores 2 through N run a Linux system to control controllers such as the I2C (Inter-Integrated Circuit) bus for component monitoring. During system operation, a dynamic BMC resource allocation table is dynamically generated based on system load and other factors, preparing for the next step in the core adaptive scheduling process.

[0448] Here, the output resource mapping table might be: X cores and xxx controllers (certain types of controllers) for real-time services, and Y cores and xxxx controllers (certain types of controllers) for non-real-time services. Some services rely not only on computing resources (corresponding to processor cores) but also on specific hardware interfaces (corresponding to controllers on the SoC). For example, a service that requires a network port must be partitioned into the same operating system (RTOS or Linux) as the corresponding network controller.

[0449] Step S906 : The core adaptive scheduling module completes the actual scheduling of the processor hard core resources according to the result of the dynamic allocation of hardware resources.

[0450] The core adaptive scheduling module schedules processor hard core resources based on the outputs of the service management module and the dynamic resource allocation module. For example, it schedules some processor hard cores to execute real-time services, such as the M cores in core group 1 in Figure 6, while the remaining processor hard cores are scheduled to run non-real-time services, such as the N cores in core group 2 in Figure 6. The entire scheduling process is led by the Linux system, specifically by configuring the processor hard core resource pool in conjunction with the Linux SMP framework. Here, the total number of available processor cores is M + N, where M ≥ 1 and N ≥ 1.

[0451] 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.

[0452] The preemption and release process depends on the real-time load of heterogeneous operating systems to maximize processor resource utilization. For example, when the number of users remotely accessing the BMC increases from 1 to 20, the BMC's Web access traffic increases dramatically, which will cause the Linux system to require more processor cores to support it. In this case, the Linux system will send a core preemption request to the RTOS system via IPI. If the RTOS system is idle at this time (i.e., no task scheduling), it will release core resources to the Linux system. At this point, the Linux system core preemption is successful, that is, Linux obtains more processor resources to meet the increased business needs. The core preemption and release mechanism significantly improves the user experience of remote server management.

[0453] The core preemption and release process is a dynamic, repetitive process. Each core preemption and release is accompanied by adjustments to the processor's 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 + NP. Furthermore, the core preemption and release process requires the coordination of load balancing policies, service management, and core adaptive adjustment modules to determine the final core adjustment results.

[0454] This cycle refers to the constant preemption and release of resources between the RTOS and Linux systems during normal system operation due to resource shortages on one side. This cyclical process involves the coordinated operation of modules such as "business management (business management is a dynamic division process) - dynamic allocation of hardware resources - and core adaptive scheduling." These modules are all implemented in a non-real-time system (Linux). This is because Linux is the primary operating system, allowing for easier access and perception of more information and status.

[0455] The aforementioned multiple modules jointly determining the core adjustment results mean that when a system needs to seize more core resources, the ultimate success of the seizure depends on the combined efforts of modules such as load balancing strategy, service management, and core adaptive adjustment. For example, in one possible scenario, when the Linux system requires more resources, while the RTOS system is in a dormant, idle state, the RTOS system will soon wake up and run a critical service thread, which also requires a significant amount of resources. Therefore, the RTOS system cannot release core resources to the Linux system. The resource scheduling process involves the criteria for determining service importance and the ultimate decision to withhold resources from the Linux system, all of which involve the participation of modules such as load balancing strategy, service management, and core adaptive adjustment. The open nature of each of these modules' strategies means that the final core adjustment result, determined by their combined efforts, is also the result of the combined efforts of these strategies.

[0456] Here, the RTOS system does not occupy any CPU core resources after hibernation. When it wakes up (for example, due to an interrupt generated by a peripheral or wake-up timer), it regains control of the designated core resources (for example, core 0) through an inter-core interrupt. During this transition from hibernation to regaining core control, the RTOS system does not require any core involvement.

[0457] The following uses an eight-core processor (cores 1 to 8) as an example to explain the dynamic balancing scheduling of processor resources among embedded heterogeneous multi-systems. Assuming that the real-time operating system and the non-real-time operating system are RTOS and Linux, respectively, the dynamic balancing scheduling process for processor resources may include the following steps:

[0458] Step 1: Power on the system and run the preset boot strategy. Core 1 (CPU0) boots the RTOS system and core 8 (CPU7) boots the Linux system.

[0459] In 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 policy 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.

[0460] 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. Through the SMP framework of the Linux system, the 8 processor cores are divided into processor core group 1 (assuming it includes cores 1 and 2) and core group 2 (assuming it includes cores 3 to 8). At this time, the system allocates the resources of core group 1 to the RTOS operating system and executes services 1 and 2, and at the same time allocates the resources of core group 2 to the Linux system and executes services 3 to 20.

[0461] 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 side is too heavy, it will initiate a core preemption action through the inter-core communication interface; when the other side receives the core preemption request, it will determine whether to release hard core resources to the other side based on its own load conditions.

[0462] For example, at a certain moment, the Linux system monitors that its own load has increased dramatically. 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 cores 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.

[0463] Step 5: Update the system load and return to step 2.

[0464] Unlike related technologies involving single-core multi-systems and fixed multi-core multi-systems (where each core is fixed to a specific operating system), the method provided in this optional example dynamically allocates different hardware processor cores to real-time and non-real-time operating systems based on actual business needs, thereby implementing a dynamic scheduling design for processor resources between embedded heterogeneous multi-systems based on processor hard cores from the perspective of the hardware and software system architecture. Because processor hard cores are dynamically allocable, heterogeneous operating systems coexisting in the system can obtain reasonable processor computing resources based on their own business load. This not only enhances the processor's ability to handle real-time business, but also comprehensively improves the utilization of processor cores, enhances computing performance, and achieves the goal of saving hardware costs.

[0465] In an optional application scenario, the following explains the operating method of the embedded system in this embodiment by combining two operating systems that alternately control the operating status of the same device (i.e., the target device), wherein the processing system of the first operating system includes the first processor core of the processor, and the processing resources of the second operating system include the second processor core of the processor. In this embodiment, a startup control process of an operating system is provided, which includes the following steps:

[0466] In step A, a first operating system running on a first processor core of a processor controls a hardware controller of a target device via a second bus to control an operating state of the target device.

[0467] Devices such as servers, personal computers, and industrial computers can be equipped with specific devices to perform operations related to their operation. In related technologies, these specific devices typically begin operating after the system is powered on. However, after powering on, the operating system running on the processor takes some time to properly take over and control the operating status of the specific device. During the operating system startup process, the specific device is uncontrollable.

[0468] For example, 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 and set the fan speed, the fan cannot be controlled during the operating system startup process.

[0469] For example, in order to control the fan during the startup of the operating system, the server adopts the control method of BMC combined with CPLD, the personal computer adopts the control method of EC chip (EC chip has the function of adjusting the fan speed according to temperature), and the industrial computer adopts the control method of customized chip. During the startup of the server, personal computer, and industrial computer operating system, CPLD, EC chip, and customized chip will intervene to control the fan speed. After the operating system is fully started, the control of the fan will be handed over to the application in the operating system.

[0470] In order to at least partially solve the above technical problems, 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. If the second operating system is not started, restarted, or otherwise unable to control the operating status of a specific device, the operating status of the specific device can be controlled by the first operating system with a higher response speed than the second operating system. This can reduce the situation where the operating status of the specific device is uncontrollable. At the same time, since no additional cost is required, it also has good scalability.

[0471] In this embodiment, when the second operating system is not started, restarted or otherwise unable to control the operating state of the target device, the hardware controller of the target device can be controlled via the second bus by the first operating system to control the operating state of the target device. The target device here can be a fan, or other devices that need to be running when the system is started. For the fan, its corresponding hardware controller is a fan controller, for example, a PWM (Pulse Width Modulation) controller or a FanTach (fan speed) controller. Here, the first operating system (for example, an RTOS system) is used to replace traditional CPLD, EC chip, and custom chip. On the one hand, hardware cost is saved, and on the other hand, since device control is implemented by software, scalability is high.

[0472] For example, dual systems, RTOS system and Linux system, are implemented based on the BMC dual-core, and fans are implemented based on the multi-core dual system. By utilizing the high real-time performance of the RTOS system, during the startup of the Linux system, the RTOS system can replace the CPLD, EC chip, or customized chip to control the fan, that is, take over the fan control and control the fan's operating status at a sufficiently fast speed.

[0473] Step B: booting a second operating system on a second processor core of the processor.

[0474] When the system is powered on or the second operating system is restarted, the second operating system can be booted on the second processor core of the processor so that the second operating system runs on the second processor core. Here, booting the second operating system on the second processor core means scheduling the second processor core to the second operating system. The system files or image files of the operating system can be stored on the chip where the processor is located or in a memory outside the chip, such as external RAM.

[0475] 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.

[0476] After the second operating system is started, the first operating system can always control the running state of the target device. Taking into account that running multiple operating systems on a multi-core processor requires data interaction between multiple operating systems, and it is convenient for one operating system to perform overall control of the device, the second operating system can also take over the control of the target device. For example, 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, sends an interrupt request via 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 control of the target device, for example, stop running the business (process) used to control the running state of the target device.

[0477] For example, after the Linux system is fully booted, the RTOS system transfers control of the fan to the Linux system, which then controls the fan. This process can be performed after the system is powered on. That is, using a multi-core dual-system boot method, the RTOS system is booted first, facilitating earlier fan control. After the Linux system is fully booted, the RTOS system transfers control of the fan to the Linux system.

[0478] In an exemplary embodiment, before 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.

[0479] The entire system can be divided into two phases based on operating time: an initial startup phase and a real-time operation phase. The startup control method in this embodiment can be executed during either the initial startup phase or the real-time operation phase. The initial startup phase begins when the system is powered on, i.e., when the chip containing the processor is powered on. After the system is powered on, one core is awakened to execute the operating system boot process, while the remaining cores are temporarily dormant. The awakened core can be the first processor core.

[0480] Optionally, after power-on, 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.

[0481] After the first processor core wakes up, 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. It refers to a program used to load the operating system, for example, the inherent program in the BootRom. The inherent program refers to the code that boots the operating system and belongs to the BootLoader program. The BootRom is a small mask ROM (Read-Only Memory) or write-protected flash memory embedded in the processor chip on the CPU chip.

[0482] In the initial startup phase, the boot loader is used to guide the operating system to start on the corresponding processor core, which can improve the success rate of the operating system startup and prepare for the real-time operation phase.

[0483] In an exemplary embodiment, 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 based on 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.

[0484] The operating system may control the hardware controller of the target device by a control task (service) on the processor core running the operating system. The control task herein may refer to a corresponding control task. For the hardware controller of the target device, a first control task (first control process) of a first operating system may be executed on a first processor core, and the first control task may control the hardware controller.

[0485] The control of the hardware controller can be based on the sensor data of the sensor. For different target devices, the parameters that affect their operation may be different, and correspondingly, the sensor data that needs to be obtained may also be different. For the target device, it can be a device that runs after the chip is powered on, and the sensor corresponding to it is the designated sensor. 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, there is no limitation on the reading location of the sensor data of the designated sensor.

[0486] The sensor data read from the designated sensor may be sensor data within a time period, all sensor data since the target device was started, or sensor data that meets other time constraints. After acquiring the sensor data from the designated sensor, the first control task may control the operating state of the target device based on the sensor data from the designated sensor. Controlling the operating state of the target device may be achieved by sending a device control instruction to a hardware controller of the target device via the first control task, so that the hardware controller controls the operating state of the target device in accordance with the device control instruction.

[0487] Optionally, the first control task can determine an expected operating state of the target device based on sensor data from a designated sensor; if the current operating state of the target device differs from the expected operating state, the device control instruction can be generated, which can control the operating state of the target device to be adjusted to the expected operating state. The device control instruction can be sent to a hardware controller of the target device via a second bus. The second bus is similar to that in the previous embodiment and is not further described here.

[0488] By reading the sensor data of the specified sensor and controlling the target device according to the sensor data, the target device's operating status is controlled, thereby improving resource utilization.

[0489] In an exemplary embodiment, 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 a device control instruction carrying the target parameter value to the hardware controller via the second bus by the first control task.

[0490] The first control task can determine the expected operating state of the target device based on the sensor data of the designated sensor. The expected operating state can be represented by a parameter value of a device operating parameter. The device operating parameter can be a parameter that controls the operating state of the target device. The corresponding device operating parameter can be different for different types of devices. For example, for a fan, the corresponding device operating parameter can be the rotational speed, while for other types of devices, the device operating parameter can be other operating parameters. The expected operating state can correspond to a target parameter value of the device operating parameter of the target device.

[0491] After determining the 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.

[0492] By determining the parameter values ​​of the device operating parameters of the target device based on the sensor data and carrying the determined parameter values ​​in the device control instructions, the accuracy of the device control can be improved.

[0493] In an exemplary embodiment, a target parameter value of a device operating parameter of a target device is determined based on sensor data of a specified 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 based on sensor data of a specified sensor through the first control task.

[0494] The target device may be a fan, which may be used to dissipate heat from a server or other device, i.e., a cooling fan. In this case, the device operating parameter may be a fan operating parameter. The fan operating parameter may include one or more parameters, 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.

[0495] Correspondingly, determining the target parameter value of the device operating parameter of the target device based on the sensor data of the designated sensor by the first control task may include determining the target parameter value of the fan operating parameter of the fan by the first control task based on the sensor data of the designated sensor. After obtaining the target parameter value, the first control task sends a 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.

[0496] By controlling the operating status of the fans, you can quickly control the operating status of the fans in scenarios such as system power-on, system restart, or other situations, thereby improving the timeliness of fan control.

[0497] In an exemplary embodiment, 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 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.

[0498] For scenarios where the target device is a fan, the designated sensor can be a temperature sensor. The number of temperature sensors can be one or more, and the location of the temperature sensors can be configured as needed, with different temperature sensors being placed in different locations. Optionally, the sensor data of the temperature sensor represents the temperature detected by the temperature sensor. In this regard, the first control task can determine a target speed value for the fan based on the sensor data of the temperature sensor. Here, the fan speed is positively correlated with the temperature detected by the temperature sensor.

[0499] If there are multiple temperature sensors, the highest temperature detected by the multiple temperature sensors can be determined based on the sensor data from each temperature sensor. The fan speed can then be determined based on the highest temperature detected by the multiple temperature sensors. This ensures safe device operation compared to determining the fan speed based on the average temperature detected by the multiple temperature sensors. For scenarios with multiple fans, the speed of each fan can also be determined based on the highest or average temperature detected by the temperature sensor that matches each fan.

[0500] For example, the first operating system (for example, RTOS system) can be used to replace the CPLD, EC chip, custom chip and other processing units to control the fan speed (BMC fan control can be performed in real time). When the system is just powered on, 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. When performing fan speed control, 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.

[0501] In an exemplary embodiment, 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.

[0502] In this embodiment, when the operating system is started, the secondary program loader can be loaded into the internal memory, for example, the static random access memory (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 the second operating system and can also boot the first operating system.

[0503] For the second operating system, the second program loader can be executed by the first processor core to wake up the second processor core through the second program loader; the second processor core can run the universal boot loader (universal boot loader) of the second operating system, thereby guiding the second operating system to start on the first processor core. Here, the boot program of the second operating system is loaded by the second program loader, and the boot program of the second operating system may include the universal boot loader.

[0504] It's important to note that the second-stage program loader is the code executed by the first stage of the universal boot loader. It is responsible for transferring the second-stage code of the universal boot loader to system RAM (also known as off-chip memory) for execution. The universal boot loader is open source software licensed under the GPL (General Public License) and can be considered a bare-metal synthesis example.

[0505] For example, after the system is powered on, 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.

[0506] It should be noted that Boot Rom is the internal ROM program of a chip (e.g., a SoC chip), which is the boot code of uboot. Boot Rom reads the startup information of the hardware (e.g., the DIP switch settings) and reads the uboot-spl code (i.e., SPL) from the specified startup medium (e.g., SD, MMC, etc.). SPL is mainly responsible for initializing the external RAM and environment and loading the actual uboot image into the external RAM for execution. The external RAM can be DDR (Double Data Rate Synchronous Dynamic RAM) or other RAM.

[0507] 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.

[0508] As an optional example, the following explains the startup process of a multi-core dual system by taking an RTOS system and a Linux system as examples.

[0509] In order to take over fan management as quickly as possible, the RTOS system can be started as soon as possible. After the Linux system is started, the Linux system takes over the control of the fans. The startup process of a multi-core dual system may include the following steps:

[0510] Step 1: Wake up CPU0 when the system is just powered on.

[0511] Step 2: CPU0 runs the specified program in BootRom and loads the RTOS system to start;

[0512] Step 3: During the RTOS system startup process, wake up CPU1 to boot u-boot and start the fan control program (FanCtrl_RTOS_APP) in the first operating system;

[0513] Step 4: CPU1 boots u-boot, which may include the SPL stage and the Uboot stage, and enters the SPL stage by calling SPL;

[0514] Step 5: In the SPL stage, SPL guides Uboot to start;

[0515] Step 6: In the Uboot stage, the Linux kernel (CPU1 to CPUN) is loaded, and the BMC service program and the fan control program (FanCtrl_Linux_APP) in the second operating system are started.

[0516] Through this optional example, during the dual-system startup and operation process, 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 can ensure that the fan is quickly controlled when the system is powered on, thereby improving the efficiency of fan control.

[0517] In an exemplary embodiment, 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 second operating system wakes up the first 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 controls the second operating system to restart the system.

[0518] When a system needs to be restarted due to reasons such as a system crash or receiving a reboot command, the second operating system can first wake up the first operating system, and the first operating system can take over the hardware controller to take over control of the target device. Waking up the first operating system can be performed via the first bus, and the first operating system can take over the hardware controller via the second bus.

[0519] When the second operating system is restarted, the reliability of device control can be improved by waking up the first operating system to take over the control of the target device.

[0520] In an exemplary embodiment, when the second operating system is to be restarted, waking up the first operating system via the first bus by the second operating system includes: when the second operating system is to be restarted, initiating a system wake-up interrupt to the first operating system via the first bus by the second operating system, wherein the system wake-up interrupt is used to wake up the first operating system.

[0521] Waking up the first operating system can be achieved through an inter-core interrupt. If the second operating system is to be restarted (for example, the system crashes, receives a reboot command), the second operating system can initiate a system wake-up interrupt to the first operating system to wake up the first operating system. The system wake-up interrupt can be an active wake-up interrupt. After the first operating system takes over the hardware controller, it can control the second operating system to restart the system. After the second operating system restarts, it can take over the hardware controller again. The process of taking over the hardware controller is similar to that in the aforementioned embodiment and will not be repeated here.

[0522] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, 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 enabling 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.

[0523] According to another aspect of the embodiments of the present application, an embedded system for implementing the operating method of the embedded system is further provided. The embedded system can run on the BMC chip. The embedded system may include:

[0524] A first operating system and a second operating system, wherein 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;

[0525] A service management module is configured to allocate a group of services to be allocated to corresponding operating systems 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 and service resource occupancy rate;

[0526] a dynamic resource allocation module, configured to determine a resource allocation result corresponding to a set of services to be allocated, wherein the resource allocation result is used to indicate a processing resource corresponding to each of the services to be allocated in the set of services to be allocated, wherein the processing resource of the processor includes a processor core;

[0527] 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 to-be-allocated service and the resource allocation result.

[0528] In this embodiment, the first operating system and the second operating system can 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 can be software modules running under the first operating system or the second operating system. By performing the above-mentioned module division, the development and maintenance of different functional modules can be facilitated. At the same time, for the resource dynamic allocation rules, the flexibility of resource allocation can be improved by flexibly setting the resource dynamic allocation rules.

[0529] Through the above-mentioned embedded system, the embedded system includes: 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; a business management module, used to allocate a group of to-be-allocated businesses to the corresponding operating systems according to a dynamic resource allocation rule, wherein the dynamic resource allocation rule includes dynamic resource allocation according to at least one of the following: business response speed, business resource occupancy rate; a dynamic resource allocation module, 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 in the processor's processing resources corresponding to each to-be-allocated business in a group of to-be-allocated businesses, and the processor's processing resources include processor cores; a resource adaptive scheduling module, used to allocate the processor's processing resources to the first operating system and the second operating system according to the operating system corresponding to each to-be-allocated business and the resource allocation result, thereby solving the problem in the related art 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, thereby improving the utilization of processing resources.

[0530] In an exemplary embodiment, the embedded system further comprises:

[0531] The load balancing policy 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.

[0532] The load balancing policy module in this embodiment is similar to that in the previous embodiment and will not be described in detail here. Here, the load balancing policy module can be a software module under the first operating system or the second operating system. By configuring the load balancing policy to be stored by a separate software module, the load balancing policy can be flexibly adjusted.

[0533] In an exemplary embodiment, the load balancing strategy module is also used to

[0534] A rule update configuration file is obtained through the external interface of the second operating system, wherein the rule update configuration file is used to update the configured dynamic resource allocation rules; and the rule update configuration file is used to update the rule structure to update the dynamic resource allocation rules recorded in the rule structure.

[0535] In this embodiment, the dynamic resource 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 embodiment and will not be described in detail here.

[0536] In an exemplary embodiment, the service management module is configured to allocate a group of services to be allocated to corresponding operating systems according to an allocation rule corresponding to a service response speed in a dynamic resource allocation rule by executing the following steps:

[0537] A group of to-be-allocated services whose service response speed requirements are greater than or equal to the set response speed threshold are allocated to the first operating system, and a group of to-be-allocated services whose service response speed requirements are less than the set response speed threshold are allocated to the second operating system.

[0538] In this embodiment, 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.

[0539] In an exemplary embodiment, the service management module is configured to allocate a group of services to be allocated to corresponding operating systems according to an allocation rule corresponding to service resource occupancy rates in a dynamic resource allocation rule by executing the following steps:

[0540] A group of to-be-allocated services with service resource occupancy rates less than a first occupancy threshold are allocated to the first operating system, and a group of to-be-allocated services with service resource occupancy rates greater than or equal to the first occupancy threshold are allocated to the second operating system.

[0541] In this embodiment, 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 is not described in detail here.

[0542] In an exemplary embodiment, 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:

[0543] Allocating to-be-allocated services, among a group of to-be-allocated services, whose service coupling degree with services already allocated to the first operating system is greater than or equal to a first coupling degree threshold, to the first operating system;

[0544] To-be-allocated services, among a group of to-be-allocated services, whose service coupling degree with services already allocated to the second operating system is greater than or equal to a second coupling degree threshold, are allocated to the second operating system.

[0545] In this embodiment, 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 is not described in detail here.

[0546] In an exemplary embodiment, the service management module is further configured to allocate a group of services to be allocated to corresponding operating systems by executing the following steps:

[0547] Allocating a group of to-be-allocated services containing sensitive information 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 a user object.

[0548] In this embodiment, 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.

[0549] It should be noted that the allocation of pending services by the business management module based on the business response speed and business resource occupancy rate is executed based on the dynamic resource allocation rules stored in the load balancing strategy module, while the allocation of pending services based on business coupling and business importance (for example, whether sensitive information is contained) can be executed by the business management module based on the configuration information preset thereon. Since the processing resource allocation rules based on business coupling and business importance are usually stable, and the business response speed and business resource occupancy rate can be flexibly configured based on demand, the dynamic resource allocation rules for dynamically allocating resources according to at least one of the business response speed and business resource occupancy rate are stored in a separate software module, which can take into account the flexibility and simplicity of the rule configuration.

[0550] In an exemplary embodiment, the dynamic resource allocation module is configured to determine resource allocation results corresponding to a group of services to be allocated by performing the following steps:

[0551] According to the allocation result of the service management module and 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, a resource mapping table of a set of services to be allocated and the processing resources of the processor is generated.

[0552] In this embodiment, the way in which the resource dynamic allocation module generates a resource mapping table of a set of services to be allocated and the processing resources of the processor is similar to that in the above-mentioned embodiment, and is not described in detail here.

[0553] In an exemplary embodiment, 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.

[0554] In an exemplary embodiment, the resource adaptive scheduling module is configured 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-allocated service and the resource allocation result by executing the following steps:

[0555] When it is determined according to the resource allocation result that unallocated processing resources in the processor's processing resources have corresponding to services to be allocated, the unallocated processing resources are allocated to the operating system to which the services to be allocated corresponding to the unallocated processing resources are allocated.

[0556] In this embodiment, the resource adaptive scheduling module allocates 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.

[0557] In an exemplary embodiment, the embedded system further comprises:

[0558] The resource preemption and release module is used to preempt and release processing resources between the first operating system and the second operating system.

[0559] In this embodiment, the resource preemption and release module performs preemption and release of processing resources between different operating systems in a similar manner to that in the aforementioned embodiment, and will not be described in detail here.

[0560] In an exemplary embodiment, 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.

[0561] In an exemplary embodiment, the resource preemption and release module is configured to implement preemption and release of processing resources between the first operating system and the second operating system via the inter-core communication interface by performing the following steps:

[0562] Transmitting 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;

[0563] 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.

[0564] In this embodiment, 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 is not described in detail here.

[0565] In an exemplary embodiment, the embedded system further comprises:

[0566] The first system control module is used to detect the resource utilization of the processing resources of the first operating system. 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.

[0567] In this embodiment, 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 here.

[0568] In an exemplary embodiment, the first system control module is further 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.

[0569] In this embodiment, 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 here.

[0570] In an exemplary embodiment, the first system control module is further configured to control the first operating system to enter a dormant state when the first operating system has no service scheduled and no service to be allocated to the first operating system.

[0571] In this embodiment, the manner in which the first system control module controls the first operating system to enter the dormant state is similar to that in the aforementioned embodiment, and is not described in detail here.

[0572] In an exemplary embodiment, the resource preemption and release module is configured 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:

[0573] transmitting a first preemption request having an interrupt number of 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 processing resources of the second operating system;

[0574] 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.

[0575] In this embodiment, 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.

[0576] In an exemplary embodiment, the resource preemption and release module is configured to implement preemption and release of processing resources between the first operating system and the second operating system via the inter-core communication interface by performing the following steps:

[0577] transmitting 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 preempt processing resources of the first operating system;

[0578] 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.

[0579] In this embodiment, 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 is not described in detail here.

[0580] In an exemplary embodiment, the embedded system further comprises:

[0581] 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.

[0582] In this embodiment, 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 aforementioned embodiment and is not described in detail here.

[0583] In an exemplary embodiment, the second system control module is further configured to perform at least one of the following steps:

[0584] When the current resource utilization rate of the processing resource of the second operating system is greater than or equal to the second utilization rate threshold, determining that the second operating system is to preempt the processing resource of the second operating system;

[0585] 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 according to the executing services of the second operating system and the services to be executed of the second operating system, it is determined that the second operating system is to preempt the processing resources of the second operating system.

[0586] In this embodiment, 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 aforementioned embodiment, and is not described in detail here.

[0587] In an exemplary embodiment, 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.

[0588] In this embodiment, 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 embodiment, which will not be described in detail here.

[0589] In an exemplary embodiment, the resource preemption and release module is configured to transmit the second interaction request of the second operating system to the first operating system through the inter-core communication interface by performing the following steps:

[0590] A second preemption request with 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 processing resources of the first operating system.

[0591] In this embodiment, 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.

[0592] In an exemplary embodiment, the resource preemption and release module is configured to obtain, through the inter-core communication interface, a second interaction response returned by the first operating system in response to the second interaction request by performing at least one of the following steps:

[0593] transmitting a resource release permission response with the ...

Claims

1. An embedded system, It is characterized in that include: A first operating system and a second operating system, wherein the first operating system and the second operating system are run on a processor, and a 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, configured to determine a resource allocation result corresponding to the set 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 set of services to be allocated among 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.

2. The embedded system according to claim 1, It is characterized in that 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 the resource dynamic allocation rule.

3. The embedded system according to claim 2, It is characterized in that 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.

4. The embedded system according to claim 1, It is characterized in that The service management module is used to allocate the 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 performing at least one of the following steps: Allocate the services to be allocated whose service response speed requirements are greater than or equal to the set response speed threshold in the group of services to be allocated to the first operating system, and allocate the services to be allocated whose service response speed requirements are less than the set response speed threshold in the group of services to be allocated to the second operating system; Allocate the services to be allocated whose service resource occupancy rate is less than a first occupancy rate threshold value in the group of services to be allocated to the first operating system, and allocate the services to be allocated whose service resource occupancy rate is greater than or equal to the first occupancy rate threshold value in the group of services to be allocated to the second operating system; Allocate the to-be-allocated services that contain sensitive information in the group of to-be-allocated services to a target operating system, wherein the target operating system is an operating system that interacts less frequently with a user object between the first operating system and the second operating system.

5. The embedded system according to claim 1, It is characterized in that The service management module is further configured to allocate the group of services to be allocated to the corresponding operating system by performing at least one of the following steps: Allocating the services to be allocated, whose service coupling degree with the services allocated to the first operating system is greater than or equal to a first coupling degree threshold, to the first operating system in the group of services to be allocated; The services to be allocated, among the group of services to be allocated, whose service coupling degree with the services allocated to the second operating system is greater than or equal to a second coupling degree threshold, are allocated to the second operating system.

6. The embedded system according to claim 1, It is characterized in that The resource dynamic allocation module is used to determine the resource allocation result corresponding to the group of services to be allocated by executing the following steps: According to the allocation result of the service management module, 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 the group of services to be allocated and the processing resources of the processor is generated.

7. The embedded system according to claim 1, It is characterized in that 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.

8. The embedded system according to claim 1, It is characterized in that 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: When it is determined according to the resource allocation result that unallocated processing resources in the processing resources of the processor have corresponding to-be-allocated services, the unallocated processing resources are allocated to the operating system to which the to-be-allocated services corresponding to the unallocated processing resources are allocated.

9. The embedded system according to claim 1, It is characterized in that 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.

10. The embedded system according to claim 9, It is characterized in that 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.

11. The embedded system according to claim 10, It is characterized in that 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: Transmitting a first interaction request of the first operating system to the second operating system through an 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; 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 the resource interaction with the second operating system according to the first interaction response.

12. The embedded system according to claim 11, It is characterized in that 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 perform the resource interaction with the second operating system, 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.

13. The embedded system according to claim 12, It is characterized in that The first system control module is further configured to perform at least one of the following steps: determining that the first operating system is to preempt the processing resources of the second operating system when the resource utilization rate of the processing resources of the first operating system is greater than or equal to a first utilization rate threshold; 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, it is determined that the processing resources of the first operating system are to be released to the second operating system.

14. The embedded system according to claim 12, It is characterized in that The first system control module is further configured 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.

15. The embedded system according to claim 11, It is characterized in that 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: Transmitting a first preemption request whose interrupt number is the first interrupt number to the second operating system through an inter-core communication interface, wherein the first preemption request is used to request to preempt processing resources of the second operating system; A resource release request with an interrupt number equal to 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.

16. The embedded system according to claim 10, It is characterized in that 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: Transmitting a second interaction request of the second operating system to the first operating system through an inter-core communication interface, wherein the second interaction request is used to request to seize processing resources of the first operating system; 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.

17. The embedded system according to claim 16, It is characterized in that 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, 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, trigger the resource preemption and release module to transmit the second interaction request to the first operating system through the inter-core communication interface.

18. The embedded system according to claim 17, It is characterized in that The second system control module is further configured to perform at least one of the following steps: When the current resource utilization rate of the processing resource of the second operating system is greater than or equal to a second utilization rate threshold, determining that the second operating system is to preempt the processing resource of 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 according to the executing services of the second operating system and the services to be executed by the second operating system, it is determined that the second operating system is to preempt the processing resources of the second operating system.

19. The embedded system according to claim 18, It is characterized in that The embedded system is further configured to determine that the first operating system refuses 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 not lower than the service priority of the service to be executed by the second 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, it is determined that the first operating system allows the second operating system to preempt the processing resources of the first operating system.

20. The embedded system according to claim 16, It is characterized in that 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 with an interrupt number of 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.

21. The embedded system according to claim 16, It is characterized in that The resource preemption and release module is used to obtain the second interaction response returned by the first operating system in response to the second interaction request through the inter-core communication interface by performing at least one of the following steps: transmitting 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; A resource release rejection response with interrupt number being 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.

22. The embedded system according to claim 9, It is characterized in that 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.

23. The embedded system according to any one of claims 1 to 22, It is characterized in that The embedded system further comprises: A system startup module, used for booting and running the 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 booting and running the second operating system on a second initial processing resource through the 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.

24. The embedded system according to claim 23, It is characterized in that The first initial processing resource is a designated processor core among the processor cores of the processor, and the second initial processing resource is other processor cores among the processor cores of the processor except the designated processor core.

25. The embedded system according to claim 23, It is characterized in that The system startup module is used to boot and run the first operating system on the 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 a secondary program loader.

26. The embedded system according to claim 25, It is characterized in that The 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.

27. The embedded system according to claim 25, It is characterized in that The system startup module is used to boot and run the second operating system on the second initial processing resource through a boot loader by executing the following steps: The second initial processing resource is awakened by the secondary program loader, and a universal boot loader is guided to execute, so as to guide and run the second operating system.

28. An embedded system, It is characterized in that include: 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 that 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 are run based on the processor, 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; The at least two operating systems communicate via the first bus; The at least two operating systems control the hardware controller through the second bus.

29. The embedded system according to claim 28, It is characterized in that The at least two operating systems include a first operating system running on at least one processor core of the processor and a second operating system running on at least one processor core, wherein 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 the 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.

30. The embedded system according to claim 29, It is characterized in that 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 the resource dynamic allocation rule.

31. The embedded system according to claim 30, It is characterized in that 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.

32. The embedded system according to claim 29, It is characterized in that The service management module is used to allocate the 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 performing at least one of the following steps: Allocate the services to be allocated whose service response speed requirements are greater than or equal to the set response speed threshold in the group of services to be allocated to the first operating system, and allocate the services to be allocated whose service response speed requirements are less than the set response speed threshold in the group of services to be allocated to the second operating system; Allocate the services to be allocated whose service resource occupancy rate is less than a first occupancy rate threshold value in the group of services to be allocated to the first operating system, and allocate the services to be allocated whose service resource occupancy rate is greater than or equal to the first occupancy rate threshold value in the group of services to be allocated to the second operating system; Allocate the to-be-allocated services that contain sensitive information in the group of to-be-allocated services to a target operating system, wherein the target operating system is an operating system that interacts less frequently with a user object between the first operating system and the second operating system.

33. The embedded system according to claim 29, It is characterized in that The service management module is further configured to allocate the group of services to be allocated to the corresponding operating system by performing at least one of the following steps: Allocating the services to be allocated, whose service coupling degree with the services allocated to the first operating system is greater than or equal to a first coupling degree threshold, to the first operating system in the group of services to be allocated; The services to be allocated, among the group of services to be allocated, whose service coupling degree with the services allocated to the second operating system is greater than or equal to a second coupling degree threshold, are allocated to the second operating system.

34. The embedded system according to claim 29, It is characterized in that The resource dynamic allocation module is used to determine the resource allocation result corresponding to the group of services to be allocated by executing the following steps: According to the allocation result of the service management module, 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 the group of services to be allocated and the processing resources of the processor is generated.

35. The embedded system according to claim 29, It is characterized in that 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.

36. The embedded system according to claim 29, It is characterized in that 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: When it is determined according to the resource allocation result that unallocated processing resources in the processing resources of the processor have corresponding to-be-allocated services, the unallocated processing resources are allocated to the operating system to which the to-be-allocated services corresponding to the unallocated processing resources are allocated.

37. The embedded system according to claim 29, It is characterized in that 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.

38. The embedded system according to claim 37, It is characterized in that The resource preemption and release module preempts and releases processing resources between the first operating system and the second operating system through the first bus, and the first bus is a bus for communication between different processor cores of the processor.

39. The embedded system according to claim 38, It is characterized in that 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: Transmitting a first interaction request of the first operating system to the second operating system via the first bus, 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, resource release; 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 the resource interaction with the second operating system according to the first interaction response.

40. The embedded system according to claim 39, It is characterized in that 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 perform the resource interaction with the second operating system, the resource preemption and release module is triggered to transmit the first interaction request to the second operating system through the first bus.

41. The embedded system according to claim 40, It is characterized in that The first system control module is further configured to perform at least one of the following steps: determining that the first operating system is to preempt the processing resources of the second operating system when the resource utilization rate of the processing resources of the first operating system is greater than or equal to a first utilization rate threshold; 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, it is determined that the processing resources of the first operating system are to be released to the second operating system.

42. The embedded system according to claim 40, It is characterized in that The first system control module is further configured 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.

43. The embedded system according to claim 39, It is characterized in that 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: transmitting a first preemption request whose interrupt number is the first interrupt number to the second operating system through the first bus, wherein the first preemption request is used to request to preempt processing resources of the second operating system; A resource release request with an interrupt number equal to the second interrupt number is transmitted to the second operating system via 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.

44. The embedded system according to claim 39, It is characterized in that 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: transmitting a second interaction request of the second operating system to the first operating system through the first bus, wherein the second interaction request is used to request to seize processing resources of the first operating system; 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.

45. The embedded system according to claim 44, It is characterized in that 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, trigger the resource preemption and release module to transmit the second interaction request to the first operating system through the first bus.

46. ​​The embedded system according to claim 45, It is characterized in that The second system control module is further configured to perform at least one of the following steps: When the current resource utilization rate of the processing resource of the second operating system is greater than or equal to a second utilization rate threshold, determining that the second operating system is to preempt the processing resource of 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 according to the executing services of the second operating system and the services to be executed by the second operating system, it is determined that the second operating system is to preempt the processing resources of the second operating system.

47. The embedded system according to claim 46, It is characterized in that The first operating system is further configured to determine that the first operating system refuses 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 not lower than the service priority of the service to be executed by the second 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, it is determined that the first operating system allows the second operating system to preempt the processing resources of the first operating system.

48. The embedded system according to claim 46, It is characterized in that 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 with an interrupt number of a 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 processing resources of the first operating system.

49. The embedded system according to claim 44, It is characterized in that The resource preemption and release module is used to obtain, through the first bus, a second interactive response returned by the first operating system in response to the second interactive request by performing at least one of the following steps: transmitting a resource release permission response whose interrupt number is a fourth interrupt number to the second operating system through the first bus, wherein the resource release permission response is used to indicate that the first operating system allows the second operating system to preempt the processing resources of the first operating system; 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.

50. The embedded system according to claim 37, It is characterized in that 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.

51. An embedded system according to any one of claims 29 to 50, It is characterized in that The processor is used to, after the chip is powered on, boot and run the first operating system on a first initial processing resource through a boot loader, and boot and run the second operating system on a second initial processing resource through the 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.

52. The embedded system according to claim 51, It is characterized in that The first initial processing resource is a designated processor core among the processor cores of the processor, and the second initial processing resource is other processor cores among the processor cores of the processor except the designated processor core.

53. The embedded system according to claim 51, It is characterized in that The processor is used to implement booting and running the first operating system on the 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 a secondary program loader.

54. The embedded system according to claim 53, It is characterized in that 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 solidified on the device mainboard, wherein the secondary program loader is executed after the check result of the security boot check is normal.

55. The embedded system according to claim 53, It is characterized in that 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 a universal boot loader is guided to execute, so as to guide and run the second operating system.

56. An embedded system according to any one of claims 29 to 50, It is characterized in that The at least two operating systems include a first operating system and a second operating system, wherein: The chip is further used to load the communication value into the first bus; The first bus is used to send 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.

57. An embedded system according to any one of claims 29 to 50, It is characterized in that The chip is further used to load the control value to the second bus; The second bus is used to send a control signal carrying the control value to a register corresponding to the hardware controller to implement the operating system's control over the hardware controller, wherein the control value is used to indicate the control content of the operating system over the hardware controller.

58. A method for operating an embedded system, It is characterized in that include: Allocating a group of services to be allocated 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, 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; Determine a resource allocation result corresponding to the set 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 set of services to be allocated among the processing resources of the processor, and the processing resources of the processor include a processor core; The processing resources of the processor are allocated 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.

59. The method according to claim 58, It is characterized in that The method further comprises: A rule structure is generated by reading a rule configuration file, wherein the rule structure is used to record the resource dynamic allocation rule.

60. The method according to claim 58, It is characterized in that The allocating a group of services to be allocated to the corresponding operating system in the embedded system according to the dynamic resource allocation rule comprises at least one of the following: Allocate the services to be allocated whose service response speed requirements are greater than or equal to the set response speed threshold in the group of services to be allocated to the first operating system, and allocate the services to be allocated whose service response speed requirements are less than the set response speed threshold in the group of services to be allocated to the first operating system. allocating the second operating system; Allocate the services to be allocated whose service resource occupancy rate is less than a first occupancy rate threshold value in the group of services to be allocated to the first operating system, and allocate the services to be allocated whose service resource occupancy rate is greater than or equal to the first occupancy rate threshold value in the group of services to be allocated to the second operating system; Allocate the to-be-allocated services that contain sensitive information in the group of to-be-allocated services to a target operating system, wherein the target operating system is an operating system that interacts less frequently with a user object between the first operating system and the second operating system.

61. The method according to claim 58, It is characterized in that The allocating a group of services to be allocated to the corresponding operating system in the embedded system according to the dynamic resource allocation rule comprises at least one of the following: Allocating the services to be allocated, whose service coupling degree with the services allocated to the first operating system is greater than or equal to a first coupling degree threshold, to the first operating system in the group of services to be allocated; The services to be allocated, among the group of services to be allocated, whose service coupling degree with the services allocated to the second operating system is greater than or equal to a second coupling degree threshold, are allocated to the second operating system.

62. The method according to claim 58, It is characterized in that The determining of the resource allocation result corresponding to the group of services to be allocated includes: According to the allocation result of the 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 the group of services to be allocated and the processing resources of the processor is generated.

63. The method according to claim 58, It is characterized in that The 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 of the services to be allocated and the resource allocation result includes: When it is determined according to the resource allocation result that unallocated processing resources in the processing resources of the processor have corresponding to-be-allocated services, the unallocated processing resources are allocated to the operating system to which the to-be-allocated services corresponding to the unallocated processing resources are allocated.

64. The method according to claim 58, It is characterized in that The method further comprises: Processing resources are preempted and released between the first operating system and the second operating system through an inter-core communication interface.

65. The method according to claim 64, It is characterized in that The preempting and releasing of processing resources between the first operating system and the second operating system through the inter-core communication interface includes: Transmitting a first interaction request of the first operating system to the second operating system through an 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; 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 the resource interaction with the second operating system according to the first interaction response.

66. The method according to claim 64, It is characterized in that The preempting and releasing of processing resources between the first operating system and the second operating system through the inter-core communication interface includes: Transmitting a second interaction request of the second operating system to the first operating system through an inter-core communication interface, wherein the second interaction request is used to request to seize processing resources of the first operating system; 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.

67. The method according to claim 66, It is characterized in that The method further comprises: detecting resource utilization of processing resources of the second operating system; 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, transmission of the second interaction request to the first operating system through the inter-core communication interface is triggered.

68. The method according to claim 67, It is characterized in that The method further comprises at least one of the following: When the current resource utilization rate of the processing resource of the second operating system is greater than or equal to the second utilization rate threshold, determining The second operating system is to preempt the processing resources of 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 according to the executing services of the second operating system and the services to be executed by the second operating system, it is determined that the second operating system is to preempt the processing resources of the second operating system.

69. The method according to claim 68, It is characterized in that The method further comprises: When the service priority of the to-be-executed service of the first operating system is not lower than the service priority of the to-be-allocated service of the second operating system, determining that the first operating system refuses the second operating system to preempt the processing resources of the first operating system; When the service priority of the to-be-executed service of the first operating system is lower than the service priority of the to-be-executed service of the second operating system, it is determined that the first operating system allows the second operating system to preempt processing resources of the first operating system.

70. The method according to any one of claims 58 to 69, It is characterized in that The method further comprises: After the chip where the processor is located is powered on, the first operating system is booted and run on the first initial processing resource through the boot loader, and the second operating system is booted and run on the second initial processing resource through the 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.

71. An operating device for an embedded system, It is characterized in that include: A first allocation unit 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, 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, configured to determine a resource allocation result corresponding to the set 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 set of services to be allocated among the processing resources of the processor, and the processing resources of the processor include a processor core; A second allocation unit is configured 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 of the services to be allocated and the resource allocation result.

72. A chip, It is characterized in that 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 method of any one of claims 58 to 70.

73. A BMC chip, It is characterized in that include: A storage unit and a processing unit connected to the storage unit, the storage unit being used to store a program, and the processing unit being used to run the program to execute the method as claimed in any one of claims 58 to 70.

74. A motherboard, It is characterized in that include: 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 method as claimed in any one of claims 58 to 70.

75. A server, It is characterized in that It 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; Memory, used to store computer programs; A processor, for implementing the method described in any one of claims 58 to 70 when executing a program stored in a memory.

76. A computer readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 58 to 70 when executed by a processor.

77. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method described in any one of claims 58 to 70 are implemented.

Citation Information

Patent Citations

  • Vehicle-mounted system

    CN106469283A

  • Electronic device, system-on-chip and physical core allocation method

    CN115413337A

  • Method and device for dynamically allocating hardware resources of system and computing equipment

    CN115421871A