Kernel object management method, device and equipment of intelligent automobile operating system

By obtaining the object creation request of the target process in the intelligent car operating system, obtaining memory information in the kernel space, determining and initializing the standard kernel object, establishing its association relationship with the process, and generating object ID, the existing system's inefficiency and insufficient security in kernel object management is solved, and efficient, safe and reliable kernel object management is achieved.

CN119883704APending Publication Date: 2025-04-25ZEBRED NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411954849.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The existing smart car operating systems have problems in the management of kernel object, inability to achieve unified management, low creation and conversion efficiency, security impacts on feature values ​​only as count IDs, and easy to cause kernel process crashes in the case of multi-threaded concurrent deletion.

Method used

By obtaining the object creation request of the target process, obtaining the memory information in the memory pool of the kernel space, determining the standard kernel object corresponding to the target process, and initializing it, establishing the association relationship between the kernel object and the process, generating the object ID, and sending the ID in the user state. This method realizes unified management of kernel objects, improves creation and conversion efficiency, and improves system reliability through delayed deletion mechanism.

Benefits of technology

It realizes unified management of kernel objects, improves the management efficiency and real-time of kernel objects, enhances the security of the system, and improves the reliability of kernel objects through the delayed deletion mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883704A_ABST
    Figure CN119883704A_ABST
Patent Text Reader

Abstract

The invention provides a kernel object management method, device and equipment of an intelligent automobile operating system, which can be used in the technical field of computers. The method comprises the following steps: acquiring an object creation request sent by a target process, acquiring memory information corresponding to a plurality of memory blocks in a memory pool of a kernel space according to the object creation request, determining a standard kernel object corresponding to the target process from the plurality of memory blocks according to the memory information, and determining a kernel object corresponding to the target process according to the target process. Performing initialization processing on the standard kernel object to obtain a target kernel object, establishing an association relationship between the target kernel object and the target process, and sending an object ID corresponding to the target kernel object to a user mode; according to the method, unified management of the kernel objects of the intelligent automobile operating system is realized, and the management efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a kernel object management method, device and equipment for an intelligent automobile operating system. Background Art

[0002] At present, the architecture of smart car operating system includes macro kernel architecture and micro kernel architecture. Among them, by decoupling the operating system of macro kernel architecture, a single function or module is separated from the kernel and deployed as an independent service in an independent operating environment; the kernel only retains a few functions and provides basic capabilities such as communication for these services, so that they can cooperate with each other to complete the functions required by the operating system. This architecture is called microkernel. Under the microkernel architecture, services are completely isolated from each other. Even if a single service fails or is attacked by security, it will not directly cause the entire operating system to crash or be hacked, thereby effectively improving the reliability and security of the operating system. In addition, the microkernel architecture brings about a further separation of mechanism and strategy, and it is also more convenient to customize different services for different scenarios, so as to better adapt to different application requirements.

[0003] The monolithic kernel is also called a single kernel. Its characteristic is that all modules of the operating system kernel run in kernel state and have the ability to directly operate hardware. As the kernel functions of the monolithic kernel operating system continue to grow, the complexity of the system continues to increase, causing more problems in terms of reliability and security. This is because under the monolithic kernel architecture, all kernel modules run in privileged space, and a single point of error may cause the entire system to crash or be compromised.

[0004] The existing intelligent automobile operating system provides services through system calls. It creates a kernel object data structure in the kernel to complete the current system call request, and returns the feature value of the object to the user state for use. Multiple processes or threads can simultaneously use the feature value of the object to request corresponding services through the system call interface. However, the existing intelligent automobile operating system has the following problems in the management method of kernel objects: it is impossible to achieve unified management of kernel objects, and the creation and conversion efficiency of kernel objects is relatively low, which affects the operating efficiency and real-time performance of the intelligent automobile operating system; the corresponding feature value returned by the kernel object is only a counted ID, which is easy to cause access anomalies or kernel crashes and other problems that affect system security; in the case of concurrent deletion of multiple threads or multiple processes, a certain erroneous operation may cause the object to be deleted prematurely, thereby causing the crash of the kernel process. Summary of the invention

[0005] The present application provides a kernel object management method, device and equipment for an intelligent automobile operating system, which is used to solve the problems existing in the kernel object management method of the existing intelligent automobile operating system, such as the inability to achieve unified management of kernel objects, low efficiency in creating and converting kernel objects; the corresponding characteristic value returned by the kernel object is only a counted ID, which can easily affect the security of the operating system; and the kernel process can easily crash in the case of concurrent deletion of multiple threads.

[0006] In a first aspect, the present application provides a kernel object management method for an intelligent automobile operating system, the method comprising:

[0007] Obtain an object creation request sent by the target process, and obtain memory information corresponding to multiple memory blocks in a memory pool of the kernel space according to the object creation request;

[0008] Determining, according to the memory information, a standard kernel object corresponding to the target process from the plurality of memory blocks;

[0009] According to the target process, the standard kernel object is initialized to obtain a target kernel object;

[0010] An association relationship between the target kernel object and the target process is established, and an object ID corresponding to the target kernel object is sent to the user state.

[0011] Optionally, the memory information includes: a storage state and a memory size of a plurality of pre-allocated candidate kernel objects, and determining, according to the memory information, a standard kernel object corresponding to the target process from the plurality of memory blocks includes:

[0012] Determine a target memory block according to the storage status of the multiple memory blocks, wherein the target memory block is the first memory block whose storage status is an idle state;

[0013] According to the memory sizes of the plurality of pre-allocated candidate kernel objects, the standard kernel object matching the target process is determined from the plurality of pre-allocated candidate kernel objects of the target memory block.

[0014] Optionally, the initializing the standard kernel object according to the target process to obtain the target kernel object includes:

[0015] According to the target process, determining an object entity corresponding to the target process;

[0016] The standard kernel object is initialized according to the object entity to obtain the target kernel object, wherein the initialization process includes: assignment of entity and type, initialization of lock, initialization of reference count, generation of check value and state initialization.

[0017] Optionally, establishing an association relationship between the target kernel object and the target process includes:

[0018] Determine the index value of the target kernel object according to the memory number of the target memory block, the number of the plurality of pre-allocated candidate kernel objects, the kernel object address of the target kernel object, the memory block start address of the target memory block and the total length of the data structure of the plurality of pre-allocated candidate kernel objects;

[0019] Generate an object ID corresponding to the target kernel object according to the check domain corresponding to the check value, the iteration domain corresponding to the target kernel object, the iteration domain corresponding to the target memory block, and the index value of the target kernel object;

[0020] An association relationship is established between the object ID and the kernel object address of the target kernel object.

[0021] Optionally, the method further includes:

[0022] Before the target kernel object is used by any thread in the target process or by a second process, the target kernel object is locked, and the target kernel object is verified according to the current state, type, object ID and verification value of the target kernel object;

