Road condition early warning method and system based on automobile data recorder

By integrating the YOLOv5s model and LSTM network into the dashcam for obstacle detection and trajectory prediction, and calculating dynamic TTC values, the problem of single judgment dimensions and insufficient risk assessment in existing road condition warnings is solved, realizing a more accurate and real-time warning mechanism, and enhancing the system's intelligence and accident tracing capabilities.

CN120977036AActive Publication Date: 2025-11-18SHENZHEN HAIZHEN AUTOMOTIVE TECH CO LTD

Patent Information

Application Number
CN202511515506.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2025-11-18
Estimated Expiration
2045-10-22

AI Technical Summary

Technical Problem

Existing camera-based video analytics technologies suffer from problems such as limited judgment dimensions, insufficient risk assessment accuracy, and poor real-time performance and precision in traffic condition warnings. Furthermore, the lack of a unified temporal modeling and behavior prediction mechanism leads to delayed warning responses and coarse warning strategies.

Method used

By using a dashcam-based road condition warning method, real-time video target detection is performed using the YOLOv5s model. The LSTM and attention mechanism are combined to predict obstacle trajectories, calculate dynamic TTC values, and judge emergency braking behavior through acceleration thresholds. This achieves multi-dimensional road condition warnings and automatically saves and uploads warning events to the cloud.

Benefits of technology

It improved the accuracy of risk assessment and the real-time nature of early warning, reduced the false alarm rate and the missed alarm rate, enhanced the accident tracing capability, and realized the continuous modeling and dynamic prediction of the future trend of obstacles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120977036A_ABST
    Figure CN120977036A_ABST
Patent Text Reader

Abstract

The invention discloses a road condition early warning method and system based on an automobile data recorder, and relates to the technical field of road condition early warning, and the method comprises the steps: starting a vehicle, recording the driving road condition through the automobile data recorder, collecting the driving speed of the vehicle, and detecting the recorded video data to recognize road condition obstacles; the actual distance and speed of an obstacle are calculated based on the recognized road condition obstacle, the movement track of the obstacle is predicted, and the dynamic TTC is calculated through the predicted movement track of the obstacle in combination with the vehicle running speed. According to the method, the motion state vector of the obstacle is constructed, and the attention mechanism and the LSTM model are combined to predict the trajectory and calculate the dynamic TTC value, so that the future position and relative trend of the obstacle can be accurately judged, the potential collision risk can be recognized in advance and graded early warning can be realized, and the accuracy of road condition early warning can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of road condition warning, in particular to a road condition warning method and system based on a driving recorder. BACKGROUND

[0002] With the continuous development of artificial intelligence, computer vision and Internet of Vehicles technology, the auxiliary driving system based on camera perception of the environment has gradually been popularized in medium and high-end vehicles. As a visual information acquisition device for vehicles, the driving recorder has been more and more widely used in intelligent driving assistance scenarios such as collision detection, accident analysis, path tracking, etc. in recent years due to its simple deployment, low cost, intuitive imaging and other characteristics. The traditional driving recorder is mainly used for passive recording, while the technology development in recent years is gradually upgrading it to an embedded intelligent device with partial active perception and judgment capability. Related technical research attempts to realize the functions of vehicle environment perception and potential risk warning by fusing target detection models (such as YOLO), path planning, sensor data processing and other algorithms without increasing the cost of additional hardware, and to empower existing vehicles with higher intelligent capabilities.

[0003] However, in the existing camera-based video analysis technology, there are still the following obvious deficiencies. First, most of the methods are based on fixed cameras or ADAS special modules, rather than using driving recorders, which have poor universality and adaptability, and most of the methods only stop at image-level target detection (i.e. identifying obstacles), without further modeling the motion state of the target, predicting its trajectory, and combining the motion parameters of the vehicle itself for dynamic prediction. Secondly, there is a lack of unified time sequence modeling and behavior prediction mechanism, which cannot realize continuous modeling of the future trend of obstacles, and the warning response is lagging, the reliability is insufficient, in addition, the warning strategy is rough, usually based on simple threshold judgment, lacks time prediction indicators such as TTC (Time to Collision) as a basis for judgment, and cannot distinguish between high-risk and low-risk situations, therefore, the existing road condition warning technology generally has the problems of single warning judgment dimension, insufficient risk assessment accuracy, poor real-time and accuracy of warning. SUMMARY

[0004] In view of the above existing problems, the present application is proposed.

[0005] Therefore, the present application provides a road condition warning method and system based on a driving recorder, which solves the problems of single warning judgment dimension, insufficient risk assessment accuracy, poor real-time and accuracy of warning.

