Traffic risk degree prediction method, system and device in combination with weather and storage medium

Through the prediction model of spatiotemporal alignment and dynamic weighting, the matching accuracy problem of meteorological and traffic data is solved, the accuracy and real-time performance of traffic risk prediction are improved, and the automatic identification and early warning of high-risk sections are realized.

CN120708419APending Publication Date: 2025-09-26浪潮智慧科技有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510836042.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing traffic risk prediction methods are unable to dynamically integrate the spatiotemporal coupling relationship between meteorological elements and real-time traffic flow parameters, resulting in low prediction accuracy, and deep learning models fail to fully explore the interactive effects of meteorological and traffic data.

Method used

Meteorological data and traffic flow data are aligned through a spatiotemporal alignment mechanism, and the weights of extreme weather events are adaptively adjusted using a dynamic weighting layer. Combined with a feature interaction layer, meteorological and traffic flow data are deeply correlated to construct a prediction model to improve prediction accuracy.

Benefits of technology

It improves the accuracy and timeliness of traffic risk prediction, realizes the automatic identification and real-time warning of high-risk sections, and supports the decision-making of intelligent transportation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120708419A_ABST
    Figure CN120708419A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and particularly provides a meteorological-combined traffic risk degree prediction method, system and device and a storage medium, and the method comprises the steps: obtaining meteorological data and traffic flow data; aligning the meteorological data and the traffic flow data in time and space to obtain a meteorological data sequence and a flow data sequence; inputting the meteorological data sequence and the flow data sequence into a prediction model, and outputting a risk degree by the prediction model; the prediction model comprises an input layer, a dynamic weighting layer, a meteorological feature processing layer, a flow feature processing layer, a feature interaction layer, a full connection layer and an output layer. According to the invention, a full-process automatic processing early warning mode is realized, and real-time decision support can be provided for an intelligent traffic system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and specifically relates to a traffic risk prediction method, system, device and storage medium combined with meteorology. Background Art

[0002] Current traffic risk prediction mainly relies on historical accident statistics or single meteorological warnings, which have obvious limitations: traditional methods (such as models based on statistical regression) can only process static data associations and cannot dynamically integrate the spatiotemporal coupling relationship between meteorological elements (such as visibility and precipitation intensity) and real-time traffic flow parameters (such as vehicle speed and density); although existing deep learning models can process multi-dimensional data, they generally use a simple feature splicing method, resulting in the interaction effect between meteorological and traffic data not being fully explored. Summary of the Invention

[0003] In view of the above-mentioned deficiencies in the prior art, the present invention provides a traffic risk prediction method, system, device and storage medium combined with weather to solve the above-mentioned technical problems.

[0004] In a first aspect, the present invention provides a method for predicting traffic risk in combination with weather, comprising: Obtain weather data and traffic flow data; Align meteorological data and traffic flow data in time and space to obtain meteorological data series and traffic flow data series; The meteorological data series and the flow data series are input into the prediction model, and the prediction model outputs the risk degree; The prediction model includes an input layer, a dynamic weighting layer, a meteorological feature processing layer, a traffic feature processing layer, a feature interaction layer, a fully connected layer and an output layer.

[0005] In an optional embodiment, the meteorological data and the traffic flow data are aligned in time and space to obtain a meteorological data sequence and a traffic flow data sequence, including: Kriging interpolation method is used to upscale the weather station data to a set resolution grid so that the weather data and traffic flow data are spatially aligned; A buffer queue for meteorological data and a buffer queue for traffic flow data are established, and a sliding window downsampling is performed on the meteorological data to align the meteorological data with the traffic flow data in time.

[0006] In an optional embodiment, the input layer includes: Meteorological data channel, used to input meteorological data sequence; Traffic data channel, used to input traffic data sequence; The context channel is used to input road type and time, and encode the road type and time respectively.

[0007] In an optional embodiment, the dynamic weighting layer is used to: Generate meteorological characteristic weights and flow characteristic weights; Multiply the meteorological feature weights by the meteorological data sequence to obtain weighted meteorological features; Multiply the traffic feature weight by the traffic data sequence to obtain the weighted traffic feature.

