Driving record and assisted driving method and device

CN122990832APending Publication Date: 2026-10-27BEI DOU ZHI LIAN KE JI YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611311727.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

部分产品虽增加了基于加速度传感器(G-sensor)的碰撞检测功能,能够在检测到异常加速度时锁定当前视频片段以防止被覆盖,但该功能仅对应单一级别的紧急锁定机制,无法区分碰撞事件、用户手动触发事件、停车监控事件及运动检测事件等不同场景下的录像需求

Benefits of technology

本发明实施例提供了一种行车记录与辅助驾驶方法及装置,方法包括预先定义多种录像模式并配置优先级表及各录像模式对应的触发条件;若接收到录像控制指令,将录像控制指令对应的目标录像模式对应的优先级与当前录像模式的优先级进行比较;若目标录像模式的优先级高于当前录像模式的优先级,则执行无缝切换,将当前录像模式对应的视频文件标记为保护状态,并创建目标录像模式对应的新视频文件继续写入; 当高优先级录像模式对应的事件结束后,根据优先级表依次自动降级直到恢复至优先级最低的普通循环录像模式。通过优先级抢占与无缝切换机制,解决了现有行车记录仪无法同时支持多种录像模式且切换时易丢失视频帧的技术问题,实现了多模式录像的自动管理与关键视频数据的完整保存。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990832A_ABST
    Figure CN122990832A_ABST
Patent Text Reader

Abstract

The application discloses a driving record and auxiliary driving method and device, the method comprises the following steps: defining multiple recording modes in advance and configuring a priority table and trigger conditions corresponding to each recording mode; if a recording control instruction is received, comparing the priority of the target recording mode corresponding to the recording control instruction with the priority of the current recording mode; if the priority of the target recording mode is higher than the priority of the current recording mode, performing seamless switching, marking the video file corresponding to the current recording mode as a protection state, and creating a new video file corresponding to the target recording mode to continue writing; and when the event corresponding to the high-priority recording mode ends, automatically downgrading according to the priority table until the normal cycle recording mode with the lowest priority is restored. The application solves the problem that the existing driving recorder cannot support multiple recording modes at the same time and is prone to losing video frames when switching, and realizes automatic management of multiple recording modes and complete saving of key video data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle electronic recording and control technology, and in particular to a driving recording and assisted driving method and device. Background Technology

[0002] With the increasing complexity of road traffic environments and the growing safety awareness of drivers, dashcams have become essential safety aids for vehicles. Existing dashcam products typically only support simple loop recording, meaning they record video continuously in fixed time segments (such as 1 minute or 3 minutes), automatically overwriting the oldest video file when the storage medium is full. While some products have added collision detection functionality based on G-sensors, which can lock the current video segment to prevent overwriting when abnormal acceleration is detected, this function only corresponds to a single level of emergency locking mechanism and cannot differentiate between recording needs in different scenarios such as collision events, user-triggered events, parking monitoring events, and motion detection events.

[0003] More critically, existing solutions typically interrupt the current encoding process, close the current video file, and recreate a new file when switching recording modes. This approach easily leads to lost video frames, file write conflicts, or file structure corruption, resulting in the incomplete recording of crucial video data before and after an event (such as the moment of a collision). Furthermore, existing solutions lack an effective priority management mechanism. When multiple events occur simultaneously or consecutively, the system cannot allocate recording resources reasonably according to the importance of the events. This means that video files corresponding to high-priority events may still be overwritten by subsequent ordinary loop recording strategies, causing the permanent loss of critical evidence.

[0004] On the other hand, existing embedded dashcam solutions typically use a hard-coded single-channel design for video pipeline configuration. When multiple downstream processing functions such as video encoding, display output, and driver assistance analysis need to be supported simultaneously, there is a lack of a unified channel abstraction and scheduling mechanism, resulting in poor code reusability, error-prone channel configuration, and difficulty in achieving efficient parallel processing of multiple video data on resource-constrained low-end and mid-range embedded platforms. Summary of the Invention

[0005] The problem solved by the embodiments of the present invention is to provide a driving recording and assisted driving method and device.

[0006] In a first aspect, embodiments of the present invention provide a driving recording and assisted driving method, including: Predefine multiple recording modes and configure priority tables and trigger conditions for each recording mode; If a recording control command is received, the priority of the target recording mode corresponding to the recording control command is compared with the priority of the current recording mode; If the priority of the target recording mode is higher than the priority of the current recording mode, a seamless switch is performed, the video file corresponding to the current recording mode is marked as protected, and a new video file corresponding to the target recording mode is created to continue writing. When the event corresponding to the high-priority recording mode ends, the recording will automatically downgrade according to the priority table until it is restored to the lowest priority normal loop recording mode.

[0007] In a second aspect, embodiments of the present invention also provide a driving recorder and driver assistance device for performing the driving recorder and driver assistance method described in the first aspect, the device comprising: The mode configuration unit is used to predefine multiple recording modes and configure the priority table and the trigger conditions corresponding to each recording mode; The instruction processing unit is configured to, if a recording control instruction is received, compare the priority of the target recording mode corresponding to the recording control instruction with the priority of the current recording mode. The switching execution unit is used to perform seamless switching if the priority of the target recording mode is higher than the priority of the current recording mode, mark the video file corresponding to the current recording mode as protected, and create a new video file corresponding to the target recording mode to continue writing. The downgrade recovery unit is used to automatically downgrade according to the priority table after the event corresponding to the high-priority recording mode ends, until it recovers to the lowest priority normal loop recording mode. This invention provides a method and apparatus for vehicle recording and assisted driving. The method includes pre-defining multiple recording modes and configuring a priority table and trigger conditions corresponding to each recording mode; if a recording control command is received, comparing the priority of the target recording mode corresponding to the recording control command with the priority of the current recording mode; if the priority of the target recording mode is higher than the priority of the current recording mode, seamless switching is performed, the video file corresponding to the current recording mode is marked as protected, and a new video file corresponding to the target recording mode is created and written; when the event corresponding to the high-priority recording mode ends, the priority is automatically downgraded according to the priority table until it is restored to the lowest priority normal loop recording mode. Through the priority preemption and seamless switching mechanism, the technical problem that existing vehicle dashcams cannot support multiple recording modes simultaneously and are prone to losing video frames during switching is solved, realizing automatic management of multi-mode recording and complete preservation of key video data. Attached Figure Description

[0008] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0009] Figure 1 This is a flowchart illustrating the driving recording and assisted driving method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the connection between the embedded driving recorder and the driver assistance system terminal provided in an embodiment of the present invention; Figure 3 This is a schematic block diagram of a driving recorder and driver assistance device provided in an embodiment of the present invention. Detailed Implementation

[0010] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0011] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0012] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0013] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0014] It should also be noted that, unless otherwise explicitly specified and limited, terms such as "installation," "connection," "linking," "fixing," and "setting" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. When an component is referred to as being "on" or "below" another component, the component can be located "directly" or "indirectly" on the other component, or there may be one or more intermediary components. The terms "first," "second," "third," etc., are only for the convenience of describing this technical solution and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature. For those skilled in the art, the specific meaning of the above terms in this invention can be understood according to the specific circumstances.

