A dangerous index comprehensive evaluation method based on CAN data

CN115994698BActive Publication Date: 2026-08-21XIAMEN XIZHONG INTERNET OF VEHICLES TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211215148.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2026-08-21
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

现有技术所使用的行车数据大部分都是轨迹数据和报警数据,GPS轨迹数据(GPS数据)由于硬件性能的影响一般都是20秒才采集一次数据,中间间隔19秒的车辆状态是未知的,分析时即使采用各种插值方法也还是会存在数据失真的情况,并且在20秒内车辆已经开出较远的距离,这也会影响数据的实时性;而报警数据是基于车上的各种报警设备,平时正常行驶情况很少报警,少量报警数据可能还有误报的情况;因此,无论是轨迹数据还是报警数据的数据分析或是算法部分都难以做到实时的分析和评价

Benefits of technology

[0023]This invention incorporates CAN data into the comprehensive evaluation of driving hazard index, combining CAN data and GPS trajectory data for evaluation. Since CAN data is collected and uploaded in real-time every second, the real-time nature of the source data is guaranteed, avoiding data distortion. Furthermore, this invention employs stream processing to extract features from the source data in real-time and inputs them into a pre-trained isolated forest model for real-time online prediction, outputting the prediction results. This enables real-time analysis and evaluation of vehicle CAN data and GPS trajectory data, solving the problem of difficulty in real-time analysis and evaluation when relying on existing GPS trajectory data and alarm data for driving hazard assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115994698B_ABST
    Figure CN115994698B_ABST
Patent Text Reader

Abstract

The application discloses a kind of dangerous index comprehensive evaluation methods based on CAN data, comprising the following steps: S1, real-time acquisition vehicle CAN data and GPS trajectory data;S2, CAN data and GPS trajectory data are merged into the data to be evaluated as every second 1 piece and upload;S3, the feature of the data to be evaluated is extracted as the sample to be evaluated by sliding window real-time;S4, the sample to be evaluated is input into the isolated forest model pre-trained and carries out online real-time evaluation, and exports evaluation score;S5, evaluation score is added with negative sign and is input into sigmoid function and is calculated, and the final dangerous index is obtained;S6, dangerous index is saved as evaluation result in database.The application uses CAN data, GPS trajectory data and the method combining isolated forest model, realizes real-time analysis and evaluation to vehicle CAN data, solves the defects of data distortion and difficult real-time analysis and evaluation existing in prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle network data application technology, and in particular to a comprehensive evaluation method for hazard index based on CAN data. Background Technology

[0002] With the rapid development of the logistics industry and the gradual maturation of vehicle networking technology, the analysis and application of vehicle driving data has begun to receive increasing attention. Research based on vehicle driving data analysis helps monitor and regulate safe vehicle operation, thereby improving traffic safety. Currently, most driving data used in existing technologies consists of trajectory data and alarm data. GPS trajectory data (GPS data) is typically collected only once every 20 seconds due to hardware limitations, leaving a 19-second interval where the vehicle's status is unknown. Even with various interpolation methods, data distortion still occurs during analysis, and the vehicle may have already traveled a considerable distance within those 20 seconds, affecting the data's real-time performance. Alarm data relies on various onboard alarm devices, which rarely trigger alarms during normal driving, and the limited amount of alarm data may contain false alarms. Therefore, real-time analysis and evaluation of both trajectory and alarm data, particularly in terms of algorithms, are difficult to achieve. Summary of the Invention

[0003] To address the aforementioned problems, this invention provides a comprehensive evaluation method for hazard indices based on CAN data.

[0004] The present invention adopts the following technical solution:

[0005] A comprehensive hazard index evaluation method based on CAN data includes the following steps:

[0006] S1. Install a CAN bus on the vehicle to collect the vehicle's CAN data in real time, and at the same time collect the vehicle's GPS trajectory data.

[0007] S2. Merge the CAN data and GPS trajectory data into data to be evaluated and upload it. The merged data to be evaluated is 1 piece per second.

[0008] S3. Perform stream processing on the data to be evaluated, and extract the features of the data to be evaluated in real time through a sliding window as samples to be evaluated.

[0009] S4. Input the sample to be evaluated into the pre-trained isolated forest model for online real-time evaluation, and output an evaluation score ranging from -1 to 1.