[0008] In an optional embodiment, generating meteorological characteristic weights and flow characteristic weights includes: The meteorological characteristic weight is obtained by correcting the pre-set basic meteorological weight by the abnormal meteorological value in the road type and meteorological data sequence; the abnormal meteorological value is a meteorological value exceeding a preset threshold; A linear transformation function is used to generate traffic feature weights based on visibility and whether it is in peak hours.

[0009] In an optional embodiment, the feature interaction layer is used to: receiving the meteorological feature vector output by the meteorological feature processing layer and the flow feature vector output by the flow feature processing layer; The meteorological feature vector and the flow feature vector are interacted by element-wise multiplication and vector concatenation to obtain the risk feature vector.

[0010] In an optional embodiment, the fully connected layer includes: The risk feature vector is cross-fused with the pre-input road type and time, and the fully connected layer adopts the ReLU activation function.

[0011] In a second aspect, the present invention provides a traffic risk prediction system combined with weather, comprising: Acquisition module, used to obtain meteorological data and traffic flow data; An alignment module is used to align meteorological data and traffic flow data in time and space to obtain meteorological data sequences and traffic flow data sequences; The prediction module is used to input the meteorological data series and the flow data series into the prediction model, and the prediction model outputs the risk degree; The prediction model includes an input layer, a dynamic weighting layer, a meteorological feature processing layer, a traffic feature processing layer, a feature interaction layer, a fully connected layer and an output layer.

[0012] According to a third aspect, a device is provided, comprising: A memory for storing a traffic risk prediction program combined with weather conditions; The processor is configured to implement the steps of the traffic risk prediction method combined with meteorology as provided in the first aspect when executing the traffic risk prediction program combined with meteorology.

[0013] In a fourth aspect, a computer-readable storage medium is provided, on which a traffic risk prediction program combined with meteorology is stored. When the traffic risk prediction program combined with meteorology is executed by a processor, the steps of the traffic risk prediction method combined with meteorology provided in the first aspect are implemented.

[0014] The beneficial effects of the present invention are that the traffic risk prediction method, system, equipment and storage medium combined with meteorology provided by the present invention solve the problem of low matching accuracy of meteorological and traffic data in traditional methods through a spatiotemporal alignment mechanism, thereby improving the timeliness of prediction; the dynamic weighting layer can adaptively adjust the weight coefficients of extreme weather such as typhoons and heavy rainfall, thereby improving the prediction accuracy; the feature interaction layer realizes the deep correlation of key features of meteorological data and traffic flow data for the first time, thereby improving the recognition rate of high-risk road sections; in addition, the present invention realizes an early warning mode with full-process automated processing, which can provide real-time decision support for intelligent transportation systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0016] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.

[0017] Figure 2 FIG. 4 is a schematic block diagram of a system according to an embodiment of the present invention.

[0018] Figure 3 A schematic structural diagram of a device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] In order to enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0021] The method for predicting traffic risk in combination with weather conditions provided in the embodiment of the present invention is executed by a computer device. Accordingly, the system for predicting traffic risk in combination with weather conditions runs in the computer device.

[0022] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention. Figure 1 The execution subject can be a traffic risk prediction system combined with weather. According to different needs, the order of the steps in the flow chart can be changed, and some can be omitted.

[0023] like Figure 1 As shown, the method includes: S1. Obtain weather data and traffic flow data; S2. Aligning the meteorological data and traffic flow data in time and space to obtain meteorological data sequences and traffic flow data sequences; S3. Input the meteorological data sequence and the traffic data sequence into the prediction model, and the prediction model outputs the risk level; the prediction model includes an input layer, a dynamic weighting layer, a meteorological feature processing layer, a traffic feature processing layer, a feature interaction layer, a fully connected layer and an output layer.

[0024] In an embodiment of the present invention, based on step S1, a possible embodiment will be given below to illustrate its specific implementation scheme in a non-limiting manner.