[0015] Please see Figure 1 to, Figure 1 This is a flowchart illustrating the driving recording and assisted driving method provided in an embodiment of the present invention. Figure 2 This is a connection diagram of an embedded driving recorder and driver assistance system terminal provided in an embodiment of the present invention. The present invention provides a driving recorder and driver assistance method, which is applied to an embedded driving recorder and driver assistance system terminal. The embedded driving recorder and driver assistance system terminal is deployed inside a vehicle and electrically connected to an acceleration sensor, a Global Positioning System (GPS) module, and an image sensor. The method includes steps S1 to S4.

[0016] S1. Predefine multiple recording modes and configure priority tables and trigger conditions corresponding to each recording mode.

[0017] In this embodiment, multiple recording modes are predefined, and a priority table and corresponding trigger conditions for each recording mode are configured. A recording mode refers to the differentiated recording strategy adopted by the embedded dashcam system in different driving and parking scenarios. Different recording modes differ in trigger source, encoding parameters, and file protection level. The priority table is a pre-configured mapping table representing the priority order between recording modes. When multiple recording requests occur during system operation, the priority table determines the recording mode to be executed. Trigger conditions refer to the event judgment rules required to activate the corresponding recording mode. The system monitors corresponding events based on each trigger condition to determine whether to enter the corresponding recording mode.

[0018] In some embodiments, multiple recording modes are predefined and a priority table and trigger conditions corresponding to each recording mode are configured, including: S11. Define multiple recording modes, including emergency event recording, manual locking recording, normal loop recording, motion detection recording, and parking monitoring recording.

[0019] Multiple recording modes are defined, including emergency recording, manual lock recording, normal loop recording, motion detection recording, and parking monitoring recording. Emergency recording is automatically triggered when a vehicle collides or experiences severe impact, used to completely record key video data before and after the accident. Video files in this mode have the highest protection level to prevent being overwritten. Manual lock recording is a user-activated recording mode used to save video data from specific time periods that the user deems necessary. Normal loop recording is the default continuous recording mode that starts after system power-on. Video files in this mode are stored in chronological order, looping and overwriting each other to maintain storage space balance. Motion detection recording is automatically triggered when the Video Detection Framework (VDF) detects a moving target in the monitored area, suitable for monitoring abnormal movements when the vehicle is stationary. Parking monitoring recording is automatically triggered when an abnormal event is detected while the vehicle is parked and off, used for security monitoring during parking periods.

[0020] S12. Configure the trigger conditions corresponding to each recording mode.

[0021] Configure the trigger conditions for each recording mode. Among them, the trigger condition for emergency event recording is that the accelerometer detects that the collision acceleration exceeds a preset threshold. The accelerometer is used to collect the vehicle's three-axis acceleration data in real time. When the rate of change of acceleration in any axis of the three-axis acceleration data exceeds the preset threshold, a collision detection signal is generated to trigger emergency event recording.

[0022] The manual locking recording is triggered when the user inputs a lock operation signal via physical buttons, touch interface, or voice command. Once the system receives the lock operation signal, it immediately triggers manual locking recording.

[0023] The trigger condition for motion detection recording is that VDF performs motion analysis on video frames and outputs motion detection results. When the motion detection results indicate that there is a moving target in the picture that meets the preset conditions, motion detection recording is triggered.

[0024] The trigger condition for parking monitoring recording is that the vehicle is in a parked state and the system detects an abnormal event. The parking state can be determined by the vehicle ignition signal, vehicle speed signal or system sleep wake-up signal.

[0025] Normal loop recording is triggered by default after the system powers on normally and starts up. It does not require any additional external events to trigger and runs continuously as the system's basic recording mode.

[0026] S13. Configure a priority table, with the priority of each recording mode decreasing in the following order: emergency event recording, manual lock recording, motion detection recording, parking monitoring recording, and normal loop recording.

[0027] Configure a priority table, with each recording mode having decreasing priority in the following order: Emergency Event Recording, Manual Lock Recording, Motion Detection Recording, Parking Monitoring Recording, and Normal Loop Recording. Specifically, the priority value for each recording mode is predefined in the system firmware using an enumeration type or a constant array. The priority value quantifies the relative importance of each recording mode; a smaller value indicates a higher priority. The priority value for Emergency Event Recording is 1, for Manual Lock Recording it is 2, for Motion Detection Recording it is 3, for Parking Monitoring Recording it is 4, and for Normal Loop Recording it is 5.

[0028] By predefining multiple recording modes and configuring priority tables and trigger conditions corresponding to each recording mode, unified management of multiple working scenarios during driving recording is achieved. This enables the system to simultaneously support the coexistence and automatic scheduling of multiple recording modes, effectively avoiding video frame loss or file writing conflicts caused by conflicts in multiple recording requirements. It also solves the problem that existing dashcams only support a single level of emergency lock and cannot support multiple recording modes simultaneously.

[0029] S2. If a recording control command is received, compare the priority of the target recording mode corresponding to the recording control command with the priority of the current recording mode.

[0030] In this embodiment, if a recording control command is received, the priority of the target recording mode corresponding to the recording control command is compared with the priority of the current recording mode. The recording control command is a control signal used to instruct the system to switch to the target recording mode. The recording control command can be manually input by the user, sent by an external device, or automatically generated by an internal system module based on triggering conditions. By comparing the priorities of the target recording mode and the current recording mode, it is determined whether the mode switching conditions are met, thereby ensuring that high-priority events can promptly interrupt low-priority recording and preventing the loss of critical video data.

[0031] In some embodiments, if a recording control command is received, the priority of the target recording mode corresponding to the recording control command is compared with the priority of the current recording mode, including: S21. Receive recording control commands through a preset named pipe and parse the target recording mode corresponding to the recording control commands.

[0032] Recording control commands are received through a pre-defined named pipe. A named pipe (FIFO, First In First Out) is a file system-based inter-process communication mechanism that allows different processes to interact with each other via file read / write. The pre-defined named pipe includes a first named pipe and a second named pipe. The first named pipe receives recording control commands sent by external processes or the user interface, while the second named pipe receives recording control commands sent by internal system modules (such as a video detection framework or accelerometer module). Recording control commands are command strings containing a target recording mode identifier, for example, the format "rec N", where "rec" is the recording mode switching command identifier and "N" is the mode number corresponding to the target recording mode. The system obtains the command string by reading the data buffer in the named pipe, parses the command string to extract the target recording mode identifier, and determines the corresponding target recording mode based on the target recording mode identifier. For example, when the command string "rec 2" is read from the named pipe, the parsed target recording mode identifier is 2, and the corresponding target recording mode is emergency event recording.

[0033] S22. Obtain the current recording mode and its corresponding priority value through the state variable.

[0034] The current recording mode and its corresponding priority value are obtained through a state variable. The state variable is a memory variable maintained by the system during runtime to record the currently active recording mode in real time. The state variable is set to the default normal loop recording mode during system initialization and is updated to the new current recording mode after each successful recording mode switch. The system queries the priority table based on the current recording mode identifier stored in the state variable to obtain the priority value corresponding to the current recording mode. For example, if the state variable indicates that the current recording mode is normal loop recording (rec 1), then querying the priority table yields a priority value of 5.

[0035] S23. Query the priority value corresponding to the target recording mode, and compare the priority value of the target recording mode with the priority value of the current recording mode.

