CN117971447A - Inter-domain communication method of microkernel user mode system service layer and vehicle machine - Google Patents

Inter-domain communication method of microkernel user mode system service layer and vehicle machine Download PDF

Info

Publication number
CN117971447A
CN117971447A CN202211317447.2A CN202211317447A CN117971447A CN 117971447 A CN117971447 A CN 117971447A CN 202211317447 A CN202211317447 A CN 202211317447A CN 117971447 A CN117971447 A CN 117971447A
Authority
CN
China
Prior art keywords
time domain
real time
memory
real
task
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211317447.2A
Other languages
Chinese (zh)
Inventor
赵二涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Co Wheels Technology Co Ltd
Original Assignee
Beijing Co Wheels Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Co Wheels Technology Co Ltd filed Critical Beijing Co Wheels Technology Co Ltd
Priority to CN202211317447.2A priority Critical patent/CN117971447A/en
Publication of CN117971447A publication Critical patent/CN117971447A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The disclosure relates to an inter-domain communication method of a microkernel user mode system service layer and a vehicle, and relates to the technical field of automatic driving. Comprising the following steps: receiving a first real-time task; under the condition that the task type of the first real-time task is the target task type, the first real-time domain corresponding to the target task type processes the real-time task to obtain first task data; writing first task data into a first memory by a first real time domain; the second real time domain reads the first task data from the first memory to establish communication between the hard real time domain and the soft real time domain in the user mode system service layer. The embodiment of the disclosure meets the real-time requirement of automatic driving and ensures the stability of an automatic driving operation system.

Description

