Electric vehicle rear-end collision accident prediction method and system based on large model knowledge and trajectory data

By combining large language models with trajectory data, the dynamic differences between electric vehicles and traditional fuel vehicles are distinguished, and a differentiated rear-end collision risk prediction model is constructed. This solves the problems of insufficient prediction accuracy and interpretability in existing technologies, and achieves high-precision and interpretable risk prediction.

CN121505849APending Publication Date: 2026-02-10SOUTHEAST UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511448842.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-11
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing methods for predicting traffic accident risks cannot accurately distinguish the dynamic differences between electric vehicles and traditional fuel vehicles, resulting in limited prediction accuracy and scenario adaptability, and machine learning models lack interpretability.

Method used

By combining a large language model with trajectory data, a differentiated rear-end collision risk prediction model is constructed by identifying vehicle types, building car-following pairs, extracting multi-dimensional features, and generating structured rules. Machine learning algorithms are then used for risk prediction.

Benefits of technology

It achieves accurate prediction of electric vehicle rear-end collision accidents, improving the relevance and accuracy of the prediction. Furthermore, it automatically extracts interpretable risk rules through a large language model, enhancing the interpretability and generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121505849A_ABST
    Figure CN121505849A_ABST
Patent Text Reader

Abstract

The invention discloses an electric vehicle rear-end collision accident prediction method and system based on large model knowledge and trajectory data. According to the method, two vehicle types of an electric vehicle and a fuel vehicle are identified based on license plate colors, the vehicle types and vehicle tracks are bound, and the following process is divided into three states according to the combination of the front and rear vehicle types. On the basis, multi-dimensional features extracted from historical tracks are input into a large language model, expert-level rule knowledge used for distinguishing accidents and non-accidents is extracted through structured cues, and a final feature matrix is constructed according to the knowledge. And finally, based on the final feature matrix, performing differentiation processing on the three car-following states, training and calibrating a dichotomy model, and realizing real-time estimation of the rear-end collision probability at a specific moment in the future. According to the invention, by fusing the reasoning ability of the large model and the real trajectory data, the accuracy and interpretability of rear-end collision risk identification under the electric vehicle participation scene can be significantly improved, and the method has engineering deployment value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of intelligent transportation systems (ITS), traffic safety and artificial intelligence, large language model applications and knowledge engineering, and in particular to a real-time traffic accident risk prediction method and system that integrates large model knowledge and high-precision trajectory data, can distinguish vehicle power types and accurately predict future risks. Background Technology

[0002] With the continued growth of global car ownership, rear-end collisions have become the most common type of traffic accident on urban expressways and highways, seriously threatening people's lives and property. At the same time, driven by both environmental policies and technological innovation, electric vehicles (EVs) are becoming more widespread at an unprecedented rate, forming a long-term coexistence of electric vehicles and traditional fuel-powered vehicles (ICEs) in road traffic.

[0003] Electric vehicles (EVs) and traditional gasoline-powered vehicles differ fundamentally in their dynamic characteristics. First, the electric motor drive system of EVs features rapid response and high instantaneous torque, typically resulting in superior acceleration compared to comparable gasoline-powered vehicles. More importantly, EVs are generally equipped with regenerative braking systems. When the driver releases the accelerator pedal, this system recovers kinetic energy and produces a noticeable deceleration effect, a characteristic distinct from the long-distance coasting motion experienced by traditional gasoline-powered vehicles after releasing the accelerator. In many situations, the deceleration caused by regenerative braking does not trigger the brake lights, leading to serious traffic safety hazards.

[0004] This hidden danger stems from a "mismatch between driver expectations and actual braking." When a driver of a traditional gasoline-powered car follows an electric vehicle, their driving experience is based on observing the clear visual signal of the vehicle ahead's brake lights to judge its intention to slow down. If the electric vehicle only slows down through regenerative braking without its brake lights illuminating, the driver of the gasoline-powered car behind cannot receive the expected slowdown signal in time, which can easily lead to a delayed reaction and insufficient braking, resulting in a rear-end collision.

[0005] Existing methods for predicting traffic accident risks mostly rely on vehicle trajectory data acquired from sensors such as radar and video, using a unified risk assessment model for prediction. However, these methods generally treat all vehicles as "homogeneous" traffic participants with similar behavioral patterns, completely ignoring the novel risk patterns arising from the differences in dynamics between EVs and ICEs. This "one-size-fits-all" modeling approach fails to accurately capture the risk evolution characteristics of specific vehicle combinations in mixed traffic flows, severely limiting the accuracy and scenario adaptability of model predictions. Furthermore, while existing machine learning-based risk prediction models have improved prediction accuracy to some extent, they are mostly "black box" models, lacking sufficient interpretability in their decision-making processes. For the high-risk and critical field of traffic safety, simply knowing that "there is risk" is insufficient; understanding "why there is risk" is crucial for system validation, deployment, and gaining trust. Automatically extracting clear risk rules that can be understood and verified by human experts from massive amounts of high-dimensional trajectory data remains a significant technical challenge. Therefore, there is an urgent need for an advanced technology that can finely distinguish vehicle types and perform differentiated risk modeling for different following scenarios, as well as a new method that can enhance the interpretability of the model and make the implicit knowledge contained in the data explicit. Summary of the Invention