[0023] After the target kernel object is successfully verified, the reference count of the target kernel object is increased by one, and the target kernel object is unlocked, so that any thread in the target process or the second process uses the target kernel object for service processing;

[0024] After any thread in the target process or the second process completes using the target kernel object, locking the target kernel object, and verifying the target kernel object according to the current state, type, object ID and check value of the target kernel object;

[0025] After the target kernel object is successfully verified, the reference count of the target kernel object is reduced by one.

[0026] Optionally, after decrementing the reference count of the target kernel object, the method further includes:

[0027] Determine whether the target kernel object is in a state to be destroyed;

[0028] If the target kernel object is in a to-be-destroyed state, determining whether a reference count of the target kernel object is zero;

[0029] If the reference count of the target kernel object is zero, unlock the target kernel object and destroy the target kernel object; if the reference count of the target kernel object is not zero, return;

[0030] If the target kernel object is not in a state to be destroyed, return.

[0031] Optionally, after establishing the association relationship between the target kernel object and the target process, the method further includes:

[0032] Adding the identifier of the target kernel object to the resource queue of the target process;

[0033] The destroying process of the target kernel object includes:

[0034] When receiving a destruction instruction sent by a user or the target process exits, locking the target kernel object, and verifying the target kernel object according to the current state, type, object ID and check value of the target kernel object;

[0035] After the target kernel object is successfully verified, determining whether the target kernel object is in a state to be destroyed;

[0036] If the target kernel object is in a state to be destroyed, return;

[0037] If the target kernel object is not in a to-be-destroyed state, determining whether a reference count of the target kernel object is zero;

[0038] If the reference count of the target kernel object is zero, resetting the parameters of the target kernel object so that the target kernel object is converted into the standard kernel object, and releasing the standard kernel object to the target memory block; deleting the object entity corresponding to the target kernel object, and deleting the identifier of the target kernel object from the resource queue;

[0039] If the reference count of the target kernel object is not zero, the state of the target kernel object is modified to a to-be-destroyed state.

[0040] In a second aspect, the present application provides a kernel object management device for an intelligent automobile operating system, the device comprising:

[0041] An acquisition module, used to acquire an object creation request sent by a target process, and acquire memory information corresponding to a plurality of memory blocks in a memory pool of a kernel space according to the object creation request;

[0042] A processing module, configured to determine, from the plurality of memory blocks, a standard kernel object corresponding to the target process according to the memory information;

[0043] The processing module is further used to initialize the standard kernel object according to the target process to obtain a target kernel object;

[0044] The processing module is further used to establish an association relationship between the target kernel object and the target process, and send the object ID corresponding to the target kernel object to the user state.

[0045] Optionally, the processing module is further used to determine a target memory block according to the storage status of the multiple memory blocks, and the target memory block is the first memory block whose storage status is an idle state;

[0046] The processing module is further used to determine the standard kernel object matching the target process from the multiple pre-allocated candidate kernel objects of the target memory block according to the memory sizes of the multiple pre-allocated candidate kernel objects.

[0047] Optionally, the processing module is further used to determine an object entity corresponding to the target process according to the target process;

[0048] The processing module is also used to initialize the standard kernel object according to the object entity to obtain the target kernel object, and the initialization process includes: assignment of entity and type, initialization of lock, initialization of reference count, generation of check value and state initialization.

[0049] Optionally, the processing module is further used to determine the index value of the target kernel object according to the memory number of the target memory block, the number of the multiple pre-allocated candidate kernel objects, the kernel object address of the target kernel object, the memory block start address of the target memory block and the total length of the data structure of the multiple pre-allocated candidate kernel objects;

[0050] The processing module is further used to generate an object ID corresponding to the target kernel object according to the check domain corresponding to the check value, the iteration domain corresponding to the target kernel object, the iteration domain corresponding to the target memory block and the index value of the target kernel object;

[0051] The processing module is further used to establish an association relationship between the object ID and the kernel object address of the target kernel object.

[0052] Optionally, the processing module is further used to lock the target kernel object before the target kernel object is used by any thread in the target process or by the second process, and to verify the target kernel object according to the current state, type, object ID and verification value of the target kernel object;

[0053] The processing module is further configured to, after the target kernel object is successfully verified, increase the reference count of the target kernel object by one, and unlock the target kernel object, so that any thread in the target process or the second process uses the target kernel object for service processing;

[0054] The processing module is further configured to lock the target kernel object after any thread in the target process or the second process completes using the target kernel object, and to verify the target kernel object according to the current state, type, object ID and verification value of the target kernel object;

[0055] The processing module is further configured to reduce the reference count of the target kernel object by one after the target kernel object is successfully verified.

[0056] Optionally, the device further includes: a judgment module;

[0057] The judging module is used to judge whether the target kernel object is in a state to be destroyed;

[0058] The judging module is further configured to judge whether the reference count of the target kernel object is zero when the target kernel object is in a state to be destroyed;

[0059] The processing module is further used to unlock the target kernel object and destroy the target kernel object when the reference count of the target kernel object is zero; the processing module is further used to return when the reference count of the target kernel object is not zero;

[0060] The processing module is further configured to return when the target kernel object is not in a state to be destroyed.

[0061] Optionally, the processing module is further used to add the identifier of the target kernel object to the resource queue of the target process;

[0062] The processing module is further used to lock the target kernel object when receiving a destruction instruction sent by a user or when the target process exits, and to verify the target kernel object according to the current state, type, object ID and verification value of the target kernel object;

[0063] The judging module is further configured to judge whether the target kernel object is in a state to be destroyed after the target kernel object is successfully verified;

[0064] The processing module is further configured to return when the target kernel object is in a state to be destroyed;

[0065] The processing module is further used to determine whether the reference count of the target kernel object is zero when the target kernel object is not in a state to be destroyed;

[0066] The processing module is further used for resetting the parameters of the target kernel object when the reference count of the target kernel object is zero, so that the target kernel object is converted into the standard kernel object, and releasing the standard kernel object to the target memory block; deleting the object entity corresponding to the target kernel object, and deleting the identifier of the target kernel object from the resource queue;

[0067] The processing module is further configured to modify the state of the target kernel object to a to-be-destroyed state when the reference count of the target kernel object is not zero.

[0068] In a third aspect, the present application provides a kernel object management device for an intelligent automobile operating system, including:

[0069] Memory;

[0070] processor;

[0071] Wherein, the memory stores computer-executable instructions;

[0072] The processor executes the computer-executable instructions stored in the memory to implement the kernel object management method of the intelligent automobile operating system as described in the above-mentioned first aspect and various possible implementation methods of the first aspect.

[0073] In a fourth aspect, the present application provides a computer storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the kernel object management method of an intelligent automobile operating system as described in the first aspect and various possible implementation methods of the first aspect.