[0036] The system queries the priority value corresponding to the target recording mode and compares it with the priority value of the current recording mode. Specifically, based on the target recording mode identifier parsed in step S21, the system queries the priority table to obtain the priority value corresponding to the target recording mode. The priority value of the target recording mode is then compared with the priority value of the current recording mode obtained in step S22: if the priority value of the target recording mode is less than the priority value of the current recording mode, the priority of the target recording mode is determined to be higher than the priority of the current recording mode, and a switching permission command is generated to trigger the subsequent seamless switching process; if the priority value of the target recording mode is greater than or equal to the priority value of the current recording mode, the priority of the target recording mode is determined to be no higher than the priority of the current recording mode, and the current recording mode continues to operate without performing this mode switch. For example, when the target recording mode is emergency event recording (priority value 1) and the current recording mode is normal loop recording (priority value 5), since 1 is less than 5, the target recording mode is determined to have a higher priority, and the switching is allowed; when the target recording mode is motion detection recording (priority value 3) and the current recording mode is manual lock recording (priority value 2), since 3 is greater than 2, the target recording mode is determined to have no higher priority, the switching is refused, and manual lock recording continues to run.

[0037] In this way, by receiving recording control commands and comparing priorities through a pre-defined named pipe, the system can efficiently and asynchronously process recording mode switching requests, enabling it to respond promptly to high-priority events such as collisions and motion detection. At the same time, the system maintains the current recording status in real time through state variables, ensuring the accuracy and consistency of priority determination. This solves the problem in existing solutions where the lack of an effective priority management mechanism leads to the overwriting of high-priority event videos.

[0038] S3. If the priority of the target recording mode is higher than the priority of the current recording mode, then a seamless switch is performed, the video file corresponding to the current recording mode is marked as protected, and a new video file corresponding to the target recording mode is created to continue writing.

[0039] In this embodiment, if the priority of the target recording mode is higher than that of the current recording mode, a seamless switch is performed. The video file corresponding to the current recording mode is marked as protected, and a new video file corresponding to the target recording mode is created to continue writing. Seamless switching refers to the technical process of marking the currently being written video file as protected while simultaneously starting a new video file to continue receiving encoded data, without interrupting video encoding or stopping the data stream. By performing seamless switching, it is ensured that when a high-priority event is triggered, the currently being written low-priority video file can be completely saved and not deleted by the subsequent loop overwrite strategy. At the same time, the video data corresponding to the high-priority event can be immediately written to the new video file, avoiding video frame loss or file structure damage caused by closing and restarting the encoding process.

[0040] In some embodiments, S3 includes: S31. The encoding module is notified via a preset seamless switching command to mark the video file corresponding to the current recording mode as protected.

[0041] The system notifies the encoding module via a pre-defined seamless switching command to mark the video file corresponding to the current recording mode as protected. The seamless switching command is a predefined control instruction within the system used to trigger the encoding module to perform file switching operations. The encoding module refers to the functional module running in the embedded dashcam terminal responsible for video encoding and file writing. Specifically, when step S2 determines that the priority of the target recording mode is higher than the priority of the current recording mode, the system generates a seamless switching command and sends it to the encoding module. After receiving the seamless switching command, the encoding module performs a protection status marking operation on the video file corresponding to the current recording mode that is currently being written.

[0042] Protection status refers to a file attribute marker used to indicate that a video file is not affected by the storage space reclamation policy of loop recording. The storage space reclamation policy is a management mechanism in which the system automatically deletes the oldest recorded ordinary video file to free up storage space when the remaining capacity of the storage medium is lower than a preset threshold.

[0043] The specific steps of the protection status marking operation include: setting a protection flag bit in the file system attributes of the video file, writing protection identification information into the file header metadata of the video file, or adding a protection prefix / suffix to the filename of the video file to distinguish it from ordinary video files. Video files marked as protected will be skipped during the execution of the storage space reclamation policy and will not be automatically deleted, thus ensuring that video data being recorded before the triggering of high-priority events is completely preserved.

[0044] S32. Create a new video file corresponding to the target recording mode, and switch the encoded data stream to the new video file to continue writing.

[0045] A new video file corresponding to the target recording mode is created, and the encoded data stream is switched to the new video file to continue writing. Specifically, while performing the protection status marking operation, the encoding module creates a new video file according to the target recording mode. The filename of the new video file includes the mode identifier of the target recording mode, timestamp information, and file sequence number, so as to quickly identify the recording mode and recording time corresponding to the video file based on the filename. After the encoding module completes the initialization of the file header information of the new video file, it switches the video encoded data stream from the video file corresponding to the current recording mode to the new video file to continue writing. The switching process is completed inside the encoder. The video encoder itself does not stop working. The continuous video frame data stream is redirected to the new file handle without interruption, thereby avoiding video frame gaps or keyframe loss caused by stopping and restarting encoding. After the new video file is created, the system updates the status variables to record the target recording mode as the new current recording mode.

[0046] In summary, by performing seamless switching and marking video files as protected, the system achieves complete preservation and continuous recording of video data when high-priority events are triggered. The current low-priority video files are fully protected from being overwritten in a loop, while high-priority video data is immediately recorded through a new file. The entire switching process does not interrupt the encoding process, effectively solving the problem of video frame loss or file write conflicts that easily occur when switching modes in existing solutions. This ensures that critical video data before and after high-priority events are not lost due to loop overwriting.

[0047] S4. When the event corresponding to the high-priority recording mode ends, the recording mode will automatically downgrade according to the priority table until it is restored to the lowest priority normal loop recording mode.

[0048] In this embodiment, after the event corresponding to the high-priority recording mode ends, the recording is automatically downgraded according to the priority table until it returns to the lowest priority normal loop recording mode. The end of an event is defined as the disappearance of the external conditions that triggered the high-priority recording mode or the duration reaching a preset criterion. For example, the end of an emergency event recording might be when the acceleration after a collision returns to normal and the duration reaches a preset buffer period; the end of a manually locked recording might be when the user does not trigger the lock operation again within a preset time. Through this automatic downgrade and recovery mechanism, the system can promptly release the recording resources occupied by the high-priority mode after the high-priority event is processed, restoring to the normal recording state. This avoids the system remaining in high-priority mode for extended periods, which could lead to excessive storage space consumption or inability to respond to subsequent high-priority events.

[0049] In some embodiments, the step of automatically downgrading the recording mode according to the priority table after the event corresponding to the high-priority recording mode ends, until it is restored to the lowest priority normal loop recording mode, includes: S41. Monitor the duration of events corresponding to the high-priority recording mode using a preset timer.

[0050] In this embodiment, a preset timer monitors the duration of events corresponding to the high-priority recording mode. The preset timer is a system-maintained timer used to measure the continuous running time of the high-priority recording mode. The system starts the preset timer when entering high-priority recording mode, and the preset timer either accumulates countdown from zero or counts down from a preset threshold. The preset threshold is a duration threshold pre-configured based on the characteristics of different recording modes. For example, the preset threshold for emergency event recording can be configured to be 30 to 60 seconds, and the preset threshold for manually locked recording can be configured to be an infinite wait or a fixed duration before the user manually unlocks the recording. During the operation of the preset timer, the system continuously monitors whether the event corresponding to the high-priority recording mode persists. If the event ends prematurely (e.g., the user manually unlocks the recording, or the accelerometer signal returns to normal), a degradation process is immediately triggered; if the event persists, monitoring continues until the preset timer reaches the preset threshold.