[0006] To solve the above technical problems, the present application provides the following technical solutions: In a first aspect, the present application provides a road condition warning method based on a driving recorder, which comprises, The vehicle starts to record the driving road condition through the driving recorder, collects the vehicle driving speed, and detects and identifies the road condition obstacles from the video data; The actual distance and speed of the obstacle are calculated based on the identified road condition obstacle, the motion trajectory of the obstacle is predicted, and the dynamic TTC is calculated by combining the predicted motion trajectory of the obstacle with the vehicle driving speed; Based on the dynamic TTC, the warning analysis is carried out, the road condition warning is carried out according to the warning analysis result, and the warning event data is saved and synchronized to the cloud.

[0007] As a preferred scheme of the road condition warning method based on the driving recorder, wherein: the motion trajectory of the obstacle is predicted, the dynamic TTC is calculated by combining the predicted motion trajectory of the obstacle with the vehicle driving speed, which is based on the actual distance between the obstacle and the vehicle at the current time , the speed of the obstacle and the acceleration of the obstacle A three-tuple is constructed , that is, the motion state vector of the obstacle, and the motion state vectors of the obstacle in the historical time are collected through a sliding window to form an input sequence Z, the motion state vector of each time in the input sequence Z is input into an attention calculation unit, the attention score of each time step is calculated , and the attention scores of all time steps are normalized by using a Softmax function to obtain normalized attention weights The original input sequence Z is weighted to obtain a weighted input sequence Input into the LSTM model to obtain the position of the obstacle at the next time , and all trainable parameters in the LSTM network are flattened into a high-dimensional vector, the particle swarm is initialized, the LSTM parameters corresponding to all particles are substituted into the LSTM model for prediction, and the fitness function of each particle is calculated. The fitness functions of all particles are sorted in descending order, and the particle with the smallest error in the particle swarm is selected as the global optimal solution of the current round According to the APSO optimization algorithm, the particle position and speed are iteratively updated, after each iteration, the position and speed of all particles are updated, the global optimal solution is re-evaluated according to the fitness function, and the maximum iteration number is set When the number of continuous iterations is greater than or equal to the maximum iteration number, the iteration is stopped, and the optimal global optimal solution , that is, the optimal LSTM model parameter, is output, the LSTM model is updated by the global optimal solution to predict the position of the obstacle , and the position of the obstacle is predicted based on the LSTM model with updated parameters The LSTM model, after being updated with new parameters, makes predictions to determine the obstacle's position at the next time step. These predictions are repeated to obtain the obstacle's future trajectory. Future movement trajectory through obstacles Calculate the future velocity of the obstacle between two adjacent predicted positions. And calculate the relative speed in combination with the vehicle speed v. ; When relative velocity When the value is greater than 0, the vehicle is approaching the obstacle, posing a collision risk, and a TTC calculation is performed. Otherwise, it is normal, based on relative speed. The collision time (TTC) is calculated based on the predicted distance.

[0008] As a preferred embodiment of the traffic condition warning method based on a dashcam described in this invention, the step of performing warning analysis based on dynamic TTC and issuing traffic condition warnings based on the warning analysis results refers to setting a threshold based on the TTC calculation results through statistical analysis. , threshold Greater than the threshold When TTC is less than the threshold When the vehicle is about to collide with an obstacle, a red warning is triggered. This occurs when the TTC (Total Traffic Control) threshold is greater than or equal to the threshold. less than the threshold When the TTC is greater than or equal to the threshold, a yellow alert will be triggered. In such cases, there is no need to trigger a warning. Based on the determined risk level, the corresponding warning triggering mechanism is executed. When a red warning is triggered, the obstacle ahead is highlighted with a red border on the vehicle display screen, and a voice prompt "Collision risk ahead, please slow down!" is played. When a yellow warning is triggered, a yellow warning box is displayed on the vehicle display screen to remind the driver to pay attention to the obstacle ahead and take measures to avoid a collision.

[0009] As a preferred embodiment of the road condition warning method based on a dashcam described in this invention, the step of saving and synchronously uploading the warning event data to the cloud refers to the following: when a red or yellow warning is triggered, and the vehicle performs a steering operation or sudden braking, the longitudinal acceleration is monitored in real time by an acceleration sensor. When the acceleration meets the conditions, the emergency recording function is immediately activated to automatically record videos before and after the sudden braking. All emergency recording data is automatically set to an "overwriteable state". After the emergency recording is completed, the recorded video file, event image snapshot, event timestamp, and TTC data of this event are packaged and uploaded to the cloud server through the Wi-Fi network connected by the vehicle communication module.