[0006] Purpose of the invention: In view of the dual shortcomings of existing risk models that cannot distinguish differences in vehicle dynamics and lack interpretability in the decision-making process, the purpose of this invention is to provide a method and system for predicting rear-end collision accidents of electric vehicles based on large model knowledge and trajectory data, so as to improve the accuracy of rear-end collision risk identification.

[0007] Technical solution: To achieve the above-mentioned objectives, the following technical solution is adopted:

[0008] In a first aspect, the present invention provides a method for predicting rear-end collision accidents of electric vehicles based on large model knowledge and trajectory data, including:

[0009] Collect vehicle trajectory data and vehicle images, identify license plate color based on vehicle images, and determine electric vehicles and traditional fuel vehicles based on license plate color, and bind vehicle type with vehicle trajectory;

[0010] Based on the longitudinal driving order of vehicles in the same lane, a car-following pair consisting of a following vehicle and a preceding vehicle is constructed; and according to the vehicle type, the car-following pair is divided into three car-following states: the preceding vehicle is an electric vehicle and the following vehicle is a traditional fuel vehicle, the preceding vehicle is a traditional fuel vehicle and the following vehicle is an electric vehicle, and both the preceding and following vehicles are electric vehicles.

[0011] Samples are extracted from rear-end collision incidents and non-accident following incidents. Trajectory data within a preset historical time window is extracted forward from a preset key moment of the incident as an anchor point, and the accident status label is associated with a preset number of seconds after that moment. Time window slicing is performed to construct a sample dataset.

[0012] Initial multi-dimensional features are extracted from the sample dataset and input into a pre-trained large language model. By providing the large language model with preset structured prompt words, structured rule knowledge for distinguishing between accident events and non-accident following events is generated. The prompt words instruct the large language model to act as a traffic safety expert, analyze the input features, and summarize the distinction rules. Based on the structured rule knowledge output by the large language model, the final feature matrix for machine learning is constructed.

[0013] Based on the final feature matrix, differentiated processing is performed for the three car-following states. Machine learning algorithms are used to construct or build a unified rear-end collision risk prediction model, which is used to predict the probability of rear-end collision risk after a preset number of seconds based on the features within the past preset historical time window.

[0014] Real-time vehicle trajectory data and vehicle type are acquired online to determine their following status, a sliding historical time window is constructed, corresponding features are extracted and input into a trained risk prediction model to predict the probability of rear-end collision in real time.

[0015] Preferably, the risk prediction model construction steps include one of the following two methods: Method 1: For three following states, namely, the preceding vehicle is an electric vehicle and the following vehicle is a traditional fuel vehicle, the preceding vehicle is a traditional fuel vehicle and the following vehicle is an electric vehicle, and both the preceding and following vehicles are electric vehicles, respectively, corresponding data subsets are selected, and a dedicated rear-end collision risk prediction sub-model is independently trained for each data subset; Method 2: A unified risk prediction model is constructed, and the following state is input as a category feature into the unified model, which learns internally and distinguishes the risk patterns under different states.

[0016] Preferably, the screening criteria for non-accident following events are: the non-accident following event and the accident event are observed by the same equipment, occur in the same lane, have the same following status, and no traffic accident occurs within a preset time before and after the key moment anchor point of the non-accident following event.

[0017] Preferably, the initial multi-dimensional features are extracted according to a preset frequency, including relative motion features, safety substitution index features, and car-following state features. The relative motion features include one or more of the following: front vehicle position, rear vehicle position, front vehicle speed, rear vehicle speed, relative speed, front vehicle acceleration, rear vehicle acceleration, headway, and headway time distance. The safety substitution index features include one or more of the following: collision time (TTC) and deceleration required to avoid a collision. The car-following state features are unique-hot encoded for three car-following states: the front vehicle is an electric vehicle and the rear vehicle is a conventional gasoline vehicle; the front vehicle is a conventional gasoline vehicle and the rear vehicle is an electric vehicle; and both the front and rear vehicles are electric vehicles.

[0018] Preferably, the content framework of the structured prompt includes: a role definition, used to specify that the large language model plays the role of an experienced traffic scientist; a task description, used to explain that the task is to use input accident and non-accident trajectory data to predict the accident risk at a specific future moment; data embedding, used to format the initial multi-dimensional feature data extracted from accident and non-accident following event samples into structured text and include it in the prompt as a data instance for the model to analyze; and output requirements, used to require the model to summarize a preset number of structured rules that can distinguish between accidents and non-accidents and their calculation methods.