[0051] S42. When the duration of the event reaches a preset threshold, the recording mode is downgraded to the second highest priority mode according to the priority table.

[0052] In this embodiment, when the duration of an event reaches a preset threshold, the recording mode is downgraded to the second-highest priority mode according to the priority table. Specifically, the system queries the priority table to obtain the priority value corresponding to the current high-priority recording mode, and finds the recording mode corresponding to the priority value that is greater than and closest to the current priority value as the second-highest priority recording mode. For example, if the current high-priority recording mode is emergency event recording (priority value 1), then the second-highest priority recording mode obtained from the priority table is manual lock recording (priority value 2); if the current high-priority recording mode is manual lock recording (priority value 2), then the second-highest priority recording mode is motion detection recording (priority value 3); if the current high-priority recording mode is parking monitoring recording (priority value 4), then the second-highest priority recording mode is normal loop recording (priority value 5). After determining the second-highest priority recording mode, the system generates a corresponding degradation control command. The second-highest priority recording mode corresponding to the degradation control command is then used as the new target recording mode, and a degradation switch is executed: the writing of the video file corresponding to the current high-priority recording mode ends, a new video file corresponding to the second-highest priority recording mode is created, the video encoding data stream is switched to the new video file for continued writing, and the status variable is updated to record the second-highest priority recording mode as the new current recording mode. The degradation switch and the seamless switch in step S3 maintain the same technical implementation of uninterrupted encoding data streams. The difference is that the degradation switch does not require additional marking of the video file corresponding to the current high-priority recording mode with a protection status; this file is automatically in a protected state or has already been normally closed when it is created, based on the configuration of the corresponding recording mode.

[0053] S43. Repeat the downgrade operation until the system is restored to the normal loop recording mode.

[0054] In this embodiment, the downgrade operation is repeated until the system recovers to the normal loop recording mode. Specifically, after completing one downgrade operation, the system restarts a preset timer to monitor the duration of events corresponding to the second-highest priority recording mode. If the duration of events corresponding to the second-highest priority recording mode reaches a preset threshold again, or if the event corresponding to that mode has ended, the priority table is queried again to perform the next downgrade operation, downgrading the current recording mode to a lower priority recording mode. This downgrade operation is repeated until the current recording mode is downgraded to the lowest priority normal loop recording mode. At this point, the system completes the entire downgrade recovery process, the preset timer stops running, and the system continues to run in the normal loop recording mode as the basic recording mode, waiting to receive new recording control commands. The repeated downgrade process ensures that the system smoothly transitions from high-priority modes to normal loop recording modes, avoiding the possibility of missing intermediate priority events that might occur if the system jumps directly from high-priority modes to normal loop recording modes.

[0055] In this way, by monitoring the duration of events through a preset timer and performing automatic degradation recovery step by step, the system achieves automated state management after the high-priority recording mode ends. It can restore the system to the normal recording state without manual intervention from the user, ensuring that the system can release the storage and encoding resources occupied by the high-priority mode in a timely manner. At the same time, the step-down mechanism ensures that the event data corresponding to each priority mode is completely recorded, so as to solve the problem of system state stagnation caused by the lack of an automatic recovery mechanism after the high-priority event ends.

[0056] In some embodiments, before predefining multiple recording modes and configuring a priority table and the triggering conditions corresponding to each recording mode, the method further includes: S00. Preset channel configuration table, traverse each entry in the channel configuration table, and determine whether the corresponding channel needs to be initialized based on the usage flag; S01. For the channels that need to be initialized, call the image signal processor driver to create an output port, set the output resolution and cropping window of the output port, set the pixel format of the output port, and allocate a frame buffer memory pool according to the channel depth. S02. According to the binding parameters, the output port of the image signal processor is cascaded and bound to the input port of the video encoder, the input port of the video detection frame, and the input port of the video display module, respectively, to establish a unified video pipeline scheduling architecture, so that the same frame of image data can be distributed in parallel to the video encoder, the video detection frame, and the video display module in a zero-copy manner through direct hardware memory access. The video encoder is used to execute the following steps based on the independent encoding channel of the video pipeline scheduling architecture: if a recording control command is received, the priority of the target recording mode corresponding to the recording control command is compared with the priority of the current recording mode, and so on.

[0057] In this embodiment, a channel configuration table is preset and each entry is traversed. Based on the usage flag, it is determined whether a channel needs initialization. For channels requiring initialization, output port creation, resolution and cropping window settings, pixel format configuration, and frame buffer memory pool allocation are completed sequentially. Then, the output port of the image signal processor is cascaded and bound to the input ports of downstream modules through binding parameters, thereby establishing a unified video pipeline scheduling architecture. The video pipeline scheduling architecture refers to a technical framework that abstracts heterogeneous hardware modules such as image signal processing, video encoding, video detection, and video display into a unified port-channel model, and completes initialization and data path construction through static configuration. Through the video pipeline scheduling architecture, the same frame of raw image data can be directly accessed from memory via hardware and simultaneously distributed to multiple downstream modules in a zero-copy manner. Each downstream module receives data based on an independent input port and operates independently without blocking each other. The video encoder executes steps S2 to S4 based on the independent encoding channels of the video pipeline scheduling architecture, ensuring that video encoding, video detection, and video display processes are performed in parallel during multi-mode recording management.

[0058] In some embodiments, S00 specifically includes: reading a pre-compiled channel configuration table from a storage medium, traversing each entry in the channel configuration table, and determining whether the corresponding channel needs to be initialized based on a usage flag. The channel configuration table is a data structure pre-compiled and stored in a non-volatile storage medium, used to describe the static configuration parameters of each video channel during system startup. The channel configuration table contains multiple entries, each corresponding to the configuration information of a video channel. The configuration information includes fields such as channel identifier, usage flag, number of output ports, output resolution, cropping window parameters, pixel format, channel depth, and binding relationship. The usage flag is a Boolean flag used to identify whether the corresponding channel has been allocated for use by the system. When the usage flag value is valid (e.g., 1), it indicates that the channel has been configured and occupied, and initialization is required; when the usage flag value is invalid (e.g., 0), it indicates that the channel is in an idle and available state, and initialization is skipped to save system resources. During system startup, the channel configuration table is read from the storage medium, traversed sequentially by entry, and the set of channels to be initialized is selected based on the usage flag in each entry.

[0059] In some embodiments, S01 specifically includes: The system calls the image signal processor (ISP) driver to create an output port. An image signal processor (ISP) is a dedicated hardware module in an embedded system used for signal processing (including denoising, white balance, color correction, gamma correction, etc.) of the raw image data output from an image sensor. An output port is the hardware interface through which the ISP outputs video data after image processing. Based on the entry information for the channels to be initialized in the channel configuration table, the system calls the ISP's low-level driver interface to create the corresponding output port and allocates low-level hardware resources to it, thus putting the output port into a created state.

[0060] The output port's output resolution and cropping window are configured. Output resolution refers to the width and height of the image data output by the output port. By setting the output resolution, the output port can output an image at a different size than the image sensor's original resolution, achieving resolution scaling. The cropping window refers to the parameters of the effective region cropped from the original image, including the horizontal and vertical coordinates of the cropping start point, as well as the width and height of the cropping area. Setting the cropping window supports digital zoom and Region of Interest (ROI) extraction. The system writes the output resolution and cropping window parameters recorded in each entry of the channel configuration table into the corresponding registers or configuration buffers of the image signal processor via the driver interface, completing the output port's output resolution and cropping window configuration.