[0010] As a preferred embodiment of the road condition warning method based on a dashcam described in this invention, the step of calculating the actual distance and speed of road obstacles based on obstacle identification refers to processing the camera focal length and the image height of the obstacle using camera calibration, calculating the actual distance D between the obstacle and the vehicle using a monocular visual ranging method, and calculating the speed of the obstacle through multiple consecutive frames of images. The change in obstacle velocity is calculated by subtracting the velocities of obstacles in adjacent frames. Based on the change in obstacle velocity Calculate the acceleration of the obstacle .

[0011] As a preferred embodiment of the road condition warning method based on a dashcam described in this invention, the step of detecting and identifying road obstacles in the recorded video data refers to inputting the real-time video stream image into a YOLOv5s model for obstacle target detection. The YOLOv5s model processes each frame of the image, generates a bounding box for each detected obstacle, outputs the bounding boxes of candidate obstacle targets, and applies a regression loss function. Regression optimization is performed on the center point coordinates and width and height parameters of the bounding box. The obstacle bounding box is obtained through the optimized parameters. Combined with the NMS algorithm, a cross-union threshold is set. When the intersection-union ratio (IU) of bounding box A and bounding box B is greater than the IU threshold. If the confidence score of bounding box A is greater than that of bounding box B, then bounding box B is removed. This process is repeated until all bounding boxes have been processed. For the processed bounding boxes, the obstacle category distribution is calculated using the softmax function, and the category classification is optimized using cross-entropy loss.

[0012] As a preferred embodiment of the road condition warning method based on a dashcam described in this invention, the vehicle starts recording the road conditions via the dashcam. The vehicle speed is collected when the vehicle's ACC is activated. The dashcam automatically starts recording the road conditions in real time and connects to the vehicle system or mobile APP via WIFI. The vehicle's actual speed is obtained via the CAN bus.

[0013] Secondly, the present invention provides a road condition warning system based on a dashcam, comprising, The road condition image acquisition module is used to automatically start the dashcam when the vehicle's auxiliary power ACC is turned on, record video in real time and collect vehicle speed data; The obstacle recognition module is used to detect obstacles encountered during driving in real time using the YOLOv5s model. The obstacle distance and speed calculation module is used to obtain image data of the camera focal length and obstacles through camera calibration, combine the image height and the actual height to calculate the actual distance between the obstacle and the vehicle, and estimate the speed and acceleration of the obstacle. The dynamic TTC calculation module is used to construct motion state vectors based on the distance, velocity, and acceleration of obstacles, collect historical motion state vector data, predict the future motion trajectory of obstacles through LSTM and attention mechanisms, and calculate TTC values. The warning and data upload module is used to determine whether a warning is triggered based on the TTC calculation results, and to remind the driver through the display screen and voice according to the warning level, while uploading the data.

[0014] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of the traffic warning method based on a driving recorder as described in the first aspect of the present invention.

[0015] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the traffic warning method based on a dashcam as described in the first aspect of the present invention.

[0016] The beneficial effects of this invention are as follows: By integrating vehicle speed information, image recognition, obstacle motion state analysis, and dynamic TTC calculation, this invention constructs a multi-dimensional road condition early warning mechanism, overcoming the problem of single judgment basis in existing technologies. It utilizes the YOLOv5s model to achieve real-time video target detection, and combines softmax classification and cross-entropy optimization to improve recognition accuracy. It uses LSTM combined with an attention mechanism to predict obstacle trajectories, calculates dynamic TTC values, and provides graded early warnings based on the degree of collision risk, thereby improving the accuracy of risk assessment and the real-time performance of early warnings. It combines acceleration thresholds to judge emergency braking behavior, and realizes automatic saving and uploading of key event recordings to the cloud, enhancing the ability to trace accidents. Attached Figure Description

[0017] 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 only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Fig. 1 This is a flowchart of the road condition warning method based on a dashcam in Example 1.

[0019] Fig. 2This is a structural diagram of the road condition warning system based on a dashcam in Example 1.

[0020] Fig. 3 This is a flowchart of obstacle detection in Example 1. Detailed Implementation