[0019] As a preferred method, based on the structured rule knowledge output by the large language model, the final feature matrix for machine learning is calculated, including: average TTC, minimum TTC, TTC trend, maximum required deceleration, average headway, average relative speed, standard deviation of rear vehicle acceleration, percentage of rear vehicles faster than front vehicles, minimum acceleration of front vehicles, and minimum acceleration of rear vehicles.

[0020] Preferably, the machine learning algorithm is logistic regression, support vector machine, random forest algorithm, or a neural network; to address the imbalance between the number of accident events and non-accident following events in the dataset, a focus loss function is used for optimization during model training, the formula of which is: ; where p t α is the model's predicted probability for the true class, γ is the focusing parameter, and α is the focusing probability. t It is a balancing factor.

[0021] Preferably, when the predicted rear-end collision risk probability exceeds a preset risk threshold, an early warning is triggered. The early warning includes risk classification and differentiated warning based on the risk probability p-value: when the p-value is greater than or equal to the first threshold, it is determined to be a high-risk level and a level two warning is triggered; when the p-value is greater than or equal to the second threshold and less than the first threshold, it is determined to be a medium-risk level and a level one warning is triggered; when the p-value is less than the second threshold, it is determined to be a low-risk level and no warning is triggered.

[0022] Secondly, the present invention provides an electric vehicle rear-end collision accident prediction system based on large model knowledge and trajectory data, comprising:

[0023] The data acquisition and processing module is used to collect vehicle trajectory data and vehicle images, identify license plate colors based on vehicle images, and determine whether a vehicle is an electric vehicle or a traditional fuel vehicle based on the license plate color, thus binding vehicle type with vehicle trajectory; and construct following pairs consisting of the following vehicle and the preceding vehicle based on the longitudinal driving order of vehicles in the same lane; and classify following pairs into three following states according to vehicle type: the preceding vehicle is an electric vehicle and the following vehicle is a traditional fuel vehicle, the preceding vehicle is a traditional fuel vehicle and the following vehicle is an electric vehicle, and both the preceding and following vehicles are electric vehicles.

[0024] The sample dataset construction module is used to extract samples from rear-end collision events and non-accident following events. It extracts trajectory data within a preset historical time window by using a preset key moment of the event as an anchor point, and associates the accident status label with a preset number of seconds after that moment. It then performs time window slicing to construct the sample dataset.

[0025] The feature construction module is used to extract initial multi-dimensional features from the sample dataset and input them into a pre-trained large language model. By providing the large language model with preset structured prompt words, it generates structured rule knowledge for distinguishing between accident events and non-accident following events. The prompt words instruct the large language model to act as a traffic safety expert, analyze the input features and summarize the distinction rules. Based on the structured rule knowledge output by the large language model, the final feature matrix for machine learning is constructed.

[0026] The risk prediction model building module is used to differentiate the three car-following states based on the final feature matrix and to build a unified rear-end collision risk prediction model using machine learning algorithms. This model is used to predict the probability of a rear-end collision a preset number of seconds later based on the features within the past preset time window.

[0027] Additionally, a risk prediction module is used to acquire real-time vehicle trajectory data and vehicle type online, determine its following status, construct a sliding historical time window, extract corresponding features, and input them into a trained risk prediction model to predict the probability of rear-end collision risk in real time.

[0028] Thirdly, the present invention provides a computer system including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the electric vehicle rear-end collision prediction method based on large model knowledge and trajectory data.

[0029] Beneficial Effects: Compared with existing technologies, this invention, by finely classifying rear-end collision risk scenarios into three following states involving electric vehicles, can accurately capture specific risk patterns (such as regenerative braking) that are overlooked by traditional homogeneous models, significantly improving the relevance and accuracy of predictions. Simultaneously, this invention innovatively introduces a large language model as an expert knowledge engine, automatically extracting high-quality, interpretable risk rules from massive trajectory data. These rules, as powerful prior knowledge, guide the feature construction of subsequent differentiated models, effectively improving the final predictive performance and generalization ability of the models. Attached Figure Description

[0030] Figure 1 This is a flowchart of a method according to an embodiment of the present invention.

[0031] Figure 2 This is a schematic diagram of the radar and surveillance camera deployment in an embodiment of the present invention.

[0032] Figure 3 This is a trajectory diagram of the lane where an accident occurred, as described in an embodiment of the present invention.

[0033] Figure 4 This is a schematic diagram of trajectory data within historical and future time windows in an embodiment of the present invention. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0035] This invention discloses a method for predicting rear-end collisions of electric vehicles based on large-scale model knowledge and trajectory data. It is applicable to constructing models to determine whether a traffic accident will occur within a given time interval. Its core innovations are: First, based on vehicle dynamics, rear-end collision risk scenarios are finely divided into three following states involving electric vehicles to address the homogenization problem of existing models. Second, a large language model is innovatively introduced as a prior knowledge engine, instructing it to deeply analyze trajectory data and automatically discover and extract high-quality, interpretable risk rules that can be directly used to optimize modeling. Finally, the extracted rule knowledge is used to guide the construction of machine learning models for the three differentiated states, thereby significantly improving the accuracy of rear-end collision risk identification.