[0025] During the data acquisition phase, meteorological data primarily comes from ground-based meteorological observation station datasets, covering core meteorological elements such as temperature, humidity, wind speed, precipitation, and visibility, with data collection occurring on an hourly basis. Traffic flow data is collected in real time using microwave detectors, geomagnetic sensors, and ETC gantries installed on urban roads. This provides minute-by-minute traffic flow data, including parameters such as cross-sectional flow, vehicle speed, and occupancy. To ensure data quality, missing value interpolation and outlier correction are performed on both types of raw data. The K-nearest neighbor (KNN) algorithm based on time series similarity is used to fill missing values ​​in the meteorological data, and the density-based outlier detection algorithm (DBSCAN) is used to identify and correct anomalous records in the traffic flow data.

[0026] In an embodiment of the present invention, based on step S2, a possible embodiment will be given below to illustrate its specific implementation scheme in a non-limiting manner.

[0027] S201. Use Kriging interpolation method to upgrade the weather station data to a set resolution grid so that the weather data and traffic flow data are spatially aligned.

[0028] The spatial alignment phase uses Kriging interpolation to improve the spatial resolution of meteorological data. Considering that the minimum spatial statistical unit for traffic flow data is a road segment, the target resolution of the meteorological data is set to a 500m×500m grid. During implementation, a semivariogram model is constructed based on the longitude and latitude coordinates of the meteorological stations. An exponential model is used to describe the spatial variation characteristics of meteorological elements. Model parameters are optimized through cross-validation to obtain the optimal nugget effect, sill value, and range parameter. On this basis, ordinary Kriging is used to interpolate the observations of discrete meteorological stations to a preset resolution grid, forming a meteorological element raster layer covering the study area. Using the spatial analysis tools of the Geographic Information System (GIS), the meteorological raster data is spatially overlaid with the traffic flow road segment vector data to ensure consistency in the spatial benchmark between the two types of data.

[0029] S202. Establish a buffer queue for meteorological data and a buffer queue for traffic flow data, and perform sliding window downsampling on the meteorological data to align the meteorological data with the traffic flow data in time.

[0030] Time alignment is achieved by constructing a buffer queue and a sliding window downsampling strategy. A 24-hour circular buffer queue for meteorological data and a fixed-length buffer queue for traffic flow data are established. The meteorological data queue is stored in hours, while the traffic flow queue is stored in minutes. Given that meteorological data has a higher temporal resolution than traffic flow data, a sliding window technique is used to downsample the meteorological data. The window size is set to 15 minutes, with a sliding step of 5 minutes. By calculating statistics such as the mean, median, or mode of meteorological elements within the window, the hourly meteorological data is downsampled to 15-minute intervals. To eliminate time offsets, the timestamp of the traffic flow data is used as a benchmark, and a dynamic matching mechanism for queue elements is used to achieve precise alignment of the two types of data on the time axis. This ultimately forms a unified meteorological-traffic flow joint dataset in both time and space, providing a standardized data foundation for subsequent coupled analysis and prediction model construction.

[0031] In an embodiment of the present invention, based on step S3, a possible embodiment will be given below to illustrate its specific implementation scheme in a non-limiting manner.

[0032] First, build a prediction model, which includes: (1) Input layer, including: meteorological data channel, used to input meteorological data sequence; traffic data channel, used to input traffic data sequence; context channel, used to input road type and time, and encode road type and time respectively.

[0033] The meteorological data channel receives time series data such as temperature, precipitation intensity, visibility, and wind speed, and uses Min-Max normalization preprocessing to ensure data distribution consistency. The traffic data channel processes traffic status parameters such as cross-sectional flow, average speed, occupancy rate, and vehicle type ratio, and eliminates dimensional differences through Z-score normalization. The context channel integrates road type and temporal features, where road type is converted into a three-dimensional vector (expressway / urban expressway / ordinary road) using One-Hot Encoding, and temporal features are captured using Sin-Cos Encoding.

