Truck fatigue driving judgment method based on GPS
Through the window translation method of dataframe, efficiently process GPS data, calculate the continuous driving time of the truck, solve the problem of difficulty in real-time evaluation of fatigue driving in the existing technology, and achieve more efficient and accurate fatigue driving judgments, reducing costs.
Patent Information
- Application Number
- CN202510070935.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-06-06
AI Technical Summary
In the field of long-distance freight, fatigue driving has always been an important hidden danger of traffic safety. The existing technology is difficult to efficiently process large-scale and high-frequency GPS data, making it difficult to calculate continuous driving time in real time, affecting the timely assessment and early warning of fatigue driving.
By using the window translation method of dataframe, GPS data is efficiently processed, each continuous driving time of the vehicle is calculated, and integrated with other systems through standardized data interfaces to achieve accurate judgment of fatigue driving.
It improves the judgment efficiency and accuracy of truck fatigue driving, reduces application costs, and makes fatigue driving evaluation technology easier to promote and apply.
Smart Images

Figure CN120105140A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of road safety, and in particular to a method for judging truck fatigue driving based on GPS. Background Art
[0002] With the rapid development of the logistics and transportation industry, the process of automobile urbanization is also accelerating, the number of drivers is constantly growing, and traffic accidents caused by fatigue driving are increasing. According to statistics, fatigue driving accounts for more than 40% of major traffic accidents. It can be seen that the harm caused by fatigue driving is very serious, which has attracted the attention of governments of various countries. In order to reduce accidents caused by fatigue driving, the most common measures currently adopted by various countries are to limit the driving time of drivers to a certain range. Article 62 of the "Regulations for the Implementation of the Road Traffic Safety Law of the People's Republic of China" clearly stipulates that motor vehicle drivers shall not "drive motor vehicles for more than 4 hours without stopping to rest or stop for rest for less than 20 minutes."
[0003] In the field of long-distance freight, fatigue driving has always been a major hidden danger to traffic safety. Long-term, high-intensity driving activities can easily cause driver fatigue, which in turn affects their reaction speed and judgment ability, increasing the risk of traffic accidents. Summary of the invention
[0004] In response to the above technical problems, the present invention provides a GPS-based truck fatigue driving judgment method, which improves the judgment efficiency and accuracy of truck fatigue driving and reduces the application cost.
[0005] To achieve the above object, the present invention provides the following technical solution: a method for judging truck fatigue driving based on GPS, comprising the following steps:
[0006] Step 1: Obtain the vehicle's driving trajectory data through the GPS device on the truck;
[0007] Step 2: Obtain the above trajectory data, filter out the stationary data whose speed is less than a predetermined speed, and arrange the driving state data in the filtered data in time order to obtain a column time1;
[0008] Step 3: Calculate each continuous driving time of the vehicle based on the displacement method of the dataframe;
[0009] Step 4: Determine the continuous_driving_time column. When continuous_driving_time>=240min(4h), it is determined as fatigue driving.
[0010] Step 5: Output each segment of continuous driving data of the vehicle.
[0011] Preferably, the trajectory data in step one includes the travel time, speed, longitude and latitude of the truck.
[0012] Preferably, the predetermined speed in step 2 is 5 km / h, and vehicles with a speed less than 5 km / h in the trajectory data are considered to be stationary, and vehicles with a speed greater than 5 km / h are considered to be in a moving state.
[0013] Preferably, the process of calculating each continuous driving time of the vehicle in step 3 is as follows:
[0014] Step 1: Use the bit shift function to shift time1 up by 1 bit to get time2;
[0015] Step 2: Compare time1 and time2. If the time difference is less than 20 minutes, mark it as "O". If the time difference is greater than or equal to 20 minutes or there is no time, mark it as "D" and generate a new column mark1.
[0016] Step 3: Use the shift function to shift mark1 down by 1 bit to get column mark2;
[0017] Step 4: Compare mark1 and mark2. If the time difference is less than 20 minutes, the mark is "O". If the time difference is greater than or equal to 20 minutes or there is no time, it is marked as "D". A new column mark2 is generated, and the data where both mark1 and mark2 are "O" are removed.
[0018] Step 5: Shift the eliminated data up one position to get mark3 and taime3, and filter out the data with mark1 as "O" and mark3 as "D" as continuous driving data; time1 is the start time of continuous driving, time3 is the end time of continuous driving, time3-time1 is used to get a new column continuous_driving_time, and continuous_driving_time is the continuous driving time.
[0019] Preferably, the driving data of each continuous driving segment is outputted using a standardized data interface and protocol and system integration.
[0020] The beneficial effects of the present invention are as follows: by using the window translation method of dataframe, large-scale, high-frequency GPS data can be efficiently processed, data processing efficiency can be improved, and the calculation of continuous driving time can be realized. There is no need to install additional hardware equipment (such as cameras, sensors, etc.), which reduces the application cost, makes fatigue driving assessment technology easier to promote and apply, improves the judgment efficiency and accuracy of truck fatigue driving, and reduces the application cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0022] Figure 1 This is a structural schematic diagram of the GPS-based truck fatigue driving judgment method proposed by the present invention.
[0023] Figure 2 This is a schematic diagram of the actual application structure of the GPS-based truck fatigue driving judgment method proposed in the present invention. DETAILED DESCRIPTION
[0024] In order to make the technical means, creative features, objectives and effects of the present invention easy to understand, the present invention is further described below in conjunction with specific embodiments and drawings, but the following embodiments are only preferred embodiments of the present invention, not all. Based on the embodiments in the implementation mode, other embodiments obtained by those skilled in the art without creative work are all within the scope of protection of the present invention.
[0025] See also Figure 1 , a truck fatigue driving judgment method based on GPS, comprising the following steps:
[0026] Step 1: Obtain the vehicle's driving trajectory data through the GPS device on the truck;
[0027] Step 2: Obtain the above trajectory data, filter out the stationary data whose speed is less than a predetermined speed, and arrange the driving state data in the filtered data in time order to obtain a column time1;
[0028] Step 3: Calculate each continuous driving time of the vehicle based on the displacement method of the dataframe;
[0029] Step 4: Determine the continuous_driving_time column. When continuous_driving_time>=240min(4h), it is determined as fatigue driving.
[0030] Step 5: Output each segment of continuous driving data of the vehicle.
[0031] The present invention uses the displacement technology of dataframe to efficiently process GPS data. This technology accurately calculates the driver's continuous driving time and can be used in spark and python's pandas library, which improves the convenience of data use, improves the judgment efficiency and accuracy of truck fatigue driving, and reduces application costs.
[0032] The trajectory data in step 1 includes the time, speed, longitude, and latitude of the truck's travel.
[0033] The predetermined speed in step 2 is 5 km / h. Vehicles with a speed less than 5 km / h in the trajectory data are considered to be stationary, and vehicles with a speed greater than 5 km / h are considered to be in motion.
[0034] The process of calculating each continuous driving time of the vehicle in step 3 is as follows:
[0035] Step 1: Use the bit shift function to shift time1 up by 1 bit to get time2;
[0036] Step 2: Compare time1 and time2. If the time difference is less than 20 minutes, mark it as "O". If the time difference is greater than or equal to 20 minutes or there is no time, mark it as "D" and generate a new column mark1.
[0037] Step 3: Use the shift function to shift mark1 down by 1 bit to get column mark2;
[0038] Step 4: Compare mark1 and mark2. If the time difference is less than 20 minutes, the mark is "O". If the time difference is greater than or equal to 20 minutes or there is no time, it is marked as "D". A new column mark2 is generated, and the data where both mark1 and mark2 are "O" are removed.
[0039] Step 5: Shift the eliminated data up one position to get mark3 and taime3, and filter out the data with mark1 as "O" and mark3 as "D" as continuous driving data; time1 is the start time of continuous driving, time3 is the end time of continuous driving, time3-time1 is used to get a new column continuous_driving_time, and continuous_driving_time is the continuous driving time.
[0040] The driving data of each continuous driving segment is integrated and output with the system using a standardized data interface and protocol.
[0041] The driving data output for each continuous driving session includes the driving start time, end time, start longitude and latitude, end longitude and latitude, continuous driving duration, whether the driver is fatigued, etc.
[0042] There are some obvious shortcomings in the existing technologies for assessing driver fatigue:
[0043] 1. Inefficient data processing: Existing technologies may rely on traditional data processing methods, which may encounter performance bottlenecks when processing large-scale, high-frequency GPS data, resulting in inefficient data processing.
[0044] 2. It is difficult to calculate the continuous driving time in real time: Due to the limitation of data processing efficiency, existing technology may not be able to calculate the driver's continuous driving time in real time, which will affect the timely assessment and warning of fatigue driving.
[0045] 3. Difficult to integrate with other systems: Existing technologies may lack the ability to integrate with other traffic management systems or vehicle monitoring systems, which limits their application in a wider range of scenarios.
[0046] 4. High equipment cost: Existing technologies may require the installation of additional hardware equipment (such as cameras, sensors, etc.) to assist in determining the driver’s fatigue status, which increases the cost of the equipment and maintenance costs.
[0047] In view of the above shortcomings of the prior art, the present invention aims to provide a more accurate, reliable and cost-effective method for calculating the driver's continuous driving time based on GPS data to assess driving fatigue. The method comprises the following:
[0048] 1. Improve data processing efficiency: By using the window translation method of dataframe, the present invention efficiently processes large-scale, high-frequency GPS data, improves data processing efficiency, and thus realizes real-time calculation of continuous driving time.
[0049] 2. Realize integration with other systems: The present invention provides standardized data interfaces and protocols, which can be easily integrated with other traffic management systems or vehicle monitoring systems to achieve data sharing and collaborative processing.
[0050] 3. Reduce application costs: By optimizing data processing algorithms and reducing hardware requirements, the present invention can reduce application costs and make fatigue driving assessment technology easier to promote and apply.
[0051] The purpose of the invention can also be achieved by traversing the GPS time data and using an accumulator to add up the duration of all continuous driving time periods.
[0052] When judging fatigue driving of a truck based on GPS, it is as follows:
[0053] The GPS track data of the truck for a certain period of time is obtained through the GPS on the truck. The data is as follows:
[0054]
[0055]
[0056]
[0057] Among them, datetime, lat, lon, spd are time, longitude, latitude, and speed (km / h) respectively.
[0058] The driving trajectory data obtained above is used to determine the driving status of the trajectory. Vehicles with a speed < 5 km / h are considered to be stationary. After filtering the data with a speed < 5 km / h, the time column is sorted in chronological order to obtain column time1;
[0059]
[0060]
[0061]
[0062] Calculate each continuous driving time of the vehicle based on the displacement method of dataframe;
[0063] Use the bit shift function to shift time1 up by 1 bit to get time2. Compare time2 with time1. If the time difference is less than 20 minutes, mark it as "O". Otherwise, mark it as "D". If the time is empty, mark it as "D". Generate a new column mark1.
[0064]
[0065]
[0066]
[0067] Shift mark1 downward by 1 bit to get column mark2. Eliminate the case where both mark1 and mark2 are "0";
[0068]
[0069]
[0070] After the data is removed, mark1 and time1 are shifted up by one position to obtain mark3 and time3;
[0071]
[0072]
[0073] Filter out the data with mark1 as "O" and mark3 as "D" as continuous driving data. time1 is the start time of continuous driving, time3 is the end time of continuous driving, time3-time1 is the new column continuous_driving_time, continuous_driving_time is the continuous driving time;
[0074]
[0075] Judge the continuous_driving_time column. If continuous_driving_time>=240min (4h), it is considered to be a fatigue driving vehicle.
[0076]
[0077] From the results, we can see that the continuous driving time of each of the above vehicles did not reach 4 hours, so there was no fatigue driving behavior.
[0078] like Figure 2 As shown in the figure, up to now, the system has been put into operation in Inner Mongolia, Qinghai, Anhui, Xinjiang and other places, with an average of about 200 vehicles checked per day, and more than 100 violations such as fatigue driving have been investigated and dealt with on the spot using the platform. It has effectively promoted the standardization, standardization and intelligence of fatigue driving warning and disposal, bringing a qualitative leap to the road traffic safety management work in the jurisdiction.
[0079] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for judging truck fatigue driving based on GPS, characterized in that: The following steps are involved: Step 1: Obtain the vehicle's driving trajectory data through the GPS device on the truck; Step 2: Obtain the above trajectory data, filter out the stationary data whose speed is less than a predetermined speed, and arrange the driving state data in the filtered data in time order to obtain a column time1; Step 3: Calculate each continuous driving time of the vehicle based on the displacement method of the dataframe; Step 4: Determine the continuous_driving_time column. If continuous_driving_time is greater than or equal to 240 minutes (4 hours), it is considered fatigue driving. Step 5: Output each segment of continuous driving data of the vehicle.
2. A method for judging truck fatigue driving based on GPS according to claim 1, characterized in that: The trajectory data in step 1 includes the time, speed, longitude, and latitude of the truck's travel.
3. The method for judging truck fatigue driving based on GPS according to claim 1, characterized in that: The predetermined speed in step 2 is 5 km / h. Vehicles with a speed less than 5 km / h in the trajectory data are considered to be stationary, and vehicles with a speed greater than 5 km / h are considered to be moving.
4. The method for judging truck fatigue driving based on GPS according to claim 1, characterized in that: The process of calculating each continuous driving time of the vehicle in step 3 is as follows: Step 1: Use the bit shift function to shift time1 up by 1 bit to get time2; Step 2: Compare time1 and time2. If the time difference is less than 20 minutes, mark it as "O". If the time difference is greater than or equal to 20 minutes or there is no time, mark it as "D". Generate a new column mark1. Step 3: Use the shift function to shift mark1 down by 1 bit to get column mark2; Step 4: Compare mark1 and mark2. If the time difference is less than 20 minutes, the mark is "O". If the time difference is greater than or equal to 20 minutes or there is no time, it is marked as "D". A new column mark2 is generated, and the data where both mark1 and mark2 are "O" are removed. Step 5: Shift the eliminated data up one position to get mark3 and taime3, and filter out the data with mark1 as "O" and mark3 as "D" as continuous driving data; time1 is the start time of continuous driving, time3 is the end time of continuous driving, time3-time1 is used to get a new column continuous_driving_time, where continuous_driving_time is the continuous driving time.
5. The method for judging truck fatigue driving based on GPS according to claim 1, characterized in that: The driving data of each continuous driving segment is integrated and output with the system using a standardized data interface and protocol.