[0036] Figure 1This is a flowchart of a real-time prediction method for the risk of rear-end collisions of electric vehicles based on large model knowledge and trajectory data, provided in an embodiment of the present invention. As shown in the figure, this embodiment specifically includes the following steps.

[0037] S1. Collect vehicle trajectory data and vehicle images, identify license plate color based on vehicle images, and determine electric vehicles and traditional fuel vehicles based on license plate color, and bind vehicle type with vehicle trajectory.

[0038] Specifically, vehicle trajectory data during the target time period is collected by roadside radar. The trajectory data includes target ID, timestamp, location, speed, and acceleration. At the same time, vehicle images are collected by surveillance video, and image recognition algorithms are used to identify license plate colors, classifying green license plate vehicles as electric vehicles (EVs) and blue license plate vehicles as conventional fuel vehicles (ICEs). Finally, a spatiotemporal correlation algorithm is used to bind the vehicle type with the corresponding radar trajectory.

[0039] For example, a 77 GHz radar (20 Hz) and a surveillance camera (25 fps) are deployed on a certain expressway, with the deployment locations as follows: Figure 2 As shown. The target period, or data collection period, is 90 days.

[0040] S2. Based on the longitudinal driving order of vehicles in the same lane, construct a car-following pair consisting of a following vehicle and a preceding vehicle; and according to vehicle type, divide the car-following pair into three car-following states: the preceding vehicle is an electric vehicle and the following vehicle is a conventional gasoline vehicle; the preceding vehicle is a conventional gasoline vehicle and the following vehicle is an electric vehicle; and both the preceding and following vehicles are electric vehicles. Specifically, the preceding vehicle being an electric vehicle and the following vehicle being a conventional gasoline vehicle is denoted as State 1, the preceding vehicle being a conventional gasoline vehicle and the following vehicle being an electric vehicle is denoted as State 2, and both the preceding and following vehicles being electric vehicles is denoted as State 3.

[0041] S3. Extract samples from rear-end collision events and non-accident following events, use the preset key moment of the event as the anchor point to extract trajectory data within a preset historical time window, and associate the accident status label with the preset number of seconds after that moment, perform time window slicing, and construct a sample dataset.

[0042] Specifically, rear-end collisions that have occurred are extracted from historical video recordings and defined as "accident events"; following processes that did not result in accidents are filtered from historical trajectory data and defined as "non-accident following events"; samples are extracted from accident events and non-accident following events according to a preset ratio (e.g., 1:4); and trajectory data within a historical time window T is extracted forward from the critical moment of the event as an anchor point S, and associated with the accident status label H seconds later at that moment. This method is used to slice the time window and construct a sample set for subsequent processing. Here, the event moment is a preset number of seconds before the accident occurs. For example, for an accident event, to predict whether a traffic accident will occur in 3 seconds, the critical moment is 3 seconds before the accident occurs.

[0043] Optionally, the screening criteria for non-accident following events are: the non-accident following event and the accident event were observed by the same radar and camera at the same time, occurred in the same lane, had the same following status, and no traffic accident occurred within 30 minutes before and after the key moment anchor point S of the non-accident following event.

[0044] For example, data was collected in a 1:1:1 ratio for following conditions one, two, and three, resulting in 96 accident events involving electric vehicles and 384 non-accident following events involving electric vehicles. The historical time window T is 5 seconds long, and the future time window H is 3 seconds long, meaning that data from 5 seconds before the anchor point is used to predict whether a rear-end collision will occur 3 seconds after the anchor point. The trajectory map of the lane where one accident case occurred is shown below. Figure 3 As shown. Using a spatiotemporal correlation algorithm, the preceding vehicle is an electric car, and the following vehicle is a traditional gasoline-powered car; the following state is classified as state one. The accident occurred at 8:35:04, the anchor point was selected at 8:35:01, the historical time window is [8:34:56, 8:35:01], and the future time window is [8:35:01, 8:35:04]. The trajectory data within the historical and future time windows are as follows... Figure 4 As shown.

[0045] S4. Extract initial multi-dimensional features from the sample dataset and input them into the pre-trained large language model. By providing the large language model with preset structured prompt words, generate structured rule knowledge for distinguishing between accident events and non-accident following events. The prompt words instruct the large language model to act as a traffic safety expert, analyze the input features, and summarize the distinction rules. Based on the structured rule knowledge output by the large language model, construct the final feature matrix for machine learning.