Inter-domain communication method of microkernel user mode system service layer and vehicle machine
Technical Field
The disclosure relates to the technical field of automatic driving, in particular to an inter-domain communication method of a microkernel user mode system service layer and a vehicle.
Background
The automatic driving operating system is a complex application system crossing industrial technologies and integrating multiple fields, the existing automatic driving operating system uses Linux kernels to meet the real-time requirement of automatic driving, as the Linux kernels are macro kernels, multiple functional modules are integrated in the kernels to realize the automatic driving function, however, if one functional module fails, the whole kernel is affected, so that the automatic driving operating system collapses, and the technical problem that needs to be solved is guaranteed when the real-time requirement of automatic driving is met.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an inter-domain communication method of a microkernel user mode system service layer and a vehicle machine, which can meet the real-time requirement of automatic driving and ensure the stability of an automatic driving operation system.
In order to achieve the above object, the technical solution provided by the embodiments of the present disclosure is as follows:
In a first aspect, the present disclosure provides an inter-domain communication method of a microkernel user mode system service layer, where the microkernel user mode system service layer is divided into a hard real time domain and a soft real time domain, and the hard real time domain and the soft real time domain share a first memory, the method includes:
Receiving a first real-time task;
Under the condition that the task type of the first real-time task is the target task type, the first real-time domain corresponding to the target task type processes the real-time task to obtain first task data;
writing first task data into a first memory by a first real time domain, wherein the first memory is a read-only memory aiming at a second real time domain;
The second real time domain reads the first task data from the first memory to establish communication between the hard real time domain and the soft real time domain in the microkernel user mode system service layer;
Wherein the first real time domain is a hard real time domain, and the second real time domain is a soft real time domain; or the first real time domain is a soft real time domain and the second real time domain is a hard real time domain.
As an optional implementation manner of the embodiment of the present disclosure, after the first real time domain writes the first task data into the first memory, the method further includes:
the first real time domain reads first task data from a first memory; rewriting the first task data to obtain second task data; writing second task data into the first memory;
the second real time domain reads the second task data from the first memory.
As an optional implementation manner of the embodiment of the present disclosure, before the first real time domain reads the first task data from the first memory, the method further includes:
receiving a second real-time task, wherein the second real-time task instructs the first real-time domain to rewrite the first task data;
rewriting the first task data to obtain second task data, including:
and the first real-time domain rewrites the first task data according to the second real-time task to obtain second task data.
As an optional implementation manner of the embodiment of the present disclosure, the hard real time domain and the soft real time domain share a second memory, where the second memory is a read-only memory for the first real time domain, and the method further includes:
The second real time domain rewrites the task data to obtain updated data, and writes the updated data into a second memory;
The first real time domain reads the update data from the second memory.
As an optional implementation manner of the embodiment of the present disclosure, before the first real time domain writes the first task data into the first memory, the method further includes:
receiving a memory allocation request, wherein the memory allocation request is used for requesting to set a physical page frame of a first memory;
and responding to the memory allocation request, and setting the memory corresponding to the physical page frame as the first memory.
As an optional implementation manner of the embodiment of the disclosure, the microkernel user mode system service layer includes at least one of the following modules:
the system comprises a process management module, a memory management module, a file system module, a network service module and a driving framework module.
As an optional implementation manner of the embodiment of the disclosure, the operating system including the microkernel user mode system service layer in any one of the optional implementation manners, the operating system further includes: a microkernel layer, a hardware layer;
The microkernel layer includes: a kernel core layer, an architecture support layer, and a platform support layer; wherein the kernel core layer comprises at least one of: the system comprises an initialization module, a kernel object management module, a permission management module, a scheduling module, an interrupt management module, a time management module, an inter-process communication module, a system call module and a health monitoring module.
In a second aspect, the present disclosure provides a vehicle mounted with an operating system in which a microkernel user mode system service layer is divided into a hard real time domain and a soft real time domain, the hard real time domain and the soft real time domain sharing a first memory, the vehicle comprising:
a receiving module for: receiving a first real-time task;
a processing module for: under the condition that the task type of the first real-time task is the target task type, the first real-time domain corresponding to the target task type processes the real-time task to obtain first task data;
and the read-write module is used for: writing first task data into a first memory by a first real time domain, wherein the first memory is a read-only memory aiming at a second real time domain;
The second real time domain reads the first task data from the first memory to establish communication between the hard real time domain and the soft real time domain in the microkernel user mode system service layer;
the first real time domain is a hard real time domain, the second real time domain is a soft real time domain, or the first real time domain is a soft real time domain, and the second real time domain is a hard real time domain.
As an optional implementation manner of the embodiment of the present disclosure, the read-write module is further configured to: the first real time domain reads first task data from a first memory; rewriting the first task data to obtain second task data; writing second task data into the first memory;
the second real time domain reads the second task data from the first memory.
As an optional implementation manner of the embodiment of the disclosure, the receiving module is further configured to: receiving a second real-time task, wherein the second real-time task instructs the first real-time domain to rewrite the first task data;
And the read-write module is used for: and the first real-time domain rewrites the first task data according to the second real-time task to obtain second task data.
As an optional implementation manner of the embodiment of the present disclosure, the hard real time domain and the soft real time domain share a second memory, where the second memory is a read-only memory of the first real time domain;
The read-write module is also used for: the second real time domain rewrites the task data to obtain updated data, and writes the updated data into a second memory;
The first real time domain reads the update data from the second memory.
As an optional implementation manner of the embodiment of the present disclosure, before the first real time domain writes the first task data into the first memory, the processing module is further configured to:
receiving a memory allocation request, wherein the memory allocation request is used for requesting to set a physical page frame of a first memory;
and responding to the memory allocation request, and setting the memory corresponding to the physical page frame as the first memory.
As an optional implementation manner of the embodiment of the disclosure, the microkernel user mode system service layer includes at least one of the following modules:
the system comprises a process management module, a memory management module, a file system module, a network service module and a driving framework module.
As an optional implementation manner of the embodiment of the disclosure, the operating system including the microkernel user mode system service layer in any one of the optional implementation manners, the operating system further includes: a microkernel layer, a hardware layer;
The microkernel layer includes: a kernel core layer, an architecture support layer, and a platform support layer; wherein the kernel core layer comprises at least one of: the system comprises an initialization module, a kernel object management module, a permission management module, a scheduling module, an interrupt management module, a time management module, an inter-process communication module, a system call module and a health monitoring module.
In a third aspect, the present disclosure provides an electronic device comprising: a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program when executed by the processor implementing the inter-domain communication method of the microkernel user mode system service layer as described in the first aspect or any of its alternative embodiments.
In a fourth aspect, the present disclosure provides a vehicle comprising: a vehicle as claimed in the second aspect or any optional embodiment thereof, or an electronic device as claimed in the third aspect.
In a fifth aspect, the present disclosure provides a computer-readable storage medium comprising: the computer readable storage medium stores thereon a computer program which when executed by a processor implements an inter-domain communication method of a microkernel user mode system service layer as described in the first aspect or any optional implementation thereof.
In a sixth aspect, the present disclosure provides a computer program product comprising: the computer program product comprises a computer program which, when run on a computer, causes the computer to implement the inter-domain communication method of the microkernel user mode system service layer as described in the first aspect or any of its alternative embodiments.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
The embodiment of the disclosure provides an inter-domain communication method and a vehicle machine of a microkernel user mode system service layer, wherein the microkernel user mode system service layer is divided into a hard real time domain and a soft real time domain, a first real time task is received first, under the condition that the task type of the first real time task is a target task type, the real time task is processed through the first real time domain corresponding to the target task type to obtain first task data, the processing of the corresponding real time domain according to the requirements of different real time tasks on the real time performance is realized, the processing real time performance of an operating system is ensured, the hard real time domain and the soft real time domain share a first memory, the first memory is a read-only memory aiming at a second real time domain, the first real time domain writes the task data into the first memory, then the second real time domain reads the first task data from the first memory, so that the real time communication is realized based on a shared memory mechanism, the communication real time performance of the operating system is ensured, and the operating system can be ensured based on the safety and stability of the microkernel.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic architecture diagram of a microkernel-based operating system provided by an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a software configuration item of a microkernel-based operating system provided by an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a microkernel architecture provided in an embodiment of the present disclosure;
Fig. 4 is a schematic architecture diagram of a user mode system service layer according to an embodiment of the present disclosure;
FIG. 5 is a flow chart of an inter-domain communication method of a microkernel user mode system service layer according to an embodiment of the disclosure;
FIG. 6 is a schematic diagram of communication between a hard real time domain and a soft real time domain provided by an embodiment of the present disclosure;
Fig. 7 is a schematic structural diagram of a vehicle machine according to an embodiment of the disclosure;
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the technical terms required to be used in the description of the embodiments or the prior art will be briefly described as follows:
Shared memory is the fastest form of Inter-process communication (IPC for short) available, allowing multiple processes to access the same block of memory space. The shared memory is often created by one process, and other processes can map the same segment of shared memory into their own address space, and all processes can access addresses in the shared memory. If one process writes data into the shared memory, the changed process can be seen by other processes accessing the same section of shared memory, so that the consumption of the memory in the large-scale data processing process is greatly reduced, and the data transmission speed is improved.
The autopilot operating system is a complex application system which is integrated across industries, technologies and fields, in new-generation electronic architectures and software architectures of automobiles and aviation, application programs with different functions and different security level requirements are highly integrated in a controller and a central computing unit, and in this case, higher requirements are put on the autopilot operating system, so that the autopilot operating system is required to provide a mechanism, and therefore, the application programs with different functions, different security levels and different real-time requirements can be ensured to run on the same standard hardware platform.
The existing autopilot operating system is mostly a Linux-based operating system, the kernel of the operating system is a Linux kernel, the real-time requirement can be met, but when the system load is high, uncertainty exists in real time, the real-time requirement of part of application programs in the autopilot operating system cannot be supported, the Linux kernel is a macro kernel, various functional modules are integrated in the kernel to realize the autopilot function, however, if one functional module fails, the whole kernel is affected, and the autopilot operating system is crashed.
In order to solve the problems, the embodiments of the present disclosure provide an inter-domain communication method and a vehicle machine for a microkernel user mode system service layer, where the method is applied to a microkernel-based operating system, the microkernel user mode system service layer in the operating system is divided into a hard real time domain and a soft real time domain, first a first real time task is received, under the condition that a task type of the first real time task is a target task type, the first real time domain corresponding to the target task type processes the first real time task to obtain first task data, and according to requirements of different real time tasks on instantaneity, the corresponding real time domains process, processing instantaneity of the operating system is guaranteed, and the hard real time domain and the soft real time domain share a first memory, the first memory is a read-only memory for a second real time domain, the first real time domain writes the task data into the first memory, and then the second real time domain reads the first task data from the first memory, so that real-time communication is realized based on a shared memory mechanism, real-time performance of the operating system is guaranteed, and the operating system is based on safety and stability of the microkernel.
The inter-domain communication method of the microkernel user mode system service layer provided in the embodiment of the disclosure can be realized through a vehicle-mounted device or an electronic device, wherein the electronic device comprises, but is not limited to, a server, a personal computer, a notebook computer, a tablet computer, a smart phone, a vehicle-mounted device and the like. The electronic device can independently operate to realize the disclosure, and can also access a network and realize the disclosure through interaction with other electronic devices in the network. The network in which the electronic device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a virtual private (Virtual Private Network, VPN) network, and the like.
As shown in fig. 1, fig. 1 is a schematic architecture diagram of a microkernel-based operating system according to an embodiment of the present disclosure. The illustrated operating system is a microkernel-based operating system, the architecture of which includes: a hardware layer, a microkernel layer and a user mode system service layer. It should be noted that, in the microkernel user mode system service layer provided by the present disclosure, the microkernel indicates that the operating system to which the method is applied is based on the microkernel, and in the following related description, the microkernel user mode system service layer is simply referred to as a user mode system service layer. The design for the operating system comprises the overall design of the system, the micro-kernel architecture design and the user mode system service layer design. In the whole design process of the system, the business requirement of the system is decomposed, the vulnerability analysis of the system is executed, and the design of the whole system architecture comprises the following steps: a hardware layer, a microkernel layer and a user mode system service layer.
As shown in fig. 2, fig. 2 is a schematic diagram of a software configuration item of a microkernel-based operating system according to an embodiment of the present disclosure. The software configuration items of the operating system of the vehicle machine comprise kernel layer software, user mode system service layer software, domain configuration table and system component fault countermeasures.
The kernel layer comprises kernel software; the user state system service layer comprises root service (process management and memory management) software, driving framework software, file system software and network service software; the configuration table comprises system resources used by a hard real time domain and a soft real time domain, such as user mode system service resources, time resources, memory resources, input/output (I/O) peripheral resources, inter-domain communication resources and maximum support task number; the system component fault countermeasures comprise system reset, microkernel restart, user mode system service restart, application software restart and fault record.
As shown in fig. 3, fig. 3 is a schematic architecture diagram of a microkernel according to an embodiment of the present disclosure, where the microkernel architecture includes a kernel core layer, an architecture support (Architecture Support Package, ARCH) layer, and a Platform support (Platform Support Package) layer. The kernel core layer is used for providing general functions of the microkernel; the ARCH layer is used to provide chip instruction level support and the Platform layer is used to provide Platform device level support.
The kernel core layer comprises an initialization module, a memory management module, a capability management module, a scheduling module, an interrupt management module, a time management module, an inter-process communication module, a synchronization module, a signal module and a system call module. According to the microkernel-based operating system provided by the disclosure, the basic functional modules are reserved in the microkernel, and compared with the linux kernel-based operating system in the prior art, the functional modules in the kernel are reduced.
The initialization module is used for executing initialization after the controller is electrified and the loading program is guided, establishing kernel virtual space mapping, completing initialization of other modules of the kernel and starting the multi-core, reading and checking a configuration table, and creating and starting root service processes of a hard real time domain and a soft real time domain according to the configuration table;
The memory management module is used for managing the corresponding hardware memory, controlling the quantity of the available physical memory of the application program and isolating the physical memory access between the application program or the equipment;
The right management module is used for providing right management and kernel object management of the process on resource operation;
And the scheduling module is used for providing a mixed scheduling mechanism of a hard real time domain and a soft real time domain. Specifically, a hard real time domain application process is scheduled according to a monotonic multi-Rate scheduling algorithm (Rate-Monotonic Scheduling); scheduling the soft real-time domain process according to a sporadic server scheduling algorithm (Sporadic Server Scheduling);
The interrupt management module is used for providing interrupt management and forwarding, in some embodiments, a user state process registers an interrupt event through a system call interface, and a kernel acquires the interrupt event and forwards the event to a user state interrupt service process responding to the interrupt event through an Inter-process communication (Inter-Process Communication, IPC) mechanism;
The time management module is used for providing a high-precision clock and supporting the timing and timer functions of a portable operating system interface timer (Portable Operating SYSTEM INTERFACETIMER, POSIX timer);
the inter-process communication module is used for providing an IPC message transfer mechanism which is suitable for inter-thread communication and communication with a system service layer;
the synchronous module is used for providing atomic operation, spin lock (spinlock), mutex lock (mutex) and quick user state mutex lock (Fast Userspace Mutex, futex) functions;
A Signal module for providing a portable operating system interface Signal (Portable Operating SYSTEM INTERFACESIGNAL, POSIX Signal) function;
and the system calling module is used for providing an interactive interface of the kernel space and the user space.
As shown in fig. 4, fig. 4 is a schematic architecture diagram of a user mode system service layer provided in an embodiment of the present disclosure, where the user mode system service layer includes: the system comprises a process management module, a memory management module, a file system module, a network service module and a driving framework module. And carrying out logic partition division on the user state system service layer to obtain a hard real time domain and a soft real time domain. The hard real-time domain processes the tasks through the user mode system services required by the hard real-time periodic tasks, and the soft real-time domain processes the soft real-time tasks through the user mode system services required by the soft real-time tasks. The microkernel-based operating system provided by the disclosure divides the user mode system service layer logic into a hard real time domain and a soft real time domain, and ensures the real time of the system through a domain isolation mechanism.
It should be noted that IPC is used as an interface between different user mode system services and between application software and user mode system services, and system call is used as an interface between user mode system service layers, application software and microkernel.
In the method, the process management module, the memory management module, the file system module, the network service module and the driving framework module are operated on the user mode system service layer in a system service mode, so that the safety and the reliability of an operating system are improved.
The process management module and the memory management module are used for providing a hard real-time domain service process and a soft real-time domain root service process. The hard time domain service process establishes a physical memory resource pool according to hard time domain memory resources in the configuration table, loads and starts other hard time domain system service processes from the root file system, including a file system service process, a network service process and a driving frame service process; the soft real-time domain root service process establishes a physical memory resource pool according to the soft real-time domain memory resources in the configuration table, and loads and starts other system service processes of the soft real-time domain from the root file system, including a file system service process, a network service process and a driving frame service process. It should be noted that, for the system service of the hard real time domain application software, firstly, a page fault allocation mechanism is designed and removed, and the uncertainty of task scheduling and execution time caused by page fault interruption is reduced; secondly, the dynamic memory allocation mechanism used by the application is used and released from a memory resource pool with a configured fixed size; third, the code and data segments of the application software are mapped in a complete manner at one time. The system services for soft real-time domain applications are designed according to dynamic system criteria.
The file system module is divided into a hard real time domain file system and a soft real time domain file system, wherein the hard real time domain file system processes hard real time domain key data, and the soft real time domain file system processes hard real time domain data. It should be noted that, the hard real time domain non-critical data is interactively processed by adopting a front-end and a back-end mode, the hard real time domain file system is the front end, and the soft real time domain file system is the back end.
The network service module is divided into a hard time domain network service and a soft real time domain network service, wherein the hard time domain network service processes the network service with the periodic input and output characteristics, the network service needing to be shared between the hard time domain and the soft real time domain is processed in an interactive mode of front and back ends, the hard time domain network service is used as a front end, and the soft real time domain network service is used as a back end; in addition, other network services are handled by the soft real-time domain network service.
The driving frame module is divided into hard real time domain driving and soft real time domain driving, wherein the hard real time domain driving is processed to have the driving with the periodic input and output characteristics, the driving which needs to be shared between the hard real time domain and the soft real time domain is processed in an interactive way by adopting a front end and a rear end, the hard real time domain driving is used as the front end, and the soft real time domain driving is used as the rear end; in addition, other drives are handled by soft real-time domain drives.
According to the operating system based on the microkernel, only the basic functional modules of the operating system such as the scheduling module, the inter-process communication module and the system call are provided in the kernel, compared with the existing operating system based on the Linux kernel, the functional modules such as the process management module, the memory management module, the driving framework module, the file system module and the network service module are run on the user system service layer in a system service mode, and under the condition that the function perfection of the operating system is ensured, the functional loss and the system breakdown caused by the fact that a certain module fault in the kernel is diffused to the whole kernel are avoided, and the stability and the reliability of the operating system are ensured. In addition, the microkernel-based operating system divides the user-mode system service layer logic into a hard real time domain and a soft real time domain, ensures the real-time performance of the system through a domain isolation mechanism, realizes the space isolation and the time isolation aiming at software application programs with different key levels, achieves the purposes of fault tolerance and simplified verification, and effectively ensures the independent safety of the application programs with different safety levels and different real-time requirements.
The inter-domain communication mode of the microkernel user mode system service layer provided by the disclosure is based on the architecture. It should be noted that, the protection scope of the inter-domain communication method of the microkernel user mode system service layer according to the embodiments of the present disclosure is not limited to the order of execution of the steps listed in the embodiments, and all the schemes implemented by adding or removing steps and replacing steps according to the prior art made according to the principles of the present disclosure are included in the protection scope of the present disclosure.
As shown in fig. 5, fig. 5 is a flow chart of an inter-domain communication method of a microkernel user mode system service layer according to an embodiment of the present disclosure, where the method includes:
S501, receiving a first real-time task.
The first real-time task carries task types, wherein the task types are classified into hard real-time types and soft real-time types, and the task types are used for distinguishing whether the first real-time task is the hard real-time task or the soft real-time task.
Hard real-time tasks require the system to ensure that the task executes for a worst-case execution time, i.e., the deadline for the response time of the real-time event must be met, otherwise fatal errors, such as vehicle emergency braking, will be incurred. Soft real-time tasks refer to statistically real-time, generally have large overall throughput or fast overall response speed, but cannot guarantee that a specific task is completed within a specified period.
In some embodiments, after receiving the real-time task, the task type of the real-time task is read, and whether the real-time task is a hard real-time task or a soft real-time task is determined according to the task type. The task types are divided to respectively adopt different scheduling methods for processing different types of real-time tasks.
S502, processing the real-time task in a first real-time domain corresponding to the target task type to obtain first task data under the condition that the task type of the real-time task is the target task type.
The target task type can be a hard real-time type or a soft real-time type, wherein the hard real-time type corresponds to a hard real-time domain, and the soft real-time type corresponds to a soft real-time domain. The first task data is data obtained after processing the real-time task, the task type and the task content of the real-time task are different, the first task data obtained through processing are also different, and the first task data is obtained through processing according to a specific real-time task, so that the disclosure is not limited.
In some embodiments, when the task type of the real-time task is a hard real-time type, the real-time task is represented as a hard real-time task, the first real-time domain is a hard real-time domain, and the hard real-time domain processes the hard real-time task to obtain first task data; or under the condition that the task type of the real-time task is a soft real-time type, the real-time task is represented as a soft real-time task, the first real-time domain is a soft real-time domain, and the soft real-time domain processes the soft real-time task to obtain first task data.
The real-time task is a vehicle emergency brake, the task type of the real-time task is determined to be a hard real-time type, the hard real-time domain processes the real-time task of the vehicle emergency brake, and the obtained first task data comprises, but is not limited to: braking anti-lock instruction and alarm reminding in the vehicle. The anti-lock braking command is issued from a hard real time domain of the operating system to a brake anti-lock braking system (ABS) to control rapid deceleration of the vehicle by the ABS and to prevent locking of the wheels; and compared with the priority of the anti-lock braking instruction, the alarm reminding in the automobile has the advantages that the real-time requirement is lower than that of the anti-lock braking instruction, and the alarm reminding is sent to the loudspeaker and the warning lamp in the cabin by the soft real-time domain of the operating system.
According to the embodiment, different real-time domains are utilized for processing the real-time tasks of different task types, so that the tasks with different real-time requirements can be met, and the real-time performance of the system is effectively ensured.
S503, the first real time domain writes first task data into the first memory.
As described above, the domain configuration table in the software configuration item of the operating system defines the physical page frame as the shared memory, and the hard real time domain and the soft real time domain communicate and data interact through the shared memory on the basis that the user state system service layer is divided into the hard real time domain and the soft real time domain.
The first memory is a memory shared by the first real time domain and the second real time domain, is a read-only memory for the second real time domain, and is used for responding to a writing operation of the first real time domain and responding to a reading operation of the second real time domain, and it can be understood that the first memory only allows the second real time domain to read data therefrom and prohibits the second real time domain from writing data therein. The first memory can be accessed by the first real-time domain or the second real-time domain, the first memory is created by a root service process of the first real-time domain, the first real-time domain can write data into the first memory, the second real-time domain can access the first memory in real time, and the data is read from the first memory. For example, the first memory is used for responding to a writing operation in the hard real time domain and responding to a reading operation in the soft real time domain.
In some embodiments, the size of the first memory may be customized, and the embodiments of the present disclosure provide an implementation manner, in which the operating system receives a memory allocation request, where the memory allocation request is used to set physical page frames of the first memory, it may be understood that, in a case where the configuration table defines a plurality of physical page frames as shared memories in a hard real time domain and a soft real time domain, a user may customize the size of the first memory, and in response to the memory allocation request, set a memory corresponding to the requested physical page frame as the first memory, so as to adjust the size of the first memory, for example, request a memory corresponding to more physical page frames as the first memory, where a storage space of the first memory becomes larger, and the first real time domain may be able to write more data into the first memory.
In some embodiments, when the task type of the real-time task is a hard real-time type, the first real-time domain is a hard real-time domain, and the first task data is written into the first memory through the hard real-time domain; or under the condition that the task type of the real-time task is a soft real-time type, the first real time domain is a soft real time domain, and the first task data is written into the first memory through the soft real time domain.
In some embodiments, after first task data is written into a first memory through a first real-time domain, a user-mode system service layer receives a new second real-time task, where the second real-time task indicates to rewrite the first task data, and in the embodiments of the present disclosure, an implementation manner is provided, the second real-time task is received, the first real-time domain reads the first task data from the first memory according to the second real-time task, and rewrites the first task data to obtain second task data, and then the first real-time domain writes the second task data into the first memory, so that data update on one side of the first real-time domain is realized, thereby ensuring that the first memory is used as a shared memory of the first real-time domain and the second real-time domain, reducing memory consumption in a data interaction process, and improving communication efficiency between different real-time domains, and thus ensuring real-time performance of the system.
In some embodiments, the first real-time domain may itself rewrite the first task data, as there is still communication interaction within the domain, e.g. there is data interaction between different applications in the first real-time domain, but such data interaction has not yet involved inter-domain communication. The embodiment of the disclosure provides an implementation manner, after first task data is written into a first memory in a first real-time domain, the first task data is read from the first memory, then the first task data is rewritten to obtain second task data, and further the second task data is written into the first memory, so that data update at one side of the first real-time domain is realized.
S504, the second real time domain reads the first task data from the first memory to establish communication between the hard real time domain and the soft real time domain in the user mode system service layer.
In some embodiments, when the task type of the real-time task is a hard real-time type, the first real-time domain is a hard real-time domain, and the second real-time domain is a soft real-time domain, and the soft real-time domain reads the first task data from the first memory. Or under the condition that the task type of the real-time task is a soft real-time type, the first real time domain is a soft real time domain, the second real time domain is a hard real time domain, and the hard real time domain reads the first task data from the first memory. Therefore, communication interaction by taking the hard real time domain as a communication initiator and taking the soft real time domain as a communication receiver is realized, and communication interaction by taking the hard real time domain as the communication initiator and taking the soft real time domain as the communication receiver is realized, and inter-domain two-way communication based on the division of a user state system service layer into the hard real time domain and the soft real time domain based on a domain isolation mechanism is realized.
Exemplary, as shown in fig. 6, fig. 6 is a schematic diagram of communication between a hard real time domain and a soft real time domain provided by an embodiment of the present disclosure. Fig. 6 includes a hard real time domain 601, a soft real time domain 602, and a first memory 603 and a second memory 604 that are shared between the hard real time domain 601 and the soft real time domain 602. Wherein, the first memory 603 only responds to the writing operation of the hard real time domain 601 and the reading operation of the soft real time domain 602; the second memory 604 is responsive only to write operations in the soft real-time domain 602 and read operations in the hard real-time domain 601.
In some embodiments, after the first task data is read from the first memory through the second real time domain, the first task data may be rewritten by the second real time domain to obtain the update data, and the update data is written into the second memory, so that the update data is read from the second memory by the first real time domain. The second memory is a memory shared by the first real time domain and the second real time domain, is a read-only memory for the first real time domain, and is configured to respond to a write operation of the second real time domain and respond to a read operation of the first real time domain, and it can be understood that the second memory only allows the first real time domain to read data therefrom, and prohibits the first real time domain from writing data therein. As described above, the second memory may be accessed by the first real-time domain or the second real-time domain, and the second memory is created by the root service process of the second real-time domain, where the second real-time domain may write data into the second memory, and the first real-time domain may access the second memory in real time, and read the data from the second memory.
In some embodiments, the size of the second memory may be customized, the operating system receives a memory allocation request for requesting to set a physical page frame of the second memory, and further sets, in response to the memory allocation request, a memory corresponding to the requested physical page frame as the second memory, so as to adjust the size of the second memory. It should be noted that, the setting of the first memory and/or the second memory according to the present disclosure may be set according to specific actual requirements, which is not limited herein. In the above embodiment, the first real time domain and the second real time domain share the first memory and the second memory, and the first memory is set to respond to the writing operation of the first real time domain and respond to the reading operation of the second real time domain, but not respond to the writing operation of the second real time domain, that is, only the first real time domain can write data into the first memory; meanwhile, the second memory is set to respond to the writing operation of the second real time domain and responds to the reading operation of the first real time domain, namely, the data is written into the second memory only by the second real time domain, so that the consistency of data updating is ensured, confusion of data writing and reading is avoided, and the stability and the reliability of the system are ensured.
In summary, the embodiments of the present disclosure provide an inter-domain communication method of a microkernel user mode system service layer, where the method is applied to a microkernel-based operating system, where the microkernel user mode system service layer in the operating system is divided into a hard real time domain and a soft real time domain, first receives a first real time task, and in the case that a task type of the first real time task is a target task type, processes the first real time task in the first real time domain corresponding to the target task type to obtain first task data, and implements requirements of different real time tasks on instantaneity, where the corresponding real time domain processes the first task data, so as to ensure processing instantaneity of the operating system, and the hard real time domain and the soft real time domain share the first memory, where the first memory is a read-only memory for a second real time domain, where the first real time domain writes task data into the first memory, and then the second real time domain reads the first task data from the first memory, so that real time communication instantaneity of the operating system is ensured based on a shared memory mechanism, and the operating system is capable of guaranteeing security and stability of the operating system based on microkernel.
As shown in fig. 7, fig. 7 is a schematic structural diagram of a vehicle machine according to an embodiment of the disclosure, where the vehicle machine includes:
a receiving module 701, configured to: receiving a first real-time task;
A processing module 702, configured to: under the condition that the task type of the first real-time task is the target task type, the first real-time domain corresponding to the target task type processes the real-time task to obtain first task data;
a read-write module 703, configured to: writing first task data into a first memory by a first real time domain, wherein the first memory is a read-only memory aiming at a second real time domain;
reading first task data from a first memory through a second real time domain to establish communication between a hard real time domain and a soft real time domain in a user mode system service layer;
the first real time domain is a hard real time domain, the second real time domain is a soft real time domain, or the first real time domain is a soft real time domain, and the second real time domain is a hard real time domain.
As an optional implementation manner of the embodiment of the present disclosure, the read-write module 703 is further configured to: the first real time domain reads first task data from a first memory; rewriting the first task data to obtain second task data; writing second task data into the first memory; the second real time domain reads the second task data from the first memory.
As an alternative implementation of the embodiment of the disclosure, the receiving module 701 is further configured to: receiving a second real-time task, wherein the second real-time task instructs the first real-time domain to rewrite the first task data;
A read-write module 703, configured to: and the first real-time domain rewrites the first task data according to the second real-time task to obtain second task data.
As an optional implementation manner of the embodiment of the present disclosure, the hard real time domain and the soft real time domain share a second memory, where the second memory is a read-only memory for the first real time domain;
The read-write module 703 is further configured to: the second real time domain rewrites the task data to obtain updated data, and writes the updated data into a second memory; the first real time domain reads the update data from the second memory.
As an optional implementation manner of the embodiment of the present disclosure, before the first real time domain writes the first task data into the first memory, the processing module 702 is further configured to:
receiving a memory allocation request, wherein the memory allocation request is used for requesting to set a physical page frame of a first memory;
and responding to the memory allocation request, and setting the memory corresponding to the physical page frame as the first memory.
As an optional implementation manner of the embodiment of the present disclosure, the user mode system service layer includes at least one of the following modules: the system comprises a process management module, a memory management module, a file system module, a network service module and a driving framework module.
As an alternative implementation of the disclosed embodiment, the microkernel-based operating system further includes: a microkernel layer, a hardware layer; the microkernel layer includes: a kernel core layer, an architecture support layer, and a platform support layer; wherein the kernel core layer comprises at least one of: the system comprises an initialization module, a kernel object management module, a permission management module, a scheduling module, an interrupt management module, a time management module, an inter-process communication module, a system call module and a health monitoring module.
In summary, the embodiment of the disclosure provides a vehicle machine, which is provided with an operating system based on a microkernel, wherein a user state system service layer in the operating system is divided into a hard real time domain and a soft real time domain, a receiving module firstly receives a first real time task, and a processing module processes the real time task through a first real time domain corresponding to a target task type under the condition that the task type of the first real time task is the target task type, so as to obtain first task data, realize the requirement of different real time tasks on instantaneity, process the corresponding real time domain, ensure the processing instantaneity of the operating system, and the hard real time domain and the soft real time domain share a first memory, a reading module writes the task data into the first memory through the first real time domain, the first memory is a read-only memory aiming at a second real time domain, and then the second real time domain reads the first task data from the first memory, thereby realizing real-time communication based on a shared memory mechanism, ensuring the real-time performance of the operating system, and the operating system is based on the security and stability of the microkernel.
As shown in fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, where the electronic device includes: the system comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program realizes each process of the inter-domain communication method of the microkernel user mode system service layer in the method embodiment when being executed by the processor. And the same technical effects can be achieved, and in order to avoid repetition, the description is omitted here.
The embodiment of the disclosure provides a vehicle, which includes the vehicle machine as described above, or the electronic device as described above, and is used for executing the inter-domain communication method of the microkernel user mode system service layer provided by any embodiment of the disclosure, and the same technical effects can be achieved, so that repetition is avoided, and no redundant description is provided herein.
The embodiments of the present disclosure provide a computer readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements each process of the inter-domain communication method of the microkernel user mode system service layer in the foregoing method embodiment, and the same technical effect can be achieved, so that repetition is avoided, and details are not repeated here.
The computer readable storage medium may be a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk.
The embodiments of the present disclosure provide a computer program product, where the computer program product stores a computer program, and when the computer program is executed by a processor, the process of the inter-domain communication method of the microkernel user mode system service layer in the foregoing method embodiment is implemented, and the same technical effect can be achieved, so that repetition is avoided, and no detailed description is given here.
It will be appreciated by those skilled in the art that embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In this disclosure, the Processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In the present disclosure, memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash RAM, in a computer readable medium. Memory is an example of a computer-readable medium.
In the present disclosure, computer readable media include both permanent and non-permanent, removable and non-removable storage media. Storage media may embody any method or technology for storage of information, which may be computer readable instructions, data structures, program modules, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The above is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. The inter-domain communication method of the microkernel user mode system service layer is characterized in that the microkernel user mode system service layer is divided into a hard real time domain and a soft real time domain, and the hard real time domain and the soft real time domain share a first memory, and the inter-domain communication method comprises the following steps:
Receiving a first real-time task;
under the condition that the task type of the first real-time task is the target task type, the first real-time domain corresponding to the target task type processes the real-time task to obtain first task data;
the first real time domain writes the first task data into a first memory, wherein the first memory is a read-only memory aiming at a second real time domain;
The second real time domain reads the first task data from the first memory to establish communication between a hard real time domain and a soft real time domain in the microkernel user mode system service layer;
Wherein the first real time domain is the hard real time domain, and the second real time domain is the soft real time domain; or the first real time domain is the soft real time domain, and the second real time domain is the hard real time domain.
2. The method of claim 1, wherein after the first real-time domain writes the first task data to the first memory, the method further comprises:
The first real time domain reads the first task data from the first memory; rewriting the first task data to obtain second task data; writing the second task data into a first memory;
and the second real time domain reads the second task data from the first memory.
3. The method of claim 2, wherein before the first real time domain reads the first task data from the first memory, the method further comprises:
Receiving a second real-time task, wherein the second real-time task instructs the first real-time domain to rewrite the first task data;
the rewriting the first task data to obtain second task data includes:
and the first real-time domain rewrites the first task data according to the second real-time task to obtain the second task data.
4. The method of claim 1, wherein the hard real time domain and soft real time domain share a second memory, the second memory being a read-only memory for the first real time domain, the method further comprising:
the second real time domain rewrites the first task data to obtain updated data, and writes the updated data into the second memory;
and the first real time domain reads the update data from the second memory.
5. The method of claim 1, wherein before the first real-time domain writes the first task data to the first memory, the method further comprises:
receiving a memory allocation request, wherein the memory allocation request is used for requesting to set a physical page frame of a first memory;
And responding to the memory allocation request, and setting the memory corresponding to the physical page frame as a first memory.
6. The method of claim 1, wherein the microkernel user mode system service layer comprises at least one of the following modules:
the system comprises a process management module, a memory management module, a file system module, a network service module and a driving framework module.
7. The method of any of claims 1 to 6, comprising an operating system of the microkernel user mode system services layer, the operating system further comprising: a microkernel layer, a hardware layer;
The microkernel layer includes: a kernel core layer, an architecture support layer, and a platform support layer; wherein the kernel core layer comprises at least one of: the system comprises an initialization module, a kernel object management module, a permission management module, a scheduling module, an interrupt management module, a time management module, an inter-process communication module, a system call module and a health monitoring module.
8. The utility model provides a car machine, its characterized in that installs operating system, microkernel user mode system service layer divide into hard real time domain and soft real time domain in the operating system, hard real time domain with soft real time domain sharing first memory, the car machine includes:
a receiving module for: receiving a first real-time task;
A processing module for: processing the real-time task in a first real-time domain corresponding to the target task type to obtain first task data under the condition that the task type of the first real-time task is the target task type, wherein the first memory is a read-only memory aiming at a second real-time domain;
and the read-write module is used for: the first real time domain writes the first task data into a first memory;
the second real time domain reads the first task data from the first memory to establish communication between the hard real time domain and the soft real time domain in the microkernel user mode system service layer;
the first real time domain is the hard real time domain, the second real time domain is the soft real time domain, or the first real time domain is the soft real time domain, and the second real time domain is the hard real time domain.
9. An electronic device, comprising: a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the inter-domain communication method of the microkernel user mode system service layer of any of claims 1 to 7.
10. A vehicle, characterized by comprising:
the vehicle of claim 8; or an electronic device as claimed in claim 9.
CN202211317447.2A 2022-10-26 2022-10-26 Inter-domain communication method of microkernel user mode system service layer and vehicle machine Pending CN117971447A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211317447.2A CN117971447A (en) 2022-10-26 2022-10-26 Inter-domain communication method of microkernel user mode system service layer and vehicle machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211317447.2A CN117971447A (en) 2022-10-26 2022-10-26 Inter-domain communication method of microkernel user mode system service layer and vehicle machine

