Method, device and equipment for analyzing characteristic parameters influencing traffic safety

Through in-depth processing and importance analysis of multi-source traffic data, identifying influencing factors under traffic conditions, the problems of incomplete data processing and insufficient interpretation in the existing technology are solved, and the reliability and interpretation of traffic safety analysis are improved. , help develop effective traffic safety strategies.

CN119274346APending Publication Date: 2025-01-07ZHEJIANG TRANSPORTATION GROUP TECHNICAL RESEARCH INSTITUTE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411556110.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The prior art has incomplete multi-source data processing in traffic safety analysis, unreliable selection of feature parameters, and insufficient interpretation, resulting in low reliability and interpretation of analysis results.

Method used

Multiple types of traffic monitoring data and traffic accident data are used to process missing data by generating adversarial networks, detect outliers in combination with isolated forest algorithms, use the improved XGBoost model and SHAP model for importance analysis, and combine the Bayesian inference model for deep mining and Explain, identify factors influencing under different traffic conditions.

Benefits of technology

Improve the data integrity and consistency of traffic safety analysis, enhance the interpretability of the analysis results, effectively reveal the complex relationship between traffic status and traffic accidents, provide scientific basis to formulate more effective traffic safety strategies, and reduce traffic accidents , improve road traffic safety and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119274346A_ABST
    Figure CN119274346A_ABST
Patent Text Reader

Abstract

The invention provides an analysis method, device and equipment for characteristic parameters influencing traffic safety, and relates to the technical field of road traffic safety analysis, and the method comprises the steps: for any type of target traffic monitoring data, calculating the corresponding statistics of the type of target traffic monitoring data at different time lengths; inputting the target traffic monitoring data of the type into the trained improved XGBoost model to obtain an importance score of the target traffic monitoring data of the type; performing importance analysis on the target traffic monitoring data of the type to obtain an importance analysis result of the target traffic monitoring data of the type; and analyzing the importance score of the target traffic monitoring data of the type under any duration and the corresponding importance analysis result to obtain an influence result of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on the traffic accident. According to the invention, the accuracy and interpretability of traffic safety analysis are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of road traffic safety analysis, and in particular, to a method, device and equipment for analyzing characteristic parameters that affect traffic safety. Background Art

[0002] As the traffic volume on highways continues to increase, the increasingly complex traffic situation has brought great challenges to road management units in accurately assessing road safety levels and controlling traffic risks. Traditional traffic safety analysis methods usually rely on a single data source and simple statistical analysis, which makes it difficult to fully and accurately reflect the impact of traffic flow characteristics on traffic safety.

[0003] In the existing technology, although some technologies try to use multi-source traffic flow data for traffic safety analysis, most of them fail to fully consider the integrity, consistency and diversity of the data, and fail to effectively apply advanced machine learning technology to conduct in-depth mining and analysis of the data. In addition, the research and combination of feature parameter selection and model interpretability are relatively insufficient, resulting in low reliability and interpretability of the analysis results. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device and equipment for analyzing characteristic parameters that affect traffic safety, so as to solve the above-mentioned problems existing in the prior art, namely, incomplete multi-source data processing, unreliable characteristic parameter selection and insufficient interpretability. The method can identify characteristic parameters that affect traffic safety under different traffic conditions, and help to intuitively understand the correlation between traffic flow characteristics and traffic safety, so as to formulate more effective traffic safety strategies, reduce the occurrence of traffic accidents, and improve the overall safety and efficiency of road traffic.

[0005] In a first aspect, a method for analyzing characteristic parameters affecting traffic safety is provided, and the method may include:

[0006] Acquire multiple types of traffic monitoring data and traffic accident data of the target monitoring area within a preset time period; wherein the traffic accident data includes: the time and location of the accident;

[0007] Based on the accident time and the accident location, extracting target traffic monitoring data associated with the traffic accident from multiple types of traffic monitoring data;

[0008] For any type of target traffic monitoring data, calculate the statistics corresponding to the target traffic monitoring data of the type at different time lengths;

[0009] At any time length, clustering the target traffic monitoring data of the type based on the statistics to obtain the traffic status at the time length;

[0010] Inputting the target traffic monitoring data of the type into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data of the type;

[0011] Using the pre-built SHAP model and Bayesian inference model, importance analysis is performed on the target traffic monitoring data of the type, and importance analysis results of the target traffic monitoring data of the type are obtained;

[0012] The importance scores of the target traffic monitoring data of the type under any duration and the corresponding importance analysis results are analyzed to obtain the impact results of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on the traffic accident.

[0013] In an optional implementation, before extracting target traffic monitoring data associated with the traffic accident from multiple types of traffic monitoring data based on the accident occurrence time and the accident location, the method further includes:

[0014] For any type of traffic monitoring data, input the traffic monitoring data of the type into a trained generative adversarial network to obtain traffic monitoring data of the type preprocessed; wherein the generative adversarial network is trained using historical traffic monitoring data of the same type as the input traffic monitoring data;

[0015] An isolation forest algorithm is used to identify outliers in the traffic monitoring data after the type of preprocessing, and the identified outliers are processed using the isolation forest algorithm to obtain the traffic monitoring data after the type of processing.

[0016] In an optional implementation, clustering the target traffic monitoring data of the type based on the statistics to obtain the traffic status under the duration includes:

[0017] Using the statistics corresponding to the target traffic monitoring data of the type, standardizing the target traffic monitoring data of the type;

[0018] Calculating attribute parameters of the target traffic monitoring data of the type after standardization processing;

[0019] For any of the target traffic monitoring data of the type, if the attribute parameters of the target traffic monitoring data meet the preset standard, the target traffic monitoring data is used as the cluster center of the target traffic monitoring data of the type;

[0020] Calculate the Euclidean distance between all target traffic monitoring data of this type and different cluster centers;

[0021] Based on the calculated Euclidean distance, all target traffic monitoring data of this type are divided into corresponding cluster centers;

[0022] For any cluster center, calculate the mean of the cluster center;

[0023] The obtained mean of the cluster centers is used as a new cluster center, and the step of returning to the execution step is: calculating the Euclidean distances of all target traffic monitoring data of the type from different cluster centers until the preset conditions are met, and outputting the classification results of the target traffic monitoring data of the type;

[0024] Based on the classification results corresponding to different types of target traffic monitoring data, the traffic status under the time length is obtained.

[0025] In an optional implementation, before inputting the target traffic monitoring data of the type into the trained improved XGBoost model, the method further includes:

[0026] For statistical parameters corresponding to the statistics of any type of target traffic data at any time length, obtaining a preset weight of the statistical parameter;

[0027] Taking the statistical parameter as an independent variable, performing regression analysis to obtain the coefficient of determination of the statistical parameter to other statistical parameters except the statistical parameter;

[0028] Subtracting the coefficient of determination from 1 to obtain a complex coefficient of determination of the statistical parameter;

[0029] Dividing the complex determination coefficient by the weight to obtain an adaptive weighted variance inflation factor of the statistical parameter;

[0030] Get the preset expansion factor screening threshold;