[0046] Optionally, the recommended extraction frequency for multi-dimensional features is twice per second, i.e., features are calculated once every 0.5 seconds. Multi-dimensional features should include at least one or more of the following categories: relative motion features: front vehicle position, rear vehicle position, front vehicle speed, rear vehicle speed, relative speed, front vehicle acceleration, rear vehicle acceleration, headway, headway time distance; safety alternative indicator features: time to collision (TTC), deceleration required to avoid collision (DRAC); car-following state features: one-hot encoding representing state one, two, or three.

[0047] Optionally, the time to collision (TTC) is calculated using the following formula: Among them, TTC i (t) represents the collision time of the following vehicle i at time t, X i (t) and X i−1 (t) represents the longitudinal position of the rear vehicle and the front vehicle, respectively, V i (t) and V i−1 (t) represents the longitudinal velocities of the rear vehicle and the front vehicle, respectively, and L i−1 Let be the length of the vehicle in front. The formula for calculating the deceleration required to avoid a collision is: Among them, TTC i (t) represents the collision time of the following vehicle i at time t. X is the deceleration required by the following vehicle i at time t to avoid a collision. i (t) and X i−1 (t) represents the longitudinal position of the rear vehicle and the front vehicle, respectively, V i (t) and V i−1 (t) represents the longitudinal velocities of the rear vehicle and the front vehicle, respectively, and L i−1 The length of the vehicle in front.

[0048] In one specific embodiment, a pre-trained large language model is used to extract expert-level, interpretable risk rule knowledge from massive and complex trajectory data. The specific steps are as follows:

[0049] S41. Extract initial multi-dimensional features, including relative motion features and safety substitution index features, from the accident and non-accident sample slices in S3. Format this data into a structured CSV text format, where each row represents an event slice and each column represents a feature dimension.

[0050] S42. Construct a structured prompt word and embed the formatted feature data mentioned above as instances within it. The framework of the prompt word is as follows: Role Definition: "Assume you are an experienced traffic safety scientist with experience analyzing trajectory data from thousands of traffic accidents." Task Description: "Your task is to analyze the following two sets of trajectory data: one set is 'accident event' data that leads to rear-end collisions, and the other set is 'non-accident event' data that does not result in an accident. Using the trajectory data from 8 seconds to 3 seconds before each event occurs, summarize the key rules that can predict whether an accident will occur 3 seconds later." Data Embedding: "The following are data examples in CSV format. The first set is [CSV text data embedded with accident events]; the second set is [CSV text data embedded with non-accident events]." Output Requirements: "Please summarize approximately 10 of the most critical structured rules used to distinguish between accidents and non-accidents, and present them in the format of '[Rule Name], [Scientific Basis], [Calculation Method]'."

[0051] S43. Rule Knowledge Generation and Validation: Input complete prompt words containing real data into the large language model. The model will output a series of structured risk rules, such as: "[Rule Name: Standard Deviation of Following Vehicle Acceleration Std_Accel_Follow_10s_to_3s], [Scientific Basis: The standard deviation of acceleration reflects the smoothness of the following vehicle's driving behavior. A higher standard deviation means that the driver is frequently and violently accelerating and decelerating, the vehicle is unstable, and it is a precursor to risk.], [Calculation Method: 1. Select columns: accel_Follow_mps2_-8.0s to accel_Follow_mps2_-3.0s; 2. Calculate the standard deviation of all these columns in this row]". Domain experts will manually judge and screen the rules generated by the model for authenticity and logic.

[0052] S44. Based on the verified rule knowledge, calculate the initial features and construct the final feature matrix.

[0053] In one specific embodiment, each row of the final feature matrix corresponds to a feature vector of an event, and the features and interpretations contained in the feature vector of each event are shown in Table 1.

[0054] Table 1. Features and Explanations

[0055] feature explain Average TTC(s) The average value of all TTCs within the historical time window. The smaller the value, the higher the overall risk of following the lead. Minimum TTC (s) The minimum TTC value that appears within the prediction window represents the most dangerous instantaneous state during that period. TTC trend (s / s) The slope of a linear regression of TTC over time within the prediction window. Negative values ​​indicate that the collision risk is increasing over time. Maximum required deceleration (m / s²) The maximum DRAC value that occurs within the prediction window quantifies the most urgent braking required to avoid a collision. Average headway (s) The average headway for all vehicles within the prediction window. The smaller the value, the closer the following distance, and the more dangerous it is. Average relative velocity (m / s) The average speed difference between the following vehicle and the preceding vehicle within the prediction window. A positive value indicates that the following vehicle is consistently faster than the preceding vehicle. Standard deviation of the following vehicle's acceleration (m / s²) The standard deviation of the following vehicle's acceleration within the prediction window measures the smoothness of driving behavior. A higher value indicates more unstable driving. The percentage of vehicles behind that are faster than the vehicles in front The proportion of times within the prediction window when the speed of the following vehicle is higher than that of the preceding vehicle reflects the persistence of the chasing behavior. Minimum acceleration of the vehicle in front (m / s²) The minimum longitudinal acceleration of the vehicle in front within the prediction window directly reflects the most violent emergency braking behavior of the vehicle in front. Minimum acceleration of the following vehicle (m / s²) The prediction window shows the minimum longitudinal acceleration of the following vehicle, directly capturing the most violent braking action of the following vehicle.

