脱敏后路口红绿灯各相位有效时长模拟还原数据
收藏资源简介:
车联网所获取的数据来自交警交管相应系统,并非原始数据,所以通过阶段时间对数据进行模拟计算,模拟交通灯各相位红绿灯三种灯态的有效时长。适用于采集的数据不是原始数据,又需要推算交通灯相位的红绿灯时长,用以车辆网业务应用从kafka获取到数据在使用之前通过解析脚本将格式化数据解析成各字段(nodeID,TIMESTAMP,PHASE_ID,LIGHT_STATE,START_TIME,likely_end_time 等)。对以上结构化数据做小时,和node_id联合分组,通过对time_stamp 进行数据转换截取等操作,在固定时间内统计每一种phase_id对应的light_state的(likely_end_time-START_TIME )求最大值。以该值作为对应小时和node_id对应的有效灯态时长。因为有三种灯态,所以模拟了路口特定时间下相位交通信号灯的红绿灯时长
The data collected by the Internet of Vehicles (IoV) is sourced from traffic police and traffic management systems, and is not raw data. Therefore, simulated calculations are conducted on the data using phase-based time intervals to derive the effective durations of the three light states (red, yellow, green) for each traffic light phase. This dataset is applicable to scenarios where the collected data is not raw, and the traffic light phase durations need to be estimated. For IoV business applications, after retrieving data from Kafka, the formatted data must be parsed into fields including nodeID, TIMESTAMP, PHASE_ID, LIGHT_STATE, START_TIME, likely_end_time and other related items via parsing scripts prior to usage. Joint grouping of the aforementioned structured data is performed by hour and node_id. Through operations such as data conversion and truncation on the TIMESTAMP field, the maximum value of (likely_end_time - START_TIME) for each LIGHT_STATE corresponding to every PHASE_ID is calculated within a fixed time window. This maximum value is taken as the effective light state duration corresponding to the given hour and node_id. Given the three light states, this approach simulates the red, yellow and green light durations for traffic signal phases at intersections under specific time conditions.




