Method, system and device for optimizing abnormal value of traffic travel time and medium
By establishing a model of travel time change characteristics and distribution characteristics, and using the improved bisection K-Means algorithm to filter outliers, the problem of uneven path travel time distribution and data sparseness is solved, and the accuracy and robustness of traffic travel time data are improved. It provides more reliable data support for intelligent transportation systems.
Patent Information
- Application Number
- CN202410716363.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, under actual road conditions, uneven distribution of path travel time and sparse data lead to large calculation errors and difficulty in direct application.
By acquiring automatic vehicle identification AVI data, a model of the travel time change characteristics of adjacent time periods and the travel time distribution characteristics of the same time period is established, and the improved bisection K-Means algorithm is used to filter outliers, taking into account the change range of adjacent time periods and the current situation. Time period data similarity, retaining data whose vehicle travel time changes are greater than the threshold.
It improves the accuracy and robustness of data, effectively eliminates abnormal data, provides more accurate traffic journey time information, and supports intelligent transportation systems.
Smart Images

Figure CN118736823A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic data processing, and in particular to a method, system, device and medium for optimizing abnormal values of traffic travel time. Background Art
[0002] Travel time is an important indicator for measuring traffic efficiency. It plays a key role in accurately understanding the operation status of road network traffic, helping traffic management departments balance road network traffic, alleviating traffic congestion and improving traffic efficiency. At the same time, travel time analysis helps travelers plan the optimal travel route, thereby reducing travel time and optimizing travel experience.
[0003] With the development of traffic detection equipment technology, data collection technology is constantly improving, and the ways to obtain traffic information are also increasing. Common detectors include location detectors, interval detectors and floating car systems. Location detectors such as coil detectors, ultrasonic detectors, and radar detectors are deployed at specific locations on the road to collect data such as vehicle point speed, road occupancy, and cross-sectional flow. Interval detectors include automatic vehicle identification (AVI) detectors and Bluetooth vehicle identification detectors, which can obtain vehicle identity information, travel time and other data. The floating car system records vehicle identity information, longitude and latitude coordinates, and vehicle speed through the on-board GPS device.
[0004] Although detection equipment is constantly updated and data types are increasing, the accuracy and reliability of data still face challenges. Location detectors usually estimate travel time indirectly based on the relationship between traffic flow parameters, while interval detectors and floating car systems rely on the time difference of vehicles within the road section to calculate travel time. However, whether it is detection error, calculation error or abnormal vehicle behavior (such as parking or detour), it may lead to the generation of abnormal data. Directly using these abnormal data for travel time estimation or prediction may cause the results to deviate from the normal value and produce large errors.
[0005] At present, a lot of research has been done on the cleaning of travel time data at home and abroad, which can be mainly divided into two categories: data filtering based on the current time window and data filtering based on adjacent time windows. Data filtering based on the current time window usually sets a reasonable time window size, assumes that the travel time in the time window obeys a specific distribution (such as normal distribution, Poisson distribution, etc.), and then removes outliers based on the distribution characteristic parameters of the data in the time window. Data filtering based on adjacent time windows considers the relationship between the traffic status of adjacent time windows on this basis, and believes that the traffic status of adjacent time windows has a certain similarity. Therefore, the mean change between the travel time of vehicles in the current time period and the travel time in the previous time period will not exceed a certain threshold. However, under actual road conditions, problems such as uneven distribution of path travel time and sparse data make it difficult for existing algorithms to be directly applied or lead to large calculation errors. Summary of the invention
[0006] The purpose of the present invention is to provide a method, system, device and medium for optimizing outliers of traffic travel time in view of the deficiencies of the above-mentioned prior art, so as to solve the problems of uneven distribution of path travel time and sparse data under actual road conditions in the prior art, which makes it difficult to directly apply the existing algorithm or leads to large calculation errors.
[0007] The present invention specifically provides the following technical solution: a method for optimizing abnormal values of traffic travel time, comprising the following steps:
[0008] Acquire automatic vehicle identification (AVI) data, and define the automatic vehicle identification (AVI) data as a travel time data set of a road section; the automatic vehicle identification (AVI) data includes departure time, arrival time, road section travel time, and detector number information;
[0009] Establishing a filtering model according to the variation characteristics of travel time in adjacent time periods in the travel time data set, and establishing a filtering model according to the distribution characteristics of travel time in the same time period in the travel time data set;
[0010] The two filtering models are fused, and the improved binary K-Means algorithm is used to filter outliers of travel time in the fused model.
[0011] The improved binary K-Means algorithm is used to filter the travel time data in the fusion model, including the following steps:
[0012] Combine the data from the previous time period and the current time period to estimate the average travel time, and select a filtering method for outliers based on the amount of data in the current time period;
[0013] By using the filtering method, outliers in the average travel time that are outside the range of travel time in adjacent time periods and outliers in the current time period whose data similarity is higher than a threshold are filtered out;
[0014] When no automatic vehicle identification (AVI) data is recorded for multiple consecutive time periods, the travel time data of vehicles with travel time changes greater than the time threshold are retained.
[0015] Preferably, the automatic vehicle identification (AVI) data is obtained, and the specific expression is:
[0016]
[0017] Where, k represents the kth time period; N k represents the amount of AVI data recorded in the kth time period; represents the travel time of the first vehicle in the kth time period, Indicates the Nth time period in the kth time period k The travel time of the car, represents the travel time of the nth vehicle in the kth time period.
[0018] Preferably, estimating the average travel time by combining the data of the previous time period and the current time period comprises the following steps:
[0019] Combined with the average travel time t in the previous time period k-1 And the valid data set for the current time period To estimate the average travel time
[0020] in, represents the effective travel time of the first vehicle in the kth time period, Indicates the Nth time period in the kth time period k The effective travel time of the vehicle, represents the effective travel time of the nth vehicle in the kth time period, N vk represents the amount of valid AVI data recorded in the kth time period, and α represents the range of variation;
[0021] If no data is recorded in the current time period, the average travel time of the previous time period is used as the average travel time of the current time period. k =t k-1 .
[0022] Preferably, the filtering method for selecting abnormal values based on the amount of data in the current time period comprises the following steps:
[0023] The filtering algorithms are divided into two categories according to the amount of data in the time period;
[0024] When the amount of data is less than 3, it is considered that the travel time variation between the current time period and the previous time period is within a certain range. The travel time is tested and the data outside this range is judged as an outlier;
[0025] When the amount of data is greater than or equal to 3, the AVI data S is converted based on the basic K-Means algorithm. k Divide into two optimal partitions and and calculate their respective centroids and If the two centroids are close enough The two partition data are merged as a valid data set; if the distance between the two centroids is far Then remove the centroid deviation t k-1 Repeat the above steps until the centroids of the two partitions are close enough. At this time, the data of the two partitions are merged as a valid data set.
[0026] Preferably, when Find something closer to t k-1 Partition make
[0027] Preferably, when no automatic vehicle identification (AVI) data is recorded in a plurality of consecutive time periods, retaining the travel time data of the vehicle whose travel time change is greater than the time threshold comprises the following steps:
[0028] when When receiving travel time data that has changed significantly after no AVI data has been recorded for a number of consecutive time periods;
[0029] in The number of time periods during which no AVI data is recorded until the end of the previous time period.
[0030] Preferably, the following step is also included: comparing the travel time after outlier filtering with the actual measurement data, and performing reliability evaluation through evaluation indicators, wherein the evaluation indicators used include mean absolute error MAE, median absolute error MAD and mean absolute percentage error MAPE.
[0031] The present invention provides a method system for optimizing abnormal values of traffic travel time, comprising:
[0032] An acquisition module is used to obtain automatic vehicle identification (AVI) data and define the automatic vehicle identification (AVI) data as a travel time data set of a road section; the automatic vehicle identification (AVI) data includes departure time, arrival time, road section travel time, and detector number information;
[0033] A model building module, used to establish a filtering model according to the change characteristics of travel time in adjacent time periods in the travel time data set, and to establish a filtering model according to the distribution characteristics of travel time in the same time period in the travel time data set;
[0034] The filtering module is used to fuse the two filtering models and filter the outliers of the travel time in the fusion model using the improved binary K-Means algorithm; the filtering module also includes:
[0035] A selection module is used to estimate the average travel time by combining the data of the previous time period and the current time period, and to select a filtering method for outliers based on the amount of data in the current time period;
[0036] A processing module, used to filter out abnormal values in the average travel time that are outside the variation range of the travel time in adjacent time periods and the data similarity of the current time period that is higher than a threshold value by using the filtering method;
[0037] The data retention module is used to retain the travel time data of the vehicle whose travel time change is greater than the time threshold when no automatic vehicle identification (AVI) data is recorded in multiple consecutive time periods.
[0038] The present invention provides a computer device, comprising a memory and a processor, wherein a program is stored in the memory, and when the program is executed by the processor, the processor executes the steps of the abnormal value optimization method of the traffic travel time.
[0039] The present invention provides a storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of the abnormal value optimization method of traffic travel time are implemented.
[0040] Compared with the prior art, the present invention has the following significant advantages:
[0041] The present invention acquires automatic vehicle identification (AVI) data, establishes a filtering model based on the variation characteristics of travel time in adjacent time periods in the travel time data set, establishes a filtering model based on the distribution characteristics of travel time in the same time period in the travel time data set, comprehensively considers multiple factors, performs multi-directional data processing based on the distribution and variation characteristics of travel time, and improves data accuracy. At the same time, an improved binary K-Means algorithm is used to filter travel time abnormal values on a fusion model of the two filtering models, and the factors of the variation range of travel time in adjacent time periods and the similarity of data in the current time period are taken into consideration, and travel time data of vehicles with travel time variation greater than a time threshold are retained, so that abnormal data are eliminated more effectively and accurately, the robustness and reliability of the filtering result are improved, and more accurate data support is provided for the intelligent transportation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 Schematic diagram of a travel time filtering algorithm according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following is a clear and complete description of the technical solutions of the embodiments of the present invention in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0044] The data input in this invention is the AVI data of Tuen Mun Highway in the New Territories of Hong Kong, China from January 1 to 31, 2018 for 31 days (consisting of departure time, arrival time, path travel time, detector number and other information). The AVI data set recorded in a certain period of time is now defined as the set of road section travel time data Where, k represents the kth time period; N k represents the amount of AVI data recorded in the kth time period; represents the travel time of the first vehicle in the kth time period, Indicates the Nth time period in the kth time period k The travel time of the car, represents the travel time of the nth vehicle in the kth time period.
[0045] In view of the shortcomings of the prior art, the present invention proposes an outlier optimization method for traffic travel time to solve the problems of the prior art, which specifically includes the following steps:
[0046] Step S1: Acquire historical automatic vehicle identification (AVI) data, and define the automatic vehicle identification (AVI) data as a travel time data set for a road section; the AVI data includes departure time, arrival time, road section travel time, and detector number information.
[0047] Among them, organize the AVI data set:
[0048] The AVI data are arranged in ascending order according to the arrival time of the vehicles. Considering that the vehicle travel time in the same time period has certain similarities and the vehicle travel time in adjacent time periods has certain variation characteristics, the AVI data within one day after the above sorting is divided into 2-minute time periods (a total of 720 time periods).
[0049] Step S2: Establish a filtering model based on the change characteristics of travel time in adjacent time periods in the travel time data set, and establish a filtering model based on the distribution characteristics of travel time in the same time period in the travel time data set.
[0050] Among them, the filtering model based on the travel time change characteristics of adjacent time periods believes that the change of travel time in adjacent time periods is gradual rather than abrupt, so the change amplitude of travel time in adjacent time periods should be within a certain range α; the filtering model based on the travel time distribution characteristics of the same time period believes that the travel time in the same time period has certain similarities and belongs to the same class, while abnormal travel time data deviates from this class.
[0051] Step S3: The two filtering models are fused, and the outliers of travel time in the fused model are filtered using the improved binary K-Means algorithm.
[0052] The improved binary K-Means algorithm is used to filter outliers of travel time in the fusion model, including the following steps:
[0053] Step S31: Estimate the average travel time by combining the data of the previous time period and the current time period, and select a filtering method for abnormal values based on the amount of data in the current time period.
[0054] The average travel time is estimated by combining the data of the previous time period and the current time period, including the following steps:
[0055] The average travel time of the previous time period is an important criterion for estimating the effective interval of the current time period. In order to obtain the average travel time more accurately and make it change more smoothly, the average travel time of the previous time period t k-1 And the valid data set for the current time period To estimate the average travel time
[0056] in, represents the effective travel time of the first vehicle in the kth time period, Indicates the Nth time period in the kth time period k The effective travel time of the vehicle, represents the effective travel time of the nth vehicle in the kth time period, N vk It represents the amount of valid AVI data recorded in the kth time period, and α represents the range of variation.
[0057] If no data is recorded in the current time period, the average travel time of the previous time period is used as the average travel time of the current time period. k =t k-1 .
[0058] The filtering method for selecting abnormal values based on the amount of data in the current time period includes the following steps:
[0059] Since the amount of data in each time period varies greatly, especially considering that there may be multiple time periods in the middle of the night where very few vehicles are detected or no vehicles are detected, outliers will greatly interfere with the overall data. In order to perform more accurate anomaly detection when the amount of data in different time periods varies greatly, the filtering algorithms are divided into two categories according to the amount of data in the time period.
[0060] When the amount of data is less than 3, it is considered that the travel time variation between the current time period and the previous time period is within a certain range. The travel time is detected and data outside this range is judged as abnormal data.
[0061] When the amount of data is greater than or equal to 3, not only the variation range of travel time in adjacent time periods is taken into account, but also the existence of certain similarities in the data in the current time period.
[0062] Based on the basic K-Means algorithm, the AVI data S k Divide into two optimal partitions and and calculate their respective centroids and If the two centroids are close enough The two partition data are merged as a valid data set; if the distance between the two centroids is far Then remove the centroid deviation t k-1 Repeat the above steps until the centroids of the two partitions are close enough. At this time, the data of the two partitions are merged as a valid data set.
[0063] when Find something closer to t k-1 Partition make
[0064] Step S32: using a filtering method, filter out abnormal values in the average travel time that are outside the range of travel time in adjacent time periods and have data similarity in the current time period higher than a threshold.
[0065] The specific steps include:
[0066] When AVI data is not recorded for a number of consecutive time periods, the outdated average travel time will be used to estimate the interval of the next travel time, which is obviously not reasonable. is the number of time periods without AVI data recorded until the end of the previous time period. When , we receive travel time data that varies greatly after no AVI data is recorded for a number of consecutive time periods.
[0067] in is the number of time periods in which no AVI data is recorded continuously until the end of the previous time period. 0 Take 3.
[0068] Exemplarily, Table 1 is the code logic for filtering AVI data based on the improved binary K-Means provided in this embodiment:
[0069] Table 1 Travel time filtering algorithm based on improved binary K-Means
[0070]
[0071]
[0072] Compare the estimated value with the true value and evaluate the experimental results:
[0073] The travel time estimated based on AVI data is compared with the true data to analyze its reliability. The evaluation indicators used include mean absolute error (MAE), median absolute error (MAD) and mean absolute percentage error (MAPE).
[0074] Based on the above methods and statements, the present invention provides a method system for optimizing outliers of traffic travel time, including: a collection module, a model building module, a filtering module, a filtering method selection module and a travel time module.
[0075] The acquisition module is used to obtain automatic vehicle identification (AVI) data and define the automatic vehicle identification (AVI) data as a travel time data set of a road section; the automatic vehicle identification (AVI) data includes departure time, arrival time, road section travel time, and detector number information; the model building module is used to establish a filtering model according to the change characteristics of travel time in adjacent time periods in the travel time data set, and to establish a filtering model according to the distribution characteristics of travel time in the same time period in the travel time data set; the filtering module is used to fuse the two filtering models and filter the abnormal values of travel time in the fusion model using the improved binary K-Means algorithm; the filtering module also includes: a selection module, a processing module and a data retention module; the selection module estimates the average travel time by combining the data of the previous time period and the current time period, and selects a filtering method for abnormal values based on the amount of data in the current time period; the processing module is used to filter out abnormal values in the average travel time that are outside the change range of travel time in adjacent time periods and the abnormal values whose similarity of data in the current time period is higher than a threshold through a filtering method; the data retention module is used to retain the travel time data of the vehicle travel time change greater than the time threshold when no automatic vehicle identification (AVI) data is recorded in multiple consecutive time periods.
[0076] The present invention also provides a computer device, including a memory and a processor. The memory stores a program. When the program is executed by the processor, the processor executes the steps of an abnormal value optimization method for traffic travel time.
[0077] In accordance with the disclosed embodiments, a computing device may communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth communications, etc.), or with any device (e.g., routers, modems, etc.) that enables a computing device to communicate with one or more other computing devices.
[0078] The present invention also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of a method for optimizing abnormal values of traffic travel time are implemented.
[0079] According to the disclosed embodiments, the storage medium may be a non-volatile computer-readable storage medium, such as but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0080] The above content is a further detailed description of the present invention in combination with a specific preferred embodiment. For technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as belonging to the protection scope of the present invention.
Claims
1. A method for optimizing outliers of traffic travel time, characterized in that: include: Acquire automatic vehicle identification (AVI) data, and define the automatic vehicle identification (AVI) data as a travel time dataset of a road segment; The automatic vehicle identification (AVI) data includes departure time, arrival time, section travel time, and detector number information; Establishing a filtering model according to the variation characteristics of travel time in adjacent time periods in the travel time data set, and establishing a filtering model according to the distribution characteristics of travel time in the same time period in the travel time data set; The two filtering models are fused, and the improved binary K-Means algorithm is used to filter outliers of travel time in the fused model. The improved binary K-Means algorithm is used to filter the travel time data in the fusion model, including the following steps: Combine the data from the previous time period and the current time period to estimate the average travel time, and select a filtering method for outliers based on the amount of data in the current time period; By using the filtering method, outliers in the average travel time that are outside the range of travel time in adjacent time periods and outliers in the current time period whose data similarity is higher than a threshold are filtered out; When no automatic vehicle identification (AVI) data is recorded for multiple consecutive time periods, the travel time data of vehicles with travel time changes greater than the time threshold are retained.
2. The method for optimizing abnormal values of traffic travel time according to claim 1, characterized in that: The specific expression for obtaining automatic vehicle identification (AVI) data is: Where, k represents the kth time period; N k represents the amount of AVI data recorded in the kth time period; represents the travel time of the first vehicle in the kth time period, Indicates the Nth time period in the kth time period k The travel time of the car, represents the travel time of the nth vehicle in the kth time period.
3. The method for optimizing abnormal values of traffic travel time according to claim 1, characterized in that: The method of estimating the average travel time by combining the data of the previous time period and the current time period includes the following steps: Combined with the average travel time t in the previous time period k-1 And the valid data set for the current time period To estimate the average travel time in, represents the effective travel time of the first vehicle in the kth time period, Indicates the Nth time period in the kth time period k The effective travel time of the vehicle, represents the effective travel time of the nth vehicle in the kth time period, N vk represents the amount of valid AVI data recorded in the kth time period, and α represents the range of variation; If no data is recorded in the current time period, the average travel time of the previous time period is used as the average travel time of the current time period. k =t k-1 .
4. The method for optimizing abnormal values of traffic travel time according to claim 3, characterized in that: The filtering method for selecting abnormal values based on the amount of data in the current time period includes the following steps: The filtering algorithms are divided into two categories according to the amount of data in the time period; When the amount of data is less than 3, it is considered that the travel time variation between the current time period and the previous time period is within a certain range. The travel time is tested and the data outside this range is judged as an outlier; When the amount of data is greater than or equal to 3, the AVI data S is converted based on the basic K-Means algorithm. k Divide into two optimal partitions and and calculate their respective centroids and If the two centroids are close enough The two partition data are merged as a valid data set; if the distance between the two centroids is far Then remove the centroid deviation t k-1 Repeat the above steps until the centroids of the two partitions are close enough. At this time, the data of the two partitions are merged as a valid data set.
5. The method for optimizing abnormal values of traffic travel time according to claim 4, characterized in that: when Find the partition closer to tk-1 make 6. The method for optimizing abnormal values of traffic travel time according to claim 1, characterized in that: When no automatic vehicle identification (AVI) data is recorded in a plurality of consecutive time periods, retaining the travel time data of the vehicle whose travel time change is greater than the time threshold comprises the following steps: when When receiving travel time data that has changed significantly after no AVI data has been recorded for a number of consecutive time periods; in The number of time periods during which no AVI data is recorded until the end of the previous time period.
7. The method for optimizing abnormal values of traffic travel time according to claim 1, characterized in that: The method also includes the steps of comparing the travel time after outlier filtering with the actual measurement data, and performing reliability evaluation through evaluation indicators, wherein the evaluation indicators used include mean absolute error (MAE), median absolute error (MAD), and mean absolute percentage error (MAPE).
8. A method system for optimizing abnormal values of traffic travel time, characterized in that: include: An acquisition module, used for acquiring automatic vehicle identification (AVI) data, and defining the automatic vehicle identification (AVI) data as a travel time data set of a road section; The automatic vehicle identification (AVI) data includes departure time, arrival time, section travel time, and detector number information; A model building module, used to establish a filtering model according to the change characteristics of travel time in adjacent time periods in the travel time data set, and to establish a filtering model according to the distribution characteristics of travel time in the same time period in the travel time data set; The filtering module is used to fuse the two filtering models and filter the outliers of travel time in the fusion model using the improved binary K-Means algorithm; The filtering module also includes: A selection module is used to estimate the average travel time by combining the data of the previous time period and the current time period, and to select a filtering method for outliers based on the amount of data in the current time period; A processing module, used to filter out abnormal values in the average travel time that are outside the variation range of the travel time in adjacent time periods and the data similarity of the current time period that is higher than a threshold value by using the filtering method; The data retention module is used to retain the travel time data of the vehicle whose travel time change is greater than the time threshold when no automatic vehicle identification (AVI) data is recorded in multiple consecutive time periods.
9. A computer device, characterized in that: It comprises a memory and a processor, wherein a program is stored in the memory, and when the program is executed by the processor, the processor executes the steps of the outlier optimization method of traffic travel time as claimed in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for optimizing abnormal values of traffic travel time according to any one of claims 1 to 7 are implemented.
