A traffic radar data optimization method
By performing deduplication processing and anomaly detection on traffic radar data, we can identify and correct anomalies such as jumps, collisions, and U-turns, solving the problem of radar data anomalies and improving the accuracy and reliability of the data.
Patent Information
- Application Number
- CN202410889853.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-07-04
AI Technical Summary
In existing traffic monitoring, radar data may be abnormal due to signal interference and other reasons, affecting the accuracy and reliability of the data.
By acquiring multiple batches of radar data, we perform deduplication processing and anomaly detection to identify abnormal types such as jumps, collisions, and U-turns, and use corresponding correction methods to process abnormal data to ensure the integrity and reliability of the data.
Effectively identify and correct abnormal data, improve the accuracy and reliability of traffic radar data, avoid misjudgments and missed judgments, and enhance the stability of the data.
Smart Images

Figure CN118427765B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic monitoring and data processing, and in particular to a traffic radar data optimization method. Background Art
[0002] Radar (Radio Detection and Ranging) technology is widely used in traffic monitoring for vehicle detection, speed measurement and traffic flow monitoring.
[0003] However, in the prior art, radar data may generate abnormal data due to various reasons (such as signal interference, equipment failure, etc.), such as abnormal jump, abnormal collision and abnormal U-turn, thus affecting the accuracy and reliability of traffic monitoring data. Summary of the invention
[0004] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a traffic radar data optimization method.
[0005] In order to achieve the above object, the main technical solutions adopted by the present invention include:
[0006] An embodiment of the present invention provides a traffic radar data optimization method, comprising:
[0007] S1, acquiring multiple batches of radar data received at first time intervals within a first specified time period;
[0008] Each batch of radar data includes data points collected by a radar installed on the highway at a first collection time interval for vehicles moving on the highway;
[0009] The parameters in each data point include: the identifier of the vehicle identified by the radar, the longitude and latitude of the vehicle identified by the radar, the speed of the vehicle identified by the radar, the timestamp corresponding to the data point, and the radar ID corresponding to the data point;
[0010] S2. Based on the identifier of the vehicle identified by the radar in the data point, perform data deduplication processing on each batch of radar data to obtain the deduplication-processed radar data of the batch;
[0011] S3. Based on the parameters in the data point, perform anomaly detection processing on the first radar data to determine the anomaly type of the first radar data;
[0012] The first radar data includes all batches of radar data after deduplication processing;
[0013] S4. Correct the first radar data using a preset data correction method corresponding to the abnormal type of the first radar data to obtain final radar data.
[0014] Preferably, the anomaly detection process includes:
[0015] For determining whether the first radar data is a jump abnormality type jump abnormality detection process based on an identifier of a vehicle identified by the radar in the data point and a timestamp corresponding to the data point;
[0016] for determining, based on a timestamp corresponding to the data point in the data point and the longitude and latitude of the vehicle identified by the radar, whether the first radar data is a collision anomaly type of collision anomaly detection processing;
[0017] for determining whether the first radar data is a U-turn abnormality type U-turn abnormality detection processing based on an identifier of the vehicle identified by the radar in the data point, a timestamp corresponding to the data point, and the longitude and latitude of the vehicle identified by the radar;
[0018] The abnormal type of the radar data includes: one or more of a jump abnormal type, a collision abnormal type, and a U-turn abnormal type.
[0019] Preferably, the abnormal jump detection process specifically includes:
[0020] For the first radar data, taking data points with the same identifier of the vehicle identified by the radar as a group of data points to obtain at least one group of data points;
[0021] For any group of data points, sort them in the time order of the timestamps corresponding to the data points to obtain the first sequence of data points;
[0022] Determine whether the first sequence of data points satisfies a preset first condition, and if so, determine that the first radar data is a jump abnormal type;
[0023] The first condition is that the time difference between the timestamps corresponding to any two adjacent data points in the first sequence of data points is greater than a preset first threshold.
[0024] Preferably, the collision anomaly detection process specifically includes:
[0025] For the first radar data, data points with the same timestamp are regarded as one type of data points to obtain at least one type of data points;
[0026] For any type of data point, determine whether the data point satisfies a preset second condition, and if so, determine that the first radar data is a collision anomaly type;
[0027] The second condition is that the distance between the first positions corresponding to any two data points of the type is less than a preset second threshold;
[0028] The first position corresponding to the data point is the position of the longitude and latitude of the vehicle identified by the radar in the data point.
[0029] Preferably, the U-turn abnormality detection process specifically includes:
[0030] For the first radar data, taking data points with the same identifier of the vehicle identified by the radar as a group of data points to obtain at least one group of data points;
[0031] For any group of data points, sort them in the time order of the timestamps corresponding to the data points to obtain the first sequence of data points;
[0032] Determine whether the first sequence of data points satisfies a preset third condition, and if so, determine that the first radar data is a U-turn abnormal type;
[0033] The third condition is that the angle formed by the first line segment and the second line segment is less than or equal to 90°;
[0034] The first line segment is a line connecting a first position corresponding to a first data point and a first position corresponding to a second data point of any three data points that are sequentially adjacent in the first sequence of data points;
[0035] The second line segment is a line connecting a first position corresponding to a second data point and a first position corresponding to a third data point of any three data points that are sequentially adjacent in the first sequence of data points.
[0036] Preferably, the S4 includes:
[0037] If the abnormal type of the first radar data is a jump abnormal type, the first radar data is processed using a first data correction method to obtain final radar data;
[0038] Wherein, the first data correction method includes:
[0039] For the first radar data, taking data points with the same identifier of the vehicle identified by the radar as a group of data points to obtain at least one group of data points;
[0040] For each group of data points, the data points are sorted in sequence according to the time sequence of the timestamps corresponding to the data points to obtain a first sequence of data points corresponding to the group of data points;
[0041] The longitude and latitude of the vehicle identified by the radar in each first sequence of data points are processed using a linear interpolation algorithm to obtain final radar data.
[0042] Preferably,
[0043] There are multiple radars installed on the expressway, and they are arranged in sequence according to the driving direction of the expressway;
[0044] Among them, each radar has a different radar ID;
[0045] Each batch of radar data includes data points collected by radars installed on the highway for five times from vehicles moving on the highway;
[0046] Among them, the first time interval is 500ms; the first collection time interval is 100ms.
[0047] Preferably, the S4 includes:
[0048] If the abnormal type of the first radar data is a collision abnormal type, the first radar data is processed using a second data correction method to obtain final radar data;
[0049] Wherein, the second data correction method includes:
[0050] For the first radar data, the data points corresponding to the data points and having the same radar ID are taken as a team of data points to obtain at least one team of data points;
[0051] Obtaining the identifier of the vehicle recognized by the radar of each data point in any team of data points, and comparing it with the identifier of the vehicle obtained in advance, and deleting the identifier of the vehicle recognized by the radar of each data point in the team of data points that is different from the identifier of the vehicle obtained in advance;
[0052] The pre-acquired vehicle identifier is an identifier of a vehicle identified by a radar of a first group of data points in a plurality of batches of radar data acquired within a second specified time period before the first specified time period;
[0053] The data points of the first group are data points with a specified radar ID in the radar data acquired within the second specified time period;
[0054] The designated radar ID is the radar ID corresponding to the radar that is preceding the radar to which the radar ID belongs in the setting order of the data point of the team.
[0055] Preferably, the S4 includes:
[0056] If the abnormal type of the first radar data is a U-turn abnormal type, a third data correction method is adopted to process the first radar data to obtain final radar data;
[0057] The third data correction method includes:
[0058] S41, using a moving average filtering algorithm with a filtering window size of 3, filtering the longitude and latitude of the vehicle identified by the radar of any first group of data points in the first batch of data points after deduplication processing in the first radar data, and obtaining the smoothed values of the longitude and latitude of the vehicle identified by the radar in the data point at the center of the filtering window in the first group of data points;
[0059] The first batch of deduplication-processed data points in the first radar data include a plurality of first groups of data points;
[0060] The first group of data points are data points with the same identifier of the vehicle identified by the radar among the first batch of data points after deduplication processing;
[0061] S42, using formula (1) and formula (2) to calculate the smoothed values of the longitude and latitude of the vehicle identified by the radar in the last data point of the first group of data points, and use them as the initial longitude value and the initial latitude value, respectively;
[0062] Wherein, formula (1) is:
[0063] Initial value of longitude = ((longitude of the data point collected for the first time in the first set of data points + longitude of the data point collected for the second time in the first set of data points + longitude of the data point collected for the third time in the first set of data points + longitude of the data point collected for the fourth time in the first set of data points) / 4 + longitude of the data point collected for the fifth time in the first set of data points * 4) / 5;
[0064] Formula (2) is:
[0065] Initial value of latitude = ((latitude of the data point collected for the first time in the first set of data points + latitude of the data point collected for the second time in the first set of data points + latitude of the data point collected for the third time in the first set of data points + latitude of the data point collected for the fourth time in the first set of data points) / 4 + latitude of the data point collected for the fifth time in the first set of data points * 4) / 5;
[0066] S43, arranging the initial numerical point and the second group of data points in the next batch of data points after deduplication processing to form a data point set;
[0067] The second set of data points are data points where the identifiers of the vehicles identified by the radar are the same as the identifiers of the vehicles identified by the radar in the first set of data points;
[0068] The set of data points includes, in sequence, an initial value and a second set of data points;
[0069] The initial value points include: initial longitude value and initial latitude value;
[0070] S44, using a moving average filtering algorithm with a filtering window size of 3, filtering the data point set to obtain smoothed values of the longitude and latitude of the vehicle identified by the radar in the data point at the center of the window among the data points of the data point set;
[0071] S45, respectively using formula (3) and formula (4) to calculate the smoothed values of the longitude and latitude of the vehicle identified by the radar in the last data point in the batch of deduplicated data points, and use them as new initial values of longitude and latitude, respectively;
[0072] Among them, formula (3) is:
[0073] New initial value of longitude = ((longitude of the data point collected for the first time in the second set of data points + longitude of the data point collected for the second time in the second set of data points + longitude of the data point collected for the third time in the second set of data points + longitude of the data point collected for the fourth time in the second set of data points) / 4 + longitude of the data point collected for the fifth time in the second set of data points * 4) / 5;
[0074] Formula (4) is:
[0075] New initial latitude value = ((latitude of the data point collected for the first time in the second group of data points + latitude of the data point collected for the second time in the second group of data points + latitude of the data point collected for the third time in the second group of data points + latitude of the data point collected for the fourth time in the second group of data points) / 4 + latitude of the data point collected for the fifth time in the second group of data points * 4) / 5;
[0076] S46. Repeat steps S43-S45 until the smoothed values of the longitude and latitude of the vehicle identified by the radar of the last data point of the second group of data points in the last batch of deduplicated data points in the first radar data are obtained.
[0077] Preferably, the deduplication processing specifically includes: deleting data points with the same timestamp in the radar data until only one is retained.
[0078] The beneficial effects of the present invention are as follows: a traffic radar data optimization method of the present invention ensures the integrity and continuity of the data by acquiring multiple batches of radar data received at a first time interval within a first specified time period, and deduplicates each batch of radar data based on a vehicle identifier identified by the radar, thereby ensuring that the data at each time point is unique. Since different detection rules and thresholds are set for different types of anomalies, it is helpful to accurately identify abnormal data, avoid misjudgments and missed judgments, and can effectively identify abnormal types in the data, such as jumps, collisions, and U-turns. In addition, different correction methods are used for different types of anomalies, and targeted data correction more effectively corrects abnormal data and improves data reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 A flow chart of a traffic radar data optimization method of the present invention;
[0080] Figure 2 Schematic diagram of the angle formed by the first line segment and the second line segment in an embodiment of the present invention.
[0081] Description of Reference Numerals
[0082] A: is the first position corresponding to the first data point of any three consecutive data points in the first sequence of data points;
[0083] B: the first position corresponding to the second data point of any three consecutive data points in the first sequence of data points;
[0084] C: is the first position corresponding to the first data point of any three consecutive data points in the first sequence of data points;
[0085] Q: is the angle between the first line segment AB and the second line segment BC. DETAILED DESCRIPTION
[0086] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.
[0087] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0088] See also Figure 1 This embodiment provides a traffic radar data optimization method, including:
[0089] S1, acquiring multiple batches of radar data received at first time intervals within a first specified time period;
[0090] Each batch of radar data includes data points collected by a radar installed on the highway at a first collection time interval for vehicles moving on the highway;
[0091] The parameters in each data point include: the identifier of the vehicle identified by the radar, the longitude and latitude of the vehicle identified by the radar, the speed of the vehicle identified by the radar, the timestamp corresponding to the data point, and the radar ID corresponding to the data point;
[0092] S2. Based on the identifier of the vehicle identified by the radar in the data point, perform data deduplication processing on each batch of radar data to obtain the deduplication-processed radar data of the batch;
[0093] In this embodiment, the deduplication process specifically includes: deleting data points with the same timestamp in the radar data until only one is retained.
[0094] S3. Based on the parameters in the data point, perform anomaly detection processing on the first radar data to determine the anomaly type of the first radar data;
[0095] The first radar data includes all batches of radar data after deduplication processing;
[0096] The abnormality detection process in this embodiment includes:
[0097] For determining whether the first radar data is a jump abnormality type jump abnormality detection process based on an identifier of a vehicle identified by the radar in the data point and a timestamp corresponding to the data point;
[0098] for determining, based on a timestamp corresponding to the data point in the data point and the longitude and latitude of the vehicle identified by the radar, whether the first radar data is a collision anomaly type of collision anomaly detection processing;
[0099] for determining whether the first radar data is a U-turn abnormality type U-turn abnormality detection processing based on an identifier of the vehicle identified by the radar in the data point, a timestamp corresponding to the data point, and the longitude and latitude of the vehicle identified by the radar;
[0100] The abnormal type of the radar data includes: one or more of a jump abnormal type, a collision abnormal type, and a U-turn abnormal type.
[0101] The abnormal jump detection process specifically includes:
[0102] For the first radar data, taking data points with the same identifier of the vehicle identified by the radar as a group of data points to obtain at least one group of data points;
[0103] For any group of data points, sort them in the time order of the timestamps corresponding to the data points to obtain the first sequence of data points;
[0104] Determine whether the first sequence of data points satisfies a preset first condition, and if so, determine that the first radar data is a jump abnormal type;
[0105] The first condition is that the time difference between the timestamps corresponding to any two adjacent data points in the first sequence of data points is greater than a preset first threshold.
[0106] In this embodiment, the same identifier represents the same vehicle. The jump anomaly detection process in this embodiment is actually to accurately identify data points with abnormally large time intervals by grouping the data points of the same vehicle and sorting them by time. The time difference between adjacent data points in the first sequence of data points exceeding the first threshold usually means that there are omissions, losses or other abnormalities in the data collection process, which can easily lead to jumps. For example, if data is collected every 100ms under normal circumstances, and the time difference between two data points exceeds 500ms (assuming the first threshold is 500ms), it can be considered that there is a jump anomaly.
[0107] The collision anomaly detection process specifically includes:
[0108] For the first radar data, data points with the same timestamp are regarded as one type of data points to obtain at least one type of data points;
[0109] For any type of data point, determine whether the data point satisfies a preset second condition, and if so, determine that the first radar data is a collision anomaly type;
[0110] The second condition is that the distance between the first positions corresponding to any two data points of the type is less than a preset second threshold;
[0111] The first position corresponding to the data point is the position of the longitude and latitude of the vehicle identified by the radar in the data point.
[0112] In this embodiment, if two or more vehicles are very close to each other at the same time, it means that they may have collided, and the distance threshold can help accurately identify this situation. Setting a reasonable distance threshold (that is, the second threshold), such as 0.5 meters, can ensure that only vehicles that actually collided will be detected as abnormal, and there will be no false alarms due to the close distance between vehicles when driving side by side.
[0113] The U-turn abnormality detection process specifically includes:
[0114] For the first radar data, taking data points with the same identifier of the vehicle identified by the radar as a group of data points to obtain at least one group of data points;
[0115] For any group of data points, sort them in the time order of the timestamps corresponding to the data points to obtain the first sequence of data points;
[0116] Determine whether the first sequence of data points satisfies a preset third condition, and if so, determine that the first radar data is a U-turn abnormal type;
[0117] The third condition is that the angle formed by the first line segment and the second line segment is less than or equal to 90°;
[0118] The first line segment is a line connecting a first position corresponding to a first data point and a first position corresponding to a second data point of any three data points that are sequentially adjacent in the first sequence of data points;
[0119] The second line segment is a line connecting a first position corresponding to a second data point and a first position corresponding to a third data point of any three data points that are sequentially adjacent in the first sequence of data points.
[0120] For an example, see Figure 2 , A is the first position corresponding to the first data point of any three data points that are adjacent in sequence in the first sequence of data points; B is the first position corresponding to the second data point of any three data points that are adjacent in sequence in the first sequence of data points; C is the first position corresponding to the first data point of any three data points that are adjacent in sequence in the first sequence of data points, wherein AB is the first line segment, BC is the second line segment, and when the angle Q between the first line segment AB and the second line segment BC is less than or equal to 90°, the first sequence of data points satisfies the preset third condition, and it is determined that the first radar data is a U-turn abnormal type.
[0121] S4. Correct the first radar data using a preset data correction method corresponding to the abnormal type of the first radar data to obtain final radar data.
[0122] In this embodiment, S4 includes:
[0123] If the abnormal type of the first radar data is a jump abnormal type, the first radar data is processed using a first data correction method to obtain final radar data;
[0124] Wherein, the first data correction method includes:
[0125] For the first radar data, taking data points with the same identifier of the vehicle identified by the radar as a group of data points to obtain at least one group of data points;
[0126] For each group of data points, the data points are sorted in sequence according to the time sequence of the timestamps corresponding to the data points to obtain a first sequence of data points corresponding to the group of data points;
[0127] The longitude and latitude of the vehicle identified by the radar in each first sequence of data points are processed using a linear interpolation algorithm to obtain final radar data.
[0128] The following are some examples:
[0129] On a certain highway, the radar system recorded the latitude and longitude data of a vehicle at different times, see Table 1;
[0130] Table 1
[0131]
[0132] As can be seen from Table 1, at 2500ms, the latitude and longitude of the vehicle suddenly jumped to (30.5000, 120.5000), which is an unreasonable jump abnormality. Then, the linear interpolation algorithm is used to interpolate the reasonable value at 2500ms based on the normal points before and after (2000ms and 3000ms). The abnormal data at 2500ms (30.5000, 120.5000) is corrected to (30.00035, 120.00035). In this way, the data points with jump abnormality are successfully corrected using the linear interpolation algorithm.
[0133] In the actual application of this embodiment, there are multiple radars installed on the highway, and they are arranged in sequence according to the driving direction of the highway;
[0134] Among them, each radar has a different radar ID;
[0135] Each batch of radar data includes data points collected by radars installed on the highway for five times from vehicles moving on the highway;
[0136] Among them, the first time interval is 500ms; the first collection time interval is 100ms.
[0137] For example, suppose there are five radars (R1, R2, R3, R4, R5) set up on a north-south highway, and each radar is set up in sequence according to the driving direction of the highway. Each radar collects data every 100ms, and the five consecutive data collected are regarded as a batch of radar data.
[0138] Specifically, the S4 includes:
[0139] If the abnormal type of the first radar data is a collision abnormal type, the first radar data is processed using a second data correction method to obtain final radar data;
[0140] Wherein, the second data correction method includes:
[0141] For the first radar data, the data points corresponding to the data points and having the same radar ID are taken as a team of data points to obtain at least one team of data points;
[0142] Obtaining the identifier of the vehicle recognized by the radar of each data point in any team of data points, and comparing it with the identifier of the vehicle obtained in advance, and deleting the identifier of the vehicle recognized by the radar of each data point in the team of data points that is different from the identifier of the vehicle obtained in advance;
[0143] The pre-acquired vehicle identifier is an identifier of a vehicle identified by a radar of a first group of data points in a plurality of batches of radar data acquired within a second specified time period before the first specified time period;
[0144] The data points of the first group are data points with a specified radar ID in the radar data acquired within the second specified time period;
[0145] The designated radar ID is the radar ID corresponding to the radar that is preceding the radar to which the radar ID belongs in the setting order of the data point of the team.
[0146] For example, in this embodiment, the radar ID is R2, and the timestamps of a pair of data points are: data points with timestamps of 1000ms, 1100ms, 1200ms, 1300ms, and 1400ms. Assume that the identifiers of the vehicles identified by the radar R2 in the pair of data points include: 123; 456; 789; and the identifiers of the vehicles obtained in advance include: 123; 456; then, the vehicle identifier 789 in the pair of data points with the radar ID R2 is deleted.
[0147] In the present embodiment, the vehicle identifier acquired in advance is the vehicle identifier recognized by the radar having the radar ID R1 within the second specified time period.
[0148] In this embodiment, the second specified time period may be 500ms-900ms.
[0149] In practical applications, the S4 includes:
[0150] If the abnormal type of the first radar data is a U-turn abnormal type, a third data correction method is adopted to process the first radar data to obtain final radar data;
[0151] The third data correction method includes:
[0152] S41, using a moving average filtering algorithm with a filtering window size of 3, filtering the longitude and latitude of the vehicle identified by the radar of any first group of data points in the first batch of data points after deduplication processing in the first radar data, and obtaining the smoothed values of the longitude and latitude of the vehicle identified by the radar in the data point at the center of the filtering window in the first group of data points;
[0153] The first batch of deduplication-processed data points in the first radar data include a plurality of first groups of data points;
[0154] The first group of data points are data points with the same identifier of the vehicle identified by the radar among the first batch of data points after deduplication processing;
[0155] In this embodiment, since a moving average filtering algorithm with a filtering window size of 3 is used, noise and mutations in the radar data can be effectively smoothed out, making the data more stable and reliable.
[0156] S42, using formula (1) and formula (2) to calculate the smoothed values of the longitude and latitude of the vehicle identified by the radar in the last data point of the first group of data points, and use them as the initial longitude value and the initial latitude value, respectively;
[0157] Wherein, formula (1) is:
[0158] Initial value of longitude = ((longitude of the data point collected for the first time in the first set of data points + longitude of the data point collected for the second time in the first set of data points + longitude of the data point collected for the third time in the first set of data points + longitude of the data point collected for the fourth time in the first set of data points) / 4 + longitude of the data point collected for the fifth time in the first set of data points * 4) / 5;
[0159] Formula (2) is:
[0160] Initial value of latitude = ((latitude of the data point collected for the first time in the first set of data points + latitude of the data point collected for the second time in the first set of data points + latitude of the data point collected for the third time in the first set of data points + latitude of the data point collected for the fourth time in the first set of data points) / 4 + latitude of the data point collected for the fifth time in the first set of data points * 4) / 5;
[0161] In this embodiment, formulas (1) and (2) are used to calculate the initial values of longitude and latitude, and a moving average method is adopted to consider the data points collected for the last five times, so as to better reflect the changing trend of the vehicle position.
[0162] S43, arranging the initial numerical point and the second group of data points in the next batch of data points after deduplication processing to form a data point set;
[0163] The second set of data points are data points where the identifiers of the vehicles identified by the radar are the same as the identifiers of the vehicles identified by the radar in the first set of data points;
[0164] The set of data points includes, in sequence, an initial value and a second set of data points;
[0165] The initial value points include: initial longitude value and initial latitude value;
[0166] S44, using a moving average filtering algorithm with a filtering window size of 3, filtering the data point set to obtain smoothed values of the longitude and latitude of the vehicle identified by the radar in the data point at the center of the window among the data points of the data point set;
[0167] S45, respectively using formula (3) and formula (4) to calculate the smoothed values of the longitude and latitude of the vehicle identified by the radar in the last data point in the batch of data points after deduplication processing, and use them as new initial values of longitude and latitude, respectively;
[0168] Among them, formula (3) is:
[0169] New initial value of longitude = ((longitude of the data point collected for the first time in the second set of data points + longitude of the data point collected for the second time in the second set of data points + longitude of the data point collected for the third time in the second set of data points + longitude of the data point collected for the fourth time in the second set of data points) / 4 + longitude of the data point collected for the fifth time in the second set of data points * 4) / 5;
[0170] Formula (4) is:
[0171] New initial latitude value = ((latitude of the data point collected for the first time in the second group of data points + latitude of the data point collected for the second time in the second group of data points + latitude of the data point collected for the third time in the second group of data points + latitude of the data point collected for the fourth time in the second group of data points) / 4 + latitude of the data point collected for the fifth time in the second group of data points * 4) / 5;
[0172] S46. Repeat steps S43-S45 until the smoothed values of the longitude and latitude of the vehicle identified by the radar of the last data point of the second group of data points in the last batch of deduplicated data points in the first radar data are obtained.
[0173] In the processing process of this embodiment, by repeating steps S43-S45, it is ensured that each batch of the entire data set is filtered and initially calculated until the last batch of data points, thereby ensuring the integrity and continuity of data processing.
[0174] Specifically, by using moving average filtering, especially in the case of abnormal U-turns, the impact of abnormal data on the final result can be effectively reduced, and the stability and accuracy of data processing can be improved. By using new initial values of longitude and latitude, continuous iterative calculation and updating can better adapt to data changes and correct possible errors, ensuring the accuracy of processing results.
[0175] For example:
[0176] A batch of radar data is received every 500 milliseconds. Each batch of radar data contains radar data collected 5 times; multiple batches of radar data are received within the first specified time period. Each collected radar data includes multiple data points; each batch of radar data received within the first specified time period is deduplicated to obtain a batch of deduplicated data points; in this embodiment, the first radar data includes all batches of deduplicated data points within the first specified time period. Each data point contains: the identifier of the vehicle identified by the radar, the longitude and latitude of the vehicle identified by the radar, the speed of the vehicle identified by the radar, the timestamp corresponding to the data point, and the radar ID corresponding to the data point.
[0177] In this embodiment, in this embodiment, the data points in which the vehicle identifications recognized by the radar are all 123 in the first batch of data points after deduplication processing in the first radar data are used as a first group of data points for illustration:
[0178] Since each batch of radar data has radar data collected 5 times, the first group of data points has data points collected 5 times;
[0179] Assume that the data points collected 5 times in the first set of data points are as follows (the latitude and longitude units are omitted), see Table 2:
[0180] Table 2
[0181]
[0182] First, the first three consecutive data points of the first group of data points are used as a filtering window for moving average filtering.
[0183] First filtering (data points collected for the first time, data points collected for the second time, data points collected for the third time):
[0184] The smoothed longitude value of the data point collected for the second time = (10 + 12 + 11) / 3;
[0185] The latitude smoothing value of the data points collected for the second time = (100 + 102 + 101) / 3;
[0186] Obtain the smoothed values of the longitude and latitude of the data points collected for the second time after the first filtering;
[0187] Second filtering (data points collected for the second time, data points collected for the third time, data points collected for the fourth time):
[0188] The smoothed longitude value of the data point collected for the third time = (12 + 11 + 13 ) / 3
[0189] The latitude smoothing value of the data point collected for the third time = (102 + 101 + 103 ) / 3
[0190] Obtain the smoothed values of the longitude and latitude of the data points collected for the third time after the first filtering;
[0191] The third filtering (data points collected for the 3rd time, data points collected for the 4th time, data points collected for the 5th time):
[0192] The smoothed longitude value of the data point collected for the 4th time = (12 + 11 + 13 ) / 3
[0193] The latitude smoothing value of the data point collected for the 4th time = (102 + 101 + 103 ) / 3
[0194] Obtain the smoothed values of the longitude and latitude of the data points collected for the fourth time after the first filtering;
[0195] The above is the filtering process of the three central window values of the first group of data points using the moving average filtering algorithm with a filtering window size of 3.
[0196] Then, the smoothed values of the longitude and latitude of the vehicle identified by the radar at the last data point of the first group of data points are calculated using formula (1) and formula (2) respectively, and used as the initial longitude value and the initial latitude value respectively;
[0197] Wherein, formula (1) is:
[0198] Initial value of longitude = ((longitude of the data point collected for the first time in the first set of data points + longitude of the data point collected for the second time in the first set of data points + longitude of the data point collected for the third time in the first set of data points + longitude of the data point collected for the fourth time in the first set of data points) / 4 + longitude of the data point collected for the fifth time in the first set of data points * 4) / 5;
[0199] The specific application of formula (1) is: ((10 + 12 + 11 + 13) / 4 + 12 * 4) / 5 = 11.9
[0200] Formula (2) is:
[0201] Initial value of latitude = ((latitude of the data point collected for the first time in the first set of data points + latitude of the data point collected for the second time in the first set of data points + latitude of the data point collected for the third time in the first set of data points + latitude of the data point collected for the fourth time in the first set of data points) / 4 + latitude of the data point collected for the fifth time in the first set of data points * 4) / 5;
[0202] Specific application of formula (2):
[0203] ((100 + 102 + 101 + 103) / 4 + 102*4) / 5 = 101.85
[0204] Then, the initial numerical points are arranged with the second group of data points in the next batch of deduplicated data points to form a data point set;
[0205] The second group of data points are data points in which the identifiers of the vehicles identified by the radar are the same as the identifiers of the vehicles identified by the radar in the first group of data points (the identifier of the vehicle identified by the radar is 123);
[0206] The set of data points includes, in sequence, an initial value and a second set of data points;
[0207] The initial value points include: initial longitude value and initial latitude value;
[0208] Assume that the second group of data points in the next batch of deduplication processing is as shown in Table 3:
[0209] Table 3
[0210]
[0211] The data point set is shown in Table 4:
[0212] Table 4
[0213]
[0214] Then, a moving average filtering algorithm with a filtering window size of 3 is used to filter the data point set to obtain smoothed values of the longitude and latitude of the vehicle identified by the radar in the data point at the center of the window in the data point set;
[0215] Then, the smoothed values of the longitude and latitude of the vehicle identified by the radar in the last data point of the batch of deduplicated data points are calculated using formula (3) and formula (4), and used as the new initial longitude value and the new initial latitude value respectively;
[0216] Among them, formula (3) is:
[0217] New initial value of longitude = ((longitude of the data point collected for the first time in the second set of data points + longitude of the data point collected for the second time in the second set of data points + longitude of the data point collected for the third time in the second set of data points + longitude of the data point collected for the fourth time in the second set of data points) / 4 + longitude of the data point collected for the fifth time in the second set of data points * 4) / 5;
[0218] Formula (4) is:
[0219] New initial latitude value = ((latitude of the data point collected for the first time in the second group of data points + latitude of the data point collected for the second time in the second group of data points + latitude of the data point collected for the third time in the second group of data points + latitude of the data point collected for the fourth time in the second group of data points) / 4 + latitude of the data point collected for the fifth time in the second group of data points * 4) / 5;
[0220] The process is executed in a loop in sequence until the smoothed values of the longitude and latitude of the vehicle identified by the radar of the last data point of the second group of data points in the last batch of data points after deduplication processing in the first radar data are obtained.
[0221] By using moving average filtering, each batch of radar data can be smoothed, gradually reducing the impact of noise and mutations, making the data smoother. The above process shows how to use the mean of the previous batch as the initial value and filter with new data points to ensure the smoothness and continuity of the trajectory data. This method can not only reduce the noise in the data, but also enhance the stability of the overall data.
[0222] In this embodiment, in order to monitor and improve the correction algorithm, detailed information of abnormal data points, including time, location, abnormal type, etc., will be recorded. These records can be used for subsequent analysis and algorithm improvement. At the same time, the comparison of radar data before and after processing according to the corresponding correction method can be displayed on the front end through GIS (Geographic Information System).
[0223] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0224] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0225] In the present invention, unless otherwise clearly specified and limited, when a first feature is “on” or “below” a second feature, it may be that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. Moreover, when a first feature is “above”, “above” or “above” a second feature, it may be that the first feature is directly above or obliquely above the second feature, or it may simply mean that the first feature is higher in level than the second feature. When a first feature is “below”, “below” or “below” a second feature, it may be that the first feature is directly below or obliquely below the second feature, or it may simply mean that the first feature is lower in level than the second feature.
[0226] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0227] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may alter, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A traffic radar data optimization method, characterized in that: include: S1, acquiring multiple batches of radar data received at first time intervals within a first specified time period; Each batch of radar data includes data points collected by a radar installed on the highway at a first collection time interval for vehicles moving on the highway; The parameters in each data point include: the identifier of the vehicle identified by the radar, the longitude and latitude of the vehicle identified by the radar, the speed of the vehicle identified by the radar, the timestamp corresponding to the data point, and the radar ID corresponding to the data point; S2. Based on the identifier of the vehicle identified by the radar in the data point, perform data deduplication processing on each batch of radar data to obtain the deduplication-processed radar data of the batch; S3. Based on the parameters in the data point, perform anomaly detection processing on the first radar data to determine the anomaly type of the first radar data; The anomaly detection process includes: a jump anomaly detection process for determining whether the first radar data is a jump anomaly type based on an identifier of a vehicle identified by the radar in the data point and a timestamp corresponding to the data point; The first radar data includes all batches of radar data after deduplication processing; S4, using a pre-set data correction method corresponding to the abnormal type of the first radar data to correct the first radar data to obtain final radar data; The S4 includes: if the abnormal type of the first radar data is a jump abnormal type, using a first data correction method to process the first radar data to obtain final radar data; wherein the first data correction method includes: for the first radar data, taking data points with the same identifier of the vehicle identified by the radar as a group of data points to obtain at least one group of data points; for each group of data points, sequentially sorting the data points according to the time sequence of the timestamps corresponding to the data points to obtain a first sequence of data points corresponding to the group of data points; The longitude and latitude of the vehicle identified by the radar in each first sequence of data points are processed using a linear interpolation algorithm to obtain final radar data.
2. The traffic radar data optimization method according to claim 1, characterized in that: The anomaly detection process further includes: for determining, based on a timestamp corresponding to the data point in the data point and the longitude and latitude of the vehicle identified by the radar, whether the first radar data is a collision anomaly type of collision anomaly detection processing; for determining whether the first radar data is a U-turn abnormality type U-turn abnormality detection processing based on an identifier of the vehicle identified by the radar in the data point, a timestamp corresponding to the data point, and the longitude and latitude of the vehicle identified by the radar; The abnormal type of the radar data includes: one or more of a jump abnormal type, a collision abnormal type, and a U-turn abnormal type.
3. The traffic radar data optimization method according to claim 2, characterized in that: The abnormal jump detection process specifically includes: For the first radar data, taking data points with the same identifier of the vehicle identified by the radar as a group of data points to obtain at least one group of data points; For any group of data points, sort them in the time order of the timestamps corresponding to the data points to obtain the first sequence of data points; Determine whether the first sequence of data points satisfies a preset first condition, and if so, determine that the first radar data is a jump abnormal type; The first condition is that the time difference between the timestamps corresponding to any two adjacent data points in the first sequence of data points is greater than a preset first threshold.
4. The traffic radar data optimization method according to claim 3, characterized in that: The collision anomaly detection process specifically includes: For the first radar data, data points with the same timestamp are regarded as one type of data points to obtain at least one type of data points; For any type of data point, determine whether the data point satisfies a preset second condition, and if so, determine that the first radar data is a collision anomaly type; The second condition is that the distance between the first positions corresponding to any two data points of the type is less than a preset second threshold; The first position corresponding to the data point is the position of the longitude and latitude of the vehicle identified by the radar in the data point.
5. The traffic radar data optimization method according to claim 4, characterized in that: The U-turn abnormality detection process specifically includes: For the first radar data, taking data points with the same identifier of the vehicle identified by the radar as a group of data points to obtain at least one group of data points; For any group of data points, sort them in the time order of the timestamps corresponding to the data points to obtain the first sequence of data points; Determine whether the first sequence of data points satisfies a preset third condition, and if so, determine that the first radar data is a U-turn abnormal type; The third condition is that the angle formed by the first line segment and the second line segment is less than or equal to 90°; The first line segment is a line connecting a first position corresponding to a first data point and a first position corresponding to a second data point of any three data points that are sequentially adjacent in the first sequence of data points; The second line segment is a line connecting a first position corresponding to a second data point and a first position corresponding to a third data point of any three data points that are sequentially adjacent in the first sequence of data points.
6. The traffic radar data optimization method according to claim 5, characterized in that: There are multiple radars installed on the expressway, and they are arranged in sequence according to the driving direction of the expressway; Among them, each radar has a different radar ID; Each batch of radar data includes data points collected by radars installed on the highway for five times from vehicles moving on the highway; Among them, the first time interval is 500ms; the first collection time interval is 100ms.
7. The traffic radar data optimization method according to claim 6, characterized in that: The S4 includes: If the abnormal type of the first radar data is a collision abnormal type, the first radar data is processed using a second data correction method to obtain final radar data; Wherein, the second data correction method includes: For the first radar data, the data points corresponding to the data points and having the same radar ID are taken as a team of data points to obtain at least one team of data points; Obtaining the identifier of the vehicle recognized by the radar of each data point in any team of data points, and comparing it with the identifier of the vehicle obtained in advance, and deleting the identifier of the vehicle recognized by the radar of each data point in the team of data points that is different from the identifier of the vehicle obtained in advance; The pre-acquired vehicle identifier is an identifier of a vehicle identified by a radar of a first group of data points in a plurality of batches of radar data acquired within a second specified time period before the first specified time period; The data points of the first group are data points with a specified radar ID in the radar data acquired within the second specified time period; The designated radar ID is the radar ID corresponding to the radar that is preceding the radar to which the radar ID belongs in the setting order of the data point of the team.
8. The traffic radar data optimization method according to claim 7, characterized in that: The S4 includes: If the abnormal type of the first radar data is a U-turn abnormal type, a third data correction method is adopted to process the first radar data to obtain final radar data; The third data correction method includes: S41, using a moving average filtering algorithm with a filtering window size of 3, filtering the longitude and latitude of the vehicle identified by the radar of any first group of data points in the first batch of data points after deduplication processing in the first radar data, and obtaining the smoothed values of the longitude and latitude of the vehicle identified by the radar in the data point at the center of the filtering window in the first group of data points; The first batch of deduplication-processed data points in the first radar data include a plurality of first groups of data points; The first group of data points are data points with the same identifier of the vehicle identified by the radar among the first batch of data points after deduplication processing; S42, using formula (1) and formula (2) to calculate the smoothed values of the longitude and latitude of the vehicle identified by the radar in the last data point of the first group of data points, and use them as the initial longitude value and the initial latitude value, respectively; Wherein, formula (1) is: Initial value of longitude = ((longitude of the data point collected for the first time in the first set of data points + longitude of the data point collected for the second time in the first set of data points + longitude of the data point collected for the third time in the first set of data points + longitude of the data point collected for the fourth time in the first set of data points) / 4+longitude of the data point collected for the fifth time in the first set of data points*4) / 5; Formula (2) is: Initial value of latitude = ((latitude of the data point collected for the first time in the first set of data points + latitude of the data point collected for the second time in the first set of data points + latitude of the data point collected for the third time in the first set of data points + latitude of the data point collected for the fourth time in the first set of data points) / 4 + latitude of the data point collected for the fifth time in the first set of data points * 4) / 5; S43, arranging the initial numerical point and the second group of data points in the next batch of data points after deduplication processing to form a data point set; The second set of data points are data points where the identifiers of the vehicles identified by the radar are the same as the identifiers of the vehicles identified by the radar in the first set of data points; The set of data points includes, in sequence, an initial value and a second set of data points; The initial value points include: initial longitude value and initial latitude value; S44, using a moving average filtering algorithm with a filtering window size of 3, filtering the data point set to obtain smoothed values of the longitude and latitude of the vehicle identified by the radar in the data point at the center of the window among the data points of the data point set; S45, respectively using formula (3) and formula (4) to calculate the smoothed values of the longitude and latitude of the vehicle identified by the radar in the last data point in the batch of data points after deduplication processing, and use them as new initial values of longitude and latitude, respectively; Among them, formula (3) is: New initial value of longitude = ((longitude of the data point collected for the first time in the second set of data points + longitude of the data point collected for the second time in the second set of data points + longitude of the data point collected for the third time in the second set of data points + longitude of the data point collected for the fourth time in the second set of data points) / 4 + longitude of the data point collected for the fifth time in the second set of data points * 4) / 5; Formula (4) is: New initial latitude value = ((latitude of the data point collected for the first time in the second group of data points + latitude of the data point collected for the second time in the second group of data points + latitude of the data point collected for the third time in the second group of data points + latitude of the data point collected for the fourth time in the second group of data points) / 4 + latitude of the data point collected for the fifth time in the second group of data points * 4) / 5; S46. Repeat steps S43-S45 until the smoothed values of the longitude and latitude of the vehicle identified by the radar of the last data point of the second group of data points in the last batch of deduplicated data points in the first radar data are obtained.
9. The traffic radar data optimization method according to claim 8, characterized in that: The deduplication process specifically includes: deleting data points with the same timestamp in the radar data until only one is retained.