[0031] If the adaptive weighted variance inflation factor of the statistical parameter does not exceed the inflation factor screening threshold, the statistical parameter is used as the first target statistical parameter.

[0032] In an optional implementation, the target traffic monitoring data of the type is input into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data of the type, including:

[0033] Input the target traffic monitoring data corresponding to the first target statistical parameter into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data corresponding to the first target statistical parameter;

[0034] After obtaining the importance score of the first target traffic monitoring data of the type, the method further includes:

[0035] Get a preset parameter quantity threshold;

[0036] The importance score of the target traffic monitoring data corresponding to the first target statistical parameter is used as the importance score of the first target statistical parameter;

[0037] Arrange different first target statistical parameters in descending order according to their corresponding importance scores;

[0038] From the arranged first target statistical parameters, the first target statistical parameters having the same number as the parameter quantity threshold are selected to obtain the second target statistical parameters.

[0039] In an optional implementation, a pre-built SHAP model and a Bayesian inference model are used to perform importance analysis on the target traffic monitoring data of the type, including:

[0040] Using the pre-built SHAP model, the importance analysis of the second objective statistical parameters is performed to obtain the Shapley values ​​of different second objective statistical parameters;

[0041] Random sampling is performed from all second target statistical parameters to obtain different statistical parameter combinations composed of different second target statistical parameters;

[0042] Using the pre-built Bayesian inference model, traffic accidents are predicted for different statistical parameter combinations, and traffic accident prediction results corresponding to different statistical parameter combinations are obtained;

[0043] Based on the obtained traffic accident prediction results, the influence degree of different second target statistical parameters on the traffic accident prediction results is obtained;

[0044] Based on the Shapley values ​​and the corresponding degrees of influence on the traffic accident prediction results, importance analysis results of the second target statistical parameters are obtained.

[0045] In an optional implementation, the importance score of the target traffic monitoring data of the type under any duration and the corresponding importance analysis result are analyzed to obtain the impact result of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on the traffic accident, including:

[0046] For any second target statistical parameter, according to the positive or negative Shapley value of the second target statistical parameter, the influence direction of the second target statistical parameter on the traffic accident is obtained;

[0047] Taking the influence degree of the second target statistical parameter on the traffic accident prediction result as the influence degree of the second target statistical parameter on the traffic accident;

[0048] Based on the impact degree and the impact direction, obtaining an impact result of the second target statistical parameter on the traffic accident;

[0049] Based on the influence results of different second target statistical parameters on the traffic accident, the influence results of the type of target traffic monitoring data corresponding to the traffic state corresponding to the duration of each second target statistical parameter on the traffic accident are obtained.

[0050] In a second aspect, a device for analyzing characteristic parameters affecting traffic safety is provided, and the device may include:

[0051] An acquisition unit is used to acquire traffic monitoring data and traffic accident data of a target monitoring area within a preset time period; wherein the traffic accident data includes: the time and location of the accident;

[0052] An extraction unit, configured to extract target traffic monitoring data associated with the traffic accident from multiple types of traffic monitoring data based on the time of the accident and the location of the accident;

[0053] A calculation unit, for calculating, for any type of target traffic monitoring data, statistics corresponding to the target traffic monitoring data of the type at different time lengths;

[0054] A clustering unit, configured to cluster the target traffic monitoring data of the type based on the statistics at any time length to obtain the traffic status at the time length;

[0055] The analysis unit is used to input the target traffic monitoring data of the type into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data of the type; use the pre-built SHAP model and Bayesian inference model to perform importance analysis on the target traffic monitoring data of the type to obtain the importance analysis results of the target traffic monitoring data of the type; analyze the importance scores and corresponding importance analysis results of the target traffic monitoring data of the type under any duration to obtain the degree of influence of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on the traffic accident.

[0056] In a third aspect, an electronic device is provided, the electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0057] Memory, used to store computer programs;

[0058] The processor is used to implement any method step described in the first aspect when executing the program stored in the memory.

[0059] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.

[0060] The invented method can accurately evaluate the main safety influencing factors under different traffic conditions and provide interpretability of the model prediction results, which can effectively enhance the scientificity and effectiveness of traffic management and accident prevention.

[0061] This application collects various types of traffic monitoring data to ensure the comprehensiveness and integrity of traffic safety analysis data; this application uses generative adversarial networks (GANs) to process missing data, and combines the isolation forest algorithm to detect and correct outliers, thereby ensuring the reliability and consistency of traffic monitoring data and improving the accuracy of traffic monitoring data; this application uses advanced machine learning models such as k-means and XGBoost and explanatory analysis tools such as SHAP to further improve, optimize, deeply mine and analyze the pre-processed traffic monitoring data, highlighting the differences in safety influencing factors under different traffic conditions, and obtaining highly interpretable analysis results.

[0062] This application can effectively reveal the complex relationship between traffic conditions and traffic accidents, identify the main statistical parameters (i.e. safety influencing factors) in different traffic scenarios, distinguish the differences in influencing factors under different traffic conditions, and provide a scientific basis for traffic management and accident prevention. This application helps to intuitively understand the relationship between traffic conditions and traffic safety, so as to formulate more effective traffic safety strategies, reduce the occurrence of traffic accidents, and improve the overall safety and efficiency of road traffic.

[0063] This application improves the k-means clustering method based on the adaptive density peak clustering algorithm (ADPC), and divides the traffic state into free flow, congestion flow and transition state for refined analysis; statistical parameter screening is performed through adaptive weighted variance inflation factor (AWVIF) and recursive feature elimination (RFE), and statistical parameter subsets are optimized to improve model performance; the improved XGBoost model is combined with the adaptive Boosting (AdaBoost) method, and the model training is optimized through dynamic learning rate and early stopping strategy, and the Bootstrapping method is used for model verification to ensure the stability and generalization ability of the model. The importance of statistical parameters is analyzed through the SHAP model, combined with the uncertainty quantification analysis of Bayesian reasoning, to clearly explain the contribution of each statistical parameter to the model output, and compare the differences in safety influencing factors under different traffic conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0065] Figure 1 A flow chart of a method for analyzing characteristic parameters affecting traffic safety provided in an embodiment of the present application;

[0066] Figure 2 A schematic diagram of a method for analyzing characteristic parameters affecting traffic safety provided in an embodiment of the present application;

[0067] Figure 3 A schematic diagram of the structure of a device for analyzing characteristic parameters affecting traffic safety provided in an embodiment of the present application;

[0068] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0070] The analysis method of characteristic parameters affecting traffic safety provided in the embodiment of the present application can be applied in a server or in a terminal with strong computing power.

[0071] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.

[0072] Figure 1 The following is a flow chart of a method for analyzing characteristic parameters affecting traffic safety provided in an embodiment of the present application. Figure 1 As shown, the method may include:

[0073] Step S110, obtaining multiple types of traffic monitoring data and traffic accident data of the target monitoring area within a preset time period; based on the time and location of the accident, extracting the target traffic monitoring data associated with the traffic accident from the multiple types of traffic monitoring data.