[0061] The pixel format of the output port is configured. The pixel format refers to the color sampling and storage format of the image data output by the output port. Different downstream modules select an appropriate pixel format based on their respective data processing capabilities. Pixel formats may include YUV420, NV12, and RGB888, etc. The system configures the pixel format of the output port according to the pixel format parameters recorded in each entry of the channel configuration table, ensuring that the image data format received by the downstream modules matches their decoding or processing capabilities.

[0062] The frame buffer memory pool is allocated based on the channel depth. Channel depth refers to the frame buffer queue depth of the output port, specifying the number of frames that the port can buffer. The frame buffer memory pool is a contiguous or non-contiguous memory area pre-allocated for the output port to temporarily store video frame data to be output. A larger channel depth value allows for more frames to be buffered, alleviating the instantaneous processing pressure on downstream modules, but will correspondingly increase memory usage; a smaller channel depth value results in lower memory usage, but may lead to frame drop due to untimely downstream processing. The system calculates the required memory capacity based on the channel depth parameters recorded in each entry of the channel configuration table, requests the corresponding size of memory space from the system memory manager as the frame buffer memory pool, and associates the frame buffer memory pool with the output port, enabling the output port to have frame data buffering capabilities.

[0063] In some embodiments, S02 specifically includes: The image signal processor's output port is cascaded and bound to the input ports of the video encoder, video detection framework, and video display module, respectively, according to the binding parameters. The binding parameters are data structures describing the association between the image signal processor's output port and the downstream module's input port, including fields such as source port identifier, target module identifier, target input port identifier, and binding type. The video encoder (VENC) is a hardware module used for compressing and encoding video frame data (such as H.264 or H.265 encoding); the video detection framework is a hardware or software framework module used for receiving video frames and performing image analysis and detection; the video display module (VDISP) is a hardware module used for outputting video frames to a display device. Based on the binding parameters, the system cascades and binds the image signal processor's output port to the corresponding input ports of the video encoder, video detection framework, and video display module, establishing a data path mapping relationship from upstream output to downstream input. The cascading binding is completed at the system kernel layer or hardware abstraction layer, and after binding, the modules form an ordered data processing link.

[0064] A unified video pipeline scheduling architecture is established by distributing image data in parallel with zero-copy using Direct Memory Access (DMA). DMA is a data transfer mechanism that allows hardware subsystems to directly read and write system memory without central processing unit (CPU) intervention. Zero-copy means that during data transfer from the image signal processor's output port to the downstream module's input port, the CPU does not need to copy data from one memory location to another; instead, data is transferred directly through the hardware bus via physical address mapping or buffer sharing. A single frame of raw image data output by the image signal processor is simultaneously distributed via the hardware bus to the input ports of the video encoder, video detection framework, and video display module. These three downstream modules receive and process data in parallel through their respective independent input ports: the video encoder performs video compression encoding, the video detection framework performs image analysis and detection, and the video display module displays the frame. Each module operates independently at its configured resolution and frame rate without blocking others, thus establishing a unified video pipeline scheduling architecture. The video encoder executes steps S2 to S4 on the independent encoding channel of the video pipeline scheduling architecture, enabling video encoding, video detection, video display and other processing in the multi-mode recording management process to be executed in parallel at the hardware level.

[0065] In this way, by pre-setting the channel configuration table and performing static initialization based on the usage flag, and combining the binding parameters to complete the port cascading binding and hardware direct memory access zero-copy transmission, a unified abstraction and scheduling of heterogeneous hardware modules is achieved. This avoids the problems of poor code reusability and easy error in channel configuration caused by traditional hard-coded single-channel configuration, and solves the problem of the lack of a unified channel abstraction and scheduling mechanism in existing embedded dashcam solutions. At the same time, the copy overhead of the central processing unit is significantly reduced through the one-to-many frame distribution mechanism, improving the system's operating efficiency on resource-constrained embedded platforms.

[0066] In some embodiments, each channel of the image signal processor includes a real-time output port, a buffered output port, and an infrared output port; the real-time output port outputs image data at a first resolution and a first frame rate to the video encoder; the buffered output port outputs image data at a second resolution and a second frame rate to the video detection frame; the real-time output port, the buffered output port, and the infrared output port are independently controlled by an enable flag; setting the enable flag to a valid value enables the data stream of the corresponding port, and setting the enable flag to an invalid value stops the data stream of the corresponding port.

[0067] In this embodiment, each output port is independently controlled by an enable flag, enabling each output port to output image data to its corresponding downstream module at different resolutions and frame rates. The real-time output port is used to output real-time image data streams to the video encoder; it is configured with a high resolution and frame rate to meet the clarity and smoothness requirements of the driving recording video. The buffered output port is used to output buffered image data streams to the video detection framework; it is configured with a lower resolution and frame rate to suit the processing capabilities and resource consumption of the assisted driving analysis algorithm. The infrared output port is used to output infrared enhanced image data streams; it outputs infrared enhanced images in low-light environments at night to assist the video detection framework in target detection. Independent control of each output port via enable flags enables dynamic runtime management at the port level, allowing data streams to be started and stopped without destroying or rebuilding channels.

[0068] The real-time output port outputs image data at a first resolution and a first frame rate to the video encoder. The first resolution and frame rate are configured based on the storage quality and smoothness requirements of the driving recording video. For example, the first resolution can be configured to 1920×1080 pixels (1080P), and the first frame rate can be configured to 30 frames per second. The buffered output port outputs image data at a second resolution and a second frame rate to the video detection framework. The second resolution and frame rate are configured based on the processing load and detection accuracy requirements of the assisted driving feature detection algorithm. For example, the second resolution can be configured to 1280×720 pixels (720P), and the second frame rate can be configured to 15 frames per second. The higher first resolution and frame rate ensure that the video encoding channel obtains a high-quality, high-frame-rate video source, while the video detection channel obtains a low-load video source adapted to the algorithm's processing capabilities.

[0069] The enable flag is a Boolean flag used to identify whether the corresponding port is currently in a data flow state, and is part of the port lifecycle management flags. When the enable flag is valid (e.g., 1), image data is allowed to flow through the port, and the data flow of the corresponding output port is enabled; when the enable flag is invalid (e.g., 0), image data flow through the port is suspended, and the data flow of the corresponding output port is stopped, but the channel configuration and hardware resources of the port are retained. By setting the enable flag to a valid or invalid value, the data flow of the corresponding port can be dynamically enabled or stopped during system operation. For example, when it is necessary to enable assisted driving analysis, the enable flag of the buffered output port is set to a valid value to send video frame data to the video detection frame; when it is necessary to disable assisted driving analysis, the enable flag of the buffered output port is set to an invalid value to stop sending video frame data to the video detection frame. This operation does not affect the data transmission from the real-time output port to the video encoder or the working status of the infrared output port.

[0070] This embodiment achieves hardware-level parallelism and independent scheduling of the encoding channel and the assisted driving analysis channel through the design of multiple output ports of the image signal processor and independent control of the enable flag. Each channel works independently with different resolutions and frame rates. During operation, specific ports can be dynamically started and stopped according to functional requirements, which effectively solves the problem that multi-channel video encoding and assisted driving analysis are difficult to implement in parallel on resource-constrained embedded platforms in existing solutions.