[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0022] Example 1, referring to Figs. 1-3 This is the first embodiment of the present invention, which provides a road condition warning method based on a dashcam, including the following steps: S1. Start the vehicle and record the driving conditions through the dashcam, collect the vehicle speed, and detect and identify road obstacles from the recorded video data; Specifically, the dashcam records driving conditions after the vehicle is started. The dashcam automatically starts recording real-time driving conditions once the ACC (auxiliary power) is connected. It connects to the vehicle's system or a mobile app via Wi-Fi (2.4GHz) to ensure data synchronization and remote control. The dashcam also obtains the vehicle's speed via the CAN bus (serial communication protocol) and converts it to meters per second (m / s) for subsequent path calculation and obstacle prediction. The conversion formula is as follows: in, It is the vehicle's real-time speed. It refers to the vehicle's speed.

[0023] The system achieves zero-delay response and full-process recording by automatically activating the dashcam after the vehicle's ACC is engaged, ensuring that the warning system is activated synchronously with the vehicle. Real-time recording of road conditions improves the integrity and continuity of road condition perception, avoiding the risk of misidentification caused by "frame interruption" or "image loss". Connecting to the vehicle system or APP via WIFI (2.4GHz) expands the system's application boundaries, improving its operability and interactivity. Obtaining vehicle speed via CAN bus and converting it to m / s ensures data consistency and accuracy throughout the motion state modeling and collision time prediction process, effectively improving the warning system's response capability and judgment accuracy to dynamic risks.

[0024] Furthermore, the detection and identification of road obstacles in the recorded video data involves inputting the real-time video stream images into the YOLOv5s model for obstacle target detection. The YOLOv5s model processes each frame of the image, generates a bounding box for each detected obstacle, and outputs the bounding box of the candidate obstacle target, which is used to define the rectangular box of the target object. The bounding box starts from the upper left corner. bottom right corner definition: in, These are the bounding box coordinates, which represent the position of the obstacle in the image; To improve the accuracy of bounding box localization, mean squared error (MSE) is used as the regression loss function during model training. Through regression loss function The center point coordinates and width / height parameters of the bounding boxes are optimized using regression. The optimized parameters are then used to obtain the obstacle bounding boxes. To avoid multiple overlapping bounding boxes pointing to the same target, the Non-Maximum Suppression (NMS) algorithm is used to retain the bounding box with the highest confidence (confidence that an object exists within the bounding box) as the final detection result for the target obstacle. The selection of bounding boxes is based on the degree of overlap between them, i.e., the Cross-Union Ratio (CUI), and a CUI threshold is set through cross-validation. When the intersection-union ratio (IU) of bounding box A and bounding box B is greater than the IU threshold... If the confidence score of bounding box A is greater than that of bounding box B, then bounding box B is removed to prevent duplicate detection. This process is repeated until all bounding boxes have been processed. For the processed bounding boxes, the obstacle category distribution (pedestrians, vehicles) is calculated using the softmax function, and the category classification is optimized using cross-entropy loss to measure the difference between the model's predicted category distribution and the true category label.

[0025] By inputting real-time acquired video stream images into the YOLOv5s model for target detection, the robustness and real-time performance of obstacle detection under different road conditions and lighting conditions are improved, providing a data foundation for subsequent early warnings. By generating bounding boxes for each detected obstacle and outputting its position coordinates, a structured representation of the obstacle's spatial location is achieved, enhancing data resolvability. By introducing the mean squared error (MSE) regression loss function into the model training to optimize the bounding box prediction parameters, the accuracy and stability of obstacle localization are significantly enhanced, improving the system's recognition reliability in complex scenarios and reducing early warning interference caused by false alarms / missed alarms. By combining the non-maximum suppression (NMS) algorithm to screen candidate bounding boxes, redundant overlapping boxes are effectively suppressed, and a unique and reliable target box is output. By performing softmax classification and cross-entropy loss optimization on the finally retained bounding boxes, high-confidence recognition and label refinement of obstacle categories (pedestrians, vehicles, etc.) are achieved.

[0026] S2. Based on the identification of road obstacles, calculate the actual distance and speed of the obstacles, predict the trajectory of the obstacles, and calculate the dynamic TTC by combining the predicted trajectory of the obstacles with the vehicle speed. Specifically, calculating the actual distance and speed of obstacles based on road condition obstacle identification involves using camera calibration (a process in computer vision and image processing used to determine the internal parameters of a camera, converting pixel values ​​into actual physical units) to process the camera focal length and the image height of the obstacle. Then, by combining the processed camera focal length and obstacle image height with the actual height of the obstacle, a monocular vision ranging method is used to calculate the actual distance between the obstacle and the vehicle at the current moment. in, is the actual distance between the obstacle and the vehicle at the current moment, f is the processed camera focal length, l is the image height of the obstacle after camera calibration, and H is the actual height of the obstacle; Calculate the velocity of the obstacle using multiple consecutive frames of images: in, It is the speed of the obstacle. It is the frame interval time. It refers to the change in the position of obstacles in adjacent frames; The change in obstacle velocity is calculated by subtracting the velocities of obstacles in two adjacent frames. Based on the change in obstacle velocity Calculate the acceleration of the obstacle to describe its changes in motion: in, It is the acceleration of the obstacle.