[0034] (2) Dynamic weighting layer, including: generating meteorological feature weights and flow feature weights; multiplying meteorological feature weights with meteorological data sequence to obtain weighted meteorological features; multiplying flow feature weights with flow data sequence to obtain weighted flow features.

[0035] The method for generating meteorological characteristic weights and flow characteristic weights includes: To address the dynamic changes in feature importance across different weather conditions and road types, the model incorporates an adaptive weight generation module. The base weather weight vector is initialized based on domain knowledge (temperature: 0.25, precipitation: 0.25, visibility: 0.3, wind speed: 0.2), and dynamically adjusted using a dual correction function.

[0036] The meteorological feature weight is obtained by correcting the pre-set basic meteorological weight by the abnormal meteorological value in the road type and meteorological data sequence; the abnormal meteorological value is the meteorological value that exceeds the preset threshold; the calculation formula is:

[0037] Here, base_weights represents the base weight vector for temperature, precipitation, visibility, and wind speed; f(road_type) represents the road type correction function; g(alert_level) represents the alert level correction function, where alert_level represents the weather warning level corresponding to the abnormal weather value. i represents the index of a specific weather feature (temperature, precipitation, visibility, wind speed); j represents the summation variable, which traverses all weather features; and n represents the total number of weather features (n=4).

[0038] The denominator represents the sum of the corrected weights for all meteorological features, and the numerator represents the corrected weight for a single feature i. The road type correction function f(・) adjusts the weight distribution according to the road functional level (highway: visibility weight × 1.5), and the warning level correction function g(・) increases the weight of key meteorological factors based on the warning signals issued by the meteorological department (orange / red warning: precipitation weight × 2.0). Finally, L1 normalization ensures that the sum of the weights is 1.

[0039] The road type correction function f(・) includes:

[0040] a r is the road sensitivity coefficient, is the meteorological characteristic reference value, It is the quantitative value of meteorological characteristics.

[0041] Warning level correction function g(・):

[0042] Feature sensitive parameter λ k : Temperature: λ temp =0.1; precipitation: λ precip =0.2; visibility: λ vis =0.18; wind speed: λ wind =0.17. l represents the quantitative value corresponding to the warning level.

[0043] A linear transformation function is used to generate traffic feature weights based on visibility and whether it is in peak hours. The calculation formula includes:

[0044] Where A represents a 4×3 weight matrix (feature × condition); b represents a 4-dimensional bias vector; visibility_level represents the visibility level (0:>200m, 1:100-200m, 2:50-100m, 3:<50m); and is_rush_hour represents the rush hour indicator (0 / 1).

[0045]

[0046] Among them, the first row represents the speed weight coefficient, the second row represents the flow weight coefficient, the third row represents the density weight coefficient, and the fourth row represents the delay weight coefficient; the first column represents the visibility coefficient, the second column represents the peak period coefficient, and the third column represents the basic offset.

[0047] The traffic feature weights in this formula are dynamically adjusted based on visibility conditions and time of day. For example, in low visibility, the speed weight is multiplied by 0.7, and the traffic weight is multiplied by 1.2; during peak hours, the occupancy weight is multiplied by 1.5. Linear transformations are used to achieve a smooth transition.

[0048] (3) Meteorological feature processing layer, which performs nonlinear transformation on weighted meteorological features: The visibility transformation is modeled using the threshold effect, i.e., the nonlinear abrupt change when visibility is less than 100 m. The formula is:

[0049] Precipitation transformation saturation effect processing, that is, logarithmic attenuation during heavy precipitation, formula:

[0050] Where v represents visibility (meters) and p represents precipitation (mm / h). The coefficients are calibrated based on measured accident data during the model training phase.

[0051] (4) Traffic feature processing layer, which maps low-dimensional traffic features to high-dimensional space (4D→8D). ReLU activation introduces nonlinear representation capabilities to capture the implicit relationship between traffic features. The calculation formula includes:

[0052] x traffic represents weighted traffic characteristics [flow rate, speed, occupancy rate, vehicle type ratio]; W embed represents a 4×8 embedding matrix; b embed Represents an 8-dimensional bias vector.