[0056] S5. Based on the final feature matrix, differentiate the three car-following states and use machine learning algorithms to build or construct a unified rear-end collision risk prediction model. This model is used to predict the probability of a rear-end collision several seconds later (future H seconds) based on the features of the past preset historical time window (historical time window T).

[0057] Optionally, in the risk prediction model construction step, the differentiated processing method includes one of the following two methods: Method 1: For state 1, state 2 and state 3, respectively select the corresponding data subsets and train a dedicated rear-end collision risk prediction sub-model independently for each data subset; Method 2: Build a unified risk prediction model and input the following state as a key category feature into the unified model.

[0058] Optionally, the machine learning algorithm can be logistic regression, support vector machine, random forest, or neural network; to address the imbalance between the number of accident events and non-accident following events in the dataset, a focus loss function is used for optimization during model training, the formula of which is: Among them, p t α is the model's predicted probability for the true class, γ is the focusing parameter, and α is the focusing probability. t It is a balancing factor.

[0059] In one specific embodiment, method two is used for model construction, which involves building a unified risk prediction model and inputting the following state as a key category feature into the unified model. The model then learns and distinguishes risk patterns under different states. The machine learning algorithm used is a support vector machine.

[0060] To verify the superiority of the core technical solution of "dividing into three car-following states" proposed in this invention, a set of comparative analysis experiments was designed, including two benchmark models and the model of this invention. Benchmark Model 1: Employs the traditional "one-size-fits-all" modeling approach. That is, it does not distinguish between vehicle type and car-following state, mixing all training samples, including states one, two, and three, together, and using the final feature matrix to train a unified support vector machine model. Benchmark Model 2: Employs the second method proposed in this invention, that is, when training the unified model, the car-following state is input as a key category feature into the model, and an support vector machine model is trained using the initial multi-dimensional features. Model of this invention: Employs the second method proposed in this invention, that is, when training the unified model, the car-following state is input as a key category feature into the model, and an support vector machine model is trained using the final feature matrix.

[0061] On the same independent test dataset, the performance of the three models was compared using standard binary classification task evaluation metrics. The experimental results are shown in Table 2. The model of this invention significantly outperforms the benchmark model on all key metrics.

[0062] Table 2 Comparison of Experimental Results

[0063] Model accuracy Accuracy Recall rate F1 score Baseline Model 1 85.2% 76.5% 71.3% 73.8% Baseline Model 2 80.2% 81.7% 31.3% 42.1% This invention model 92.7% 88.2% 89.5% 88.8%

[0064] S6. Acquire real-time vehicle trajectory data and vehicle type online, determine its following status, construct a sliding historical time window, extract corresponding features and input them into the trained risk prediction model to predict the probability of rear-end collision risk in real time.

[0065] Optionally, a sliding historical time window T is constructed, corresponding features are extracted and input into the trained model, and the probability of a rear-end collision H seconds later is calculated in real time; when the probability of the risk exceeds the preset risk threshold, an early warning is triggered.

[0066] Optionally, the early warning steps further include risk classification and differentiated early warning based on the risk probability p-value: when p ≥ 0.8, it is determined to be a high-risk level and a level-two early warning is triggered; when 0.5 ≤ p < 0.8, it is determined to be a medium-risk level and a level-one early warning is triggered; when p < 0.5, it is determined to be a low-risk level and no early warning is triggered.

[0067] In one specific embodiment, at time 14:32:05, the system detects a car-following pair in state two. The system maintains in real time the multi-dimensional features of the sliding historical time window data of this car-following pair [14:32:00, 14:32:05], including relative motion features: position of the preceding vehicle, position of the following vehicle, speed of the preceding vehicle, speed of the following vehicle, relative speed, acceleration of the preceding vehicle, acceleration of the following vehicle, distance between vehicles, and time distance between vehicles; and safety alternative indicator features: time to collision (TTC) and deceleration required to avoid a collision (DRAC).

[0068] Based on the validated rule knowledge, the initial features are calculated to construct the final feature matrix.

[0069] The system inputs the final feature matrix into the support vector machine model and outputs the risk probability within the future time window as p=0.89≥0.8, which is judged as a high-risk level and triggers a level 2 warning.