[0010] S5. Add a negative sign to the score, and then input it into the sigmoid function for calculation, thereby obtaining the danger index with a final range of 0 to 1;

[0011] S6. The risk index is stored in the database as an evaluation result.

[0012] Furthermore, the CAN data is collected once every 1 second, and the sampled CAN data includes CAN vehicle speed, CAN throttle, CAN brake, CAN engine speed, CAN instantaneous fuel consumption and CAN fluid level.

[0013] Furthermore, the GPS trajectory data is collected every 20 seconds.

[0014] Further, in step S2, the CAN data and GPS trajectory data are merged into data to be evaluated. Specifically, linear interpolation is first used to fill in the empty data in the middle of the GPS trajectory data to align the GPS trajectory data and CAN data. Then, the filled GPS trajectory data and the CAN data are merged into one data per second.

[0015] Furthermore, the sliding window has a step size of 1s and a window width of 20s. One sample is extracted for each sliding step, and no sample features are extracted when the CAN speed is below 30km / h.

[0016] Furthermore, the isolated forest model is trained offline, and its training process specifically includes the following steps:

[0017] Q1. The collected historical source data is merged and used as training samples;

[0018] Q2. Extract the features of the training samples and train the isolated forest, then save the trained isolated forest model file.

[0019] Furthermore, the historical source data includes historical CAN data and historical GPS trajectory data.

[0020] Furthermore, the data to be evaluated is uploaded in the form of streaming data.

[0021] Furthermore, the stream processing described in step S3 employs a Kafka message queue.

[0022] By adopting the above technical solution, the present invention has the following advantages compared with the prior art:

[0023] This invention incorporates CAN data into the comprehensive evaluation of driving hazard index, combining CAN data and GPS trajectory data for evaluation. Since CAN data is collected and uploaded in real-time every second, the real-time nature of the source data is guaranteed, avoiding data distortion. Furthermore, this invention employs stream processing to extract features from the source data in real-time and inputs them into a pre-trained isolated forest model for real-time online prediction, outputting the prediction results. This enables real-time analysis and evaluation of vehicle CAN data and GPS trajectory data, solving the problem of difficulty in real-time analysis and evaluation when relying on existing GPS trajectory data and alarm data for driving hazard assessment. Attached Figure Description

[0024] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0026] Example

[0027] like Figure 1 As shown, a comprehensive hazard index evaluation method based on CAN data includes the following steps:

[0028] S1. Install a CAN bus on the vehicle to collect the vehicle's CAN data in real time, and at the same time collect the vehicle's GPS trajectory data.

[0029] The CAN data is collected once every 1 second. The sampled CAN data includes CAN vehicle speed, CAN throttle, CAN brake, CAN engine speed, CAN instantaneous fuel consumption, and CAN fluid level.

[0030] The GPS trajectory data is collected every 20 seconds.

[0031] S2. The CAN data and GPS trajectory data are merged into data to be evaluated and uploaded. The merged data to be evaluated is 1 piece per second. The data to be evaluated is uploaded to the risk control platform in the form of streaming data.

[0032] In step S2, the CAN data and GPS trajectory data are merged into the data to be evaluated. Specifically, linear interpolation is first used to fill in the empty data in the middle of the GPS trajectory data to align the GPS trajectory data and CAN data. Then, the filled GPS trajectory data and the CAN data are merged into one data per second.

[0033] S3. Perform stream processing on the data to be evaluated, and extract the features of the data to be evaluated as samples in real time through a sliding window; the step size of the sliding window is 1s, the window width is 20s, and one sample is extracted for each sliding step, and no sample features are extracted when the CAN speed is below 30km / h.

[0034] All features and feature extraction rules are as follows:

[0035] (1)cur_v, which is the latest speed value (CAN_velocity) within the current 20s. The extraction rules are as follows: if CAN_velocity is greater than 120km / h or empty, it is filled with the data of the previous second. If the previous second is also empty, it is filled with the data of the previous two seconds, and so on. In addition, if it is less than 52km / h or there is no value, it is directly assigned the value 52.

[0036] (2)cur_a, which is the acceleration within 1 second, is extracted according to the following rules: extract the first two CAN_velocity values. If the CAN_velocity value is greater than 120km / h or empty, it is filled with the data from the previous second. If the previous second is also empty, it is filled with the data from the previous two seconds. And so on. Then, the latest CAN_velocity value is subtracted from the CAN_velocity value of the previous second.