[0053] (5) Feature interaction layer: The meteorological feature vector output by the meteorological feature processing layer and the flow feature vector output by the flow feature processing layer are concatenated by element multiplication to obtain the risk feature vector z.

[0054] (6) The fusion formula of the fully connected layer is:

[0055] r represents the road type embedding (32 dimensions); time represents the time feature (sine and cosine encoding of hours); W h Represents the transformation matrix (60×128); the output h is a 128-dimensional fusion feature.

[0056] (7) The fully connected layer realizes feature cross-fusion, and the ReLU activation introduces nonlinearity to provide comprehensive feature expression for downstream tasks. Among them, the 32-dimensional road type embedding vector r is generated by one-hot encoding followed by a 32×32 linear layer. The time feature (time) uses 8-dimensional sine-cosine encoding, and the 60×128 transformation matrix Wh realizes feature dimension enhancement and cross-fusion.

[0057] (8) The output layer is used to output the accident probability: p(accident)=σ(W a z+b a ) σ is the sigmoid function, W a and b a are parameters that need to be trained.

[0058] Auxiliary output (risk index): Assume that three indices are output (meteorological risk index, traffic anomaly index, and comprehensive risk level), each ranging from 0 to 10. Since this is a regression task, a linear layer with ReLU activation is used (to ensure non-negative): y risk =ReLU(W risk z+b risk ) The comprehensive risk level can be a discrete category (level 1-5), but here we treat it as a continuous value and round it off later. risk The dimension is (hidden_units, 3), and it outputs 3 values.

[0059] The training methods for the prediction model include: (1) Data division and preprocessing Before model training, the collected weather-traffic flow joint dataset needs to be scientifically partitioned. The dataset is divided into training, validation, and test sets in a 7:2:1 ratio. The training set is used to learn model parameters, the validation set is used to evaluate model performance and adjust hyperparameters during training, and the test set is used to ultimately evaluate the model's generalization ability on unseen data.

[0060] Data preprocessing for both the training and validation sets is crucial. For meteorological data, in addition to conventional Min-Max normalization, special processing is performed to address outliers. The 3σ principle is used to identify anomalous meteorological values. Data points exceeding three standard deviations from the mean are filled in using the weighted average of the preceding and following time points. For traffic flow data, after Z-score normalization, time series smoothing is performed using the Holt-Winters exponential smoothing method to eliminate random fluctuations in the data and enhance traffic trends.

[0061] (2) Multi-objective loss function optimization The combined loss function used by the model is L = λ1 × L bce +λ2×L mse +λ3×L reg , it is necessary to fine-tune the weight coefficients λ1, λ2, and λ3. Using the grid search method, with the comprehensive performance indicator on the validation set (combining the F1 score of accident probability prediction and the RMSE of risk index regression) as the optimization target, an exhaustive search is performed in the preset parameter space λ1∈[0.4,0.8], λ2[∈0.2,0.4], λ3∈[0.05,0.15].

[0062] For the binary cross entropy loss function L bce, considering the class imbalance problem of accident data, the weight factor w is introduced to give a higher weight to the minority class (accident samples). The calculation formula is L bce =-w×ylog(p)-(1-y)log(1-p), where y is the true label and p is the accident probability predicted by the model. mse In the calculation, the errors of the three regression targets, meteorological risk index, flow anomaly index and comprehensive risk level, are calculated respectively, and the average value is taken as the final L mse .

[0063] (3) Training algorithm and hyperparameter adjustment The optimizer uses the Adam algorithm, whose adaptive learning rate adjustment mechanism can effectively cope with the update requirements of different parameters. The initial learning rate is set to 0.001. In order to avoid the model from not converging due to excessively high learning rate in the later stages of training, a learning rate decay strategy is adopted. The learning rate is decayed to 0.7 times the original value every 5 epochs, and the lower limit of the learning rate is set to 10 -5 , to prevent the learning rate from being too small and causing training to stagnate.