[0027] Through camera calibration, the mapping between image pixels and actual physical units was realized, establishing a basic spatial model for distance measurement. By combining the processed focal length, image height, and the actual height of the obstacle, the actual distance between the obstacle and the vehicle was calculated, realizing non-contact monocular ranging. By calculating the change in obstacle position through continuous image frames, the relative velocity of the obstacle was estimated, providing input for dynamic behavior modeling. By analyzing velocity changes, the acceleration of the obstacle was further calculated, enabling sensitive recognition of changes in motion trends.

[0028] Furthermore, the trajectory of the obstacle is predicted, and the dynamic TTC (Time Toll Collection) index is calculated based on the actual distance between the obstacle and the vehicle at the current moment, using the predicted obstacle trajectory combined with the vehicle speed. The speed of the obstacle and the acceleration of obstacles Construct triples This refers to the motion state vector of the obstacle. To support the dynamic perception and prediction of the subsequent model, the motion state vectors of the obstacle over historical time periods are collected through a sliding window to construct the input sequence. ,in, This is the obstacle motion state vector at time t. The motion state vector at each time step in the input sequence Z is input into the attention calculation unit to calculate the attention score at each time step. To ensure the comparability of attention scores, the attention scores at all time steps are normalized using the Softmax function to obtain normalized attention weights. Using normalized attention weights The original input sequence is weighted to obtain a new input sequence. The new input sequence after weighting Each time step in the sequence is sequentially input into the LSTM model for hidden state updates, and the hidden state of the last time step in the sequence is selected. The obstacle position at the next time step is output through a fully connected layer. To enhance the ability of LSTM models to handle complex problems, all trainable parameters in the LSTM network are flattened into a high-dimensional vector for unified optimization. A particle swarm is then initialized, with each particle representing a set of LSTM parameter vectors to obtain the initial particle swarm set. ,in, Let be the LSTM parameters corresponding to the i-th particle. To evaluate the performance of the LSTM model for each particle, the LSTM parameters corresponding to all particles are substituted into the LSTM model for prediction, and the fitness function for each particle is calculated. The fitness function is defined as the root mean square error (RMSE) on the validation set. ; Sort all particles by their fitness functions in descending order, and select the particle with the smallest error (i.e., the smallest fitness) as the global optimum for the current round. Based on the APSO optimization algorithm, the particle position and velocity are iteratively updated: in, It is the updated particle velocity. This is the updated particle position. It is the inertial weight, which is set through experiments. It is the particle's current velocity. It is a random number. It is the best-performing global optimal solution in the current particle swarm. , These are the perturbation factor and the guiding factor, which are set through an adaptive mechanism; After each iteration, the positions and velocities of all particles are updated, the global optimum is re-evaluated based on the fitness function, and the maximum number of iterations is set using fuzzy logic. When continuous iteration If the variation of the fitness function converges, then stop iterating and output the optimal global solution. That is, the optimal LSTM model parameters, obtained through the global optimal solution. Update the LSTM model to predict obstacle locations Predicting obstacle locations based on an LSTM model with updated parameters The LSTM model, after being updated with new parameters, makes predictions to determine the obstacle's position at the next time step. These predictions are repeated to obtain the obstacle's future trajectory. ,in, It is the future trajectory of the obstacle. It predicts the obstacle's position at time t+J; Future movement trajectory through obstacles Calculate the future velocity of the obstacle between two adjacent predicted positions: in, It is the future velocity of the obstacle at time t+1. It is the sampling time interval; Based on the future velocity of the obstacle at time t+1 Calculate relative speed by subtracting vehicle speed v It is used to determine whether a vehicle and an obstacle are approaching each other, when the relative speed... When the value is greater than 0, the vehicle is approaching the obstacle, posing a collision risk, and a TTC calculation is performed. Otherwise, it is normal, based on relative speed. Calculate the time of collision (TTC) based on the predicted distance: Where TTC is the collision time. It is the actual distance between the obstacle and the vehicle at the current moment. It predicts the distance.