[0074] The kernel object management method of the intelligent automobile operating system provided in the present application obtains an object creation request sent by a target process, and obtains memory information corresponding to multiple memory blocks in a memory pool of a kernel space according to the object creation request, determines a standard kernel object corresponding to the target process from the multiple memory blocks according to the memory information, initializes the standard kernel object according to the target process to obtain a target kernel object, establishes an association relationship between the target kernel object and the target process, and sends the object ID corresponding to the target kernel object to the user state; the method realizes unified management of kernel objects and improves the management efficiency of kernel objects. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0076] Figure 1 A schematic diagram of an application scenario of the kernel object management method of the intelligent automobile operating system provided in this application;

[0077] Figure 2 The process of the kernel object management method of the intelligent automobile operating system provided in this application Figure 1 ;

[0078] Figure 3 A schematic diagram of the data structure of the kernel object provided for this application;

[0079] Figure 4 The process of the kernel object management method of the intelligent automobile operating system provided in this application Figure 2 ;

[0080] Figure 5 The process of the kernel object management method of the intelligent automobile operating system provided by this application Figure 3 ;

[0081] Figure 6 A schematic diagram of the structure of the kernel object management device of the intelligent automobile operating system provided by this application;

[0082] Figure 7 A schematic diagram of the structure of the kernel object management device of the intelligent automobile operating system provided in this application.

[0083] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0084] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0085] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein.

[0086] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0087] First, the terms involved in this application are explained.

[0088] Kernel object: An abstract concept used to manage resources (such as files, processes, threads, etc.) in the operating system. It is created and maintained by the kernel and used by applications through the API provided by the kernel.

[0089] The management of kernel objects includes operations such as creation, opening, closing, deletion, and query, as follows:

[0090] Create an object: The application requests the kernel to create an object through the API provided by the kernel. The kernel returns the object handle or ID to the application and creates the corresponding object management structure internally.

[0091] Open object: An application can open an existing object through the API provided by the kernel and obtain the object handle to operate it.

[0092] Close an object: The application closes the object handle through the API provided by the kernel. At this time, the kernel releases the corresponding object management structure and may delete the object itself if there are no other references to the object.

[0093] Deleting an object: The application requests the kernel to delete an object through the API provided by the kernel, and the kernel will delete the corresponding object management structure and the object itself.

[0094] Query object: The application queries the properties or status of an object through the API provided by the kernel.

[0095] The management of kernel objects needs to consider concurrent operations and synchronization issues in multi-threaded and multi-process situations. Various synchronization primitives (such as mutex locks, critical sections, semaphores, etc.) are usually used to ensure the correctness and effectiveness of object access.

[0096] At present, the architecture of smart car operating system includes macro kernel architecture and micro kernel architecture. Among them, by decoupling the operating system of macro kernel architecture, a single function or module is separated from the kernel and deployed as an independent service in an independent operating environment; the kernel only retains a few functions and provides basic capabilities such as communication for these services, so that they can cooperate with each other to complete the functions required by the operating system. This architecture is called microkernel. Under the microkernel architecture, services are completely isolated from each other. Even if a single service fails or is attacked by security, it will not directly cause the entire operating system to crash or be hacked, thereby effectively improving the reliability and security of the operating system. In addition, the microkernel architecture brings about a further separation of mechanism and strategy, and it is also more convenient to customize different services for different scenarios, so as to better adapt to different application requirements.

[0097] The monolithic kernel is also called a single kernel. Its characteristic is that all modules of the operating system kernel run in kernel state and have the ability to directly operate hardware. As the kernel functions of the monolithic kernel operating system continue to grow, the complexity of the system continues to increase, causing more problems in terms of reliability and security. This is because under the monolithic kernel architecture, all kernel modules run in privileged space, and a single point of error may cause the entire system to crash or be compromised.

[0098] In smart car operating systems, most systems provide services through system calls. The first step of a system call is to create a kernel object (such as process, thread, semaphore, lock, message queue, timer, etc.) data structure in the kernel to complete the current system call request, and return the characteristic value of the object (such as kernel address, handle or ID) to the user state for use. Multiple processes or threads can simultaneously use the characteristic value of the object to request corresponding services through the system call interface.

[0099] There are three main kernel management methods for existing smart car operating systems:

[0100] The kernel objects of Linux, the mainstream macro kernel operating system in the industry, are managed through kernel data structures. Each object has a corresponding data structure to describe its attributes and status. Kernel objects include processes, files, devices, semaphores, locks, waiting queues, etc.

[0101] 1. Linux kernel objects use a technique called reference counting to manage memory usage. The basic idea of ​​this technique is to maintain a counter in the data structure of each kernel object, which indicates how many places currently reference this object. When a new reference is established, the counter increases by one. When the reference is canceled, the counter decreases by one. When the counter value reaches 0, it means that the object is no longer referenced by anywhere, and the kernel can release the memory occupied by the object.

[0102] The Linux kernel manages IPC class objects mainly through kernel data structures. These structures contain various information about IPC objects, such as object permissions, size, process waiting queue, etc. The Linux kernel maintains the status of IPC objects through these data structures, and provides corresponding system calls to create, access, and delete IPC objects. It converts kernel objects into IDs through idr and returns them to user state. When making a system call, the kernel uses idr to find the address of the kernel object converted from id for operation.

[0103] 2. The microkernel operating system QNX uses a service called the Kernel Name Service to manage kernel objects. This service acts as an interface between the kernel and user processes, enabling user processes to access and operate kernel objects. The Kernel Name Service maintains the name space of kernel objects, and the names of kernel objects are unique.

[0104] In QNX, kernel objects can be processes, threads, message queues, sockets, files, etc. Each kernel object has a unique name. User processes can use system calls (such as open, read, write, close) to access and operate kernel objects. The kernel name service maps the names of kernel objects to its internal data structure so that the kernel can access and operate these objects. In addition, QNX also provides some synchronization primitives, such as mutex locks, semaphores, conditional variables, etc., so that user processes can protect shared resources and coordinate interactions between processes.

[0105] 3. Fuchsia's microkernel Zircon uses a file system-like approach to manage kernel objects. Each kernel object is considered a file node, and each file node has a unique name and a handle. Kernel objects are divided into two categories: one is resource objects, such as files, sockets, threads, tasks, etc.; the other is synchronization objects, such as semaphores, mutexes, conditional variables, etc.

[0106] Zircon's kernel objects use reference counting to manage the life cycle of objects. When an object is created, its reference count is 1. Every time a handle is assigned to an object, its reference count increases by 1. When a handle is closed, the object's reference count decreases by 1. When an object's reference count reaches 0, it is automatically destroyed by the system.