[0071] In some embodiments, the method further includes: S5. Obtain video frame data through the input port of the video detection framework.

[0072] In this embodiment, video frame data processed by the image signal processor is acquired through the input port of the video detection framework. Specifically, the buffer output port of the image signal processor continuously outputs processed video frame data at a preset second resolution and second frame rate (e.g., 1280×720 pixel resolution, 15 frames per second). The video frame data is directly transmitted to the input port of the video detection framework via a hardware bus. After receiving the video frame data, the video detection framework stores it in a preset detection buffer for subsequent assisted driving feature detection algorithms to read and process. The video frame data carries a timestamp during transmission. The timestamp is generated by the image signal processor at the frame acquisition time and embedded in the frame header metadata for timestamp alignment in subsequent step S7.

[0073] S6. Acquire positioning data and acceleration data, wherein the positioning data includes latitude and longitude, velocity, orientation angle and UTC time.

[0074] In this embodiment, the system receives and parses raw positioning data using a Global Positioning System (GPS) module to obtain positioning data. It continuously receives raw positioning data transmitted from satellites. The system uses a GPS parsing module to perform protocol parsing on the raw positioning data, extracting latitude and longitude information, velocity information, heading angle information, and Coordinated Universal Time (UTC) time information to generate structured positioning data. The UTC time in the positioning data serves as the timestamp reference for alignment with the acquisition timestamps of the video frame data.

[0075] Vehicle triaxial acceleration data is acquired using an accelerometer. The accelerometer collects the vehicle's acceleration values ​​in the X, Y, and Z axes in real time at a preset sampling frequency (e.g., 100 Hz). The triaxial acceleration data reflects the vehicle's real-time motion state, including dynamic characteristics such as rapid acceleration, rapid deceleration, and collision impacts. The accelerometer records a corresponding sampling timestamp for each sample, provided by the system clock at the time of data readout, and is used for subsequent timestamp alignment with video frame data and positioning data.

[0076] S7. The video frame data, the positioning data, and the acceleration data are time-stamped and fused using a unified timestamp mechanism.

[0077] In this embodiment, the timestamp information carried by video frame data, positioning data, and acceleration data is extracted. A unified timestamp mechanism refers to a synchronization mechanism that establishes a unified time base for sensor data from different sources. Specifically, the system extracts the acquisition timestamp from the frame header metadata of the video frame data, extracts the UTC time from the positioning data as the positioning timestamp, and extracts the sampling timestamp from the acceleration data as the acceleration timestamp. Since the positioning data uses UTC time while the video frame data and acceleration data may use the system's local time or a hardware clock, the system automatically converts the UTC time to a time representation consistent with the local time through time zone identification, or establishes a mapping relationship between the timestamps through time offset calculation, thereby normalizing the three heterogeneous timestamps to the same time base.

[0078] Based on timestamp information, the system aligns and fuses video frame data, positioning data, and acceleration data from the same moment. Specifically, using the acquisition timestamp of the video frame data as a benchmark, the system searches for the data frame corresponding to the positioning and acceleration timestamps closest to the acquisition timestamp within a preset time window (e.g., ±50 milliseconds). When both the positioning and acceleration timestamps fall within the time window, the video frame data, positioning data, and acceleration data are determined to be a synchronized data group from the same moment, and the synchronized data group is packaged into a fused data structure. The fused data structure includes the image content of the video frame data, the latitude, longitude, and velocity from the positioning data, the three-axis acceleration values ​​from the acceleration data, and the unified timestamp information. If a matching timestamp is not found for a certain sensor data within the time window, the most recent valid data from that sensor or an estimated value generated using a linear interpolation algorithm is used to fill the gap, ensuring the integrity of the fused data structure.

[0079] S8. Perform assisted driving feature detection based on the fused data. The assisted driving feature detection includes lane departure warning, forward collision warning, start-stop assist and blind spot detection.

[0080] In this embodiment, lane departure warning detection is performed based on the fused data. Lane Departure Warning System (LDWS) is an assisted driving function that uses image processing algorithms to identify road lane lines and monitor the vehicle's lateral position relative to the lane lines, issuing a warning to the driver when the vehicle unintentionally deviates from its current lane. Specifically, video frame data is extracted from the fused data structure, and lane line feature points are extracted using image processing algorithms such as edge detection and Hough transform. The straight or curved equations of the left and right lane lines are then fitted. Combining the speed and direction angle data from the fused data structure, the lateral deviation and trend of the vehicle's current trajectory from the lane line equations are determined. When the lateral deviation exceeds a preset deviation threshold and no driver steering operation is detected, a lane departure warning is triggered. The deviation threshold is configured through calibration parameters, supporting independent adjustment of the sensitivity for the left and right lane lines to adapt to different road conditions and driver habits.

[0081] Forward Collision Warning (FCWS) is a driver assistance function that uses image processing algorithms to detect vehicles ahead and estimate the relative distance and collision time between the vehicle and the preceding vehicle. It issues a warning to the driver when a collision risk is detected. Specifically, video frame data is extracted from the fused data structure. A vehicle detection algorithm (such as a vehicle detection model based on feature extraction or deep learning) is used to identify the preceding vehicle target. The system outputs the position coordinates of the preceding vehicle target in the image (including the lateral center coordinates, longitudinal center coordinates, width, and height of the preceding vehicle) and the estimated distance between the vehicle and the preceding vehicle. Combining the vehicle's speed and the relative speed with the preceding vehicle in the fused data structure, the Time To Collision (TTC) is calculated. A FCWS is triggered when the estimated distance is less than a preset distance threshold or the collision time is less than a preset time threshold.

[0082] Stop-and-Go Assist (SAG) detection is performed based on the fused data. SAG uses image processing algorithms to monitor the starting and stopping states of vehicles ahead, assisting drivers in judging the dynamics of vehicles ahead during traffic jams or while waiting at red lights to reduce the risk of rear-end collisions. Specifically, multiple consecutive video frames are extracted from the fused data structure, and a target tracking algorithm continuously tracks the target vehicle ahead, analyzing its longitudinal displacement changes in the image coordinate system. When a vehicle ahead is detected to change from a stationary state to a moving state (e.g., a continuous increase in longitudinal displacement and a change in velocity from zero to a positive value), a starting prompt is output; when a vehicle ahead is detected to change from a moving state to a stationary state (e.g., a stabilizing longitudinal displacement and a near-zero velocity), a stopping prompt is output. SAG detection combines the vehicle's speed and acceleration data from the fused data structure to eliminate interference from changes in the vehicle's motion state on the target displacement analysis, improving the accuracy of judging the state of the vehicle ahead.

[0083] Blind spot detection (BSD) is performed based on fused data. BSD refers to an assisted driving function that uses a rear-facing camera to monitor other vehicles or obstacles within the blind spot area to the side and rear of the vehicle, issuing a warning to the driver when a target with a collision risk is detected. Specifically, auxiliary cameras deployed to the side and rear of the vehicle collect blind spot video data. These auxiliary cameras are connected to the video detection framework through an independent image signal processor channel or video input interface. The system extracts video frames from the blind spot video data, identifies vehicle targets within the blind spot using a target detection algorithm, and combines this with the vehicle's speed and direction angle data from the fused data structure to determine the movement trend and distance changes of the vehicle target relative to the vehicle. When a vehicle target is detected entering a preset blind spot warning range and there is a risk of lane-changing collision, a blind spot detection warning is triggered.