[0074] In an embodiment of the present application, the preset time period is a plurality of complete time periods, and the target monitoring area includes locations along a plurality of roads; by pre-deploying ground sensing coils, radars, cameras and other monitoring equipment in the target monitoring area, a plurality of types of traffic monitoring data including macro traffic flow characteristics such as traffic flow, average speed and occupancy rate are collected, thereby obtaining sufficient, accurate and continuous multi-type traffic monitoring data that can be effectively matched, associated and integrated.

[0075] In an embodiment of the present application, an induction coil is embedded in the road surface, and is mainly used to count the flow rate and vehicle speed in the target monitoring area within a preset time period; a millimeter-wave radar is installed on the roadside to detect data such as the speed and distance of vehicles in the target monitoring area within a preset time period; a video surveillance camera is installed on the gantry to collect image data such as driving behavior and traffic events in the target monitoring area within a preset time period.

[0076] In the embodiment of the present application, the traffic accident data includes: the time of the accident, the location of the accident, the type and severity of the accident, etc. In the embodiment of the present application, the video or image data collected by the camera can be used to determine the speed, traffic flow, congestion level within a certain time period, and locate the time, location, type and severity of the traffic accident.

[0077] In one embodiment of the present application, by capturing the video of a certain time period as video frames, image analysis is performed on any video frame to obtain the vehicle density corresponding to the image acquisition time point; based on the vehicle density corresponding to all image acquisition time points within any time period, the collected traffic flow data can be corrected; by obtaining the speed of a vehicle by the displacement distance of the vehicle in two images at adjacent image acquisition time points, the collected traffic flow data can be corrected.

[0078] In another embodiment of the present application, by locating the time point of the traffic accident, images before and after the traffic accident are captured from the video, and the images before the traffic accident are analyzed to determine the vehicle that caused the traffic accident, the illegal operation of the vehicle, the speed, and other data; the images before and after the traffic accident are analyzed to determine the scope and severity of the damage caused by the traffic accident.

[0079] In the embodiment of the present application, the acquired multiple types of traffic monitoring data are data within a continuous time period, but missing values ​​or abnormal values ​​may appear during the collection process. Therefore, after collection, the acquired multiple types of traffic monitoring data need to be preprocessed for missing values ​​and blank values ​​to ensure the integrity and consistency of the traffic monitoring data. The specific steps are as follows:

[0080] For any type of traffic monitoring data, the traffic monitoring data of this type is input into a trained generative adversarial network to obtain the traffic monitoring data of this type after preprocessing; the outliers in the traffic monitoring data of this type after preprocessing are identified using the isolation forest algorithm, and the identified outliers are processed using the isolation forest algorithm to obtain the traffic monitoring data of this type after processing.

[0081] In an embodiment of the present application, a generative adversarial network is pre-trained for each type of traffic monitoring data using historical traffic monitoring data of the same type or other traffic simulation data of the same type, thereby obtaining different generative adversarial networks corresponding to different types of traffic monitoring data, so as to perform missing value processing on the corresponding type of traffic monitoring data; for example, for traffic flow monitoring data, a trained traffic flow type generative adversarial network (the training data is historical monitoring data of the traffic flow type or traffic flow simulation data) is used to process missing values ​​on the traffic flow type monitoring data to obtain pre-processed traffic flow type monitoring data.

[0082] In an embodiment of the present application, a generative adversarial network includes a generator and a discriminator; the generator is used to generate missing values ​​similar to the corresponding type of traffic monitoring data (i.e., real data) based on an input noise variable; the discriminator is used to distinguish between the generated traffic monitoring data and the monitored traffic monitoring data (i.e., distinguish between real data and generated data), thereby completing the missing values ​​in the monitored traffic monitoring data; by pre-training the generative adversarial network, the quality of the generated data is continuously improved so that it gradually approaches the real data distribution, thereby ensuring the continuity of the data.

[0083] In the embodiment of the present application, an outlier in the traffic monitoring data after preprocessing of the type is identified using an isolation forest algorithm, and the identified outlier is processed using the isolation forest algorithm to obtain the traffic monitoring data after processing of the type, including: constructing multiple random trees by randomly selecting features and cutting points, judging the outlier according to the path length of the data point (i.e., any type of traffic monitoring data after processing) in the tree, and replacing it with the average value of the adjacent normal data before and after to ensure the integrity and consistency of the data; the specific steps are as follows:

[0084] Random sampling is performed on any type of pre-processed traffic monitoring data, and the samples obtained by random sampling are divided until each sample is isolated or reaches the maximum depth of the tree; for any pre-processed traffic monitoring data of this type (i.e., any data point), the path length of the data point in the isolated number and the average path length of the binary tree are calculated, and based on the calculation results combined with the outlier score calculation formula, it is determined whether the data point is abnormal; if it is abnormal, the outlier is processed using the outlier processing formula; wherein, the path length of the data point in the isolated tree is defined as the number of edges required to reach the node from the root node.

[0085] In the embodiment of the present application, the outlier score calculation formula is:

[0086]

[0087] Where E(h(x)) is the average path length of the data point in all trees in the isolation forest, c(n) is the average path length of the binary tree, and n is the number of samples. A score s(x, n) close to 1 indicates that the data point may be an outlier, and a score close to 0 indicates a normal value.

[0088] The outlier processing formula is: Among them, x a is an outlier, x a-1 and x a+1 The data points judged as outliers are replaced with the average value of the adjacent normal data before and after.

[0089] In an embodiment of the present application, the target traffic monitoring data includes first target traffic monitoring data and second target traffic monitoring data; the first target traffic monitoring data is the traffic monitoring data of the accident site at different time lengths before the accident time; the second target traffic monitoring data is the traffic monitoring data of the accident site and the upstream and downstream locations of the accident site in a similar time period to the accident time; wherein, the similar time period to the accident time is a time period with weather conditions and road conditions similar to those of the accident and where no traffic accident occurred; the different time lengths may be 5 minutes, 10 minutes, 15 minutes, etc.

[0090] For example, on July 5, 2016, at 10 a.m., the weather was clear, the traffic condition on M Street was congested, and a traffic accident occurred at point B on M Street; M Street includes points A, B and C in order of driving, with different durations including 5 minutes and 10 minutes; the first target traffic monitoring data includes: the traffic monitoring data at point B from 9:55 to 10 a.m. on July 5, 2016, and the traffic monitoring data at point B from 9:50 to 10 a.m. on July 5, 2016; assuming that the weather conditions and road conditions on July 4 and July 5, 2016 are similar, the second target traffic monitoring data includes the traffic monitoring data at points A, B and C from 9:55 to 10 a.m. on July 4, 2016, and the traffic monitoring data at points A, B and C from 9:50 to 10 a.m. on July 4, 2016.

[0091] In an embodiment of the present application, by obtaining the target traffic monitoring data of a traffic accident (i.e., the first target traffic monitoring data) and the target traffic monitoring data of similar weather, similar road conditions, similar time, and the same or similar locations, but no traffic accident occurred (i.e., the second target traffic monitoring data), by strictly controlling the influence of external factors (i.e., weather and traffic, etc.), the first target traffic monitoring data and the second target traffic monitoring data are made to be the experimental group data and the control group data under the same or similar external conditions, thereby controlling the variables in the analysis process and ensuring the accuracy and comparability of the analysis results; by comparing the two types of target traffic monitoring data, the characteristic differences of the traffic monitoring data when a traffic accident occurs and when no traffic accident occurs can be truly reflected, thereby accurately locating the causes of the traffic accident and the characteristic parameters affecting road traffic safety.