[0107] Zircon supports establishing associations and dependencies between kernel objects, for example, a process can depend on multiple thread objects, a thread object can depend on multiple mutex objects, etc. It can be shared with different processes or threads through different transmission methods, such as passing handles, sharing memory, or transmitting over the network.

[0108] However, the kernel object management methods of the above three operating systems have the following problems:

[0109] 1. Unable to achieve unified management of kernel objects. Each kernel object has its own data structure and corresponding management and operation functions in the kernel. There is no unified data structure to describe and manage all kernel objects, which makes management more chaotic and is not conducive to the unified management of process resources. When the process exits normally or abnormally, the kernel objects that are no longer used cannot be recycled. It is very costly to add or delete a certain type of kernel object, and a lot of repeated logic code needs to be implemented.

[0110] 2. The creation and conversion efficiency of kernel objects is relatively low, which seriously affects the operating efficiency and real-time performance of the system. Generally, the idr method is used to convert kernel object addresses and IDs. If the number is large, the height of the red-black tree will increase accordingly, making the time complexity of search and insertion operations higher, thus affecting efficiency. At the same time, a large amount of memory space is required, resulting in memory fragmentation and performance degradation.

[0111] 3. The issue of safe use of kernel objects. After creating a kernel object, the existing smart car operating system only returns a counting ID without any protection measures. In this way, any process can use or delete this ID, and all processes can access the object. Malicious attacks and operations may cause data errors, access exceptions, or kernel crashes in normal use processes.

[0112] 4. The problem of deleting multiple threads or tasks at the same time. Existing smart car operating systems such as Linux use reference counting to manage kernel objects. If the reference count is reduced to 0, the object will be deleted. However, in the case of concurrent deletion by multiple threads, if the logic implementation of the specific object management code itself is problematic, or if there is a random failure, a mistaken decrement of 1 will delete the object in advance, which may cause the kernel process to crash.

[0113] In view of the above problems, the present application provides a kernel object management method for an intelligent automobile operating system. In view of the above problems, the present application provides a kernel object management method for an intelligent automobile operating system. Figure 1 A schematic diagram of a scenario of a kernel object management method for an intelligent vehicle operating system provided in this application. It should be noted that: Figure 1 What is shown are merely examples of application scenarios to which the kernel object management method of the intelligent automobile operating system of the present application can be applied, in order to help those skilled in the art understand the technical content of the present application, but it does not mean that the embodiments of the present application cannot be used in other devices, systems, environments or scenarios.

[0114] like Figure 1 As shown in the figure, the virtual memory is divided into two parts by the smart car operating system: kernel space and user space. The kernel space is where the kernel code runs, and the user space is where the user program code runs. When a process runs in the kernel space, it is in kernel state, and when a process runs in the user space, it is in user state. Process A enters the kernel space from the user space through a system call, creates kernel objects kobj1 and kobj2, and after successful creation, inserts kobj1 and kobj2 into the resource queue corresponding to process A according to the object types of kernel objects kobj1 and kobj2, and generates the identifier ID1 corresponding to kobj1 and the identifier ID2 corresponding to kobj2d, and then returns ID1 and ID2 to the user space, so that the user state process A can subsequently apply for various services of kernel objects kobj1 and kobj2 through ID1 and ID2. When process A exits, process A will destroy the kernel objects kobj1 and kobj2 it owns.

[0115] Process B enters kernel space from user space through system call, creates kernel object kobj3, and after successful creation, inserts kobj3 into the resource queue corresponding to process B according to the object type of kernel object kobj3, generates ID3 corresponding to kobj3, and then returns ID3 to user space for user-state process B to apply for various services of kernel object kobj3 through ID3. When process B exits, process B will destroy kobj3.

[0116] The kernel objects kobj1, kobj2 and kobj3 may be various common resources such as threads, semaphores, mutexes, message queues, files, etc.

[0117] When process A or process B exits, the destruction of the kernel object can be initiated by the user state or by the kernel state process exiting. Specifically, when destroying the kernel object, if the current kobj is not used by other processes, it is directly deleted; if the current kobj is being used by other processes, the deletion is delayed and the state of the kernel object is changed to closing (to be destroyed).

[0118] The kernel object management method of the intelligent automobile operating system provided by the embodiment of the present application enters the kernel through a system call through a user space process to create a kernel object. After the kernel object is successfully created, the object is inserted into the resource queue corresponding to the process according to the object type, and the ID of the successfully created kernel object is returned to the user state. When the process exits, the process will destroy the kernel object it owns. If the current kernel object is not used by other processes, it will be deleted directly; if the current kernel object is being used by other processes, the deletion will be delayed and the state of the kernel object will be modified to be destroyed; this method realizes unified management of kernel objects, improves the management efficiency of kernel objects, and improves the reliability of processes accessing kernel objects by delayed deletion.

[0119] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0120] Figure 2 This is the process of the kernel object management method of the intelligent automobile operating system provided by the embodiment of the present application Figure 1 The execution subject of this embodiment may be, for example, a kernel module of an intelligent vehicle operating system, such as Figure 2 As shown, the kernel object management method of the intelligent automobile operating system provided in this embodiment includes:

[0121] S101. Obtain an object creation request sent by a target process, and obtain memory information corresponding to a plurality of memory blocks in a memory pool of a kernel space according to the object creation request.

[0122] Among them, the object creation request is used to instruct the kernel of the operating system to create a target kernel object in the memory space. The kernel object is used to manage resources in the operating system. The object creation request includes the type of the target kernel object. The kernel object can be, for example, a file object, a process object, a thread object, etc.

[0123] It can be understood that the target process enters the kernel space by calling the API provided by the operating system to send an object creation request to the kernel module of the operating system. After receiving the object creation request sent by the target process, the kernel module obtains the memory information corresponding to multiple memory blocks in the memory pool of the kernel space according to the object creation request. The memory information is managed by the kernel module to facilitate subsequent memory allocation.

[0124] S102: Determine, according to the memory information, a standard kernel object corresponding to the target process from the multiple memory blocks.

[0125] The memory information is used to indicate the status of multiple memory blocks, and the standard kernel object refers to a kernel object that matches the memory size corresponding to the kernel object to be created by the target process in the virtual memory space.

[0126] Figure 3 A schematic diagram of the data structure of the kernel object provided in this embodiment, such as Figure 3 As shown, the memory pool includes multiple memory blocks managed by the kernel: block1, block2, etc. Each block memory block also includes multiple kernel objects. For example, block1 includes kobj 1, kobj2, kobj3, etc., and the divided memory blocks are linearly managed through a linked list.

[0127] The data structure of the kernel object (Kobj class) mainly includes common data, common processing methods and special processing methods. The common data includes: list node, kernel object entity, kernel object type, lock, check value, state and reference count, etc.

[0128] General operations include object creation, deletion, object acquisition, and object release. Special operations include methods corresponding to each kernel object entity, such as semaphore give and task, message queue send and receive, etc.