[0084] By acquiring video frames through a video detection framework and combining them with positioning and acceleration data for timestamp alignment and sensor fusion, assisted driving feature detection can simultaneously utilize visual information, geographic location information, and vehicle dynamic information. This effectively improves the accuracy and environmental adaptability of detection functions such as lane departure warning and forward collision warning, and enhances the reliability of assisted driving feature detection.

[0085] In some embodiments, performing assisted driving feature detection based on the fused data includes: S81. Obtain the light detection results.

[0086] In this embodiment, an ambient light intensity module collects ambient light intensity data and determines the current light mode. The ambient light intensity detection module is a functional module integrated into the embedded dashcam terminal for sensing the intensity of external ambient light. It can acquire ambient light intensity data through a photoresistor, an ambient light sensor, or automatic exposure statistics from an image signal processor. The ambient light intensity detection module continuously collects ambient light intensity data at a preset sampling period and compares the collected light intensity values ​​with preset daytime and nighttime thresholds: when the light intensity value is greater than or equal to the daytime threshold, the current light mode is determined to be daytime mode; when the light intensity value is less than or equal to the nighttime threshold, the current light mode is determined to be nighttime mode; when the light intensity value is between the daytime and nighttime thresholds, the previously determined light mode is maintained or a delayed switch is performed based on trend changes to avoid frequent changes in the light mode near the critical value.

[0087] S82. When the light detection result is daytime mode, the first set of detection parameters is used to perform the assisted driving feature detection.

[0088] In this embodiment, when the light detection result is in daytime mode, the first set of detection parameters is used to perform assisted driving feature detection. The first set of detection parameters is a set of parameters optimized for environmental conditions where there is sufficient daylight, high image contrast, and clear lane lines and vehicle target outlines. Specifically, in lane departure warning detection, the first set of detection parameters is configured with a higher sensitivity threshold (for example, setting the gradient threshold for lane line edge detection to a lower value so that the system remains sensitive to weak lane line markings), enabling the system to promptly identify faded or worn lane lines during the day. In forward collision warning detection, the first set of detection parameters is configured with a longer distance threshold (for example, setting the forward collision warning trigger distance to 50 meters), enabling the system to provide early warning of deceleration or braking behavior of distant vehicles when visibility is good during the day, allowing the driver sufficient reaction time.

[0089] S83. When the light detection result is night mode, the second set of detection parameters is used to perform the assisted driving feature detection; wherein, the first set of detection parameters and the second set of detection parameters are different in terms of the sensitivity threshold of lane departure warning and the distance threshold of forward collision warning.

[0090] In this embodiment, when the light detection result is in night mode, the second set of detection parameters is used to perform assisted driving feature detection. The second set of detection parameters is a set of parameters optimized for environmental conditions such as insufficient nighttime illumination, increased image noise, and reduced visibility of lane lines and vehicle targets. Specifically, in lane departure warning detection, the second set of detection parameters is configured with a lower sensitivity threshold (for example, setting the gradient threshold for lane line edge detection to a higher value and enabling image denoising preprocessing) to reduce the false detection rate caused by factors such as road surface reflection and interference from oncoming headlights at night. In forward collision warning detection, the second set of detection parameters is configured with a closer distance threshold (for example, setting the forward collision warning trigger distance to 30 meters) to adapt to the decrease in the accuracy of long-distance target detection caused by the loss of image details in nighttime environments, while avoiding false distance estimation caused by the glare of the taillights of the vehicle in front at night. The first set of detection parameters and the second set of detection parameters have clear differences in the sensitivity threshold for lane departure warning and the distance threshold for forward collision warning, ensuring that assisted driving feature detection adopts a detection strategy that matches the lighting conditions both during the day and at night.

[0091] By dynamically adjusting the detection parameters of the assisted driving system based on the light detection results, the same assisted driving algorithm can adapt to different lighting conditions, avoiding the decline in detection performance caused by strong daylight or low illumination at night, and improving the working stability of the assisted driving system in all-weather environments.

[0092] It should be understood that the aforementioned multi-mode recording priority preemption and seamless switching method, multi-channel video pipeline unified scheduling architecture, and embedded multi-sensor fusion assisted driving analysis method are not independent technical modules, but rather a holistic technical solution that works collaboratively and supports each other within the embedded driving recorder terminal. The unified video pipeline scheduling architecture provides underlying hardware data path support for multi-mode recording management and assisted driving feature detection. The video encoder performs encoding and file switching for multi-mode recording based on the independent encoding channel of the video pipeline scheduling architecture, ensuring uninterrupted video data flow during seamless switching. Simultaneously, the video detection framework acquires video frame data based on another independent input port of the video pipeline scheduling architecture and performs assisted driving feature detection. Both achieve hardware-level parallelism through the multi-output port design of the image signal processor, ensuring no interference between them. Furthermore, the motion detection results output by the video detection framework during assisted driving feature detection can serve as trigger conditions for motion detection recording, creating a data closed loop between assisted driving analysis and multi-mode recording management: when the video detection framework detects a moving target in the frame that meets preset conditions, it not only performs assisted driving level analysis but also triggers high-priority motion detection recording by generating recording control commands, ensuring that abnormal events are fully recorded. In addition, the multi-sensor timestamp alignment mechanism fuses positioning data and acceleration data with video frames, which not only improves the accuracy of assisted driving feature detection, but also provides multi-source data support with spatiotemporal information for subsequent emergency event recording.

[0093] By abstracting heterogeneous hardware modules into a unified port-channel model, the unified scheduling architecture of multi-channel video pipelines effectively reduces the engineering complexity of parallel operation of multi-channel video encoding and assisted driving analysis, making it possible to simultaneously integrate multi-mode intelligent recording and complete assisted driving functions on a single-core embedded processor. Furthermore, the deep coupling between the multi-mode recording priority preemption mechanism and assisted driving feature detection at the trigger source and data flow levels further ensures the integrated fusion of driving recording and assisted driving in terms of functional logic. Together, these three elements constitute an integrated solution for driving recording and assisted driving on resource-constrained embedded platforms.

[0094] This invention also provides a driving recorder and driver assistance device, which is used to execute any of the aforementioned driving recorder and driver assistance methods. Specifically, please refer to... Figure 3 , Figure 3 This is a schematic block diagram of a driving recorder and driver assistance device provided in an embodiment of the present invention.

[0095] like Figure 3 As shown, the driving recorder and driver assistance device 100 includes: The mode configuration unit 110 is used to predefine multiple recording modes and configure a priority table and the trigger conditions corresponding to each recording mode. The instruction processing unit 120 is configured to, if a recording control instruction is received, compare the priority of the target recording mode corresponding to the recording control instruction with the priority of the current recording mode. The switching execution unit 130 is used to perform seamless switching if the priority of the target recording mode is higher than the priority of the current recording mode, mark the video file corresponding to the current recording mode as protected, and create a new video file corresponding to the target recording mode to continue writing. The downgrade recovery unit 140 is used to automatically downgrade according to the priority table after the event corresponding to the high priority recording mode ends, until it is restored to the lowest priority normal loop recording mode.