[0092] In an embodiment of the present application, the second target traffic monitoring data not only includes the traffic monitoring data of the accident site, but also includes the traffic monitoring data of the upstream and downstream locations of the accident site, so as to ensure that the characteristic parameters can reflect the differences in traffic conditions between different locations.

[0093] Step S120: for any type of target traffic monitoring data, calculate the statistics corresponding to the target traffic monitoring data of this type at different time lengths; at any time length, cluster the target traffic monitoring data of this type based on the statistics to obtain the traffic status at this time length.

[0094] In an embodiment of the present application, different time lengths are different time lengths before a traffic accident occurs, which may include 5 minutes, 10 minutes, and 15 minutes, etc.; statistics include: mean, standard deviation, and coefficient of variation, etc.; statistics corresponding to different types of target traffic monitoring data at different time lengths include: mean, standard deviation, and coefficient of variation of traffic volume 5 minutes and 10 minutes before a traffic accident occurs, mean, standard deviation, and coefficient of variation of vehicle speed (or average speed) 5 minutes and 10 minutes before a traffic accident occurs, as well as mean, standard deviation, and coefficient of variation of density 5 minutes and 10 minutes before a traffic accident occurs.

[0095] In the embodiments of the present application, the calculation formulas of different statistics are as follows:

[0096]

[0097] in, represents the mean, σ represents the standard deviation, CV represents the coefficient of variation, and N represents the number of target traffic monitoring data of any type at any time. The target traffic monitoring data of any type at any time is regarded as a data set, and each target traffic monitoring data in the data set is regarded as a data point. b is the value of the bth data point.

[0098] In the embodiment of the present application, the statistics at different time lengths are calculated in order to select the time length that is most suitable for characterizing the evolution law of the traffic situation and reduce the scale of unnecessary data calculation; finally, data in a suitable time and space range are selected to extract statistical feature parameters and safety overlay features to reflect the impact of traffic flow situation on traffic safety.

[0099] In an embodiment of the present application, statistics corresponding to different types of target traffic monitoring data at different time lengths are calculated, and comparative analysis is performed to select traffic flow data within a reasonable time and space range, construct a variable indicator combination that can reflect the differences in traffic status and evolution trends, and form safety superposition features to analyze the impact of traffic flow characteristics on safety.

[0100] In the embodiment of the present application, based on the statistics, the target traffic monitoring data of this type is clustered to obtain the traffic status under this time length, including:

[0101] Using the statistics corresponding to any type of target traffic monitoring data, standardize the target traffic monitoring data of that type;

[0102] Calculate the attribute parameters of the target traffic monitoring data of this type after standardization; for any target traffic monitoring data of this type, if the attribute parameters of the target traffic monitoring data meet the preset standards, use the target traffic monitoring data as the cluster center of the target traffic monitoring data of this type; calculate the Euclidean distances of all target traffic monitoring data of this type from different cluster centers; based on the calculated Euclidean distances, divide all target traffic monitoring data of this type into corresponding cluster centers; for any cluster center, calculate the mean of the cluster center; use the obtained mean of the cluster center as the new cluster center, and return to the execution step: calculate the Euclidean distances of all target traffic monitoring data of this type from different cluster centers until the preset conditions are met, and output the classification results of the target traffic monitoring data of the type; based on the classification results corresponding to different types of target traffic monitoring data, obtain the traffic status under the corresponding time length.

[0103] In an embodiment of the present application, the average speed and flow rate are used as variables, and an adaptive density peak clustering algorithm (ADPC) is used to calculate the local density and relative distance of data points, select points with high local density and large relative distance as initial clustering centers, and optimize the selection of initial clustering centers; then the k-means model is used for clustering, and finally the traffic status of each duration is divided into three types: free flow, congested flow, and transition state; based on the target traffic monitoring data, the traffic status type corresponding to the corresponding location when a traffic accident occurs and when no traffic accident occurs is determined, and the first target traffic monitoring data and the second target traffic monitoring data are divided according to the corresponding traffic status categories.

[0104] In an embodiment of the present application, the statistics corresponding to any type of target traffic monitoring data are used to standardize the target traffic monitoring data of that type, including: using the standard deviation and average value of target traffic monitoring data of any duration and any type to standardize the target traffic monitoring data of the corresponding duration and type, to obtain the standardized target traffic monitoring data of that type.

[0105] For example, if the statistical time is 5 minutes before a traffic accident occurs, the target traffic monitoring data of speed 5 minutes before the traffic accident is standardized using the average speed and standard deviation of the speed 5 minutes before the traffic accident occurs, so as to obtain the target traffic monitoring data of speed 5 minutes before the traffic accident occurs after standardized processing.

[0106] In the embodiment of the present application, the normalization processing formula is as follows: Among them, Z′ represents the data after standardization; Z represents the data without standardization (i.e., the original value); represents the mean, and σ represents the standard deviation.

[0107] In the embodiment of the present application, the attribute parameters include: local density and relative distance; the calculation formulas are as follows:

[0108]

[0109] Among them, U represents the indicator function, d fg is the distance between data point f and data point g (i.e. any two standardized target traffic monitoring data of the same type), d c is the distance threshold.

[0110] In the embodiment of the present application, the preset standard is greater than the local density threshold and greater than the relative distance threshold; that is, the target traffic monitoring data with a local density greater than the local density threshold and a relative distance greater than the relative distance threshold is selected as the initial clustering center; wherein the local density threshold and the relative distance threshold can be calculated by the attribute parameters of all target monitoring data, or can be preset. The present application can avoid the clustering result from falling into the local optimum by selecting data points with high local density and large relative distance as the initial clustering center.

[0111] In an embodiment of the present application, after obtaining the initial cluster center, the Euclidean distance of all target traffic monitoring data of this type (i.e., each data point) from different cluster centers is calculated, and the data points are assigned to the nearest cluster center based on the calculation results, and the corresponding traffic status category is matched; after all target traffic monitoring data of this type are assigned to the cluster center closest to them, it is necessary to update the cluster center according to the mean of the attribute parameters of all data points in any cluster center, and repeat the process of data point assignment and cluster center calculation, and optimize the position of the cluster center according to the objective function until the position of the cluster center no longer changes or the change is less than the set threshold, that is, the algorithm converges and reaches the minimum value of the objective function.

[0112] In the embodiment of the present application, the objective function is expressed as: Among them, w represents the number of cluster centers, c m represents the mth class, z m represents the center of the mth class and β represents the data point.

[0113] Step S130: input the target traffic monitoring data of this type into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data of this type.

[0114] In an embodiment of the present application, before inputting the target traffic monitoring data of the type into the trained improved XGBoost model, the method further includes:

[0115] For the statistical parameter corresponding to the statistic of any type of target traffic data at any time length, obtain the preset weight of the statistical parameter; use the statistical parameter as the independent variable, perform regression analysis, and obtain the determination coefficient of the statistical parameter to other statistical parameters except the statistical parameter; subtract the determination coefficient from 1 to obtain the complex determination coefficient of the statistical parameter; divide the complex determination coefficient by the weight to obtain the adaptive weighted variance inflation factor of the statistical parameter; obtain the preset inflation factor screening threshold; if the adaptive weighted variance inflation factor of the statistical parameter does not exceed the inflation factor screening threshold, use the statistical parameter as the first target statistical parameter; if the adaptive weighted variance inflation factor of the statistical parameter exceeds the inflation factor screening threshold, delete the statistical parameter.

[0116] In an embodiment of the present application, the statistic is a specific value. For example, if the average vehicle speed 5 minutes before the traffic accident is 5 m / s, then the statistic is 5 m / s. In this case, the average vehicle speed 5 minutes before the traffic accident is the statistical parameter corresponding to 5 m / s.

[0117] In the embodiments of the present application, the statistical parameters need to be screened twice, namely, using an improved variance inflation factor (VIF) to perform multicollinearity detection, preliminarily screening the statistical parameters, and removing statistical parameters with high multicollinearity; and then using the recursive feature elimination (RFE) method to select the statistical parameter combination that contributes most to the model performance.

[0118] In the embodiment of the present application, the use of the improved variance inflation factor (VIF) for multicollinearity detection includes: setting a corresponding weight for each statistical parameter in advance, and the value of the weight can be determined based on the statistical characteristics of the statistical parameter or the expert score; based on the weight and the adaptive weighted variance inflation factor, the statistical parameters corresponding to each statistic are screened, thereby controlling the dimension of the target statistical parameter; specifically, the adaptive weighted variance inflation factor calculation formula is as follows: Among them, AWVIF o represents the adaptive weighted variance inflation factor of the statistical parameter o; γ o represents the weight of the statistical parameter o; It represents the coefficient of determination of the regression analysis of statistical parameter o on all other statistical parameters.

[0119] In an embodiment of the present application, the target traffic monitoring data of the type is input into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data of the type, including: inputting the target traffic monitoring data corresponding to the first target statistical parameter into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data corresponding to the first target statistical parameter.

[0120] In an embodiment of the present application, an improved XGBoost model is used to score the importance of different types of target traffic monitoring data, and the sample weights are adjusted by integrating the adaptive Boosting (AdaBoost) method to enhance the model's ability to recognize abnormal state samples and complex traffic patterns. An improved early stopping strategy is used during the training process, and training is stopped in advance when the loss on the validation set no longer decreases significantly, reducing the computational cost. At the same time, by constructing a high-order feature combination, selecting interaction items that significantly improve model performance, automatically generating and selecting feature interaction items, improving the model's expressiveness, and capturing complex feature relationships. After the model training is completed, the Bootstrapping method is used for verification, and different data subsets are generated by multiple samplings with replacement, the model is tested, the average performance index of the model is calculated, and the consistent performance of the model on different data sets is evaluated to ensure the stability and generalization ability of the model.

[0121] In an embodiment of the present application, a data set constructed based on different types of historical target traffic monitoring data is divided into a training set and a validation set; wherein, the training set is used to train the improved XGBoost model; the validation set is used to validate the model using the Bootstrapping method after the model training is completed, and different data subsets are generated by multiple samplings with replacement, the average performance index of the improved XGBoost model is calculated, and the consistency of the model on different data sets is evaluated.

[0122] In the embodiment of the present application, the objective function of the improved XGBoost model during training is:

[0123]

[0124] Among them, l represents the loss function, represents the predicted value, yi represents the actual value, Ω represents the regularization term, and f k represents the kth tree; by continuously minimizing the residual in the loss function The sum of squares is used to optimize the model parameters.

[0125] In the embodiment of the present application, the sample weight is adjusted by integrating the adaptive Boosting (AdaBoost) method, including:

[0126] The sample weights are adjusted using the following formula:

[0127]

[0128] Among them, ω i (t) is the weight of sample i at the tth iteration, α t is the learning rate, y i is the actual value, is the predicted value;

[0129] During the training process, the learning rate is dynamically adjusted according to the loss changes of the improved XGBoost model to avoid overfitting and underfitting problems; the adjustment coefficient of the dynamic learning rate is: Among them, α t is the learning rate of the tth iteration, and λ is the decay coefficient.

[0130] In the embodiment of the present application, an improved early stopping strategy is adopted during the training process, that is, the training is stopped in advance when the loss on the validation set no longer decreases significantly, so as to reduce the computational cost; the judgment condition for stopping the training is:

[0131]

[0132] Among them, L val (t)is the validation set loss of the tth iteration, ∈ is the set threshold.

[0133] In an embodiment of the present application, after obtaining the importance scores of the target traffic monitoring data corresponding to different first target statistical parameters, the first target statistical parameters need to be screened again by removing the first target statistical parameters with the lowest importance (i.e., the lowest importance score), and repeating the two steps of using the expansion factor screening threshold to perform statistical parameter screening and using the importance score to perform statistical parameter screening until the number of remaining statistical parameters reaches a predetermined value, thereby obtaining the feature subset that contributes most to the model performance and reasonably controlling the variable dimension.

[0134] In the embodiment of the present application, a recursive feature elimination (RFE) method is used to select the statistical parameter combination that contributes most to the model performance, including:

[0135] Obtain a preset parameter quantity threshold; use the importance score of the target traffic monitoring data corresponding to the first target statistical parameter as the importance score of the first target statistical parameter; arrange different first target statistical parameters in descending order according to the corresponding importance scores; and select the first target statistical parameters with the same number as the parameter quantity threshold from the arranged first target statistical parameters to obtain the second target statistical parameters.

[0136] Step S140: Use the pre-built SHAP model and Bayesian inference model to perform importance analysis on the target traffic monitoring data of this type to obtain the importance analysis result of the target traffic monitoring data of this type.

[0137] In the embodiment of the present application, the pre-built SHAP model and Bayesian inference model are used to perform importance analysis on the target traffic monitoring data of the type, including:

[0138] Using the pre-constructed SHAP model, an importance analysis is performed on the second target statistical parameters to obtain Shapley values ​​of different second target statistical parameters; random sampling is performed from all second target statistical parameters to obtain different statistical parameter combinations composed of different second target statistical parameters; using the pre-constructed Bayesian inference model, traffic accidents are predicted for different statistical parameter combinations to obtain traffic accident prediction results corresponding to different statistical parameter combinations; based on the obtained traffic accident prediction results, the degree of influence of different second target statistical parameters on the traffic accident prediction results is obtained; based on the Shapley value and the corresponding degree of influence on the traffic accident prediction results, the importance analysis results of each second target statistical parameter are obtained.

[0139] In the embodiment of the present application, the SHAP model is used to interpret the trained XGBoost model, and the importance of each second target statistical parameter is visualized by calculating the Shapley value representing the marginal contribution of each second target statistical parameter to the model output; the calculation formula of the Shapley value is: Among them, V o is the Shapley value of the second target statistical parameter o, O is the set of all second target statistical parameters, S is the second target statistical parameter subset, and v(S) is the contribution value of the second target statistical parameter subset S to the model output; when the Shapley value is positive, it means that the second target statistical parameter subset has a positive impact on the model output; when the Shapley value is negative, it means that the second target statistical parameter subset has a negative impact on the model output.