[0037] (3) sigma_a, which is the standard deviation of acceleration within 20 seconds (that is, the first difference of CAN_velocity). The extraction rule is as follows: extract 20 CAN_velocity values. If the CAN_velocity value is greater than 120km / h or is empty, fill it with the value of the previous second. If the previous second is also empty, fill it with the value of the previous two seconds, and so on. Then subtract the value of the previous second from the CAN_velocity value per second within 20 seconds to get 19 acceleration values. Then calculate the standard deviation of these 19 acceleration values.

[0038] (4) sigma_a1d, which is the standard deviation of the first-order difference of acceleration within 20s. The extraction rule is: subtract the previous acceleration value from each of the previous 19 acceleration values ​​to get the first-order difference of 18 accelerations, and then calculate the standard deviation of the first-order difference of these 18 accelerations.

[0039] (5)abssum_a1d, which is the sum of the absolute values ​​of the first-order differences of the 18 accelerations. The extraction rule is: calculate the sum of the absolute values ​​of the first-order differences of the first 18 accelerations.

[0040] (6)cur_al, which is the latest altitude value. The extraction rule is: if there is a null value, fill it with the value of the previous second; if the previous second is also null, fill it with the value of the previous two seconds, and so on.

[0041] (7) al1d_positive_set_0, which is the first-order difference of the current altitude. The extraction rule is: subtract the altitude value of the previous second from the altitude value of the previous second within 20 seconds to get 19 altitude difference values, and then calculate the standard deviation of these 19 altitude difference values. If the standard deviation value is greater than 0, it is directly assigned the value of 0.

[0042] (8) al1d_nag_count, which is the number of negative numbers among the first 19 altitude first-order difference values;

[0043] (9)cur_r, which is the engine speed of the latest 1 second. The extraction rule is: if it is less than 500r / s, then give 1100; if it is empty, then fill it with the previous second; if the previous second is also empty, then fill it with the previous two seconds, and so on.

[0044] (10)r700, which is the sum of the absolute values ​​of each engine speed value minus 700 within 20 seconds;

[0045] (11) sigma_r, which is the standard deviation of engine speed within 20 seconds;

[0046] (12) sigma_r1d, which is the standard deviation of the first-order difference of the rotational speed within 20s;

[0047] (13)abssum_r1d, which is the sum of the absolute values ​​of the first-order differences of the rotational speed within 20s;

[0048] (14)cur_acc, which is the current throttle. The extraction rule is: if it is empty, fill it with the previous second; if the previous second is also empty, fill it with the previous two seconds, and so on.

[0049] (15)sum_ped, which is the sum of braking values ​​within 20 seconds, that is, the number of braking values ​​of 1. The extraction rule is: if the braking value is 1 or 0, add the braking values ​​in 20 seconds. If the braking value is empty, no processing is required.

[0050] (16)cur_insoil, i.e., the current instantaneous fuel consumption, the extraction rule is: if there is no space, fill it with the previous second; if the previous second is also empty, fill it with the previous two seconds, and so on.

[0051] (17) sigma_insoil, which is the standard deviation of instantaneous fuel consumption within 20 seconds;

[0052] (18)insoil1d, which is the first-order difference of instantaneous fuel consumption;

[0053] (19) sigma_insoil1d, which is the standard deviation of the first difference of instantaneous fuel consumption;

[0054] (20)fluid1d, i.e. the first difference of liquid level, is extracted by the following rules: first, the liquid level data is processed. If the liquid level data is empty, it is filled with the value of the previous second. If the previous second is also empty, it is filled with the value of the previous two seconds. And so on. Then the first difference of the current liquid level is calculated.

[0055] It is important to note that none of the above feature values ​​can be empty. If the final calculation result still contains empty values, default values ​​need to be provided. The default values ​​are as follows:

[0056] cur_v:52;

[0057] cur_a:0;

[0058] sigma_a: 0, there must be 19 of them, otherwise set to 0;

[0059] sigma_a1d: 0, there must be 18 of them, otherwise set to 0;

[0060] abssum_a1d:0, must have 18, otherwise set to 0;

[0061] cur_al: 0;

[0062] al1d_positive_set_0:0;

