The gradual increase in the density of highway vehicles and traffic flow makes the abnormal driving state of vehicles an indispensable tool for assisting traffic dispatch. Intelligent transportation systems can detect and track vehicles in real time, acquire characteristics such as vehicle traffic, vehicle speed, vehicle flow density, and vehicle trajectory, and further perform advanced tasks such as vehicle trajectory. The detection of abnormal vehicle trajectory is an important content of vehicle trajectory understanding. And the development of the Internet of Things (IoT) and 5G technology has led to a continuous increase in the rate of data information circulation. The “Internet of Vehicles” generated based on the practice of 5G communication technology constitutes a vehicle abnormal trajectory detection system, which has very high feasibility and safety and stability. Therefore, this research is aimed at the needs of preventing major accidents and forensic analysis during highway vehicles. Based on the integration of the Internet of Things 5G communication technology, a trajectorial anomaly detection of highway vehicle trajectory based on the integration of the Internet of Things 5G is proposed. By accurately sensing unsafe events at the perception layer, network layer, and application layer, the vehicle driving trajectory state is divided into several simple semantic representations. The semantic representation is analyzed, and then the moving target detection and moving target tracking algorithms needed to extract the vehicle trajectory are introduced. Through video detection and tracking of moving vehicle targets, the driving trajectory of the vehicle is obtained, and the movement characteristics of the vehicle in each frame of image are extracted. According to the relationship between the trajectory of the vehicle and the lane line, the vehicle trajectory analysis is realized, and then it is judged whether the vehicle has abnormal trajectory. Compared with the traditional method of manually detecting the driving condition of the vehicle, the abnormal trajectory detection of the vehicle based on the integration of the Internet of Things and 5G can quickly detect the abnormal trajectory of the vehicle in the traffic monitoring video.