[0096] In some embodiments, the driving recorder and driver assistance device 100 further includes: The channel configuration unit is used to preset the channel configuration table, traverse each entry in the channel configuration table, and determine whether the corresponding channel needs to be initialized based on the usage flag. The initialization unit is used to call the image signal processor driver to create an output port for the channel that needs to be initialized, set the output resolution and cropping window of the output port, set the pixel format of the output port, and allocate a frame buffer memory pool according to the channel depth. The architecture establishment unit is used to cascade and bind the output port of the image signal processor with the input port of the video encoder, the input port of the video detection frame, and the input port of the video display module according to the binding parameters, so as to establish a unified video pipeline scheduling architecture, enabling the same frame of image data to be distributed in parallel to the video encoder, the video detection frame, and the video display module in a zero-copy manner through direct hardware memory access.

[0097] In some embodiments, the driving recorder and driver assistance device 100 further includes: The first data acquisition unit is used to acquire video frame data through the input port of the video detection framework; The second data acquisition unit is used to acquire positioning data and acceleration data, wherein the positioning data includes latitude and longitude, velocity, orientation angle and UTC time; The data fusion unit is used to perform time stamp alignment and sensor fusion of the video frame data, the positioning data and the acceleration data through a unified timestamp mechanism. The feature detection unit is used to perform assisted driving feature detection based on the fused data. The assisted driving feature detection includes lane departure warning, forward collision warning, start-stop assist and blind spot detection.

[0098] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0099] In the embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Units with the same function may be grouped into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, or it may be an electrical, mechanical, or other form of connection.

[0100] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.

[0101] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0102] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a computer-readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned computer-readable storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks.

[0103] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A driving recorder and assisted driving method, characterized in that, include: Predefine multiple recording modes and configure priority tables and trigger conditions for each recording mode; If a recording control command is received, the priority of the target recording mode corresponding to the recording control command is compared with the priority of the current recording mode; If the priority of the target recording mode is higher than the priority of the current recording mode, a seamless switch is performed, the video file corresponding to the current recording mode is marked as protected, and a new video file corresponding to the target recording mode is created to continue writing. When the event corresponding to the high-priority recording mode ends, the recording will automatically downgrade according to the priority table until it is restored to the lowest priority normal loop recording mode.

2. The driving recording and assisted driving method according to claim 1, characterized in that, The predefined multiple recording modes and the configuration of priority tables and corresponding trigger conditions for each recording mode include: Define multiple recording modes, including emergency event recording, manual lock recording, normal loop recording, motion detection recording, and parking monitoring recording; Configure the trigger conditions for each recording mode; Configure a priority table, with the priority of each recording mode decreasing in the following order: emergency event recording, manual lock recording, motion detection recording, parking monitoring recording, and normal loop recording.

3. The driving recording and assisted driving method according to claim 1, characterized in that, If a recording control command is received, the priority of the target recording mode corresponding to the recording control command is compared with the priority of the current recording mode, including: The recording control command is received through a preset named pipe, and the target recording mode corresponding to the recording control command is parsed. The current recording mode and its corresponding priority value are obtained through the status variable; Query the priority value corresponding to the target recording mode, and compare the priority value of the target recording mode with the priority value of the current recording mode.

4. The driving recording and assisted driving method according to claim 1, characterized in that, The seamless execution switch includes: The preset seamless switching command notifies the encoding module to mark the video file corresponding to the current recording mode as protected. Create a new video file corresponding to the target recording mode, and switch the encoded data stream to the new video file to continue writing.

5. The driving recording and assisted driving method according to claim 1, characterized in that, The step of automatically downgrading the recording mode according to the priority table after the event corresponding to the high-priority recording mode ends, until it is restored to the lowest priority normal loop recording mode, includes: The duration of events corresponding to the high-priority recording mode is monitored by a preset timer; When the duration of the event reaches a preset threshold, the recording mode is downgraded to the second-highest priority mode according to the priority table. Repeat the downgrade operation until the system is restored to the normal loop recording mode.

6. The driving recording and assisted driving method according to claim 1, characterized in that, The method further includes: A preset channel configuration table is used. Each entry in the channel configuration table is traversed, and the corresponding channel is determined to be initialized based on the usage flag. For channels that need initialization, the image signal processor driver is called to create an output port, set the output resolution and cropping window of the output port, set the pixel format of the output port, and allocate a frame buffer memory pool according to the channel depth. According to the binding parameters, the output port of the image signal processor is cascaded and bound to the input port of the video encoder, the input port of the video detection frame, and the input port of the video display module, respectively, to establish a unified video pipeline scheduling architecture, so that the same frame of image data can be distributed in parallel to the video encoder, the video detection frame, and the video display module in a zero-copy manner through direct hardware memory access; The video encoder is used to execute the following steps based on the independent encoding channel of the video pipeline scheduling architecture: if a recording control command is received, the priority of the target recording mode corresponding to the recording control command is compared with the priority of the current recording mode, and so on.

7. The driving recording and assisted driving method according to claim 6, characterized in that, Each channel of the image signal processor includes a real-time output port, a buffered output port, and an infrared output port; the real-time output port outputs image data with a first resolution and a first frame rate to the video encoder. The buffer output port outputs image data with a second resolution and a second frame rate to the video detection frame; the real-time output port, the buffer output port, and the infrared output port are independently controlled by an enable flag; the enable flag is set to a valid value to start the data stream of the corresponding port, and the enable flag is set to an invalid value to stop the data stream of the corresponding port.

8. The driving recording and assisted driving method according to claim 6, characterized in that, The method further includes: Video frame data is obtained through the input port of the video detection framework; Acquire positioning data and acceleration data, wherein the positioning data includes latitude and longitude, velocity, orientation angle and UTC time; The video frame data, the positioning data, and the acceleration data are time-stamped and fused using a unified timestamp mechanism. The assisted driving feature detection is performed based on the fused data. The assisted driving feature detection includes lane departure warning, forward collision warning, start-stop assist and blind spot detection.

9. The driving recording and assisted driving method according to claim 8, characterized in that, The process of performing assisted driving feature detection based on the fused data includes: Obtain the light detection results; When the light detection result is daytime mode, the assisted driving feature detection is performed using the first set of detection parameters; When the light detection result indicates night mode, the second set of detection parameters is used to perform the assisted driving feature detection. The first set of detection parameters differs from the second set of detection parameters in terms of the sensitivity threshold for lane departure warning and the distance threshold for forward collision warning.

10. A driving recorder and driver assistance device, characterized in that, The apparatus for performing the driving recording and assisted driving method according to any one of claims 1-9, the apparatus comprising: The mode configuration unit is used to predefine multiple recording modes and configure the priority table and the trigger conditions corresponding to each recording mode; The instruction processing unit is configured to, if a recording control instruction is received, compare the priority of the target recording mode corresponding to the recording control instruction with the priority of the current recording mode. The switching execution unit is used to perform seamless switching if the priority of the target recording mode is higher than the priority of the current recording mode, mark the video file corresponding to the current recording mode as protected, and create a new video file corresponding to the target recording mode to continue writing. The downgrade recovery unit is used to automatically downgrade according to the priority table after the event corresponding to the high-priority recording mode ends, until it is restored to the lowest priority normal loop recording mode.