[0063] al1d_nag_count: 0, there must be 19, otherwise set to 0;

[0064] cur_r:1200;

[0065] r700:2000, there must be 20 of them, otherwise set to 2000;

[0066] sigma_r: 0, there must be 20, otherwise set to 0;

[0067] sigma_r1d:0, there must be 19 of them, otherwise set to 0;

[0068] abssum_r1d:0, must have 19, otherwise set to 0;

[0069] cur_acc:0;

[0070] sum_ped: 0, there must be 20, otherwise set to 0;

[0071] cur_insoil:0;

[0072] sigma_insoil: 0, there must be 20, otherwise set to 0;

[0073] insoil1d:0;

[0074] sigma_insoil1d:0, must have 19, otherwise set to 0;

[0075] fluid1d:0.

[0076] S4. Input the sample to be evaluated into the pre-trained isolated forest model for online real-time evaluation, and output an evaluation score ranging from -1 to 1.

[0077] The isolated forest model is trained offline, and its training process includes the following steps:

[0078] Q1. The collected historical source data is merged and used as training samples. The historical source data includes historical CAN data and historical GPS trajectory data. The merging method is to first use linear interpolation to supplement the historical GPS trajectory data and then merge the data.

[0079] Q2. Extract the features of the training samples and train the isolated forest, then save the trained isolated forest model file.

[0080] S5. Add a negative sign to the score, and then input it into the sigmoid function for calculation, thereby obtaining the danger index with a final range of 0 to 1;

[0081] S6. The risk index is stored in the database as an evaluation result.

[0082] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A comprehensive evaluation method for hazard index based on CAN data, characterized in that: Includes the following steps: S1. Install a CAN bus on the vehicle to collect the vehicle's CAN data in real time, and at the same time collect the vehicle's GPS trajectory data. S2. Merge the CAN data and GPS trajectory data into data to be evaluated and upload it. The merged data to be evaluated is 1 piece per second. S3. Perform stream processing on the data to be evaluated, and extract the features of the data to be evaluated in real time through a sliding window as samples to be evaluated. S4. Input the sample to be evaluated into the pre-trained isolated forest model for online real-time evaluation, and output an evaluation score ranging from -1 to 1. S5. Add a negative sign to the score, and then input it into the sigmoid function for calculation, thereby obtaining the danger index with a final range of 0 to 1; S6. The danger index is stored in the database as an evaluation result; the step size of the sliding window is 1s, the window width is 20s, one sample is extracted for each sliding step, and no sample features are extracted when the CAN speed is below 30km / h.

2. The comprehensive evaluation method for hazard index based on CAN data as described in claim 1, characterized in that: The CAN data is collected once every 1 second. The sampled CAN data includes CAN vehicle speed, CAN throttle, CAN brake, CAN engine speed, CAN instantaneous fuel consumption, and CAN fluid level.

3. The comprehensive evaluation method for hazard index based on CAN data as described in claim 2, characterized in that: The GPS trajectory data is collected every 20 seconds.

4. The comprehensive evaluation method for hazard index based on CAN data as described in claim 3, characterized in that: In step S2, the CAN data and GPS trajectory data are merged into the data to be evaluated. Specifically, linear interpolation is first used to fill in the empty data in the middle of the GPS trajectory data to align the GPS trajectory data and CAN data. Then, the filled GPS trajectory data and the CAN data are merged into one data per second.

5. The comprehensive evaluation method for hazard index based on CAN data as described in claim 4, characterized in that: The isolated forest model is trained offline, and its training process includes the following steps: Q1. The collected historical source data is merged and used as training samples; Q2. Extract the features of the training samples and train the isolated forest, then save the trained isolated forest model file.

6. The comprehensive evaluation method for hazard index based on CAN data as described in claim 5, characterized in that: The historical source data includes historical CAN data and historical GPS trajectory data.

7. The comprehensive evaluation method for hazard index based on CAN data as described in claim 1, characterized in that: The data to be evaluated is uploaded in the form of streaming data.

8. The comprehensive evaluation method for hazard index based on CAN data as described in claim 7, characterized in that: The stream processing described in step S3 uses a Kafka message queue.

Citation Information

Patent Citations

  • CAN bus data anomaly detection method for multiple attack modes

    CN111970229A

  • KR20200078274A