[0140] In the embodiment of the present application, after obtaining the Shapley values ​​of different second target statistical parameters, the contribution degree and influence direction of each second target statistical parameter on the model prediction result can be intuitively viewed by drawing a SHAP value bar chart.

[0141] In the embodiment of the present application, the formula of Bayesian reasoning is: Among them, P(θ|D) is the posterior probability, P(D|θ) is the likelihood function, P(θ) is the prior probability, and P(D) is the marginal likelihood. By statistically analyzing the prediction results of multiple samplings, the uncertainty impact of each second target statistical parameter on the prediction results is quantified, and an uncertainty distribution map is generated to show which second target statistical parameters have the greatest impact on traffic safety, so as to identify and compare the differences in the main factors affecting the occurrence of events under different types of traffic conditions.

[0142] In the embodiment of the present application, the Shapley value of each second target statistical parameter is calculated, the magnitude and direction of the impact of these values ​​on the model output is analyzed, the contribution of each second target statistical parameter to the model prediction is explained in a visual way, and the differences in factors affecting the occurrence of events under different types of traffic conditions are compared. At the same time, uncertainty quantification analysis is introduced, and the degree of influence of different second target statistical parameters on the occurrence of traffic accidents under different traffic conditions is identified through the Bayesian reasoning method, which helps users focus on observing key influencing factors.

[0143] For example, the statistical parameters include: the mean, standard deviation and coefficient of variation of the traffic flow 5 minutes and 10 minutes before the traffic accident, the mean, standard deviation and coefficient of variation of the vehicle speed (or average speed) 5 minutes and 10 minutes before the traffic accident, and the mean, standard deviation and coefficient of variation of the density 5 minutes and 10 minutes before the traffic accident; after screening the statistical parameters using the adaptive weighted expansion factor, the first target statistical parameters obtained include the mean and standard deviation of the traffic flow 5 minutes before the traffic accident, the standard deviation of the vehicle speed and the mean of the density, and the standard deviation of the traffic flow 10 minutes before the traffic accident, the mean of the vehicle speed and the mean of the density.

[0144] Calculate the importance score of each first target statistical parameter. Assuming that the importance scores of the mean and standard deviation of the traffic flow 5 minutes before the traffic accident, the standard deviation of the vehicle speed and the mean of the density, and the standard deviation of the traffic flow 10 minutes before the traffic accident, the mean of the vehicle speed and the mean of the density are 8, 5, 7, 9, 6, 3, and 4 respectively, then they are arranged from large to small as the mean of the density 5 minutes before the traffic accident, the mean of the traffic flow 5 minutes before the traffic accident, the standard deviation of the vehicle speed 5 minutes before the traffic accident, the standard deviation of the traffic flow 10 minutes before the traffic accident, the standard deviation of the traffic flow 5 minutes before the traffic accident, the mean of the density 10 minutes before the traffic accident, and the mean of the vehicle speed 10 minutes before the traffic accident; assuming that only 3 statistical parameters are retained, the second target statistical parameters are the mean of the density 5 minutes before the traffic accident, the mean of the traffic flow 5 minutes before the traffic accident, and the standard deviation of the vehicle speed 5 minutes before the traffic accident.

[0145] Random sampling is performed from the second target statistical parameter to obtain a first statistical parameter combination including the mean of the density 5 minutes before the traffic accident and the mean of the traffic flow 5 minutes before the traffic accident, a second statistical parameter combination including the mean of the density 5 minutes before the traffic accident and the standard deviation of the vehicle speed 5 minutes before the traffic accident, and a third statistical parameter combination including the mean of the traffic flow 5 minutes before the traffic accident and the standard deviation of the vehicle speed 5 minutes before the traffic accident; traffic accidents are predicted for the first statistical parameter combination, the second statistical parameter combination, and the third statistical parameter combination respectively to obtain corresponding traffic accident prediction results; and the degree of influence of the mean of the density 5 minutes before the traffic accident, the mean of the traffic flow 5 minutes before the traffic accident, and the standard deviation of the vehicle speed 5 minutes before the traffic accident on the traffic accident prediction results is obtained.

[0146] Based on the Shapley values ​​of the mean density 5 minutes before a traffic accident, the mean traffic flow 5 minutes before a traffic accident, and the standard deviation of the vehicle speed 5 minutes before a traffic accident and the corresponding impact on the traffic accident prediction results, the importance analysis results of the mean density 5 minutes before a traffic accident, the mean traffic flow 5 minutes before a traffic accident, and the standard deviation of the vehicle speed 5 minutes before a traffic accident were obtained.

[0147] Step S150: Analyze the importance scores of the target traffic monitoring data of any type for any duration and the corresponding importance analysis results to obtain the degree of influence of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on the traffic accident.

[0148] In the embodiment of the present application, the importance scores of the target traffic monitoring data of any type under any duration and the corresponding importance analysis results are analyzed to obtain the impact results of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on the traffic accident, including:

[0149] For any second target statistical parameter, the direction of influence of the second target statistical parameter on traffic accidents is obtained according to the positive or negative Shapley value of the second target statistical parameter; the degree of influence of the second target statistical parameter on the traffic accident prediction result is taken as the degree of influence of the second target statistical parameter on the traffic accident; based on the degree of influence and the direction of influence, the influence result of the second target statistical parameter on traffic accidents is obtained; based on the influence results of different second target statistical parameters on traffic accidents, the influence result of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding time length of each second target statistical parameter on traffic accidents is obtained.

[0150] In an embodiment of the present application, different second target statistical parameters correspond to a unique duration, type and statistical type. For example, if the second target statistical parameter is the mean density 5 minutes before a traffic accident occurs, the corresponding duration is 5 minutes before the traffic accident occurs, the type is density, and the statistical type is mean; the impact of the second target statistical parameter on the traffic accident, that is, whether the mean density 5 minutes before the traffic accident occurs has a positive or negative impact on the traffic accident and the corresponding degree of impact.

[0151] In an embodiment of the present application, when statistics are used for cluster analysis, the traffic status under the corresponding time length is obtained. At this time, the traffic status is combined with the second target statistical parameter to obtain the impact of the type of target traffic monitoring data corresponding to the traffic status of the time length corresponding to each second target statistical parameter on the traffic accident; assuming that the traffic status 5 minutes before the traffic accident is a congested flow, it can be obtained that when the traffic status is a congested flow, the mean of the density 5 minutes before the traffic accident, the mean of the traffic flow 5 minutes before the traffic accident, and the standard deviation of the vehicle speed 5 minutes before the traffic accident all have a negative impact on the traffic accident, and the degree of impact is how much; further, the main characteristic parameters affecting the occurrence of this traffic accident and the corresponding impact direction and impact degree can be obtained.

[0152] In one embodiment of the present application, Figure 2 As shown in FIG. 1 , the analysis method of characteristic parameters affecting traffic safety includes:

[0153] S1. Data collection and monitoring equipment deployment: Through the deployment of monitoring equipment such as coils, radars, and cameras around the highway, multi-source data including macro traffic flow characteristics such as traffic volume, average speed, and occupancy rate are collected;

[0154] S2. Data cleaning and missing value processing: Combined with traffic event record information, the generative adversarial network is used to process missing values. The missing values ​​are generated by the generator and the generated data and real data are distinguished by the discriminator to complete the missing values. The isolation forest algorithm is used to clean up outliers to ensure the integrity and consistency of the data.

[0155] S3, case-control data matching: according to the timestamp and location information of the event, match the traffic flow data of the corresponding time period and location, and match the traffic flow data without traffic incidents under the condition of controlling external factors, and divide the traffic flow data into unsafe scene data and safe scene data;

[0156] S4. Extract traffic flow characteristic parameters and safety superposition characteristics: Consider the factors that affect the statistical results of variables, such as the upstream and downstream location differences, characteristic parameter combinations, and the influencing time range, and clarify the calculation methods of statistical characteristic parameters and safety superposition characteristics;

[0157] S5. Traffic status clustering: using average speed and flow as variables, using the adaptive density peak clustering algorithm (ADPC), calculating the local density and relative distance of data points, selecting points with high local density and large relative distance as initial cluster centers, and optimizing the selection of initial cluster centers; then using the k-means model for clustering, and finally dividing the traffic status of the road section into three types: free flow, congested flow, and transition state; based on the traffic flow data matched with traffic events, determine the traffic status type corresponding to the traffic event, and divide the experimental group and control group data according to the traffic status category corresponding to the event;

[0158] S6. Multicollinearity detection and feature screening: Use the improved variance inflation factor (VIF) to perform multicollinearity detection, preliminarily screen features, and remove features with high multicollinearity; then use the recursive feature elimination (RFE) method to select the feature combination that contributes most to model performance;

[0159] S7. Model training and performance evaluation: The improved XGBoost model is selected for model training, and the adaptive Boosting (AdaBoost) method is integrated to adjust the sample weights to enhance the model's ability to identify abnormal state samples and complex traffic patterns. During the training process, an improved early stopping strategy is adopted to stop training in advance when the loss on the validation set no longer decreases significantly, thereby reducing computational costs. At the same time, the expressiveness of the model is improved by automatically generating and selecting feature interaction items, and complex feature relationships are captured. After the model training is completed, the Bootstrapping method is used for verification to ensure the stability and generalization ability of the model.

[0160] S8. Feature importance analysis based on SHAP model and Bayesian reasoning: Use SHAP model (SHapleyAdditive exPlanations) to perform feature importance analysis, calculate the Shapley value of feature values, analyze the magnitude and direction of the impact of these values ​​on model output, explain the contribution of each feature to model prediction in a visual way, and compare the differences in factors affecting the occurrence of events under different types of traffic conditions. At the same time, introduce uncertainty quantification analysis, identify the degree of influence of features on the occurrence of events under different traffic conditions through Bayesian reasoning methods, and assist users to focus on observing key influencing factors.

[0161] Corresponding to the above method, the embodiment of the present application also provides an analysis device for characteristic parameters affecting traffic safety, such as Figure 3 As shown, the analysis device of the characteristic parameters affecting traffic safety includes:

[0162] The acquisition unit 310 is used to acquire traffic monitoring data and traffic accident data of the target monitoring area within a preset time period; wherein the traffic accident data includes: the time and location of the accident;

[0163] An extraction unit 320 is used to extract target traffic monitoring data associated with the traffic accident from multiple types of traffic monitoring data based on the time and location of the accident;

[0164] A calculation unit 330 is used to calculate the statistics corresponding to the target traffic monitoring data of any type at different time lengths;

[0165] The clustering unit 340 is used to cluster the target traffic monitoring data of the type based on the statistics at any time length to obtain the traffic status at the time length;

[0166] The analysis unit 350 is used to input the target traffic monitoring data of the type into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data of the type; use the pre-built SHAP model and Bayesian inference model to perform importance analysis on the target traffic monitoring data of the type to obtain the importance analysis results of the target traffic monitoring data of the type; analyze the importance scores and corresponding importance analysis results of the target traffic monitoring data of the type under any duration to obtain the degree of influence of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on traffic accidents.

[0167] The functions of each functional unit of the device for analyzing characteristic parameters affecting traffic safety provided in the above-mentioned embodiments of the present application can be realized through the above-mentioned method steps. Therefore, the specific working process and beneficial effects of each unit in the device for analyzing characteristic parameters affecting traffic safety provided in the embodiments of the present application will not be repeated here.

[0168] The present application also provides an electronic device, such as Figure 4 As shown, it includes a processor 410 , a communication interface 420 , a memory 430 and a communication bus 440 , wherein the processor 410 , the communication interface 420 , and the memory 430 communicate with each other via the communication bus 440 .

[0169] Memory 430, for storing computer programs;

[0170] The processor 410 is used to execute the program stored in the memory 430 to implement the following steps:

[0171] Obtaining traffic monitoring data and traffic accident data of the target monitoring area within a preset time period; wherein the traffic accident data includes: the time and location of the accident;

[0172] Based on the time and location of the accident, target traffic monitoring data associated with the traffic accident is extracted from multiple types of traffic monitoring data;

[0173] For any type of target traffic monitoring data, calculate the statistics corresponding to the target traffic monitoring data of the same type at different time lengths;

[0174] At any time length, based on statistics, the target traffic monitoring data of the type is clustered to obtain the traffic status at that time length;

[0175] The target traffic monitoring data of the type is input into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data of the type; the pre-built SHAP model and Bayesian inference model are used to perform importance analysis on the target traffic monitoring data of the type to obtain the importance analysis results of the target traffic monitoring data of the type; the importance scores and corresponding importance analysis results of the target traffic monitoring data of the type under any duration are analyzed to obtain the degree of influence of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on traffic accidents.

[0176] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0177] The communication interface is used for communication between the above electronic device and other devices.

[0178] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0179] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0180] The implementation methods and beneficial effects of the components of the electronic device in the above embodiments to solve the problems can be found in Figure 1 The various steps in the illustrated embodiment are implemented, therefore, the specific working process and beneficial effects of the electronic device provided by the embodiment of the present application are not repeated here.

[0181] In another embodiment provided in the present application, a computer-readable storage medium is also provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes any one of the analysis methods of characteristic parameters affecting traffic safety in the above-mentioned embodiments.

[0182] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the methods for analyzing characteristic parameters affecting traffic safety in the above embodiments.

[0183] Those skilled in the art will appreciate that the embodiments in the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt a complete hardware embodiment, a complete software embodiment, or a form of an embodiment combining software and hardware. Moreover, the present application may adopt a form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0184] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0185] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0186] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0187] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.

[0188] Obviously, those skilled in the art can make various changes and modifications to the embodiments in the present application without departing from the spirit and scope of the embodiments in the present application. Thus, if these modifications and variations of the embodiments in the present application fall within the scope of the claims and their equivalents in the embodiments of the present application, the embodiments of the present application are also intended to include these modifications and variations.