[0070] Based on the same inventive concept, this invention discloses an electric vehicle rear-end collision prediction system based on large model knowledge and trajectory data, comprising: a data acquisition and processing module, used to acquire vehicle trajectory data and vehicle images, identify license plate color based on vehicle images, and determine electric vehicles and traditional fuel vehicles based on license plate color, binding vehicle type with vehicle trajectory; and, based on the longitudinal driving order of vehicles in the same lane, constructing a following pair consisting of a rear vehicle and a front vehicle; and according to vehicle type, dividing the following pair into three following states: the front vehicle is an electric vehicle and the rear vehicle is a traditional fuel vehicle, the front vehicle is a traditional fuel vehicle and the rear vehicle is an electric vehicle, and both the front and rear vehicles are electric vehicles; a sample dataset construction module, used to extract samples from rear-end collision events and non-accident following events, using a preset key moment of the event as an anchor point to extract trajectory data within a preset historical time window, and associating it with an accident status label a preset number of seconds later at that moment, performing time window slicing, and constructing a sample dataset; a feature construction module, used to extract from... Initial multi-dimensional features are extracted from the sample dataset and input into a pre-trained large language model. By providing the large language model with preset structured prompt words, structured rule knowledge is generated to distinguish between accident events and non-accident following events. The prompt words instruct the large language model to act as a traffic safety expert, analyze the input features, and summarize the distinction rules. Based on the structured rule knowledge output by the large language model, a final feature matrix for machine learning is constructed. A risk prediction model construction module is used to differentiate the three following states based on the final feature matrix, and to construct or build a unified rear-end collision risk prediction model using machine learning algorithms. This model is used to predict the probability of a rear-end collision several seconds later based on features within a preset historical time window. A risk prediction module is used to acquire real-time vehicle trajectory data and vehicle type online, determine the following state, construct a sliding historical time window, extract corresponding features, and input them into the trained risk prediction model to predict the probability of a rear-end collision in real time.

[0071] This invention also discloses a computer system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the electric vehicle rear-end collision prediction method based on large model knowledge and trajectory data.

[0072] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting rear-end collision accidents of electric vehicles based on large model knowledge and trajectory data, characterized in that, include: Collect vehicle trajectory data and vehicle images, identify license plate color based on vehicle images, and determine electric vehicles and traditional fuel vehicles based on license plate color, and bind vehicle type with vehicle trajectory; Based on the longitudinal driving order of vehicles in the same lane, a car-following pair consisting of a following vehicle and a preceding vehicle is constructed; and according to the vehicle type, the car-following pair is divided into three car-following states: the preceding vehicle is an electric vehicle and the following vehicle is a traditional fuel vehicle, the preceding vehicle is a traditional fuel vehicle and the following vehicle is an electric vehicle, and both the preceding and following vehicles are electric vehicles. Samples are extracted from rear-end collision incidents and non-accident following incidents. Trajectory data within a preset historical time window is extracted forward from a preset key moment of the incident as an anchor point, and the accident status label is associated with a preset number of seconds after that moment. Time window slicing is performed to construct a sample dataset. Initial multi-dimensional features are extracted from the sample dataset and input into a pre-trained large language model. By providing the large language model with preset structured prompt words, structured rule knowledge for distinguishing between accident events and non-accident following events is generated. The prompt words instruct the large language model to act as a traffic safety expert, analyze the input features, and summarize the distinction rules. Based on the structured rule knowledge output by the large language model, the final feature matrix for machine learning is constructed. Based on the final feature matrix, differentiated processing is performed for the three car-following states. Machine learning algorithms are used to construct or build a unified rear-end collision risk prediction model, which is used to predict the probability of rear-end collision risk after a preset number of seconds based on the features within the past preset historical time window. Real-time vehicle trajectory data and vehicle type are acquired online to determine their following status, a sliding historical time window is constructed, corresponding features are extracted and input into a trained risk prediction model to predict the probability of rear-end collision in real time.

2. The method for predicting electric vehicle rear-end collisions based on large model knowledge and trajectory data according to claim 1, characterized in that, The risk prediction model is constructed using one of the following two methods: Method 1: For three following scenarios—the preceding vehicle is an electric vehicle and the following vehicle is a traditional fuel vehicle, the preceding vehicle is a traditional fuel vehicle and the following vehicle is an electric vehicle, and both the preceding and following vehicles are electric vehicles—corresponding data subsets are selected for each scenario, and a dedicated rear-end collision risk prediction sub-model is trained independently for each data subset; Method 2: A unified risk prediction model is constructed, and the following scenario is input as a category feature into the unified model, which then learns and distinguishes risk patterns under different scenarios.

3. The method for predicting electric vehicle rear-end collisions based on large model knowledge and trajectory data according to claim 1, characterized in that, The screening criteria for non-accident following events are: the non-accident following event and the accident event are observed by the same equipment, occur in the same lane, have the same following status, and no traffic accident occurs within a preset time before and after the key moment anchor point of the non-accident following event.