[0029] By constructing a triplet of obstacle motion states including actual distance, velocity, and acceleration, multidimensional dynamic behavior modeling is achieved, providing comprehensive input for trajectory prediction and avoiding the warning lag problem caused by static recognition. An attention mechanism is used to calculate weights on historical state sequences, enhancing the model's ability to capture complex behavior patterns, improving trajectory prediction accuracy, and reducing false predictions caused by invalid data interference. By inputting the weighted sequence into an LSTM network and continuously updating the hidden states, temporal context modeling is achieved, enhancing the model's memory and reasoning capabilities, providing stable input for TTC calculation and warning. The APSO optimization algorithm is then applied to... Global search optimization of LSTM parameters enhances the model's stability and adaptability under different road conditions and obstacle behavior patterns, ensuring high reliability of trajectory prediction even in complex environments. By continuously calling the optimized LSTM model for iterative position prediction, the granularity and continuity of obstacle movement trend prediction are improved. By calculating the relative speed between future speed and vehicle speed, and combining it with the predicted obstacle distance, the TTC value is calculated, constructing a more accurate and dynamic early warning mechanism. Compared with traditional judgment methods based on fixed distances, it can significantly reduce the false alarm rate and false negative rate, improving the reliability and practicality of road condition early warning.

[0030] S3. Based on dynamic TTC, perform early warning analysis, issue traffic condition warnings based on the early warning analysis results, and save and synchronously upload the warning event data to the cloud.

[0031] Specifically, early warning analysis is performed based on dynamic TTC (Time of Collision), and road condition warnings are issued based on the analysis results. Thresholds are set through statistical analysis based on the TTC calculation results. , threshold Greater than the threshold When TTC is less than the threshold When the vehicle is about to collide with an obstacle, a red warning is triggered. This occurs when the TTC (Total Traffic Control) threshold is greater than or equal to the threshold. less than the threshold When the TTC is greater than or equal to the threshold, a yellow alert will be triggered. In the event of a red warning, no warning needs to be triggered. Instead, the corresponding warning triggering mechanism is executed based on the assessed risk level. When a red warning is triggered, obstacles ahead are highlighted with a red border on the vehicle's display screen to help the driver quickly identify the collision risk area, and a voice prompt, "Collision risk ahead, please slow down!" is played to ensure that the driver can hear the warning in time. When a yellow warning is triggered, a yellow warning box is displayed on the vehicle's display screen to remind the driver to pay attention to obstacles ahead and take measures to avoid a collision.

[0032] By using a threshold judgment mechanism based on TTC (Time of Collision), a more progressive and refined risk assessment mechanism is achieved, which enhances the ability of the early warning system to respond to risk scenarios of different severity levels, improves its practicality and fault tolerance in actual driving, and enables drivers to intuitively perceive and respond quickly to high-risk targets by marking obstacles with image visual enhancement in the red warning state. In the yellow warning state, timely reminders rather than interventions are provided to drivers to pay attention to targets ahead in a low-interference manner.

[0033] Furthermore, the data on early warning events is saved and synchronously uploaded to the cloud. This means that when a red or yellow warning is triggered, and the vehicle engages in steering or sudden braking, the acceleration sensor monitors the longitudinal acceleration (i.e., the acceleration in the vehicle's forward and backward direction) in real time. When the acceleration meets the following conditions... in, It is longitudinal acceleration. It is a threshold set based on the typical emergency braking behavior of a vehicle, used to distinguish between normal braking and emergency braking. When the conditions are met, the emergency recording function is immediately activated, automatically recording videos before and after the emergency braking. To ensure that critical data before and after the accident is not lost or overwritten, all emergency recording data is automatically set to "unwritable state". After the emergency recording is completed, the recorded video file, event image snapshot, event timestamp, and TTC data of this event are packaged and uploaded to the cloud server through the Wi-Fi network connected by the vehicle communication module.

[0034] By combining vehicle operation behaviors (such as steering and emergency braking) with acceleration monitoring during red and yellow warning states, the system achieves accurate identification of key driving dynamics, improves the accuracy of identifying high-risk events, ensures that data is recorded and processed only when there is a genuine safety hazard, and enhances the intelligence and reliability of the warning system. Through the emergency braking acceleration threshold judgment mechanism, the system distinguishes between normal braking and dangerous braking, establishes scientific triggering criteria, and achieves closed-loop recording of the entire event process by automatically recording video content before and after emergency braking. By setting emergency video data to an "overwriteable" state, the system ensures that key data is not overwritten by new data, achieving a data priority preservation mechanism. Event-related data is packaged and uploaded to the cloud via Wi-Fi network, enabling remote accident synchronization and background record management.

[0035] This embodiment also provides a road condition warning system based on a dashcam, including: The road condition image acquisition module is used to automatically start the dashcam when the vehicle's auxiliary power ACC is turned on, record video in real time and collect vehicle speed data; The obstacle recognition module is used to perform real-time detection of recorded video using the YOLOv5s model and identify obstacles encountered during driving. The obstacle distance and speed calculation module is used to obtain image data of the camera focal length and obstacles through camera calibration, combine the image height and the actual height to calculate the actual distance between the obstacle and the vehicle, and estimate the speed and acceleration of the obstacle. The dynamic TTC calculation module is used to construct motion state vectors based on the distance, velocity, and acceleration of obstacles, collect historical motion state vector data, predict the future motion trajectory of obstacles through LSTM and attention mechanisms, and calculate TTC values. The warning and data upload module is used to determine whether a warning is triggered based on the TTC calculation results, and to remind the driver through the display screen and voice according to the warning level, while uploading the data.

[0036] This embodiment also provides a computer device applicable to the traffic condition warning method based on a dashcam, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the traffic condition warning method based on a dashcam as proposed in the above embodiment.

[0037] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0038] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the traffic condition warning method based on a dashcam as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