[0064] The batch size was set to 64. This value was determined through experimental comparison to achieve a good balance between training speed and convergence stability. The number of training epochs was preset to 100, and early stopping was enabled, monitoring the overall performance indicators on the validation set. Training was stopped when performance on the validation set did not improve for 10 consecutive epochs to avoid overfitting.

[0065] During training, the number of neurons in the model's hidden layer was also adjusted. Comparative experiments revealed that adjusting the number of hidden units in the fully connected layer from 128 to 256 improved the model's F1 score on the validation set by 3.2% and reduced the RMSE by 1.8%. Therefore, the final number of hidden units in the fully connected layer was set to 256.

[0066] (4) Model evaluation and tuning After training is completed, the test set is used to conduct a comprehensive evaluation of the model. In addition to the precision, recall, F1 score, AUC, MAE, RMSE, R 2 The model uses metrics such as the Brier score and the Confusion Matrix to analyze accident probability prediction results in detail. This confusion matrix provides a clear understanding of the model's performance on different categories, and reveals that the model's prediction accuracy for the minority class (accident samples) is low, allowing for targeted adjustments to the weighting factors in the loss function.

[0067] The risk index regression results were visualized using scatter plots and fitted curves to intuitively display the distribution relationship between the predicted and true values. Based on the evaluation results, the model was further refined, such as adjusting the parameters of the correction function in the dynamic weighting layer and optimizing the weight distribution in the feature interaction layer, to continuously improve model performance.

[0068] The application process of the prediction model includes: (1) Real-time data access and preprocessing In actual application scenarios, the model requires real-time access to meteorological and traffic flow data. Meteorological data is connected to the meteorological department's API in real time, obtaining the latest data on temperature, precipitation intensity, visibility, wind speed, and other indicators every 15 minutes. Traffic flow data is transmitted to the data center at a minute-by-minute frequency via a network of roadside sensors. After data cleaning and integration, it is aggregated at a 15-minute granularity.

[0069] For newly acquired data, the same preprocessing methods as in the training phase are used. Meteorological data undergoes Min-Max normalization and outlier processing, while traffic flow data undergoes Z-score normalization and smoothing. Furthermore, based on real-time meteorological data and in accordance with national meteorological disaster warning signal standards, meteorological warning levels are calculated and updated. Road type and time characteristics are also encoded using one-hot encoding and sine-cosine encoding.

[0070] (2) Real-time calculation of dynamic weights and feature transformations After acquiring preprocessed data, the model immediately activates the dynamic weight generation module. It modifies the basic meteorological weights based on the real-time road type and weather warning level. For example, when a highway section is detected with an orange visibility warning, the visibility weight is multiplied by 1.5 according to pre-set rules. Traffic feature weights are quickly calculated using a linear transformation function based on the real-time visibility level and whether the traffic is during peak hours.

[0071] During feature transformation, the meteorological feature processing layer applies trained, specialized transformation functions to perform real-time calculations for different meteorological elements. If visibility falls below 100 meters, a piecewise nonlinear transformation function is immediately applied to account for threshold effects. The traffic feature processing layer uses a pre-trained embedding matrix to quickly map low-dimensional traffic features to a high-dimensional space, introducing nonlinearity through the ReLU activation function.

[0072] (3) Risk prediction and result output After dynamic weighting and feature transformation, the data enters the feature interaction layer and the fully connected layer for deep fusion. The feature interaction layer efficiently captures the synergistic effects of meteorological and traffic characteristics through three mechanisms: element-wise multiplication, feature concatenation, and weighted fusion. The fully connected layer further integrates these fused features with road type and time characteristics, ultimately generating a 128-dimensional fused feature.

[0073] The model's primary output layer calculates real-time accident probability based on fused features using a Sigmoid activation function. The auxiliary output layer uses a linear layer and a ReLU activation function to generate a meteorological risk index, a traffic anomaly index, and an overall risk level. The prediction results are output as an API, allowing traffic management departments and relevant entities to access real-time road risk information.

[0074] (4) Model monitoring and updating To ensure the model's continued effectiveness in practical applications, a comprehensive model monitoring system has been established. This system monitors the model's predictive performance on new data in real time, using metrics such as the F1 score for accident probability prediction and the RMSE for risk index regression. If a performance metric on the validation set drops by more than 5%, a model update process is automatically triggered.

