Taxi driver driving behavior scoring prediction method, system, terminal and medium
By using gamma distribution and LightGBM algorithm, driver shifts are accurately divided, multi-dimensional features are integrated, fault probability is predicted and standardized scores are output, which solves the problems of inaccurate shift change time, lack of predictability of scores and static model, and realizes the forward-looking risk assessment of taxi driver driving behavior.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN YIYOUXING TECHNOLOGY CO LTD
- Filing Date
- 2026-04-28
- Publication Date
- 2026-07-24
AI Technical Summary
Current taxi driver driving behavior assessments suffer from several problems: inaccurate shift change times leading to incorrect data attribution; a lack of ability to predict fault probability in scoring; neglect of multi-source information such as weather and historical faults; and static models that cannot be incrementally updated.
The model employs a gamma distribution to accurately classify driver shifts, combines the LightGBM gradient boosting decision tree algorithm with multi-dimensional features, predicts fault probabilities, and outputs standardized scores, supporting continuous model optimization.
It improves the accuracy of shift change time identification, enhances the precision of prediction models, integrates weather and fault severity, supports incremental learning, and features modular design for easy deployment, enabling a shift from post-event evaluation to proactive risk assessment.
Smart Images

Figure CN122453142A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of intelligent transportation and data mining technology, and in particular to a method, system, intelligent terminal and storage medium for predicting taxi driver driving behavior scores. Background Technology
[0002] Taxi driving behavior directly impacts driving safety, passenger experience, vehicle maintenance costs, and operational efficiency. Accurately assessing driver behavior and predicting the risk of malfunctions (including accidents) is crucial for taxi companies in safety management, insurance pricing, and driver evaluation.
[0003] Currently, the industry faces the following technical challenges in assessing taxi driver behavior: 1. Vague shift change times lead to incorrect data attribution: Taxis typically operate on a two-shift (early and late) or three-shift (including special shifts) system. The shift schedule only indicates the shift type, without specifying the actual shift change time down to the minute. Driving data collected by the vehicle terminal (such as rapid acceleration and deceleration) cannot be accurately attributed to the driver on duty, resulting in distorted driving behavior statistics. Existing technologies often use fixed time points (such as 4:00 AM) to segment data, which cannot adapt to the daily fluctuations in actual shift change times.
[0004] 2. Driving behavior scoring lacks predictability: Most existing methods accumulate points based on rules for events such as rapid acceleration and speeding, resulting in a "post-event evaluation" of past actions, which cannot predict the probability of future malfunctions or accidents. Insurance companies and fleet managers prefer a forward-looking risk assessment indicator.
[0005] 3. External environmental factors are not fully considered: Severe weather (heavy rain, extreme heat, frost, etc.) can significantly affect driving safety, but traditional scoring models often ignore weather factors, resulting in the same risk meaning of the same driving behavior being treated equally under different weather conditions, leading to inaccurate assessments.
[0006] 4. Fault data is not effectively utilized: Historical fault records (including fault severity and driver liability percentage) contain valuable risk information, but existing technologies either only use them as statistical reports or only for post-event accountability, without using them as labels to train predictive models.
[0007] 5. Static model, unable to adapt to change: Driver behavior changes with seasons, routes, vehicle conditions and even personal habits. Traditional methods remain fixed once deployed, lacking incremental learning capabilities, and prediction accuracy declines after long-term use.
[0008] To address the aforementioned issues, this invention provides a method and system for predicting taxi driver driving behavior scores based on gamma distribution and LightGBM. This method can accurately determine shift change times, integrate multi-source data, predict fault probabilities, and output standardized scores, while also supporting continuous model optimization. Summary of the Invention
[0009] The technical problem this application aims to solve is that existing taxi driver driving behavior assessments suffer from several shortcomings: inaccurate shift change times leading to incorrect data attribution, a lack of fault probability prediction capabilities in scoring, neglect of multi-source information such as weather and historical faults, and static models that cannot be incrementally updated. To address these deficiencies, this application provides a method, system, terminal, and storage medium for predicting taxi driver driving behavior scores. This method can accurately classify driver shifts, integrate multi-dimensional features, predict fault probabilities, and output standardized scores.
[0010] To solve the above-mentioned technical problems, the technical solution adopted in this application is: A method for predicting taxi driver driving behavior scores is provided, including the following steps: Acquire vehicle operating status data, weather data, historical fault records, and driver scheduling information; Based on the continuous time period when the vehicle speed is zero, the gamma distribution is used to perform weighted integration on each time period, and the time period with the largest integral value is selected as the actual shift change time. Based on the actual shift change time, the vehicle operation data is divided into corresponding drivers and shifts, driving behavior indicators for each shift are statistically analyzed, weather data and fault labels are associated, and a training sample set is constructed. The gradient boosting decision tree algorithm is used to train the training sample set to obtain a classification model for predicting the probability of failure. The current shift features of the driver to be predicted are obtained, input into the classification model to obtain the fault probability, and the fault probability is mapped to a driving behavior score and then output.
[0011] Preferably, in the process of using a gamma distribution to perform weighted integration on each time period based on a continuous time period when the vehicle speed is zero, and selecting the time period with the largest integral value as the actual shift change time, the process includes: The parameters of the gamma distribution are set so that the peak of its probability density function is located in the preset shift change peak period, and the gamma distribution is not normalized, but only used to compare the integral size of each static time period.
[0012] Preferably, the weighted integration of the static time period using the gamma distribution includes: Based on the taxi shift change habits in the city where the vehicle is located, the shape and scale parameters of the gamma distribution are pre-set so that the peak of the probability density function is located near the peak shift change period, and the probability density function exhibits an asymmetric unimodal shape before and after the peak period.
[0013] Preferably, the process of training the training sample set using the gradient boosting decision tree algorithm to obtain a classification model for predicting fault probabilities includes: Standardize the continuous features in the training sample set and save the standardized parameters; Encode categorical features; Early stopping and / or cross-validation are used to determine the model training parameters; Save the trained model and the standardized parameters.
[0014] Preferably, the process of obtaining the current shift features of the driver to be predicted, inputting them into the classification model to obtain the fault probability, and mapping the fault probability to a driving behavior score before outputting the result includes: Based on the distribution of historical predicted probabilities, the current failure probability is converted into a standard normal quantile, then linearly mapped to a preset scoring interval, and the boundary values are truncated and rounded.
[0015] Preferably, mapping the failure probability to a driving behavior score includes: The cumulative distribution function of historical predicted probabilities is dynamically maintained. Based on the quantile position of the current fault probability in the cumulative distribution function, it is converted into a standard normal quantile and then mapped to a preset scoring interval. The cumulative distribution function is updated periodically with new predicted data.
[0016] Preferably, the process of training the training sample set using the gradient boosting decision tree algorithm to obtain a classification model for predicting fault probabilities further includes an incremental training step, which periodically loads the saved model, uses newly added sample data to continue training the model, and updates the standardized parameters.
[0017] A taxi driver driving behavior scoring and prediction system is provided, including a data acquisition module, a data processing module, a model training module, and a scoring and prediction module; The data acquisition module is used to collect vehicle operating status data, weather data, historical fault data, and driver scheduling information; The data processing module is used to calculate the actual shift change time based on the vehicle stationary time period and gamma distribution, divide driver shifts according to the shift change time, statistically analyze driving behavior indicators and associate them with weather and fault labels, and generate a training sample set. The model training module is used to preprocess the training sample set, train the classification model using the gradient boosting decision tree algorithm, and save the model and preprocessing parameters. The rating prediction module is used to load the trained model, output the failure probability of the sample to be predicted, and convert it into a driving behavior rating.
[0018] A smart terminal is provided, characterized in that the smart terminal includes at least one memory, at least one processor, and a taxi driver driving behavior scoring prediction program stored in the memory and executable on the processor, wherein when the taxi driver driving behavior scoring prediction program is executed by the processor, it implements the steps of a taxi driver driving behavior scoring prediction method as described above.
[0019] A computer-readable storage medium is provided, characterized in that the computer-readable storage medium stores a taxi driver driving behavior scoring prediction program, which, when executed by a processor, implements the steps of a taxi driver driving behavior scoring prediction method as described above.
[0020] The beneficial effects of this application are as follows: 1. More accurate shift change time identification: By utilizing a gamma distribution to perform weighted integration on vehicle stationary periods, and fully leveraging the historical distribution patterns of shift change times (sharper on the left, gradual on the right, peaking at 4:30), the actual shift change time that best conforms to industry practices is selected from multiple candidate stationary periods. Compared to fixed time point segmentation, this application improves the accuracy of assigning driving behavior data to the correct driver by approximately 25%-35% (experimentally verified), laying a reliable foundation for subsequent feature statistics.
[0021] 2. High Prediction Model Accuracy: Employing LightGBM gradient boosting decision trees, the model automatically handles nonlinear relationships, feature interactions, and missing values. It combines multi-dimensional information such as driving behavior indicators, weather, time, driver history, and vehicle characteristics to output the probability of failure. Validated with 100,000 real taxi data points, the model's AUC reaches over 0.87, outperforming traditional logistic regression and random forests.
[0022] 3. The scoring is intuitive and conforms to a normal distribution: The probability of failure is mapped to a score of 15-95 points through the cumulative distribution function and the standard normal quantile, so that the scores of all drivers are approximately normally distributed. This makes it easier for managers to identify excellent (high score) and high-risk (low score) drivers. Moreover, the score range is fixed and comparable across time periods.
[0023] 4. Integration of Weather and Fault Severity: The introduction of weather severity quantification (0-10) and fault severity (1-10) enables the model to distinguish risk differences under different levels of severity. Simultaneously, the inclusion of a "driver-responsible" fault label eliminates interference from third-party liability faults, focusing the prediction results on the driver's own behavior.
[0024] 5. Supports incremental learning: The model is updated periodically with new data through a warm-start mechanism, eliminating the need to retrain the entire dataset. This enables the scoring system to adapt to changes in driver behavior, seasonal weather patterns, and new driving risks, maintaining long-term effectiveness.
[0025] 6. Modular system and easy deployment: The modules for data collection, shift change time calculation, feature construction, model training, score prediction, and incremental training are decoupled and can be deployed on cloud servers or edge computing nodes respectively, supporting both real-time and offline prediction modes. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the present application will be further described below in conjunction with the accompanying drawings and embodiments. The drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Figure 1 This is a flowchart illustrating the scoring prediction method of a preferred embodiment of this application; Figure 2 This is a schematic diagram of the system structure of the scoring prediction system according to a preferred embodiment of this application; Figure 3 This is a schematic diagram of the data processing module according to a preferred embodiment of the present application; Figure 4 This is a schematic diagram of the scoring prediction module according to a preferred embodiment of this application; Figure 5 This is a schematic diagram of the structure of a smart terminal according to a preferred embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, a clear and complete description will be provided below in conjunction with the technical solutions in the embodiments of this application. Obviously, the described embodiments are some embodiments of this application, but not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of this application.
[0028] A preferred embodiment of this application provides a method for predicting taxi driver driving behavior scores; such as... Figure 1The diagram shown is a flowchart illustrating a taxi driver driving behavior scoring prediction method according to an embodiment of the present invention. This method can be executed by a device, which can be implemented by software and / or hardware.
[0029] Specifically, in this embodiment, a method for predicting taxi driver driving behavior scores includes: S10: Obtain vehicle operating status data, quantitative values of weather severity, historical vehicle fault records, and driver scheduling information; In a preferred embodiment of the present invention, data collection includes two parts: one part is vehicle operation status data, which can be obtained through the taxi's MongoDB unit; the other part is weather conditions, vehicle malfunction conditions, and driver scheduling information, which can be obtained through the MySQL unit. The taxi's TBOX uploads the real-time operation status of the vehicle to MongoDB every 5 seconds, so the vehicle operation status data can be read from MongoDB, such as reading the operation status data of all taxis starting from January 1, 2024. The operation status data includes vehicle ID, vehicle running and stopping time, vehicle speed for each time period, latitude and longitude of the vehicle for each time period, total mileage traveled per day, data on rapid acceleration, rapid deceleration, sharp curves, speeding, and fatigue driving, as well as data collected by cameras or other devices such as smoking or talking on the phone while driving, which is then transmitted to MongoDB. The MySQL unit stores daily weather information, such as tropical cyclones, heavy rain, landslides, fires, extreme heat, extreme cold, frost, strong monsoons, and tsunamis. It also stores taxi malfunction data, including the details of the malfunction, the vehicle ID, the event that caused it, the severity of the malfunction, and whether any third-party liability was incurred. The MySQL unit further stores daily driver scheduling information, including early shifts, late shifts, and special shifts.
[0030] S20: For each taxi, for all consecutive time periods when the speed is 0 every day, integrate the probability density function of the gamma distribution over each time period, and select the time period with the largest integral value as the actual shift change time. In a preferred embodiment of the present invention, the driver's shift schedule only records vague shifts such as "early shift," "late shift," and "special shift," without precise shift change times, such as the exact time of vehicle handover. However, the vehicle's TBOX uploads data every 5 seconds, including information such as vehicle speed and latitude / longitude. If the actual shift change time for each vehicle each day can be accurately known, the daily data can be accurately assigned to the corresponding driver, thereby calculating the driver's driving behavior indicators (such as the number of times they accelerate rapidly from 0 to 100 km / h), providing accurate feature data for subsequent fault probability prediction. For example, Hong Kong regulations stipulate that early shifts are from 4:00 AM to 4:00 PM, and late shifts are from 4:00 PM to 4:00 AM, but the actual shift change times are not strictly on the hour, and the shift change times for each vehicle are not uniform each day. For example, the pick-up times for early shift drivers are mainly concentrated between 3:00 AM and 7:00 AM, and the distribution is uneven. The peak is around 4:30 AM, with the period from 3:00 AM to 4:30 AM being more concentrated, while the period from 4:30 AM to 7:00 AM is relatively flat. That is, the trend on the left side of the peak is steep, while the trend on the right side of the peak is gentle. This "steep on the left and gentle on the right, single-peak asymmetry" distribution pattern is very similar to the probability density function shape of the gamma distribution. Therefore, the gamma distribution can be used to calculate the probability of the time distribution to calculate the actual distribution pattern of shift change times.
[0031] It should be noted that the shape and scale parameters of the gamma distribution can be preset based on the statistical patterns of taxi shift change times in different cities or regions. For example, for cities where the shift change peak is concentrated around 4:30 AM, the shape parameters can be preset accordingly. Scale parameters This ensures that the probability density function exhibits an asymmetric unimodal shape with a steep left side and a gentle right side between 3 AM and 7 AM, with the peak value located near the peak shift change period. For other cities with different shift change habits, the parameters can be adjusted accordingly based on their actual statistical data, but the probability density function should always maintain an asymmetric unimodal shape before and after the peak period to adapt to the shift change time identification needs in different scenarios.
[0032] Furthermore, the gamma distribution has two parameters that can flexibly fit this skewed distribution. Since determining the shift change time only involves judging the integral size, rather than actually calculating the shift change probability, the gamma distribution function does not need to be normalized to make its integral equal to 1. The specific approach involves two steps: The first step is to extract the periods when the vehicle is stationary. When drivers change shifts, the vehicle will stop in a certain place, and its speed will be 0. From the TBOX data, find all consecutive periods of stationary time for a particular vehicle on a given day, for example: Time period 1: 03:10–03:25; Time period 2: 04:20–04:50; Time period 3: 05:30–05:45.
[0033] The second step involves integrating the gamma distribution function over each time period to construct a probability density function of the gamma distribution. Its shape parameters are set empirically (e.g., to make the peak around 4:30). For each static time period Calculate the integral: This integral value represents the probability that a shift change will occur within a given time period, assuming the shift change time follows a gamma distribution. The time period with the largest integral is determined as the actual shift change time for that day. It's important to note that since we don't need to calculate the actual probability value here, but only compare the integrals across different time periods, the unnormalized gamma function shape can be used directly. The shift schedule only indicates "early shift," but doesn't specify whether the driver picks up at 4:00 or 5:30. Simply taking 4:00 as the shift change time would incorrectly assign data before 4:00 to early shift drivers, when that time period actually belongs to late shift drivers, leading to statistical errors in indicators such as rapid acceleration and driver fatigue. By using a weighted integral of the vehicle's stationary position and the gamma distribution, historical statistical patterns (such as peak shift change times around 4:30) can be used to correct the possible shift change time for a single vehicle on that day. Even if a vehicle has multiple stationary periods due to refueling or charging, the shift change time that best aligns with industry practices can be selected. Therefore, the gamma distribution is not used for probability prediction in this application, but is used as a "weighting function" to assign different weights to the static periods at different time points (with the highest weight around 4:30 am), thereby selecting the most reasonable shift change time from multiple candidate static periods, and finally accurately assigning vehicle operation data to the corresponding drivers, thereby improving the data quality of subsequent driving behavior scoring and fault probability models.
[0034] This invention employs an unnormalized gamma distribution probability density function to perform weighted integration on vehicle stationary periods, fully utilizing the actual distribution pattern of shift change times (sharper on the left, gradual on the right, peaking at 4:30) to select the shift change time that best aligns with industry practices from multiple candidate stationary periods. Validated with 100,000 actual vehicle trips, compared to fixed time point segmentation (e.g., default 4:00 shift change), this method improves the accuracy of assigning driving behavior data to the correct driver by approximately 28%, and reduces the statistical error of indicators such as rapid acceleration and deceleration at 0-100 km / h by more than 30%, providing high-reliability sample features for subsequent model training.
[0035] S30: Based on the actual shift change time, vehicle operation data is divided into corresponding drivers and shifts. The driving behavior index per 100 kilometers for each driver and shift is calculated. At the same time, the quantitative value of the weather severity corresponding to the shift is associated to form sample features. If a fault occurs in the shift that is the driver's fault, the severity of the fault is used as the sample label, and a training sample set is constructed. In a preferred embodiment of the present invention, based on the accurate shift change time, the continuous data stream of real-time vehicle operation status data obtained from the vehicle's TBOX can be segmented by shift and assigned to specific drivers and shifts (early shift / late shift / special shift), thereby constructing a "driver-shift" level sample. For example: Vehicle V001's shift change time on June 1, 2024 is 04:32. Therefore, the shift for early shift driver D01 is from 04:32 to 16:00 (or the next shift change time), and the shift for late shift driver D02 is from 16:00 of the previous day to 04:32 of the following day. Then, for each driver's shift, driving behavior indicators based on the frequency per 100 kilometers can be calculated. For example, the calculation method for the number of rapid accelerations per 100 kilometers is as follows: This also allows us to calculate indicators such as the number of times we decelerate rapidly at 100 km / h, the number of times we make sharp turns at 100 km / h, the number of times we speed at 100 km / h, the number of times we drive while fatigued at 100 km / h, the number of times we smoke at 100 km / h, and the number of times we make phone calls at 100 km / h. The calculation method is the same as that for the number of times we accelerate rapidly at 100 km / h. After calculating the above indicators, they can be used as one of the core sample features of the subsequent model.
[0036] Furthermore, the sample features also include another weather indicator feature linked to external data. Weather data is retrieved from MySQL, showing the day's weather conditions, such as heavy rain, extreme heat, and strong monsoons. The severity of the weather is digitized, with clear skies representing 0 and increasing values for more severe conditions, up to the maximum of torrential rain or blizzard. The weather data for a specific shift is combined with the 100-kilometer data. If a shift spans multiple weather periods, such as severe fog in the first half of the morning shift followed by clear skies at noon, the most severe period is selected, for example, the severe fog. The sample features are constructed by combining the driving behavior indicators of vehicle frequency per 100 kilometers within a specific shift with the corresponding weather conditions. Sample features may also include time features (such as the start hour of the shift, day of the week, and whether it is a public holiday) and vehicle features (such as the total mileage driven and the vehicle's age).
[0037] Furthermore, when a vehicle malfunctions and is reported, the administrator will handle the malfunction. If the malfunction occurs within a specific shift, the severity of the malfunction (graded from 1 to 10) and the driver's percentage of responsibility will be determined based on video footage. If the driver is at fault (responsibility percentage > 0), the severity of the malfunction will be included in the driver's corresponding 100km data record for that shift. Therefore, sample labels can be of two types: binary labels, indicating whether a driver-attributable malfunction occurred within that shift (yes = 1, no = 0). "Driver-attributable" means that the driver bears primary responsibility for the malfunction (responsibility percentage > 50%) as determined by video review. The other type is multi-class labels, where if a driver-attributable malfunction occurs, the severity of the malfunction is recorded (1-10); otherwise, the severity is 0. This embodiment primarily uses binary classification, but the model output can be expanded to predict malfunction severity. It should be noted that vehicle malfunctions can be used as sample labels to predict whether malfunctions will occur in the future, or as sample features to determine the number of malfunctions and the severity of each malfunction over a period of time. Combined with driving behavior over a period of time and the corresponding weather, it can be used to predict whether a malfunction will occur on that shift that day. Thus, the sample features and sample labels together form a training sample set. All shift samples for all drivers can be constructed according to the above method for subsequent model use. For example, about 100,000 sample data are generated to form a sample set, of which about 5,000 are positive samples (malfunction = 1), accounting for 5%.
[0038] It should be noted that all of the above features can be pre-trained and used for subsequent model training. In practical applications, redundant features can be eliminated through feature importance analysis, but the initial model retains all features.
[0039] The system records the severity of the fault (1-10) and the driver's liability percentage, and generates a binary label (whether the driver is at fault). This design not only meets the current version's requirement to predict the probability of fault occurrence, but also retains a data foundation for future expansion to multi-class or regression tasks that predict fault severity, demonstrating good scalability.
[0040] S40: Use the training sample set as input parameters, train the model using the LightGBM algorithm, with the objective function being the binary log loss, determine the number of boost rounds through cross-validation, and save the trained model and standardized parameters. In a preferred embodiment of the present invention, all samples are first divided chronologically: the last 30 days' data are used as the test set, and the rest as the training set. The training set is then further divided into a training subset and a validation subset in an 8:2 ratio. Next, the sample features are preprocessed, categorized into two types: continuous features (such as driving behavior characteristics, weather severity, time characteristics, historical average characteristics, total vehicle mileage, and vehicle age) and standardized. The mean of each feature in the training set is then calculated. and standard deviation Then for each sample, this feature value implement: Standardized parameters Features need to be saved for reuse in the prediction phase. Another type is categorical features, such as shift type, day of the week, and other weather indicators and time features. For categorical features, target encoding or one-hot encoding is used, such as early shift [1,0,0], late shift [0,1,0], special shift [0,0,1], preserving the order. Since the number of fault samples (positive samples) is far less than the number of normal samples (negative samples), direct training would cause the model to be biased towards the majority class. This embodiment uses a combination of two methods, setting the parameters during LightGBM training. The system automatically adjusts sample weights to ensure the sum of positive and negative sample weights is equal. Optionally, SMOTE (Synthetic Minority Oversampling) can be used to generate minority class samples on the training set, but attention must be paid to the time series characteristics to avoid future information leakage. Two methods are used to address sample imbalance.
[0041] Furthermore, during the LightGBM model training process, the LightGBM gradient boosting decision tree framework was used to train a binary classification model to predict the probability of a driver committing a fault at fault during a given shift. The model parameters were configured as follows: the objective function was selected as binary log loss (…). That is, minimizing cross-entropy; the number of boost rounds is determined by the early stopping method, and the initial settings are... If the AUC on the validation set shows no improvement for 20 consecutive rounds, the process stops; the tree depth is limited to a maximum of 6 layers to prevent overfitting; the learning rate... To complement early stopping, use a smaller learning rate; Number of leaf nodes: (not exceeding) Subsampling: , This increases randomness; the class weights are automatically balanced, making the weight of the minority class (faulty samples) inversely proportional to that of the majority class.
[0042] Furthermore, the training process first involves training the feature matrix of the subset. and tags Input the model, use the validation subset as the evaluation set, and monitor the AUC and logloss on the validation set. During training, calculate the validation set metrics every 5 iterations. When the validation set AUC no longer improves for 20 consecutive iterations, training automatically terminates and rolls back to the model with the optimal number of iterations. To improve model stability, perform 5-fold cross-validation on the training subset. Randomly divide the training subset into 5 equal parts, and alternately use 4 parts as the folded training set and 1 part as the folded validation set to train 5 models. The average AUC of each model on the validation set is used as the model performance estimate. The final model is trained using the entire training subset, but the parameters are the optimal parameters determined by cross-validation. After training, save the following: LightGBM model file ( ), feature standardization parameters ( ), including the mean of each continuous feature and standard deviation And a list of feature names (used for verification during prediction).
[0043] The trained LightGBM binary classification model, labeled with "whether a driver-attributable fault occurred," integrates driving behavior indicators, weather severity, time features, driver historical statistics, and vehicle characteristics to output the fault probability for future shifts. In practical applications, the actual fault rate of the top 10% of drivers in terms of predicted probability is 6.8 times higher than that of the bottom 10%, demonstrating strong discriminative ability. This allows managers to shift from post-event accountability to pre-event intervention, reducing the overall accident rate. Overfitting is effectively prevented through early termination (stopping if the validation set AUC does not improve for 20 consecutive rounds), maximum depth limit (6 layers), subsampling (0.8), feature sampling (0.8), and 5-fold cross-validation. On the independent test set, the difference between the training and test set AUCs is less than 0.03, demonstrating excellent generalization performance.
[0044] S50: Based on the target driver's current shift information, obtain the corresponding driving behavior index per 100 kilometers, the severity of the weather on that day, time characteristics, and historical driving statistical characteristics to form the feature vector of the sample to be predicted. In a preferred embodiment of the present invention, for a new sample to be predicted (i.e., a certain shift that a driver is about to begin), the same feature extraction and preprocessing as in the training phase are performed (using the saved data). (After standardization), the model prediction method is called: in To determine the probability of a driver-at-fault fault occurring during this shift, the feature vector of this sample is input into the trained LightGBM model.
[0045] S60: Input the feature vector into the trained model, the model outputs the predicted probability value of the driver's at-fault fault in the current shift, and maps the predicted probability to a driving behavior score, and outputs the driving behavior score; In a preferred embodiment of the present invention, the LightGBM model outputs a probability value between 0 and 1. This represents the predicted probability of a driver-in-charge malfunction occurring during this shift. For ease of understanding and evaluation, the predicted probability will be... Mapped to driving behavior scores between 15 and 95 points This ensures that the rating distribution of all drivers approximates a normal distribution (mean 55 points, standard deviation 20 points).
[0046] Furthermore, predicting probabilities Mapped to driving behavior scores between 15 and 95 points The mapping method involves first collecting the predicted probabilities of all samples from the past month. Calculate its cumulative distribution function. For each new probability Find its corresponding standard normal quantile. ,in This is the inverse function of the standard normal distribution. Linear mapping to the interval [15, 95]: in , For historical samples The minimum and maximum values (usually taken as the quantiles corresponding to -2.5 and 2.5). The final score is rounded to the nearest integer. If no historical probability distribution is available, the initial settings can be used: At this point, the score is given. (After truncation), if the calculated value exceeds [15, 95], it is truncated to the boundary value, and the calculated score is then... The data is stored in the database, linked to driver ID, shift time, and vehicle ID, and can be pushed to the fleet management terminal or driver app. As new fault data is generated, incremental training is performed periodically (e.g., weekly): the saved LightGBM model is loaded, and the model is further trained using the newly added sample data. Update the feature standardization parameters and recalculate the score mapping. , The incrementally trained model replaces the old model for subsequent predictions. This ensures that the scoring model always adapts to the current driving environment and changes in driver behavior. Accurate shift change times ensure the purity of each driver's behavioral data, while LightGBM can capture non-linear relationships and feature interactions, thus providing reliable fault probability predictions, which are ultimately transformed into intuitive scores.
[0047] Furthermore, during the scoring mapping process, the system dynamically maintains the cumulative distribution function of the predicted probabilities of all samples within a rolling time window (e.g., the past 30 days). Whenever a new batch of predicted data is added, the system automatically recalculates the cumulative distribution function within that time window and updates the parameters used for scoring mapping (including...). , In this way, the quantile position corresponding to the current failure probability will be determined based on the latest historical probability distribution, enabling the score to reflect the overall risk level in the recent period and avoiding score distortion due to outdated historical data. This dynamic update mechanism and the incremental training of the model are independent of each other but work together to ensure the timeliness of the scoring system.
[0048] The predicted probabilities are mapped to a range of 15-95 points using a cumulative distribution function and standard normal quantiles, ensuring that all driver scores approximate a normal distribution (mean 55 points, standard deviation 20 points). A score of 95 represents excellent driving behavior, and 15 points represents very poor behavior, making the information intuitive and easy to understand. Furthermore, because the mapping function is based on a dynamically updated historical probability distribution, the meaning of the same score remains stable across different time periods, facilitating the establishment of uniform reward and punishment thresholds (e.g., triggering safety training below 40 points). An incremental training mechanism (loading new data weekly) is also implemented. (Continued training) enables the model to adapt to changes in driver behavior, seasonal weather patterns, and new driving risks. For example, when heavy rains increase in summer, the model automatically increases the weight of severe weather to avoid underestimating the risk of rainy days due to the dominance of sunny days in the training data. Compared to retraining on the full dataset, incremental training saves approximately 80% of computational resources.
[0049] By utilizing the above method and weighted integral of the gamma distribution to determine the actual shift change time, vehicle operation data is correctly assigned to the corresponding driver and shift. This reduces the statistical error of indicators such as rapid acceleration and deceleration per 100 kilometers, improves the accuracy of data assignment, and provides high-quality training samples for the model. The probability value output by the model represents "the possibility of a driver-attributable fault occurring in this shift in the future," realizing the transformation from post-event statistics to pre-event prediction. Fleet managers can provide safety reminders or training to high-risk drivers in advance, making fault prediction a prerequisite and reducing the actual fault rate. Mapping the probability to a normal distribution score of 15-95 points avoids the problem of the original probability values being too small (mostly between 0.01-0.30) and not intuitive. 95 points represents excellent, and 15 points represents very poor, which conforms to human intuitive cognition. At the same time, the normal distribution characteristic makes the meaning of the same score stable at different time periods, which is convenient for setting reward and punishment thresholds (such as below 40 points being a red warning). Through multiple methods such as early stopping, maximum depth limit, subsampling, and cross-validation, the overfitting degree of the LightGBM model on the test set is controlled within 3%, demonstrating strong generalization ability. The incremental training module updates the model periodically, enabling the scores to reflect recent changes in driver behavior. For example, during periods of increased heavy rainfall in summer, the model automatically increases the weight of severe weather, rather than underestimating the risk of rainy days even if the training data is dominated by sunny days.
[0050] Therefore, this method solves several technical problems in the existing technology, such as ambiguous shift change time, lack of predictability in scoring, neglect of external environmental influences, and static model, and realizes a technical leap from "post-event deduction" to "proactive risk scoring" of taxi driver driving behavior.
[0051] Corresponding to a method for predicting taxi driver driving behavior scores, this invention also provides a system for predicting taxi driver driving behavior scores, specifically, as follows: Figure 2 As shown, the taxi driver driving behavior scoring prediction system of this application includes: a data acquisition module 100, a data processing module 200, a model training module 300, an incremental training module 400, and a scoring prediction module 500.
[0052] Data acquisition module 100 is used to collect vehicle operating status data, weather data, historical fault data and driver scheduling information; Specifically, the data acquisition module connects to both a MongoDB database and a MySQL database. It reads real-time vehicle status data reported every 5 seconds from the taxi's TBOX from MongoDB. This data includes at least: vehicle ID, timestamp, and vehicle speed. ), latitude and longitude, total mileage ( The system includes signs for sudden acceleration, sudden deceleration, sharp turns, sudden lane changes, speeding, fatigued driving, smoking while driving, and using a mobile phone while driving. It reads daily weather conditions and their severity values (0 for sunny, 10 for torrential rain or snow) from MySQL, as well as historical vehicle fault records (including vehicle ID, fault occurrence time, fault severity 1-10, and whether it was third-party liability) and driver scheduling information (date, vehicle ID, driver ID, shift type, including early shift, late shift, and special shift). The data acquisition module stores raw data in an internal buffer by time partitioning and records the time range of the data for subsequent modules to use.
[0053] The data processing module 200 is used to calculate the actual shift change time based on the vehicle stationary time period and gamma distribution, divide the vehicle operation data into the corresponding drivers and shifts according to the shift change time, count the driving behavior index per 100 kilometers for each shift, and associate it with weather and fault labels to generate structured training samples. Specifically, such as Figure 3 As shown, the data processing module 200 includes a shift change time calculation unit 201, a driving behavior characteristic statistics unit 202, and a feature association unit 203.
[0054] Furthermore, the shift change time calculation unit 201 calculates all consecutive time periods (start time) during which the vehicle speed is zero for each vehicle each day. End time Construct the unnormalized gamma distribution probability density function. Shape parameters Scale parameters This causes the function peak to occur at 4:30 AM. The integral is calculated for each static time interval: The time period with the largest integral value is selected as the actual shift change time for that vehicle on that day. The gamma distribution is not normalized and is only used to compare the integral values of different time periods.
[0055] Furthermore, the driving behavior characteristic statistics unit 202, based on the actual shift change time, segments the vehicle operation data to drivers corresponding to early shifts, late shifts, or special shifts, and calculates the driving behavior indicators per 100 kilometers for each driver per shift, including: the number of times the vehicle accelerates rapidly per 100 kilometers, the number of times it decelerates rapidly per 100 kilometers, the number of times it makes sharp turns per 100 kilometers, the number of times it changes lanes sharply per 100 kilometers, the number of times it speeds per 100 kilometers, the number of times the vehicle is fatigued while driving per 100 kilometers, the number of times the vehicle smokes while driving per 100 kilometers, and the number of times the vehicle is used for phone calls while driving per 100 kilometers. The specific calculation method is: the total number of times a certain event occurs within the shift divided by the total mileage of the shift (in 100 kilometers).
[0056] Furthermore, the feature association unit 203 merges the aforementioned 100km driving behavior index with the quantified value of the weather severity for the current shift; if multiple weather conditions occur within a shift, the quantified value of the most severe weather is taken. Simultaneously, based on historical fault data, if a fault occurs during the shift where the driver is at fault (verified by video review as the driver bearing primary responsibility, with a responsibility ratio > 50%), the sample label is set to 1, and the fault severity (1-10) is recorded as auxiliary information; otherwise, the label is set to 0. The feature association unit also extracts the following additional features: time features (starting hour of shift, day of the week, whether it is a statutory holiday), driver historical features (the driver's average 100km driving behavior index and historical fault count in the past 7 days), and vehicle features (total mileage, vehicle age). This generates a feature matrix and a corresponding label vector, with each sample corresponding to one driver's shift.
[0057] The model training module 300 is used to preprocess the training samples generated by the data preparation module, train the model using the LightGBM algorithm, and save the model and preprocessing parameters. Specifically, the model training module first divides the samples chronologically: the data from the last 30 days is used as the test set, and the rest as the training set; the training set is then further divided into a training subset and a validation subset in an 8:2 ratio. Then, the following feature preprocessing operations are performed: First, feature standardization is performed. For continuous features (including driving behavior indicators per 100 kilometers, weather severity, start time, day of the week, average of the past 7 days, total mileage, vehicle age, etc.), the mean of each feature on the training subset is calculated. and standard deviation Z-score standardization is performed on each sample feature of the training subset, validation subset, and test set respectively: . save and To standardize the parameter file. Encode categorical features, and perform one-hot encoding on shift types (early shift, late shift, special shift); retain the day of the week as an integer (1-7). For features with imbalanced samples, since the number of faulty samples (positive samples) is much smaller than the number of normal samples (negative samples), class weights are set during training. This ensures that the sum of the weights of positive and negative samples is equal; alternatively, the SMOTE algorithm can be applied to the training set to generate minority class samples, but these must be done in chronological order to avoid future information leakage.
[0058] After preprocessing, the module is configured with a LightGBM binary classifier, and the objective function is set to binary log loss. The evaluation metric is AUC, the maximum tree depth is 6, the learning rate is 0.05, the number of leaf nodes is 31, the subsampling rate is 0.8, the feature sampling rate is 0.8, and the class weights are... The training process employs early stopping on the validation set: training stops if the validation set AUC does not improve for 20 consecutive rounds. Simultaneously, 5-fold cross-validation is performed to assess model stability. The final model is retrained using the entire training set (training subset + validation set) and saved as a model file. The module also saves a list of feature names for input validation during prediction.
[0059] The incremental training module 400 is used to periodically update the model incrementally as new fault data accumulates, so that the model can adapt to changes in driving behavior. Specifically, the incremental training module is triggered weekly. First, it loads the saved model file and standardized parameters. Then, it retrieves newly added data samples (features and labels) with confirmed labels from the database within the previous week. The new data undergoes the same feature engineering and standardization processes as in the training phase (using existing data). Setting up the LightGBM model The model is trained for up to 50 more epochs with a low learning rate (e.g., 0.01), while the validation set AUC is monitored to prevent overfitting. If the amount of new data exceeds 10% of the original training set size, the standardized parameters are recalculated. After training is complete, the updated model and standardized parameters are saved, replacing the old file, for use by the scoring prediction module.
[0060] The rating prediction module 500 is used to load the pre-trained model and standardized parameters, output the failure probability of the driver shift sample to be predicted, and convert the probability into a driving behavior rating. Specifically, such as Figure 4 As shown, the rating prediction module 500 includes a fault probability prediction unit 501, a rating conversion unit 502, and a rating output unit 503. The fault probability prediction unit 501 receives the features of the sample to be predicted (including driving behavior indicators per 100 kilometers, weather severity, time features, driver history features, and vehicle features) from the data processing module. First, it loads the standardized parameters saved by the model training module. The same Z-score normalization is performed on the continuous features of the samples to be predicted; the class encoding map is loaded for encoding. Then the trained LightGBM model is loaded, and the model's... The function outputs the probability that the sample belongs to the positive class (a fault where the driver is at fault). , The scoring conversion unit 502 collects the probability values of all predicted samples from the past 30 days and calculates their empirical cumulative distribution function. For the current probability Find its standard normal quantile. ,in This is the inverse function of the cumulative distribution function of the standard normal distribution. Based on historical samples... The 2.5% and 97.5% quantiles were determined. and ,Will Linear mapping to the interval [15, 95]: If no historical distribution is available, use the initial boundary. , ,at this time .right The system performs boundary truncation (rounding down to 15 for scores below 15 and 95 for scores above 95) and rounds to the nearest integer. The scoring output unit 503 stores the calculated score S in the results database, associating it with the driver ID, shift time, and vehicle ID; simultaneously, it pushes the score to the fleet management terminal or driver APP for display via API or message queue.
[0061] Through the cooperation of the above system modules, each module interacts with the others via standardized data interfaces, while remaining internally independent. For example, if the data source needs to be changed from MongoDB / MySQL to a Kafka message queue, only the data acquisition module 100 needs to be modified; if the machine learning algorithm needs to be replaced from LightGBM to XGBoost or a deep network, only the model training module 300 needs to be updated, and the other modules do not need to be modified. This architecture design significantly reduces long-term operation and maintenance costs and is easy to maintain and upgrade. The fault probability prediction unit 501 in the scoring prediction module 500 can process historical data offline in batches (such as calculating all shifts from the previous day at midnight) and can also receive real-time requests via API (such as predicting the driver's upcoming shift). The system can be deployed as a hybrid architecture of scheduled tasks and online services to meet the business needs of taxi companies for both daily assessments and real-time safety warnings. The feature association unit 203 simultaneously outputs binary classification labels (whether the fault is at fault) and fault severity values (1-10), and the model training module 300 reserves interfaces for multi-classification / regression branches. In the future, if direct prediction of fault severity is required, there is no need to redesign the entire system; only the loss function and output layer of the model training module 300 need to be adjusted. The feature association unit 203 also supports dynamically adding feature fields (such as adding a "road congestion index"), offering strong scalability. The shift change time calculation unit 201 adopts an unnormalized gamma distribution, eliminating the overhead of normalization coefficient calculation; LightGBM reduces memory usage by approximately 30% compared to traditional GBDT. With 100,000 vehicles and approximately 17,280 TBOX data points per vehicle per day (5 seconds / data point), a single 8-core 32G server can complete daily incremental training and real-time prediction, meeting actual operational requirements. All modules generate operation logs, and the raw data and scoring results are associated through driver ID, vehicle ID, and shift time for easy auditing. The model training module 300 synchronously records the start and end times of the training data, feature list, hyperparameters, and standardized parameters each time the model is saved; the incremental training module 400 saves the new version of the model and retains the old version after each update, supporting one-click rollback. The rating prediction module 500 can be configured to use a specified version of the model for backtesting. The rating output unit 503 pushes the rating to the fleet management terminal or driver APP via API or message queue, and also supports custom alarm rules (e.g., automatically generating a safety warning work order and pushing it to the fleet safety officer if the rating is below 30 points for three consecutive days or below 20 points on a single day). The system achieves full-link automation from data collection to rating to alarm to intervention. The data collection module 100 can isolate data by city or fleet identifier, and the model training module 300 can train dedicated models for different cities (which may vary due to shift change patterns and weather characteristics). The rating prediction module 500 automatically loads the corresponding model based on the request source. The system supports multi-tenant mode and is easy to promote to multiple taxi companies.
[0062] In summary, this system achieves high-precision scoring and prediction while also considering engineering maintainability, scalability, resource efficiency, and operability, providing a complete technical solution for the taxi industry.
[0063] Based on the above embodiments, the present invention also provides a smart terminal, the principle block diagram of which is as follows: Figure 5 As shown, the aforementioned smart terminal includes a processor, memory, network interface, and display screen connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and a taxi driver driving behavior scoring prediction program. The memory provides an environment for the operation of the operating system and the taxi driver driving behavior scoring prediction program stored in the non-volatile storage medium. The network interface of the smart terminal is used for communication with external terminals via a network connection. When the taxi driver driving behavior scoring prediction program is executed by the processor, it implements the steps of any of the aforementioned taxi driver driving behavior scoring prediction methods. The display screen of the smart terminal can be a liquid crystal display (LCD) or other types of display screens.
[0064] Those skilled in the art will understand that Figure 5 The block diagram shown is merely a partial structural diagram related to the present invention and does not constitute a limitation on the smart terminal to which the present invention is applied. A specific smart terminal may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0065] In this embodiment of the invention, a smart terminal is provided, comprising a memory, a processor, and a taxi driver driving behavior scoring prediction program stored in the memory and executable on the processor. When the taxi driver driving behavior scoring prediction program is executed by the processor, it performs the following operation instructions: The system retrieves taxi operation status data from MongoDB and weather severity quantification, historical vehicle malfunction records, and driver scheduling information from MySQL. For each taxi, for all consecutive time periods when the speed is 0 each day, the probability density function of the gamma distribution is used to integrate each time period, and the time period with the largest integral value is selected as the actual shift change time. The vehicle's operational data is matched with the corresponding driver and shift based on the actual shift change time. The driving behavior indicators for each driver per 100 kilometers per shift are statistically analyzed and correlated with the quantitative value of the weather severity corresponding to that shift, which together constitute the sample features; The severity of driver malfunction is used as the sample label, and the sample features and sample labels are matched to construct a training sample set; The training sample set is used as input parameters to train the LightGBM algorithm model. The number of boost rounds is determined through cross-validation, and the trained model and standardized parameters are saved. Use the training sample set to validate and optimize the trained model, and save the optimized model. The driver's current shift information and corresponding driving behavior indicators per 100 kilometers, the severity of the weather on that day, time characteristics, and historical driving statistics are obtained to form a feature vector with predictive samples. The feature vector is input into the trained model, which outputs the predicted probability of the driver committing a fault at fault in the current shift. The predicted probability is then mapped to a driving behavior score, which is then output.
[0066] This invention also provides a computer-readable storage medium storing a taxi driver driving behavior scoring prediction program. When executed by a processor, the taxi driver driving behavior scoring prediction program implements the steps of any taxi driver driving behavior scoring prediction method provided in this invention.
[0067] It should be understood that this application has been described through some embodiments, and those skilled in the art will recognize that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of this application. Furthermore, based on the teachings of this application, these features and embodiments can be modified to suit specific circumstances and materials without departing from the spirit and scope of this application. Therefore, this application is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of this application.
Claims
1. A method for predicting taxi driver driving behavior scores, characterized in that, Includes the following steps: Acquire vehicle operating status data, weather data, historical fault records, and driver scheduling information; Based on the continuous time period when the vehicle speed is zero, the gamma distribution is used to perform weighted integration on each time period, and the time period with the largest integral value is selected as the actual shift change time. Based on the actual shift change time, the vehicle operation data is divided into corresponding drivers and shifts, driving behavior indicators for each shift are statistically analyzed, weather data and fault labels are associated, and a training sample set is constructed. The gradient boosting decision tree algorithm is used to train the training sample set to obtain a classification model for predicting the probability of failure. The current shift features of the driver to be predicted are obtained, input into the classification model to obtain the fault probability, and the fault probability is mapped to a driving behavior score and then output.
2. The scoring prediction method according to claim 1, characterized in that: In the process of using a gamma distribution to perform weighted integration on each time period based on a continuous time period where the vehicle speed is zero, and selecting the time period with the largest integral value as the actual shift change time, the following steps are included: The parameters of the gamma distribution are set so that the peak of its probability density function is located in the preset shift change peak period, and the gamma distribution is not normalized, but only used to compare the integral size of each static time period.
3. The scoring prediction method according to claim 2, characterized in that, The weighted integration of the static time period using the gamma distribution includes: Based on the taxi shift change habits in the city where the vehicle is located, the shape and scale parameters of the gamma distribution are pre-set so that the peak of the probability density function is located near the peak shift change period, and the probability density function exhibits an asymmetric unimodal shape before and after the peak period.
4. The scoring prediction method according to claim 1, characterized in that: The process of training the training sample set using the gradient boosting decision tree algorithm to obtain a classification model for predicting fault probabilities includes: Standardize the continuous features in the training sample set and save the standardized parameters; Encode categorical features; Early stopping and / or cross-validation are used to determine the model training parameters; Save the trained model and the standardized parameters.
5. The scoring prediction method according to claim 1, characterized in that: The process of obtaining the current shift features of the driver to be predicted, inputting them into the classification model to obtain the fault probability, and mapping the fault probability to a driving behavior score before outputting the result includes: Based on the distribution of historical predicted probabilities, the current failure probability is converted into a standard normal quantile, then linearly mapped to a preset scoring interval, and the boundary values are truncated and rounded.
6. The scoring prediction method according to claim 5, characterized in that: The mapping of fault probability to driving behavior score includes: The cumulative distribution function of historical predicted probabilities is dynamically maintained. Based on the quantile position of the current fault probability in the cumulative distribution function, it is converted into a standard normal quantile and then mapped to a preset scoring interval. The cumulative distribution function is updated periodically with new predicted data.
7. The scoring prediction method according to claim 1, characterized in that: The process of training the training sample set using the gradient boosting decision tree algorithm to obtain a classification model for predicting fault probabilities also includes an incremental training step, which periodically loads the saved model, uses newly added sample data to continue training the model, and updates the standardized parameters.
8. A taxi driver driving behavior scoring and prediction system, characterized in that, It includes a data acquisition module, a data processing module, a model training module, and a score prediction module; The data acquisition module is used to collect vehicle operating status data, weather data, historical fault data, and driver scheduling information; The data processing module is used to calculate the actual shift change time based on the vehicle stationary time period and gamma distribution, divide driver shifts according to the shift change time, statistically analyze driving behavior indicators and associate them with weather and fault labels, and generate a training sample set. The model training module is used to preprocess the training sample set, train the classification model using the gradient boosting decision tree algorithm, and save the model and preprocessing parameters. The rating prediction module is used to load the trained model, output the failure probability of the sample to be predicted, and convert it into a driving behavior rating.
9. A smart terminal, characterized in that, The smart terminal includes at least one memory, at least one processor, and a taxi driver driving behavior scoring prediction program stored in the memory and executable on the processor. When the taxi driver driving behavior scoring prediction program is executed by the processor, it implements the steps of a taxi driver driving behavior scoring prediction method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a taxi driver driving behavior scoring prediction program, which, when executed by a processor, implements the steps of a taxi driver driving behavior scoring prediction method as described in any one of claims 1-7.