Claims

1. A road condition warning method based on a dashcam, characterized in that: include, The vehicle is started and the dashcam records the driving conditions, collects the vehicle speed, and detects and identifies road obstacles from the recorded video data. The road obstacles include pedestrians and vehicles; Based on the identification of road obstacles, the actual distance and speed of the obstacles are calculated, and the trajectory of the obstacles is predicted. The dynamic TTC is calculated by combining the predicted trajectory of the obstacles with the vehicle speed. The system performs early warning analysis based on dynamic TTC, issues traffic condition warnings based on the analysis results, and saves and synchronously uploads the warning event data to the cloud.

2. The traffic condition warning method based on a dashcam as described in claim 1, characterized in that: The process of predicting obstacle trajectory and calculating dynamic TTC (Time Toll Collection) based on the predicted obstacle trajectory and vehicle speed is described, using the actual distance between the obstacle and the vehicle at the current moment. The speed of the obstacle and the acceleration of obstacles Construct triples The input sequence Z is constructed by collecting the motion state vectors of obstacles over historical time periods through a sliding window. The motion state vectors at each time step in the input sequence Z are then input into the attention calculation unit to calculate the attention score at each time step. The attention scores at all time steps are normalized using the Softmax function to obtain normalized attention weights. The original input sequence Z is weighted to obtain the weighted input sequence. The obstacle position is obtained by inputting it into the LSTM model. The trainable parameters in the LSTM network are flattened into a high-dimensional vector, the particle swarm is initialized, the LSTM parameters corresponding to all particles are substituted into the LSTM model for prediction, and the fitness function of each particle is calculated. Sort all particles by their fitness functions in descending order, and select the particle with the smallest error in the swarm as the global optimum for the current round. Based on the APSO optimization algorithm, the particle positions and velocities are iteratively updated. After each iteration, the positions and velocities of all particles are updated, and the global optimum is re-evaluated according to the fitness function. A maximum number of iterations is set. When continuous iteration If the variation of the fitness function converges, then stop iterating and output the optimal global solution. That is, the optimal LSTM model parameters, obtained through the global optimal solution. Update the LSTM model to predict obstacle locations Predicting obstacle locations based on an LSTM model with updated parameters The LSTM model, after being updated with new parameters, makes predictions to determine the obstacle's position at the next time step. These predictions are repeated to obtain the obstacle's future trajectory. Future movement trajectory through obstacles Calculate the future velocity of the obstacle between two adjacent predicted positions. And calculate the relative speed in combination with the vehicle speed v. ; When relative velocity When the value is greater than 0, the vehicle is approaching the obstacle, posing a collision risk, and a TTC calculation is performed. Otherwise, it is normal, based on relative speed. The collision time (TTC) is calculated based on the predicted distance.

3. The road condition warning method based on a driving recorder as described in claim 2, characterized in that: The aforementioned early warning analysis based on dynamic TTC (Traffic Traffic Control) and the subsequent traffic condition warning based on the analysis results, along with the setting of thresholds through statistical analysis of the TTC calculation results, are described. , threshold Greater than the threshold When TTC is less than the threshold When the vehicle is about to collide with an obstacle, a red warning is triggered. This occurs when the TTC (Total Traffic Control) threshold is greater than or equal to the threshold. less than the threshold When the TTC is greater than or equal to the threshold, a yellow alert will be triggered. In such cases, there is no need to trigger a warning. Based on the determined risk level, the corresponding warning triggering mechanism is executed. When a red warning is triggered, the obstacle ahead is highlighted with a red border on the vehicle display screen, and a voice prompt "Collision risk ahead, please slow down!" is played. When a yellow warning is triggered, a yellow warning box is displayed on the vehicle display screen to remind the driver to pay attention to the obstacle ahead and take measures to avoid a collision.

