Serial port log data processing method, control component, vehicle terminal equipment and vehicle
By directly processing and storing serial port log data in the kernel layer, data transmission between the user layer and the kernel layer is reduced, which solves the problem of serial port log data processing performance overhead in the existing technology and achieves more efficient log data processing and storage.
Patent Information
- Application Number
- CN202410632287.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, the processing and storage of serial port log data in the Linux kernel relies on the system log service, resulting in significant performance overhead when processing high-speed or large amounts of log data, especially due to the log data transmission between the user layer and the kernel layer. The resulting context switching overhead is large.
By creating a virtual control terminal and buffer area in the kernel layer, the log data of the serial port device is directly obtained and written, and the user layer reads from the buffer area and stores it in the persistent storage area, reducing data transmission between the user layer and the kernel layer. , use mutex locks to ensure thread safety, and add timestamps to ensure data integrity.
It reduces the context switching overhead due to log data transmission between the user layer and the kernel layer, and reduces the need for real-time synchronous write operations, thereby reducing I/O waiting time and improving log data processing efficiency and reliability.
Smart Images

Figure CN118732943A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a serial port log data processing method, a control component, a vehicle terminal device and a vehicle. Background Art
[0002] Currently, the technology related to serial port logging in the Linux kernel mainly relies on the use of standard serial port drivers and logging systems. This technical solution usually involves the serial port driver receiving data and then recording this information through a standard system logging mechanism. Figure 1 As shown in the figure. Hardware serial port devices refer to the source of log data, which generates data that needs to be recorded. The serial port driver is part of the Linux kernel, responsible for receiving data from hardware serial port devices and passing the data to higher-level services or applications. The system log service is a log daemon that receives log data from multiple sources such as serial port drivers and stores it in the system's log files. The logging tool is used to view, manage, and configure system logs.
[0003] In this way, the processing and storage of serial port log data mainly depends on the system log service and tools. For high-speed or large amounts of log data, the system log service may incur significant performance overhead. Summary of the invention
[0004] Based on this, it is necessary to provide a serial port log data processing method, control component, vehicle terminal equipment and vehicle to address the above-mentioned technical problems, which can directly write log data into the kernel layer buffer, thereby reducing the context switching overhead caused by the transmission of log data between the user layer and the kernel layer.
[0005] In one embodiment, a serial port log data processing method is provided, including: obtaining log data output by a target serial port device of an autonomous driving domain controller through a virtual control terminal of a kernel layer of a system, and writing the log data output by the target serial port device into a cache area of the kernel layer; reading the log data output by the target serial port device from the cache area of the kernel layer through a user layer of the system, and storing the log data output by the target serial port device in a persistent storage area.
[0006] In one of the embodiments, a serial port log data processing method also includes: configuring a status detection program in a virtual control terminal of the kernel layer, and when the status detection program is run, the virtual control terminal of the kernel layer detects whether the target serial port device is in an open state, and if it is in an open state, activating the logging function of the virtual control terminal; obtaining the log data output by the target serial port device through the virtual control terminal of the kernel layer of the system, including: obtaining the log data output by the target serial port device through the activated logging function of the virtual control terminal.
[0007] In one of the embodiments, a serial port log data processing method further includes: configuring a log writing program in a virtual control terminal of the kernel layer, and when the log writing program is executed, the virtual control terminal of the kernel layer writes the log data output by the target serial port device into a cache area of the kernel layer.
[0008] In one of the embodiments, when the log writing program is executed, the virtual control terminal of the kernel layer also obtains the current timestamp, associates the current timestamp with the log data output by the target serial port device, and writes the associated timestamp into the cache area of the kernel layer.
[0009] In one of the embodiments, a serial port log data processing method further includes: creating a proc file system node in the kernel layer, and the user layer reads the log data output by the target serial port device from the cache area of the kernel layer through the proc file system node.
[0010] In one of the embodiments, a serial port log data processing method further includes: configuring a system service program at the user layer, and reading the log data output by the target serial port device from the proc file system node when the system service program is called.
[0011] In one of the embodiments, a serial port log data processing method further includes: configuring a mutex lock for the buffer area, where the mutex lock is used to ensure that only one user-level thread accesses the buffer area at any time.
[0012] In one embodiment, a serial port log data processing device is provided, including: a writing module, used to obtain log data output by a target serial port device of an autonomous driving domain controller through a virtual control terminal of a kernel layer of a system, and write the log data output by the target serial port device into a cache area of the kernel layer; a storage module, used to read the log data output by the target serial port device from the cache area of the kernel layer through a user layer of the system, and store the log data output by the target serial port device in a persistent storage area.
[0013] In one embodiment, a control component is provided, including a storage component and a processing component. The storage component stores the program code of the Linux kernel. When the program code of the Linux kernel is executed by the processing component, the steps of any of the above-mentioned embodiments are implemented.
[0014] In one embodiment, a vehicle terminal device is provided. The vehicle terminal device is configured with the above control component and a persistent storage area.
[0015] In one embodiment, a vehicle is provided, characterized in that the vehicle is equipped with the above-mentioned vehicle terminal device.
[0016] The above-mentioned serial port log data processing method, control component, vehicle terminal device and vehicle obtain the log data output by the target serial port device of the autonomous driving domain controller through the virtual control terminal of the kernel layer of the system, and write the log data output by the target serial port device into the cache area of the kernel layer; read the log data output by the target serial port device from the cache area of the kernel layer through the user layer of the system, and store the log data output by the target serial port device in the persistent storage area. Therefore, the log data can be directly written into the buffer of the kernel layer, which can reduce the context switching overhead caused by the transmission of log data between the user layer and the kernel layer. In addition, the log data is read by the user layer and written into the persistent storage area, which reduces the need for real-time synchronous write operations, thereby reducing the I / O waiting time. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of the framework of the system log data recording method in the prior art;
[0018] Figure 2 A schematic diagram of an application environment of a serial port log data processing method in one embodiment of the present application;
[0019] Figure 3 This is a flow chart of a serial port log data processing method in one embodiment of the present application;
[0020] Figure 4 This is a schematic diagram of the framework of serial port log data processing in one embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. 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.
[0022] It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like throughout the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as including but not limited to.
[0023] It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.
[0024] The present application provides a serial port log data processing method, which is applied to Figure 2 In the application environment shown. Figure 2 As shown, the vehicle terminal device is configured with a user layer and a kernel layer. A virtual control terminal and a cache area are configured in the kernel layer. The virtual control terminal is a TTY virtual device. The user layer is configured with a proc file system node and a persistent storage area. The persistent storage area is a device such as a hard disk. The vehicle terminal device is used to implement a serial port log data processing method of the present application. Specifically, the vehicle terminal device obtains the log data output by the target serial port device of the autonomous driving domain controller through the virtual control terminal of the kernel layer of the system, and writes the log data output by the target serial port device into the cache area of the kernel layer; reads the log data output by the target serial port device from the cache area of the kernel layer through the user layer of the system, and stores the log data output by the target serial port device in the persistent storage area. Therefore, the log data can be written directly to the buffer of the kernel layer, which can reduce the context switching overhead caused by the transmission of log data between the user layer and the kernel layer. In addition, the log data is read by the user layer and written into the persistent storage area, which reduces the need for real-time synchronous write operations, thereby reducing the I / O waiting time.
[0025] In one embodiment, a serial port log data processing method provided by the present application is applied to Figure 2 In the vehicle terminal device shown. Figure 3 As shown, a serial port log data processing method includes the following steps:
[0026] S302, obtaining the log data output by the target serial port device of the autonomous driving domain controller through the virtual control terminal of the kernel layer of the system, and writing the log data output by the target serial port device into the cache area of the kernel layer.
[0027] In this embodiment, the kernel layer can be a Linux kernel. The virtual control terminal is a TTY virtual device. The cache area is a KFIFO buffer. KFIFO is a specific type of ring buffer implemented in the Linux kernel, which is a first-in-first-out data queue. Once the content is read, the buffer is cleared and new data can continue to be written in. Therefore, using the KFIFO interface provided by the kernel layer, a first-in-first-out buffer is created in the kernel layer for efficiently processing the log data output by the target serial port device, optimizing the temporary storage method of the log data, improving the processing speed and reducing context switching.
[0028] In this embodiment, the tty_io.c file in the Linux kernel is modified to achieve effective capture of serial port log data. Specifically, in the kernel layer, the log data in the write buffer (such as tty->write_buf) of the TTY virtual device is sent to a ring buffer named KFIFO. This KFIFO buffer is responsible for storing log data according to the first-in-first-out principle, and can efficiently manage the reading and writing operations of data. In an example, before the above step S302, it also includes: configuring a mutex lock for the buffer area, and the mutex lock is used to ensure that only one thread of the user layer accesses the buffer area at any time. Specifically, the thread safety of access to the KFIFO buffer is ensured by using the mutex lock read_lock. At the same time, the addition of timestamps ensures the integrity and accuracy of the log data. Therefore, thread safety and data integrity can be guaranteed.
[0029] In one embodiment, in the above step S302, before the step of obtaining the log data output by the target serial port device of the autonomous driving domain controller through the virtual control terminal of the kernel layer of the system, it also includes: configuring a status detection program in the virtual control terminal of the kernel layer, and when the status detection program is run, the virtual control terminal of the kernel layer detects whether the target serial port device is in an open state, and if it is in an open state, activating the logging function of the virtual control terminal; the above-mentioned obtaining the log data output by the target serial port device through the virtual control terminal of the kernel layer of the system includes: obtaining the log data output by the target serial port device through the activated logging function of the virtual control terminal.
[0030] In one embodiment, before writing the log data output by the target serial port device into the cache area of the kernel layer, it also includes: configuring a log writing program in the virtual control terminal of the kernel layer, and when the log writing program is run, the virtual control terminal of the kernel layer writes the log data output by the target serial port device into the cache area of the kernel layer.
[0031] When the log writing program is executed, the virtual control terminal of the kernel layer also obtains the current timestamp, associates the current timestamp with the log data output by the target serial port device, and writes the associated timestamp into the cache area of the kernel layer.
[0032] Specifically, modify the opening and writing functions of the serial port device in the TTY virtual device. In the tty_open_by_driver function of the TTY virtual device, add detection of the target serial port device, such as ttyS2. If the target serial port device is detected to be in the open state, the logging function will be activated. In the do_tty_write function, in addition to the standard write operation, the current timestamp and the log data written by the serial port are stored in the serial_fifo buffer.
[0033] S304, reading the log data output by the target serial port device from the buffer area of the kernel layer through the user layer of the system, and storing the log data output by the target serial port device in the persistent storage area.
[0034] In this embodiment, a process node named serial-port-fifo is created in the application layer of the system, through which the log data in the KFIFO buffer can be accessed. Then, the read log data is stored in a persistent storage area. The persistent storage area can be a storage device such as a hard disk.
[0035] In one embodiment, before step S304, the method further includes: creating a proc file system node in the kernel layer, and the user layer reads the log data output by the target serial port device from the cache area of the kernel layer through the proc file system node.
[0036] After the step of creating the proc file system node in the kernel layer, the method further includes: configuring a system service program in the user layer, and reading the log data output by the target serial port device from the proc file system node when the system service program is called.
[0037] Specifically, the proc_create function in the kernel layer creates a node named / proc / serial-port-fifo, which is a proc file system node. User-layer programs can read data in the KFIFO buffer through this node. Therefore, by creating a specific proc file system node, such as / proc / serial-port-fifo, a mechanism is implemented that allows user-layer programs to directly read kernel-layer log data. This design simplifies the communication between the user layer and the kernel layer.
[0038] A system service program is developed at the user level. The system service program periodically reads the log data of the target serial port device from the serial-port-fifo node and saves the read log data to a persistent storage, such as a hard disk, to implement a persistent service for log data. Therefore, a script is used at the user level to periodically read the data in the KFIFO ring buffer and persist it to the disk. This process automates the persistent storage of log data and avoids the performance loss caused by real-time writing.
[0039] The above-mentioned method for processing serial port log data obtains the log data output by the target serial port device of the autonomous driving domain controller through the virtual control terminal of the kernel layer of the system, and writes the log data output by the target serial port device into the cache area of the kernel layer; reads the log data output by the target serial port device from the cache area of the kernel layer through the user layer of the system, and stores the log data output by the target serial port device in the persistent storage area. Therefore, the log data can be directly written into the buffer of the kernel layer, which can reduce the context switching overhead caused by the transmission of log data between the user layer and the kernel layer. In addition, reading the log data through the user layer and writing it into the persistent storage area reduces the need for real-time synchronous write operations, thereby reducing the I / O waiting time.
[0040] For the above-mentioned serial port log data processing method, the serial port log data processing on the autonomous driving domain controller is used as an example to illustrate:
[0041] like Figure 4 As shown in the figure, kernel space represents the kernel layer, user space represents the user layer, disk represents the disk, and KFIFO represents the cache area.
[0042] tty→write_buf: In the kernel layer, the log data in the write buffer of the TTY virtual device is sent to a ring buffer called KFIFO.
[0043] KFIFO: KFIFO is a specific type of circular buffer implemented in the Linux kernel. It is a first-in-first-out data queue. Once the content is read, the circular buffer will be cleared, and then new data can continue to be written in. Figure 4 As shown in Figure 1, Data in indicates that log data is stored in the queue, and Data out indicates that log data is read. This KFIFO ring buffer is responsible for storing data according to the first-in-first-out principle and can efficiently manage the reading and writing operations of log data.
[0044] kfifo_to_user: A function used to copy log data from the KFIFO ring buffer in the kernel layer to the user layer. This is a secure way of data transfer to transfer log data from the kernel layer to the user layer.
[0045] proc file system node: Create a node named / proc / serial-port-fifo through the proc_create function in the kernel layer. The system service program in the user layer can read the log data in the KFIFO ring buffer through this node.
[0046] User space scripts and storage operations: At the user level, the system service program calls a script named write_serial_to_disk.sh to periodically read log data from the / proc / serial-port-fifo node and write it to disk to achieve persistent storage of data.
[0047] Therefore, if Figure 4 As shown in , a new data capture and storage mechanism for log data is implemented by combining the efficient data processing capabilities of the kernel layer and the flexible script processing capabilities of the user layer.
[0048] For safety reasons, the serial port on the autonomous driving domain controller is generally disabled, which makes it impossible to save the log data output to the serial port. This part of the log data is very important for troubleshooting. The method proposed in this application directly processes the serial port log data at the kernel layer, writes the log data into a large-capacity KFIFO ring buffer, and provides an independent system service program to regularly read the log data in the buffer and save it to the disk. This method improves the reliability and efficiency of logging, and can save the serial port log data even when the serial port is closed. In addition, compared with traditional log services, this method writes log data directly to the FIFO ring buffer of the kernel layer, which can reduce the context switching overhead caused by data transmission between the user layer and the kernel layer. By using scripts in the user layer to regularly read log data from the KFIFO ring buffer and write it to disk, the need for real-time synchronous write operations is reduced, thereby reducing I / O waiting time.
[0049] It should be understood that, although the various steps in the flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flow chart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0050] In one embodiment, the present application also provides a serial port log data processing device. A serial port log data processing device includes a writing module and a storage module. The writing module is used to obtain the log data output by the target serial port device of the autonomous driving domain controller through the virtual control terminal of the kernel layer of the system, and write the log data output by the target serial port device to the cache area of the kernel layer; the storage module is used to read the log data output by the target serial port device from the cache area of the kernel layer through the user layer of the system, and store the log data output by the target serial port device in the persistent storage area.
[0051] In one of the embodiments, a serial port log data processing device also includes a first configuration module, which is used to configure a status detection program in a virtual control terminal of the kernel layer. When the status detection program is run, the virtual control terminal of the kernel layer detects whether the target serial port device is in an open state. If it is in an open state, the logging function of the virtual control terminal is activated; wherein, obtaining the log data output by the target serial port device through the virtual control terminal of the kernel layer of the system includes: obtaining the log data output by the target serial port device through the activated logging function of the virtual control terminal.
[0052] In one of the embodiments, a serial port log data processing device also includes a second configuration module, which is used to configure a log writing program in a virtual control terminal of the kernel layer. When the log writing program is run, the virtual control terminal of the kernel layer writes the log data output by the target serial port device into a cache area of the kernel layer.
[0053] In one of the embodiments, when the log writing program is executed, the virtual control terminal of the kernel layer also obtains the current timestamp, associates the current timestamp with the log data output by the target serial port device, and writes the associated timestamp into the cache area of the kernel layer.
[0054] In one of the embodiments, a serial port log data processing device also includes a creation module for creating a proc file system node in the kernel layer, and the user layer reads the log data output by the target serial port device from the cache area of the kernel layer through the proc file system node.
[0055] In one of the embodiments, a serial port log data processing device further includes a third configuration module, which is used to configure a system service program at the user layer, and the system service program reads the log data output by the target serial port device from the proc file system node when being called.
[0056] In one of the embodiments, a serial port log data processing device further includes a fourth configuration module, which is used to configure a mutex lock for the cache area, and the mutex lock is used to ensure that only one user-level thread accesses the cache area at any time.
[0057] For the specific definition of a serial port log data processing device, please refer to the definition of a serial port log data processing method above, which will not be repeated here. Each module in the above-mentioned serial port log data processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0058] The present application also provides a control component, including a storage component and a processing component. The storage component stores the program code of the Linux kernel. When the program code of the Linux kernel is run by the processing component, the following steps are implemented: obtaining the log data output by the target serial port device of the autonomous driving domain controller through the virtual control terminal of the kernel layer of the system, and writing the log data output by the target serial port device into the cache area of the kernel layer; reading the log data output by the target serial port device from the cache area of the kernel layer through the user layer of the system, and storing the log data output by the target serial port device in the persistent storage area.
[0059] In one of the embodiments, when the program code of the Linux kernel is run by the processing component, the following steps are also implemented: a status detection program is configured in the virtual control terminal of the kernel layer, and when the status detection program is run, the virtual control terminal of the kernel layer detects whether the target serial port device is in an open state, and if it is in an open state, the logging function of the virtual control terminal is activated; wherein, when the program code of the Linux kernel is run by the processing component to implement the above-mentioned step of obtaining the log data output by the target serial port device through the virtual control terminal of the kernel layer of the system, the following steps are specifically implemented: the log data output by the target serial port device is obtained through the activated logging function of the virtual control terminal.
[0060] In one of the embodiments, when the program code of the Linux kernel is executed by the processing component, the following steps are also implemented: a log writing program is configured in the virtual control terminal of the kernel layer, and when the log writing program is executed, the virtual control terminal of the kernel layer writes the log data output by the target serial port device into the cache area of the kernel layer.
[0061] In one of the embodiments, when the log writing program is executed, the virtual control terminal of the kernel layer also obtains the current timestamp, associates the current timestamp with the log data output by the target serial port device, and writes the associated timestamp into the cache area of the kernel layer.
[0062] In one of the embodiments, when the program code of the Linux kernel is run by the processing component, the following steps are also implemented: a proc file system node is created at the kernel layer, and the user layer reads the log data output by the target serial port device from the cache area of the kernel layer through the proc file system node.
[0063] In one of the embodiments, when the program code of the Linux kernel is run by the processing component, the following steps are also implemented: a system service program is configured at the user layer, and when the system service program is called, the log data output by the target serial port device is read from the proc file system node.
[0064] In one of the embodiments, when the program code of the Linux kernel is executed by the processing component, the following steps are also implemented: a mutex lock is configured for the cache area, and the mutex lock is used to ensure that only one user-level thread accesses the cache area at any time.
[0065] The present application also provides a vehicle terminal device. In one embodiment, the vehicle terminal device is configured with the control component of any of the above embodiments and is also configured with a persistent storage area.
[0066] The present application also provides a vehicle. In one embodiment, the vehicle is equipped with the vehicle terminal device of the above embodiment.
[0067] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0068] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0069] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application.
Claims
1. A method for processing serial port log data, It is characterized in that The method comprises: Obtaining log data output by a target serial port device of the autonomous driving domain controller through a virtual control terminal of the kernel layer of the system, and writing the log data output by the target serial port device into a cache area of the kernel layer; The log data output by the target serial port device is read from the buffer area of the kernel layer through the user layer of the system, and the log data output by the target serial port device is stored in the persistent storage area.
2. The method according to claim 1, It is characterized in that The method further comprises: A status detection program is configured in the virtual control terminal of the kernel layer, and when the status detection program is executed, the virtual control terminal of the kernel layer detects whether the target serial port device is in an open state, and if it is in an open state, a log recording function of the virtual control terminal is activated; The obtaining the log data output by the target serial port device through the virtual control terminal of the kernel layer of the system includes: obtaining the log data output by the target serial port device through the activated logging function of the virtual control terminal.
3. The method according to claim 2, It is characterized in that The method further comprises: A log writing program is configured in the virtual control terminal of the kernel layer. When the log writing program is executed, the virtual control terminal of the kernel layer writes the log data output by the target serial port device into the buffer area of the kernel layer.
4. The method according to claim 3, It is characterized in that When the log writing program is executed, the virtual control terminal of the kernel layer also obtains a current timestamp, associates the current timestamp with the log data output by the target serial port device, and writes the associated timestamp into the buffer area of the kernel layer.
5. The method according to claim 3, It is characterized in that The method further comprises: A proc file system node is created in the kernel layer, and the user layer reads the log data output by the target serial port device from the buffer area of the kernel layer through the proc file system node.
6. The method according to claim 5, It is characterized in that The method further comprises: A system service program is configured in the user layer, and when the system service program is called, the log data output by the target serial port device is read from the proc file system node.
7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: A mutual exclusion lock is configured for the cache area, and the mutual exclusion lock is used to ensure that only one user-level thread accesses the cache area at any time.
8. A serial port log data processing device, It is characterized in that The device comprises: A writing module, used to obtain log data output by a target serial port device of the autonomous driving domain controller through a virtual control terminal of the kernel layer of the system, and write the log data output by the target serial port device into a cache area of the kernel layer; The storage module is used to read the log data output by the target serial port device from the buffer area of the kernel layer through the user layer of the system, and store the log data output by the target serial port device in the persistent storage area.
9. A control component, It is characterized in that The method comprises a storage component and a processing component, wherein the storage component stores a program code of a Linux kernel, and the program code of the Linux kernel is executed by the processing component to implement the steps of the method according to any one of claims 1 to 7.
10. A vehicle terminal device, It is characterized in that The vehicle terminal device is equipped with the control component described in claim 9 and is also equipped with a persistent storage area.
11. A vehicle, It is characterized in that The vehicle is equipped with the vehicle terminal device according to claim 10.
Citation Information
Cited By
Kernel soft deadlock capturing and restarting method based on BMC log mirror image
CN121785840A
A BMC log mirror-based kernel soft deadlock capture restart method
CN121785840B