Claims

1. A method for analyzing characteristic parameters affecting traffic safety, characterized in that: The method comprises: Acquire multiple types of traffic monitoring data and traffic accident data of the target monitoring area within a preset time period; wherein the traffic accident data includes: the time and location of the accident; Based on the accident time and the accident location, extracting target traffic monitoring data associated with the traffic accident from multiple types of traffic monitoring data; For any type of target traffic monitoring data, calculate the statistics corresponding to the target traffic monitoring data of the type at different time lengths; At any time length, clustering the target traffic monitoring data of the type based on the statistics to obtain the traffic status at the time length; Inputting the target traffic monitoring data of the type into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data of the type; Using the pre-built SHAP model and Bayesian inference model, importance analysis is performed on the target traffic monitoring data of the type, and importance analysis results of the target traffic monitoring data of the type are obtained; The importance scores of the target traffic monitoring data of the type under any duration and the corresponding importance analysis results are analyzed to obtain the impact results of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on the traffic accident.

2. The method according to claim 1, characterized in that Before extracting target traffic monitoring data associated with the traffic accident from multiple types of traffic monitoring data based on the accident time and the accident location, the method further includes: For any type of traffic monitoring data, input the traffic monitoring data of the type into a trained generative adversarial network to obtain traffic monitoring data of the type preprocessed; wherein the generative adversarial network is trained using historical traffic monitoring data of the same type as the input traffic monitoring data; An isolation forest algorithm is used to identify abnormal values ​​in the traffic monitoring data after the type of preprocessing, and the identified abnormal values ​​are processed using the isolation forest algorithm to obtain the traffic monitoring data after the type of processing.

3. The method according to claim 1, characterized in that Based on the statistics, clustering the target traffic monitoring data of the type to obtain the traffic status under the duration includes: Using the statistics corresponding to the target traffic monitoring data of the type, standardizing the target traffic monitoring data of the type; Calculating attribute parameters of the target traffic monitoring data of the type after standardization processing; For any of the target traffic monitoring data of the type, if the attribute parameters of the target traffic monitoring data meet the preset standard, the target traffic monitoring data is used as the cluster center of the target traffic monitoring data of the type; Calculate the Euclidean distance between all target traffic monitoring data of this type and different cluster centers; Based on the calculated Euclidean distance, all target traffic monitoring data of this type are divided into corresponding cluster centers; For any cluster center, calculate the mean of the cluster center; The obtained mean of the cluster centers is used as a new cluster center, and the step of returning to the execution step is: calculating the Euclidean distances of all target traffic monitoring data of the type from different cluster centers until the preset conditions are met, and outputting the classification results of the target traffic monitoring data of the type; Based on the classification results corresponding to different types of target traffic monitoring data, the traffic status under the time length is obtained.

4. The method according to claim 1, characterized in that Before inputting the target traffic monitoring data of the type into the trained improved XGBoost model, the method further includes: For statistical parameters corresponding to the statistics of any type of target traffic data at any time length, obtaining a preset weight of the statistical parameter; Taking the statistical parameter as an independent variable, performing regression analysis to obtain the coefficient of determination of the statistical parameter to other statistical parameters except the statistical parameter; Subtracting the coefficient of determination from 1 to obtain a complex coefficient of determination of the statistical parameter; Dividing the complex determination coefficient by the weight to obtain an adaptive weighted variance inflation factor of the statistical parameter; Get the preset expansion factor screening threshold; If the adaptive weighted variance inflation factor of the statistical parameter does not exceed the inflation factor screening threshold, the statistical parameter is used as the first target statistical parameter.

5. The method according to claim 4, characterized in that Input the target traffic monitoring data of the type into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data of the type, including: Input the target traffic monitoring data corresponding to the first target statistical parameter into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data corresponding to the first target statistical parameter; After obtaining the importance score of the first target traffic monitoring data of the type, the method further includes: Obtain a preset parameter quantity threshold; The importance score of the target traffic monitoring data corresponding to the first target statistical parameter is used as the importance score of the first target statistical parameter; Arrange different first target statistical parameters in descending order according to their corresponding importance scores; From the arranged first target statistical parameters, the first target statistical parameters having the same number as the parameter quantity threshold are selected to obtain the second target statistical parameters.

6. The method according to claim 1, characterized in that Use the pre-built SHAP model and Bayesian inference model to perform importance analysis on the target traffic monitoring data of the above types, including: Using the pre-built SHAP model, the importance analysis of the second objective statistical parameters is performed to obtain the Shapley values ​​of different second objective statistical parameters; Random sampling is performed from all second target statistical parameters to obtain different statistical parameter combinations composed of different second target statistical parameters; Using the pre-built Bayesian inference model, traffic accidents are predicted for different statistical parameter combinations, and traffic accident prediction results corresponding to different statistical parameter combinations are obtained; Based on the obtained traffic accident prediction results, the influence degree of different second target statistical parameters on the traffic accident prediction results is obtained; Based on the Shapley values ​​and the corresponding degrees of influence on the traffic accident prediction results, importance analysis results of the second target statistical parameters are obtained.

7. The method according to claim 6, characterized in that The importance scores of the target traffic monitoring data of the type under any duration and the corresponding importance analysis results are analyzed to obtain the impact results of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on the traffic accident, including: For any second target statistical parameter, according to the positive or negative Shapley value of the second target statistical parameter, the influence direction of the second target statistical parameter on the traffic accident is obtained; Using the influence degree of the second target statistical parameter on the traffic accident prediction result as the influence degree of the second target statistical parameter on the traffic accident; Based on the impact degree and the impact direction, obtaining an impact result of the second target statistical parameter on the traffic accident; Based on the influence results of different second target statistical parameters on the traffic accident, the influence results of the type of target traffic monitoring data corresponding to the traffic state corresponding to the duration of each second target statistical parameter on the traffic accident are obtained.

8. An analysis device for characteristic parameters affecting traffic safety, characterized in that: The device comprises: An acquisition unit is used to acquire traffic monitoring data and traffic accident data of a target monitoring area within a preset time period; wherein the traffic accident data includes: the time and location of the accident; An extraction unit, configured to extract target traffic monitoring data associated with the traffic accident from multiple types of traffic monitoring data based on the time of the accident and the location of the accident; A calculation unit, for calculating, for any type of target traffic monitoring data, statistics corresponding to the target traffic monitoring data of the type at different time lengths; A clustering unit, configured to cluster the target traffic monitoring data of the type based on the statistics at any time length to obtain the traffic status at the time length; The analysis unit is used to input the target traffic monitoring data of the type into the trained improved XGBoost model to obtain the importance score of the target traffic monitoring data of the type; use the pre-built SHAP model and Bayesian inference model to perform importance analysis on the target traffic monitoring data of the type to obtain the importance analysis results of the target traffic monitoring data of the type; analyze the importance scores and corresponding importance analysis results of the target traffic monitoring data of the type under any duration to obtain the degree of influence of the target traffic monitoring data of the type corresponding to the traffic state of the corresponding duration on the traffic accident.

9. An electronic device, characterized in that: The electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-7 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.