4. The road condition warning method based on a driving recorder as described in claim 3, characterized in that: The process of saving and synchronously uploading early warning event data to the cloud refers to the following: when a red or yellow warning is triggered, and the vehicle performs a steering maneuver or sudden braking, the acceleration sensor monitors the longitudinal acceleration in real time. When the acceleration meets the conditions, the emergency recording function is immediately activated to automatically record videos before and after the sudden braking. All emergency recording data is automatically set to an "overwriteable state." After the emergency recording is completed, the recorded video file, event image snapshot, event timestamp, and TTC data of this event are packaged and uploaded to the cloud server through the Wi-Fi network connected by the vehicle communication module.

5. The road condition warning method based on a driving recorder as described in claim 4, characterized in that: The calculation of the actual distance and speed of obstacles based on road condition obstacle identification involves processing the camera's focal length and the image height of the obstacle using camera calibration, calculating the actual distance D between the obstacle and the vehicle using a monocular vision ranging method, and calculating the speed of the obstacle using multiple consecutive frames of images. The change in obstacle velocity is calculated by subtracting the velocities of obstacles in adjacent frames. Based on the change in obstacle velocity Calculate the acceleration of the obstacle .

6. The road condition warning method based on a driving recorder as described in claim 5, characterized in that: The process of detecting and identifying road obstacles from recorded video data involves inputting the real-time video stream into a YOLOv5s model for obstacle detection. The YOLOv5s model processes each frame, generates a bounding box for each detected obstacle, outputs the bounding boxes of candidate obstacles, and applies a regression loss function. Regression optimization is performed on the center point coordinates and width and height parameters of the bounding box. The obstacle bounding box is obtained through the optimized parameters. Combined with the NMS algorithm, a cross-union threshold is set. When the intersection-union ratio (IU) of bounding box A and bounding box B is greater than the IU threshold... If the confidence score of bounding box A is greater than that of bounding box B, then bounding box B is removed. This process is repeated until all bounding boxes have been processed. For the processed bounding boxes, the obstacle category distribution is calculated using the softmax function, and the category classification is optimized using cross-entropy loss.

7. The road condition warning method based on a driving recorder as described in claim 6, characterized in that: The vehicle starts recording the driving conditions via a dashcam. The dashcam automatically starts recording the driving conditions in real time after the vehicle's ACC is activated. It connects to the vehicle system or mobile APP via WIFI and obtains the vehicle's real-time speed via CAN bus.

8. A traffic warning system based on a dashcam, based on the traffic warning method based on a dashcam as described in any one of claims 1 to 7, characterized in that: include, The road condition image acquisition module is used to automatically start the dashcam when the vehicle's auxiliary power ACC is turned on, record video in real time and collect vehicle speed data; The obstacle recognition module is used to perform real-time detection of recorded video using the YOLOv5s model and identify obstacles encountered during driving. The obstacle distance and speed calculation module is used to obtain image data of the camera focal length and obstacles through camera calibration, combine the image height and the actual height to calculate the actual distance between the obstacle and the vehicle, and estimate the speed and acceleration of the obstacle. The dynamic TTC calculation module is used to construct motion state vectors based on the distance, velocity, and acceleration of obstacles, collect historical motion state vector data, predict the future motion trajectory of obstacles through LSTM and attention mechanisms, and calculate TTC values. The warning and data upload module is used to determine whether a warning is triggered based on the TTC calculation results, and to remind the driver through the display screen and voice according to the warning level, while uploading the data.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the road condition warning method based on a driving recorder as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the road condition warning method based on a driving recorder as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Vehicle pre-warning method, vehicle pre-warning device, terminal and travelling data recorder

    CN104200542A

  • Auxiliary driving system based on collision early-warning algorithm

    CN110276988A

  • AI collision automobile data recorder adopting inertial sensing technology

    CN116311592A

  • Intelligent driving assistance automobile data recorder system and method

    CN118942173A

  • Traveling assist system

    JP2019079242A

Cited By

  • Obstacle early warning system and obstacle early warning method

    CN121999611A

  • Vehicle driving control method and device, vehicle and computer readable storage medium

    CN122126259A