[0129] The user-mode ID (kobj ID) corresponding to the kernel object includes: check field (check_value), block iteration field (block_iter), kobj iteration field (kobj_iter) and kobj count field (kobj_index). The check field has a unique correspondence with the check value in kobj. The block iteration field is used to indicate the number of times the block where the current block id is located has been repeatedly applied for and recycled, which can effectively prevent kobj at the same position from having the same ID from being applied for from the same block. The kobj iteration field is used to indicate the number of iterations of repeated application and recycling of the memory block corresponding to the current kobj, which can effectively prevent kobj at the same position from having the same ID when being reused. The kobj count field is the index of the current kobj in the entire block pool, which is a globally unique count value.

[0130] The ID of the kernel object can be calculated based on the starting bit of the checksum field, the starting bit of the block iteration field, and the starting bit of the kobj iteration field, and these starting bits can be configured according to actual needs.

[0131] The kobj count field can be calculated based on the block number where the current kobj is located, the number of kobj contained in each block, the address of the current kobj, the start address of the block where the current kobj is located, and the length of each kobj data structure. In this way, by setting the user state ID corresponding to the kernel object, a direct conversion can be performed between the ID and the object address of the kobj, thereby improving system efficiency.

[0132] It can be understood that the memory block that can be used to store the kernel object entity of the target process can be determined based on the status of multiple memory blocks in the memory pool, and a standard kernel object matching the memory size corresponding to the type of kernel object to be created by the target process can be determined from the memory block.

[0133] S103: Initialize the standard kernel object according to the target process to obtain a target kernel object.

[0134] Among them, the entity specified by the object can be created according to the object creation request of the target process, and after the creation, a standard kernel object is created, and the standard kernel object is initialized by setting relevant parameters and assigning parameters, and the kernel object after the initialization process is completed is used as the target kernel object to ensure that the target kernel object is in the correct state and is convenient for the target process to use.

[0135] S104: Establish an association relationship between the target kernel object and the target process, and send the object ID corresponding to the target kernel object to the user state.

[0136] Among them, by generating an object ID of a target kernel object corresponding to a target process, an association relationship between the target kernel object and the target process is established, and the ID of the target kernel object is sent to the target process in user state. This is done so that the target process, as the creator process of the target kernel object, can use the target kernel object through the object ID when running in user state.

[0137] Optionally, after establishing the association relationship between the target kernel object and the target process, the created target kernel object may be added to the resource queue of the target process to facilitate destruction of the target kernel object upon exit.

[0138] The kernel object management method of the intelligent automobile operating system provided in the embodiment of the present application obtains an object creation request sent by a target process, and obtains memory information corresponding to multiple memory blocks in a memory pool of the kernel space according to the object creation request, and determines a standard kernel object corresponding to the target process from the multiple memory blocks according to the memory information, initializes the standard kernel object according to the target process to obtain a target kernel object, establishes an association relationship between the target kernel object and the target process, and sends the object ID corresponding to the target kernel object to the user state; the method realizes unified management of kernel objects and improves the management efficiency of kernel objects.

[0139] Figure 4 The process of the kernel object management method of the intelligent automobile operating system provided in the embodiment of the present application Figure 2 This embodiment is in Figure 2 Based on the embodiment, the kernel object management method of the intelligent automobile operating system is described in detail. Figure 4 As shown, the kernel object management method of the intelligent automobile operating system provided in this embodiment includes:

[0140] S201. Obtain an object creation request sent by a target process, and obtain memory information corresponding to multiple memory blocks in a memory pool of a kernel space according to the object creation request.

[0141] The memory information includes: storage status and memory sizes of multiple pre-allocated candidate kernel objects.

[0142] S202. Determine a target memory block according to the storage status of the multiple memory blocks, where the target memory block is the first memory block whose storage status is an idle state.

[0143] Among them, the kernel can use a bitmap algorithm (bitmap) to manage multiple memory blocks in the memory pool. For example, a data structure in bitmap format is used to store the storage status of each memory block in each bit. Therefore, the memory block that can be used to store the target kernel object can be determined according to the storage status of each memory block. This can improve the allocation efficiency by pre-allocating the target memory block so that the target memory block can be used as the resource allocation pool of the kernel object of the target process.

[0144] Optionally, if there is no idle memory block among the current multiple memory blocks, a new memory block may be applied for the target process as the target memory block.

[0145] S203. Determine the standard kernel object that matches the target process from the multiple pre-allocated candidate kernel objects of the target memory block according to the memory sizes of the multiple pre-allocated candidate kernel objects.

[0146] Among them, the memory size of each pre-allocated candidate kernel object can be determined according to the type of the candidate kernel object. After obtaining the target memory block, the target memory block is divided into blocks according to the memory size of each candidate kernel object, and linear management is performed through a linked list to achieve direct acquisition of free candidate kernel objects without traversal and search, and according to the object creation request of the target process, the candidate kernel object with the highest degree of match with the target is determined, and the candidate kernel object is used as the standard kernel object.

[0147] Optionally, in order to improve the management efficiency of kernel objects, in addition to pre-allocation management of kernel objects, release management of kernel objects can also be performed. After the standard kernel objects in the target memory block are released, it is determined whether all kernel objects in the target memory block have been released. If all kernel objects in the target memory block have been released, that is, the kernel objects are all in an idle state, and the number of idle kernel objects in the current system has reached a preset recycling waterline, the target memory block is recycled. This is done to achieve the purpose of saving system memory by dynamically adjusting the number of pre-allocated memory blocks in the memory pool.

[0148] S204: Determine, according to the target process, an object entity corresponding to the target process.

[0149] The kernel creates the object entity specified by the kernel object according to the object creation request of the target process, and performs initialization processing according to the object entity if the creation is successful.

[0150] S205 , initializing the standard kernel object according to the object entity to obtain the target kernel object.

[0151] The initialization process includes: entity and type assignment, lock initialization, reference count initialization, checksum generation and state initialization. In this step, the purpose of the initialization process is to ensure that the object has the expected initial state after creation, ensure the correct use of the object, and improve the reliability and stability of the kernel object.

[0152] S206. Determine the index value of the target kernel object based on the memory number of the target memory block, the number of the multiple pre-allocated candidate kernel objects, the kernel object address of the target kernel object, the memory block start address of the target memory block, and the total length of the data structure of the multiple pre-allocated candidate kernel objects.

[0153] For example, the index value of the target kernel object can be obtained by using the following formula:

[0154]

[0155] Among them, Kobj index is the index value of the target kernel object in the entire memory pool, which is a globally unique count value, block id is the memory number of the target memory block, each block num is the number of multiple pre-allocated candidate kernel objects contained in each memory block, kobj addr is the kernel object address of the target kernel object, block addr is the memory block starting address of the target memory block, and kobj len is the total length of the data structure of multiple pre-allocated candidate kernel objects.

[0156] S207. Generate an object ID corresponding to the target kernel object according to the check field corresponding to the check value, the iteration field corresponding to the target kernel object, the iteration field corresponding to the target memory block, and the index value of the target kernel object.

[0157] Among them, there is a unique corresponding relationship between the check domain and the check value in the target kernel object. The check value can be an arbitrary value. Only when the check domain in the object ID can calculate the check value and pass the check, can it be guaranteed that the object ID can point to a valid target kernel object.

[0158] The iteration domain corresponding to the target kernel object is used to indicate the number of iterations of the memory block corresponding to the target kernel object being repeatedly applied for and recycled, which can effectively prevent kernel objects at the same location from having the same ID when being reused.

[0159] The iteration field corresponding to the target memory block is used to indicate how many times the target memory block where the current memory block ID is located has been repeatedly applied for and recycled, which can effectively prevent kernel objects at the same location in the same memory block from having the same ID.

[0160] Since the index value of the target kernel object is the count value, the index value of the target kernel object is the count domain of the target kernel object, and the object ID of the target kernel object can be calculated based on the starting address of the check domain corresponding to the check value, the starting address of the iteration domain corresponding to the target kernel object, the starting address of the iteration domain corresponding to the target memory block and the index value of the target kernel object. Among them, the above starting addresses can be configured according to actual needs, and the check domain of the object ID is added for the existing count, so that the user-mode process cannot easily delete or maliciously operate the kernel object in use.

[0161] S208: Establish an association relationship between the object ID and the kernel object address of the target kernel object, and send the object ID corresponding to the target kernel object to the user state.

[0162] The object ID of the target kernel object is generated according to the kernel object address of the target kernel object, so an association relationship between the ID of the target kernel object and the kernel object address of the target kernel object, i.e., an association relationship between the target process and the target kernel object, can be established. The object ID corresponding to the target kernel object is sent to the user state, so that the target process can use the service corresponding to the target kernel object through the object ID of the target kernel object through a system call when running in the user space.

[0163] Optionally, after establishing the association relationship between the object ID and the kernel object address of the target kernel object, the identifier of the target kernel object can also be added to the resource queue of the target process to facilitate destruction of the target kernel object when the target process exits.

[0164] The kernel object management method of the intelligent automobile operating system provided in the embodiment of the present application obtains an object creation request sent by the target process, and obtains memory information corresponding to multiple memory blocks in the memory pool of the kernel space according to the object creation request, determines the target memory block according to the storage status of the multiple memory blocks, and determines the standard kernel object matching the target process from the multiple pre-allocated candidate kernel objects of the target memory block according to the memory size of the multiple pre-allocated candidate kernel objects; determines the object entity corresponding to the target process according to the target process, initializes the standard kernel object according to the object entity to obtain the target kernel object, and initializes the standard kernel object according to the memory number of the target memory block, the number of the multiple pre-allocated candidate kernel objects, and the kernel pair of the target kernel object. The method comprises the following steps: according to the object address, the memory block starting address of the target memory block and the total length of the data structure of multiple pre-allocated candidate kernel objects, determining the index value of the target kernel object, generating an object ID corresponding to the target kernel object according to the check domain corresponding to the check value, the iteration domain corresponding to the target kernel object, the iteration domain corresponding to the target memory block and the index value of the target kernel object, establishing an association between the object ID and the kernel object address of the target kernel object, and sending the object ID corresponding to the target kernel object to the user state; the method realizes the unified management of kernel objects and improves the management efficiency of kernel objects. At the same time, the creation efficiency of kernel objects is improved through pre-allocation, the conversion efficiency of object ID and object address is improved, and the reliability of object ID is improved.

[0165] Figure 5 The process of the kernel object management method of the intelligent automobile operating system provided in the embodiment of the present application Figure 3 This embodiment is in Figure 2 or Figure 4 Based on the embodiment, the use and destruction process after the target kernel object is created are described in detail. Figure 5 As shown, the kernel object management method of the intelligent automobile operating system provided in this embodiment includes:

[0166] S301. Before the target kernel object is used by any thread in the target process or by a second process, the target kernel object is locked, and the target kernel object is verified according to the current state, type, object ID and verification value of the target kernel object.

[0167] Wherein, before any thread or second process in the target process uses the target kernel object, it is necessary to obtain the object ID of the target kernel object, and obtain the object address of the target kernel object according to the object ID of the target kernel object to obtain the target kernel object. After obtaining the target kernel object, the target kernel object is first locked, and the purpose of locking is to prevent the target kernel object from being modified by other tasks when the thread or process obtains the target kernel object and is ready to use it. After the locking process is completed, the current state, type, object ID and check value of the target kernel object are checked, for example, to determine whether the kernel object is currently in a normal state, whether the kernel object type is correct, and whether the check value of the kernel object can point to the object ID of the target kernel object.

[0168] S302: After the target kernel object is successfully verified, the reference count of the target kernel object is increased by one, and the target kernel object is unlocked.

[0169] The reference count is used to indicate the number of currently referenced target kernel objects. Whenever a new process or thread references the target kernel object, the reference count increases by one.

[0170] It is understandable that if the target kernel object is successfully verified, it indicates that the target kernel object can be accessed and used normally. At this time, the reference count of the target kernel object is increased by one, indicating that a new thread or process has referenced the target kernel object. Even if other tasks perform a destruction operation, the object will not be actually destroyed, and the current task can safely use the object. After unlocking the target kernel object, the kernel returns the object entity corresponding to the target kernel object.

[0171] S303. After any thread in the target process or the second process completes using the target kernel object, the target kernel object is locked, and the target kernel object is verified according to the current state, type, object ID and verification value of the target kernel object.

[0172] Among them, after any thread or second process in the target process has used the target kernel object, it is necessary to destroy the kernel object to release memory. The target kernel object is first locked to prevent the target kernel object from being modified by other tasks during the destruction process; after locking is completed, the target kernel object is verified.

[0173] S304: After the target kernel object is successfully verified, the reference count of the target kernel object is reduced by one.

[0174] After the target kernel object is successfully verified, the reference count of the target kernel object is reduced by one, indicating that the use of the target kernel object by the current process or thread has ended.

[0175] S305, determining whether the target kernel object is in a state to be destroyed, if so, executing step S306, if not, executing step S308.

[0176] The purpose of determining whether the target kernel object is in a state to be destroyed is to confirm whether the current thread or process is initiating a destruction task for the target kernel object, that is, whether the target kernel object is in a state that can be destroyed. If so, further determine whether the reference count of the target kernel object is zero; if not, return directly.

[0177] S306, determine whether the reference count of the target kernel object is zero, if so, execute step S307, if not, execute step S308.

[0178] If the reference count of the target kernel object is zero, the target kernel object is unlocked and destroyed; if the reference count of the target kernel object is not zero, the method returns.

[0179] S307: Unlock the target kernel object and destroy the target kernel object.

[0180] The prerequisite for the destruction of the target kernel object is that when the kernel receives a destruction instruction initiated by the user or the target process exits the kernel state, the target kernel object is destroyed.

[0181] Exemplarily, an implementation method for destroying the target kernel object is provided here:

[0182] When receiving a destruction instruction sent by a user or the target process exits, locking the target kernel object, and verifying the target kernel object according to the current state, type, object ID and verification value of the target kernel object, if the verification of the target kernel object succeeds, determining whether the target kernel object is in a state to be destroyed; if the verification of the target kernel object fails, returning failure;

[0183] If the target kernel object is in a state to be destroyed, return so that it will be destroyed again when the reference count of the target kernel object is reduced by one next time;

[0184] If the target kernel object is not in a to-be-destroyed state, determining whether a reference count of the target kernel object is zero;

[0185] When the reference count of the target kernel object is zero, the target kernel object is destroyed. Specifically, the parameters of the target kernel object are reset to convert the target kernel object into the standard kernel object, and the standard kernel object is released to the target memory block; the object entity corresponding to the target kernel object is deleted, and the identifier of the target kernel object is deleted from the resource queue.

[0186] When the reference count of the target kernel object is not zero, the state of the target kernel object is modified to a state to be destroyed. It is understandable that the target kernel object is not destroyed temporarily at this moment, and is destroyed after all user processes or threads are used up, and the state of the target kernel object is only modified to a state to be destroyed.

[0187] S308. Return.

[0188] The return is used to indicate that the process of using the target kernel object has been completed.

[0189] The kernel object management method of the intelligent automobile operating system provided by the embodiment of the present application locks the target kernel object before the target kernel object is used by any thread in the target process or by the second process, and verifies the target kernel object according to the current state, type, object ID and check value of the target kernel object. After the target kernel object is successfully verified, the reference count of the target kernel object is increased by one, and the target kernel object is unlocked. After any thread in the target process or the second process completes the use of the target kernel object, the target kernel object is locked, and the target kernel object is verified according to the current state, type, object ID and check value of the target kernel object. type, the object ID and the check value, verify the target kernel object, after the target kernel object is successfully verified, reduce the reference count of the target kernel object by one, determine whether the target kernel object is in a state to be destroyed, if the target kernel object is in a state to be destroyed, further determine whether the reference count of the target kernel object is zero; if the target kernel object is not in a state to be destroyed, directly return; if the reference count of the target kernel object is zero, unlock the target kernel object and destroy the target kernel object; if the reference count of the target kernel object is not zero, return; this method improves the reliability of the process accessing the kernel object by delaying deletion.

[0190] Figure 6 This is a schematic diagram of the structure of the kernel object management device of the intelligent automobile operating system provided by this application. Figure 6 As shown, the kernel object management device 400 of the intelligent automobile operating system provided in this embodiment includes:

[0191] The acquisition module 401 is used to acquire an object creation request sent by a target process, and acquire memory information corresponding to multiple memory blocks in a memory pool of a kernel space according to the object creation request;

[0192] A processing module 402 is used to determine a standard kernel object corresponding to the target process from the multiple memory blocks according to the memory information;

[0193] The processing module 402 is further used to initialize the standard kernel object according to the target process to obtain a target kernel object;

[0194] The processing module 402 is further used to establish an association relationship between the target kernel object and the target process, and send the object ID corresponding to the target kernel object to the user state.

[0195] Optionally, the processing module 402 is further configured to determine a target memory block according to the storage status of the multiple memory blocks, wherein the target memory block is the first memory block whose storage status is an idle state;

[0196] The processing module 402 is further configured to determine the standard kernel object matching the target process from the multiple pre-allocated candidate kernel objects of the target memory block according to the memory sizes of the multiple pre-allocated candidate kernel objects.

[0197] Optionally, the processing module 402 is further configured to determine, according to the target process, an object entity corresponding to the target process;

[0198] The processing module 402 is also used to initialize the standard kernel object according to the object entity to obtain the target kernel object, and the initialization process includes: entity and type assignment, lock initialization, reference count initialization, check value generation and state initialization.

[0199] Optionally, the processing module 402 is further used to determine the index value of the target kernel object according to the memory number of the target memory block, the number of the multiple pre-allocated candidate kernel objects, the kernel object address of the target kernel object, the memory block start address of the target memory block and the total length of the data structure of the multiple pre-allocated candidate kernel objects;

[0200] The processing module 402 is further configured to generate an object ID corresponding to the target kernel object according to the check field corresponding to the check value, the iteration field corresponding to the target kernel object, the iteration field corresponding to the target memory block, and the index value of the target kernel object;

[0201] The processing module 402 is further configured to establish an association relationship between the object ID and the kernel object address of the target kernel object.

[0202] Optionally, the processing module 402 is further used to lock the target kernel object before the target kernel object is used by any thread in the target process or by the second process, and to verify the target kernel object according to the current state, type, object ID and verification value of the target kernel object;

[0203] The processing module 402 is further configured to, after the target kernel object is successfully verified, increase the reference count of the target kernel object by one, and unlock the target kernel object, so that any thread in the target process or the second process uses the target kernel object for service processing;

[0204] The processing module 402 is further configured to lock the target kernel object after any thread in the target process or the second process completes using the target kernel object, and to verify the target kernel object according to the current state, type, object ID and verification value of the target kernel object;

[0205] The processing module 402 is further configured to reduce the reference count of the target kernel object by one after the target kernel object is successfully verified.

[0206] Optionally, the device further includes: a judgment module 403;

[0207] The judging module 403 is used to judge whether the target kernel object is in a state to be destroyed;

[0208] The judging module 403 is further configured to judge whether the reference count of the target kernel object is zero when the target kernel object is in a state to be destroyed;

[0209] The processing module 402 is further used to unlock the target kernel object and destroy the target kernel object when the reference count of the target kernel object is zero; the processing module 402 is further used to return when the reference count of the target kernel object is not zero;

[0210] The processing module 402 is further configured to return when the target kernel object is not in a state to be destroyed.

[0211] Optionally, the processing module 402 is further configured to add the identifier of the target kernel object to the resource queue of the target process;

[0212] The processing module 402 is further used to lock the target kernel object when receiving a destruction instruction sent by the user or the target process exits, and to verify the target kernel object according to the current state, type, object ID and verification value of the target kernel object;

[0213] The judging module 403 is further configured to judge whether the target kernel object is in a state to be destroyed after the target kernel object is successfully verified;

[0214] The processing module 402 is further configured to return when the target kernel object is in a state to be destroyed;

[0215] The processing module 402 is further configured to determine whether a reference count of the target kernel object is zero when the target kernel object is not in a state to be destroyed;

[0216] The processing module 402 is further used to reset the parameters of the target kernel object when the reference count of the target kernel object is zero, so that the target kernel object is converted into the standard kernel object, and release the standard kernel object to the target memory block; delete the object entity corresponding to the target kernel object, and delete the identifier of the target kernel object from the resource queue;

[0217] The processing module 402 is further configured to modify the state of the target kernel object to a to-be-destroyed state when the reference count of the target kernel object is not zero.

[0218] Figure 7 This is a schematic diagram of the structure of the kernel object management device of the intelligent automobile operating system provided by this application. Figure 7 As shown, the present application provides a kernel object management device for an intelligent automobile operating system. The kernel object management device 500 for the intelligent automobile operating system includes: a receiver 501, a transmitter 502, a processor 503 and a memory 504.

[0219] Receiver 501, used for receiving instructions and data;

[0220] A transmitter 502, used for sending instructions and data;

[0221] Memory 504, used to store computer-executable instructions;

[0222] The processor 503 is used to execute the computer-executable instructions stored in the memory 504 to implement the various steps executed by the kernel object management method of the intelligent automobile operating system in the above embodiment. For details, please refer to the relevant description in the above embodiment of the kernel object management method of the intelligent automobile operating system.

[0223] Optionally, the memory 504 may be independent or integrated with the processor 503 .

[0224] When the memory 504 is independently provided, the electronic device further includes a bus for connecting the memory 504 and the processor 503 .

[0225] The present application also provides a computer storage medium, which stores computer execution instructions. When a processor executes the computer execution instructions, a kernel object management method of an intelligent vehicle operating system as executed by the kernel object management device of the above-mentioned intelligent vehicle operating system is implemented.

[0226] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0227] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0228] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A kernel object management method for an intelligent automobile operating system, characterized in that: The method comprises: Obtain an object creation request sent by the target process, and obtain memory information corresponding to multiple memory blocks in a memory pool of the kernel space according to the object creation request; Determining, according to the memory information, a standard kernel object corresponding to the target process from the plurality of memory blocks; According to the target process, the standard kernel object is initialized to obtain a target kernel object; An association relationship between the target kernel object and the target process is established, and an object ID corresponding to the target kernel object is sent to the user state.

2. The method according to claim 1, characterized in that: The memory information includes: a storage state and a memory size of a plurality of pre-allocated candidate kernel objects, and determining a standard kernel object corresponding to the target process from the plurality of memory blocks according to the memory information includes: Determine a target memory block according to the storage status of the multiple memory blocks, wherein the target memory block is the first memory block whose storage status is an idle state; According to the memory sizes of the plurality of pre-allocated candidate kernel objects, the standard kernel object matching the target process is determined from the plurality of pre-allocated candidate kernel objects of the target memory block.

3. The method according to claim 1, characterized in that The initializing process of the standard kernel object according to the target process to obtain the target kernel object includes: According to the target process, determining an object entity corresponding to the target process; The standard kernel object is initialized according to the object entity to obtain the target kernel object, wherein the initialization process includes: assignment of entity and type, initialization of lock, initialization of reference count, generation of check value and state initialization.

4. The method according to claim 3, characterized in that The establishing of the association relationship between the target kernel object and the target process includes: Determine the index value of the target kernel object according to the memory number of the target memory block, the number of the plurality of pre-allocated candidate kernel objects, the kernel object address of the target kernel object, the memory block start address of the target memory block and the total length of the data structure of the plurality of pre-allocated candidate kernel objects; Generate an object ID corresponding to the target kernel object according to the check domain corresponding to the check value, the iteration domain corresponding to the target kernel object, the iteration domain corresponding to the target memory block, and the index value of the target kernel object; An association relationship is established between the object ID and the kernel object address of the target kernel object.

5. The method according to claim 4, characterized in that The method further comprises: Before the target kernel object is used by any thread in the target process or by a second process, the target kernel object is locked, and the target kernel object is verified according to the current state, type, object ID and verification value of the target kernel object; After the target kernel object is successfully verified, the reference count of the target kernel object is increased by one, and the target kernel object is unlocked, so that any thread in the target process or the second process uses the target kernel object for service processing; After any thread in the target process or the second process completes using the target kernel object, locking the target kernel object, and verifying the target kernel object according to the current state, type, object ID and check value of the target kernel object; After the target kernel object is successfully verified, the reference count of the target kernel object is reduced by one.

6. The method according to claim 5, characterized in that After decrementing the reference count of the target kernel object, the method further comprises: Determine whether the target kernel object is in a state to be destroyed; If the target kernel object is in a to-be-destroyed state, determining whether a reference count of the target kernel object is zero; If the reference count of the target kernel object is zero, unlock the target kernel object and destroy the target kernel object; if the reference count of the target kernel object is not zero, return; If the target kernel object is not in a state to be destroyed, return.

7. The method according to claim 6, characterized in that After establishing the association relationship between the target kernel object and the target process, the method further includes: Adding the identifier of the target kernel object to the resource queue of the target process; The destroying process of the target kernel object includes: When receiving a destruction instruction sent by a user or the target process exits, locking the target kernel object, and verifying the target kernel object according to the current state, type, object ID and check value of the target kernel object; After the target kernel object is successfully verified, determining whether the target kernel object is in a state to be destroyed; If the target kernel object is in a state to be destroyed, return; If the target kernel object is not in a to-be-destroyed state, determining whether a reference count of the target kernel object is zero; If the reference count of the target kernel object is zero, resetting the parameters of the target kernel object so that the target kernel object is converted into the standard kernel object, and releasing the standard kernel object to the target memory block; deleting the object entity corresponding to the target kernel object, and deleting the identifier of the target kernel object from the resource queue; If the reference count of the target kernel object is not zero, the state of the target kernel object is modified to a to-be-destroyed state.

8. A kernel object management device for an intelligent automobile operating system, characterized in that: The device comprises: An acquisition module, used to acquire an object creation request sent by a target process, and acquire memory information corresponding to a plurality of memory blocks in a memory pool of a kernel space according to the object creation request; A processing module, configured to determine, from the plurality of memory blocks, a standard kernel object corresponding to the target process according to the memory information; The processing module is further used to initialize the standard kernel object according to the target process to obtain a target kernel object; The processing module is further used to establish an association relationship between the target kernel object and the target process, and send the object ID corresponding to the target kernel object to the user state.

9. A kernel object management device for an intelligent automobile operating system, characterized in that: include: Memory; processor; Wherein, the memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the kernel object management method of the intelligent automobile operating system according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The computer storage medium stores computer execution instructions, which, when executed by a processor, are used to implement the kernel object management method of the intelligent automobile operating system according to any one of claims 1 to 7.