Publications (1)

Publication Number Publication Date
CN117971447A true CN117971447A (en) 2024-05-03

Family

ID=90846526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211317447.2A Pending CN117971447A (en) 2022-10-26 2022-10-26 Inter-domain communication method of microkernel user mode system service layer and vehicle machine

Country Status (1)

Country Link
CN (1) CN117971447A (en)

Similar Documents

Publication Publication Date Title
US11550641B2 (en) Extending the kubernetes API in-process
CN104111897A (en) Data processing method, data processing device and computer system
US7661115B2 (en) Method, apparatus and program storage device for preserving locked pages in memory when in user mode
CN107239319B (en) Data storage method and device of virtual machine
US10802875B2 (en) Multithread framework for use in pre-boot environment of a system-on-chip
US10459771B2 (en) Lightweight thread synchronization using shared memory state
CN114168271B (en) Task scheduling method, electronic device and storage medium
CN113010265A (en) Pod scheduling method, scheduler, memory plug-in and system
US20220261489A1 (en) Capability management method and computer device
US9606827B2 (en) Sharing memory between guests by adapting a base address register to translate pointers to share a memory region upon requesting for functions of another guest
US20180365080A1 (en) Architecture and services supporting reconfigurable synchronization in a multiprocessing system
CN113377517B (en) Thread scheduling method and system based on real-time operating system
CN112330229B (en) Resource scheduling method, device, electronic equipment and computer readable storage medium
CN114546642A (en) Task execution method, device, computer equipment, storage medium and program product
US8010963B2 (en) Method, apparatus and program storage device for providing light weight system calls to improve user mode performance
CN117971447A (en) Inter-domain communication method of microkernel user mode system service layer and vehicle machine
US10303507B2 (en) Off-the-shelf software component reuse in a cloud computing environment
CN117971407A (en) Inter-domain communication method of microkernel user mode system service layer and vehicle machine
WO2024074090A1 (en) Smart cockpit implementation method, smart cockpit, and computer readable medium
US11385927B2 (en) Interrupt servicing in userspace
US20120054773A1 (en) Processor support for secure device driver architecture
Brewerton et al. Hardware based paravirtualization: simplifying the co-hosting of legacy code for mixed criticality applications
US10922149B2 (en) System comprising a plurality of virtualization systems
US20230067658A1 (en) System and operation method of hybrid virtual machine managers
Lampka et al. Safety Certification with the Open Source Microkernel-Based Operating System L4Re

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination