Dangerous or illegal driving may disrupt the traffic safety management of public security organs, damage road infrastructure, lead to traffic accidents, or result in economic losses. This paper proposes a framework based on China’s highway toll data to identify dangerous or illegal driving risks, such as unfamiliarity with road conditions, overload, driving over the speed limit, fatigued driving, fake license plates, and other risks. The unfamiliarity with road conditions is identified with the frequency of driving routes. When the total weight of a vehicle and its cargo is greater than the upper limit of the total weight of the vehicle and its cargo, the vehicle can be judged as overloaded. When the actual travel time is less than the minimum travel time, it can be inferred that the vehicle has a risk of fatigued driving, driving over the speed limit, a fake license plate, or other risks. Two accidents are used to demonstrate the process of the proposed framework for identifying driving risks based on China’s highway toll data. Additional analysis proves that the proposed framework can be used to identify dangerous or illegal driving risks, and it provides a scientific basis for the traffic safety management of public security organs, reducing infrastructure damage, and avoiding the loss of national taxes and fees.