[0075] The model update utilizes an incremental learning strategy, prioritizing the collection of new data from the last three months. This data is then merged with historical data and re-partitioned. During the update process, the parameters of the dynamic weighting layer and feature processing layer are first fine-tuned, focusing on optimizing parameters that are highly relevant to the current environment. The fully connected layer and output layer are then jointly trained based on these fine-tuned parameters. After the update is complete, the model is thoroughly evaluated using a test set to ensure that the updated model outperforms the original model before being deployed in production environments.

[0076] (5) Application scenario expansion and optimization In practical applications, the model is not only used to predict accident probabilities and generate risk indices, but can also be integrated with geographic information systems (GIS) to visualize risk information on maps. Using different colors and icons, it intuitively presents the risk level of each road section, providing decision-making support for traffic management departments in developing emergency plans.

[0077] Furthermore, the model is customized and optimized based on the needs of different application scenarios. For example, during large-scale events, relevant features such as foot traffic are added; during holidays, the encoding method of time features is adjusted to better capture traffic patterns during special periods. By continuously expanding application scenarios and optimizing the model, the practicality and adaptability of the model are enhanced.

[0078] In addition, model pruning and knowledge distillation technologies can be used to compress the model size to 45MB to support edge computing of vehicle terminals; distributed inference services can be deployed in the cloud to support city-level traffic risk prediction.

[0079] In some embodiments, the traffic risk prediction system combined with weather conditions may include multiple functional modules composed of computer program segments. The computer program of each program segment in the traffic risk prediction system combined with weather conditions may be stored in a memory of a computer device and executed by at least one processor to perform (see Figure 1 Description) Combines traffic risk prediction with meteorological information.

[0080] In this embodiment, the traffic risk prediction system combined with weather can be divided into multiple functional modules according to the functions it performs, such as Figure 2 As shown. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can perform fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

[0081] Acquisition module, used to obtain meteorological data and traffic flow data; An alignment module is used to align meteorological data and traffic flow data in time and space to obtain meteorological data sequences and traffic flow data sequences; The prediction module is used to input the meteorological data series and the flow data series into the prediction model, and the prediction model outputs the risk degree; The prediction model includes an input layer, a dynamic weighting layer, a meteorological feature processing layer, a traffic feature processing layer, a feature interaction layer, a fully connected layer and an output layer.

[0082] Figure 3 The traffic risk prediction method combined with weather provided for the embodiment of the present application can be applied to a device. Those skilled in the art will understand that the device structure involved in the embodiment of the present invention does not constitute a limitation on the device, and the device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiment of the present invention, the device includes but is not limited to a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present application described and / or required herein.

[0083] The device 300 may include a processor 310, a memory 320, and a communication unit 330. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention. The server structure may be a bus structure or a star structure, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0084] The memory 320 can be used to store execution instructions of the processor 310. The memory 320 can be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. When the execution instructions in the memory 320 are executed by the processor 310, the device 300 can perform some or all of the steps in the above-described method embodiments.

[0085] The processor 310 is the control center of the storage device, which uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and / or processes data by running or executing software programs and / or modules stored in the memory 320, and calling data stored in the memory. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 310 can only include a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.

[0086] The communication unit 330 is configured to establish a communication channel so that the storage device can communicate with other devices, receive user data sent by other devices, or send user data to other devices.

[0087] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program that, when executed, may include some or all of the steps of each embodiment provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0088] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software and a necessary general-purpose hardware platform. Based on this understanding, the technical solutions in the embodiments of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, among other media capable of storing program code, and includes instructions for causing a computer device (which can be a personal computer, a server, or a second device, a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention.

[0089] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

[0090] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or modules, and can be electrical, mechanical or other forms.

[0091] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected to achieve the purpose of the present embodiment according to actual needs.

[0092] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0093] Although the present invention has been described in detail with reference to the accompanying drawings and in conjunction with preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, persons of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and such modifications or substitutions shall be within the scope of the present invention. Any changes or substitutions that can be easily conceived by persons skilled in the art within the technical scope disclosed in the present invention shall be within the scope of protection of the present invention.