4. The method for predicting rear-end collisions of electric vehicles based on large model knowledge and trajectory data according to claim 1, characterized in that, The initial multi-dimensional features are extracted according to a preset frequency, including relative motion features, safety substitution index features, and car-following state features. The relative motion features include one or more of the following: front vehicle position, rear vehicle position, front vehicle speed, rear vehicle speed, relative speed, front vehicle acceleration, rear vehicle acceleration, headway, and headway time distance. The safety substitution index features include one or more of the following: collision time (TTC) and deceleration required to avoid a collision. The car-following state features are unique-hot encoded for three car-following states: the front vehicle is an electric vehicle and the rear vehicle is a conventional gasoline vehicle; the front vehicle is a conventional gasoline vehicle and the rear vehicle is an electric vehicle; and both the front and rear vehicles are electric vehicles.

5. The method for predicting rear-end collisions of electric vehicles based on large model knowledge and trajectory data according to claim 1, characterized in that, The structured prompt content framework includes: role definition, which specifies that the large language model plays the role of an experienced traffic scientist; task description, which explains that the task is to predict the accident risk at a specific future moment using input accident and non-accident trajectory data; data embedding, which formats the initial multi-dimensional feature data extracted from accident and non-accident following event samples into structured text and includes it in the prompt as data instances for the model to analyze; and output requirements, which require the model to summarize a preset number of structured rules that can distinguish between accidents and non-accidents and their calculation methods.

6. The method for predicting electric vehicle rear-end collisions based on large model knowledge and trajectory data according to claim 1, characterized in that, Based on the structured rule knowledge output by the large language model, the final feature matrix for machine learning is calculated, including: average TTC, minimum TTC, TTC trend, maximum required deceleration, average headway, average relative speed, standard deviation of following vehicle acceleration, percentage of following vehicles faster than the preceding vehicle, minimum acceleration of the preceding vehicle, and minimum acceleration of the following vehicle.

7. The method for predicting rear-end collisions of electric vehicles based on large model knowledge and trajectory data according to claim 1, characterized in that, The machine learning algorithm is logistic regression, support vector machine, random forest algorithm, or a neural network; to address the imbalance between the number of accident events and non-accident following events in the dataset, a focus loss function is used for optimization during model training, and its formula is: ; where p t α is the model's predicted probability for the true class, γ is the focusing parameter, and α is the focusing probability. t It is a balancing factor.

8. The method for predicting electric vehicle rear-end collisions based on large model knowledge and trajectory data according to claim 1, characterized in that, An alert is triggered when the predicted probability of a rear-end collision exceeds a preset risk threshold. The early warning includes risk classification and differentiated early warning based on the risk probability p-value: when the p-value is greater than or equal to the first threshold, it is determined to be a high-risk level and a second-level early warning is triggered; When the p-value is greater than or equal to the second threshold and less than the first threshold, it is determined to be a medium-risk level and a level one warning is triggered; when the p-value is less than the second threshold, it is determined to be a low-risk level and no warning is triggered.

9. A system for predicting rear-end collisions of electric vehicles based on large model knowledge and trajectory data, characterized in that, include: The data acquisition and processing module is used to collect vehicle trajectory data and vehicle images, identify license plate colors based on vehicle images, and determine whether the vehicle is an electric vehicle or a traditional fuel vehicle based on the license plate color, thus binding the vehicle type with the vehicle trajectory. Furthermore, based on the longitudinal driving order of vehicles in the same lane, a car-following pair consisting of a following vehicle and a preceding vehicle is constructed; and according to the vehicle type, the car-following pair is divided into three car-following states: the preceding vehicle is an electric vehicle and the following vehicle is a traditional fuel vehicle, the preceding vehicle is a traditional fuel vehicle and the following vehicle is an electric vehicle, and both the preceding and following vehicles are electric vehicles. The sample dataset construction module is used to extract samples from rear-end collision events and non-accident following events. It extracts trajectory data within a preset historical time window by using a preset key moment of the event as an anchor point, and associates the accident status label with a preset number of seconds after that moment. It then performs time window slicing to construct the sample dataset. The feature construction module is used to extract initial multi-dimensional features from the sample dataset and input them into a pre-trained large language model. By providing the large language model with preset structured prompt words, it generates structured rule knowledge for distinguishing between accident events and non-accident following events. The prompt words instruct the large language model to act as a traffic safety expert, analyze the input features and summarize the distinction rules. Based on the structured rule knowledge output by the large language model, the final feature matrix for machine learning is constructed. The risk prediction model building module is used to differentiate the three car-following states based on the final feature matrix and to build a unified rear-end collision risk prediction model using machine learning algorithms. This model is used to predict the probability of a rear-end collision a preset number of seconds later based on the features within the past preset time window. Additionally, a risk prediction module is used to acquire real-time vehicle trajectory data and vehicle type online, determine its following status, construct a sliding historical time window, extract corresponding features, and input them into a trained risk prediction model to predict the probability of rear-end collision risk in real time.

10. A computer system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by the processor, it implements the steps of the electric vehicle rear-end collision accident prediction method based on large model knowledge and trajectory data according to any one of claims 1-8.

Citation Information

Cited By

  • Signal control intersection electric vehicle track prediction method based on driving style

    CN122024495A