Claims

1. A traffic risk prediction method combined with weather, characterized in that: include: Obtain weather data and traffic flow data; Align meteorological data and traffic flow data in time and space to obtain meteorological data series and traffic flow data series; The meteorological data series and the flow data series are input into the prediction model, and the prediction model outputs the risk degree; The prediction model includes an input layer, a dynamic weighting layer, a meteorological feature processing layer, a traffic feature processing layer, a feature interaction layer, a fully connected layer and an output layer.

2. The method according to claim 1, characterized in that Align meteorological data and traffic flow data in time and space to obtain meteorological data series and traffic flow data series, including: Kriging interpolation method is used to upscale the weather station data to a set resolution grid so that the weather data and traffic flow data are spatially aligned; A buffer queue for meteorological data and a buffer queue for traffic flow data are established, and a sliding window downsampling is performed on the meteorological data to align the meteorological data with the traffic flow data in time.

3. The method according to claim 1, characterized in that The input layer includes: Meteorological data channel, used to input meteorological data sequence; Traffic data channel, used to input traffic data sequence; The context channel is used to input road type and time, and encode the road type and time respectively.

4. The method according to claim 1, wherein The dynamic weighting layer is used to: Generate meteorological characteristic weights and flow characteristic weights; Multiply the meteorological feature weights by the meteorological data sequence to obtain weighted meteorological features; Multiply the traffic feature weight by the traffic data sequence to obtain the weighted traffic feature.

5. The method according to claim 4, characterized in that Generate meteorological characteristic weights and flow characteristic weights, including: The meteorological characteristic weight is obtained by correcting the pre-set basic meteorological weight by the abnormal meteorological value in the road type and meteorological data sequence; the abnormal meteorological value is a meteorological value exceeding a preset threshold; A linear transformation function is used to generate traffic feature weights based on visibility and whether it is in peak hours.

6. The method according to claim 1, characterized in that The feature interaction layer is used to: receiving the meteorological feature vector output by the meteorological feature processing layer and the flow feature vector output by the flow feature processing layer; The meteorological feature vector and the flow feature vector are interacted by element-wise multiplication and vector concatenation to obtain the risk feature vector.

7. The method according to claim 6, characterized in that The fully connected layer includes: The risk feature vector is cross-fused with the pre-input road type and time, and the fully connected layer adopts the ReLU activation function.

8. A traffic risk prediction system combined with weather, characterized by: include: Acquisition module, used to obtain meteorological data and traffic flow data; An alignment module is used to align meteorological data and traffic flow data in time and space to obtain meteorological data sequences and traffic flow data sequences; The prediction module is used to input the meteorological data series and the flow data series into the prediction model, and the prediction model outputs the risk degree; The prediction model includes an input layer, a dynamic weighting layer, a meteorological feature processing layer, a traffic feature processing layer, a feature interaction layer, a fully connected layer and an output layer.

9. A device, characterized in that include: A memory for storing a traffic risk prediction program combined with weather conditions; A processor is used to implement the steps of the traffic risk prediction method combined with meteorology as described in any one of claims 1-7 when executing the traffic risk prediction program combined with meteorology.

10. A computer-readable storage medium storing a computer program, characterized in that: The readable storage medium stores a traffic risk prediction program combined with weather conditions, and when the traffic risk prediction program combined with weather conditions is executed by a processor, the steps of the traffic risk prediction method combined with weather conditions as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Traffic flow prediction method based on time and space and related equipment

    CN114360254A

  • Traffic accident risk prediction method based on multi-view multi-task space-time network

    CN115775034A

  • Multi-modal traffic flow prediction system based on AI

    CN117437774A

  • Accident prediction method, computer program, accident prediction device, and learning model generation method

    JP2021182189A

  • Accident forecast system, and accident forecast method

    JP2022012418A