Training method of traffic situation prediction model, traffic situation prediction method and equipment
By building a gantry connection matrix and training a hybrid prediction model, the problem that traditional traffic data monitoring methods are difficult to achieve accurate situation prediction is solved, the accuracy and automation of traffic situation prediction is improved, and technical support is provided for traffic data management and smart transportation. .
Patent Information
- Application Number
- CN202411138839.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-17
AI Technical Summary
Traditional traffic data monitoring methods are difficult to adapt to the rapid expansion of urban traffic scale, and it is difficult to achieve accurate and automated situation prediction of traffic data.
By constructing the gantry connection matrix of the target area, obtaining historical traffic state data, calculating the average value of traffic state and differential learning values, and training a hybrid prediction model to predict future traffic situations.
It improves the data reliability and accuracy of the traffic situation prediction model, enhances the degree of automation and intelligence, can provide strong technical support for traffic data management decisions, and promotes the construction of green and smart urban transportation systems.
Smart Images

Figure CN119152674A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of traffic data processing, and in particular to a training method for a traffic situation prediction model, a traffic situation prediction method and a device. Background Art
[0002] With the rapid development of economy and society, the scale of urban traffic and highway traffic is constantly expanding, and the demand for traffic monitoring and management is also increasing. Faced with the growing scale of traffic data and limited manpower and material resources, traditional monitoring methods can no longer meet the needs of development, and it is urgent to build an intelligent traffic monitoring system to assist in the management of traffic data.
[0003] Therefore, in view of the rapid expansion of urban traffic scale and the limitations of traditional traffic data monitoring methods, there is an urgent need to design a method that can accurately and automatically predict the situation of traffic data. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a training method for a traffic situation prediction model, a traffic situation prediction method and a device to eliminate or improve one or more defects existing in the prior art.
[0005] One aspect of the present application provides a method for training a traffic situation prediction model, comprising:
[0006] Based on the portal frame connectivity basic data of the target area, construct the portal frame connectivity matrix of the target area;
[0007] Acquiring historical traffic status data of the target area within a historical time period according to the portal connection matrix and the portal connection basic data;
[0008] Based on the historical traffic status data, the traffic status average value and traffic status differential learning value of the target area in each preset unit time period in the historical time period are obtained, and a corresponding traffic situation label is set for each preset unit time period;
[0009] The preset hybrid prediction model is trained using the traffic state average value and the traffic state differential learning value in each preset unit time period respectively provided with the traffic state label, so as to train the hybrid prediction model as a traffic state prediction model for predicting the traffic state of the target area in the future unit time period.
[0010] In some embodiments of the present application, constructing a gantry connectivity matrix of the target area based on the gantry connectivity basic data of the target area includes:
[0011] Acquire the collected data of toll stations, toll plazas, ETC gantries, toll collection units, basic road network structures and toll collection unit GPS on the highways in the target area to form the current gantries connectivity basic data of the target area;
[0012] Connectivity data between the charging units are extracted from the gantry connectivity basic data, and a corresponding charging unit connectivity graph is constructed, wherein each vertex in the charging unit connectivity graph represents a different charging unit, and an edge in the charging unit connectivity graph represents that there is a connection relationship between the charging units located at both ends of the edge;
[0013] Selecting a plurality of the ETC gantries in the gantries connection basic data as target gantries respectively;
[0014] The correspondence between each of the target gantries and the charging unit is searched from the gantries connectivity basic data, and a gantries connectivity matrix of the target area is constructed according to the correspondence between each of the target gantries and the charging unit and the charging unit connectivity map, wherein the gantries connectivity matrix is composed of connectivity marks corresponding to each of the target gantries, and the connectivity marks are used to indicate whether two charging units corresponding to the target gantries are adjacent or non-adjacent;
[0015] Searching for connection relationships between the ETC gantries from the gantry connectivity basic data to construct a gantry connectivity graph of the target area, wherein each vertex in the gantry connectivity graph represents a different ETC gantries, and an edge in the gantry connectivity graph represents that there is a connection relationship between the ETC gantries located at both ends of the edge;
[0016] The gantry connectivity diagram, the gantry connectivity matrix and the gantry connectivity basic data are stored in a preset database.
[0017] In some embodiments of the present application, the acquiring of historical traffic status data of the target area within a historical time period according to the gantry connectivity matrix and the gantry connectivity basic data includes:
[0018] Get the start and end time of the preset historical time period;
[0019] According to the start time and the end time of the historical time period, extracting the gantry connectivity diagram, the gantry connectivity matrix and the gantry connectivity basic data within the historical time period from the database;
[0020] Preprocessing the gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data within the historical time period;
[0021] Based on the pre-processed gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data within the historical time period, historical traffic status data of the target area within the historical time period is obtained.
[0022] In some embodiments of the present application, the historical traffic status data includes: historical traffic flow data and historical traffic flow speed data;
[0023] Correspondingly, the traffic status average value includes: the traffic flow average value and the traffic flow speed average value;
[0024] The traffic state differential learning value includes: a traffic flow differential learning value and a traffic flow speed differential learning value;
[0025] The traffic situation label includes: data for representing the traffic flow, traffic flow speed, traffic congestion index and traffic safety index of the target area in a single preset unit time period.
[0026] In some embodiments of the present application, the method of training a preset hybrid prediction model using the traffic state average value and the traffic state differential learning value in each preset unit time period respectively provided with the traffic state label, so as to train the hybrid prediction model as a traffic state prediction model for predicting the traffic state of the target area in the future unit time period, includes:
[0027] Taking each of the unit time periods as a unit, taking the average value of the traffic state and the traffic state difference learning value in each of the unit time periods with the traffic situation label as initial samples;
[0028] Performing data cleaning and preset standard format conversion on each of the initial samples to obtain target samples corresponding to each of the initial samples;
[0029] Dividing each of the target samples into a training set, an evaluation set and a test set respectively;
[0030] The training set is used to train a preset hybrid prediction model, so that the hybrid prediction model outputs the traffic situation prediction data of the target area in a future unit time period;
[0031] The evaluation set and the test set are used to evaluate and test the trained hybrid prediction model, so as to determine the hybrid prediction model that has passed the evaluation and the test as a traffic situation prediction model for predicting the traffic situation of the target area within a future unit time period.
[0032] In some embodiments of the present application, the hybrid prediction model includes: an input layer, a feature extraction layer, a model combination layer, and an output layer connected in sequence;
[0033] The input layer is used to receive a target sample, wherein the target sample includes the traffic state average value and the traffic state differential learning value of the target area within the unit time period, and the target sample is provided with the traffic situation label;
[0034] The feature extraction layer is used to extract the feature vector corresponding to the target sample;
[0035] The model combination layer is used to input the feature vectors into a plurality of different types of classification models, so that each of the classification models outputs the traffic situation prediction data corresponding to the feature vectors;
[0036] The output layer is used to perform weighted averaging processing on the traffic situation prediction data corresponding to the characteristic vector output by each of the classification models to obtain the traffic situation prediction result data corresponding to the target sample, wherein the traffic situation prediction result data includes: the prediction result data of traffic flow, traffic flow speed, traffic congestion index and traffic safety index of the target area in a future unit time period.
[0037] In some embodiments of the present application, each of the classification models in the model combination layer includes: a linear regression LR model, a vector autoregression VAR model, and an extreme gradient boosting XGBoost model.
[0038] Another aspect of the present application provides a traffic situation prediction method, comprising:
[0039] Obtain the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the current unit time period;
[0040] The traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the current unit time period are input into a preset traffic situation prediction model, so that the traffic situation prediction model correspondingly outputs the prediction result data of the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the future unit time period, wherein the traffic situation prediction model is pre-trained based on the training method of the traffic situation prediction model described in the first aspect.
[0041] The third aspect of the present application provides a training device for a traffic situation prediction model, comprising:
[0042] A matrix construction module, used to construct a gantry connectivity matrix of the target area based on the gantry connectivity basic data of the target area;
[0043] A historical data acquisition module, used to acquire historical traffic status data of the target area within a historical time period according to the gantry connectivity matrix and the gantry connectivity basic data;
[0044] A training data construction module, for obtaining, based on the historical traffic status data, an average value of the traffic status of the target area in each preset unit time period in the historical time period and a traffic status differential learning value, and setting a corresponding traffic situation label for each preset unit time period;
[0045] The model training module is used to train a preset hybrid prediction model using the average value of the traffic state in each preset unit time period respectively provided with the traffic state label and the traffic state differential learning value, so as to train the hybrid prediction model into a traffic situation prediction model for predicting the traffic situation of the target area in the future unit time period.
[0046] A fourth aspect of the present application provides a traffic situation prediction device, comprising:
[0047] A data acquisition module is used to obtain the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the current unit time period;
[0048] A model prediction module is used to input the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the current unit time period into a preset traffic situation prediction model, so that the traffic situation prediction model correspondingly outputs the prediction result data of the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the future unit time period, wherein the traffic situation prediction model is pre-trained based on the training method of the traffic situation prediction model described in the first aspect.
[0049] The fifth aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the training method of the traffic situation prediction model and / or implements the traffic situation prediction method.
[0050] The sixth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the training method of the traffic situation prediction model and / or implements the traffic situation prediction method.
[0051] The seventh aspect of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the training method of the traffic situation prediction model and / or implements the traffic situation prediction method.
[0052] The training method of the traffic situation prediction model provided in the present application constructs a gantry connectivity matrix of the target area based on the gantry connectivity basic data of the target area; obtains the historical traffic status data of the target area in a historical time period according to the gantry connectivity matrix and the gantry connectivity basic data; obtains the traffic status average value and traffic status differential learning value of the target area in each preset unit time period in the historical time period based on the historical traffic status data, and sets a corresponding traffic situation label for each preset unit time period; uses the traffic status average value and traffic status differential learning value in each preset unit time period respectively provided with the traffic situation label to train a preset hybrid Prediction model, in order to train the hybrid prediction model into a traffic situation prediction model for predicting the traffic situation of the target area within a future unit time period, can effectively improve the reliability and effectiveness of the data used to train the traffic situation prediction model, and thus can effectively improve the accuracy and reliability of the results of predicting the traffic situation using the trained traffic situation prediction model, and can improve the degree of automation and intelligence of traffic situation prediction, and then can use the prediction results as input data for other downstream traffic applications, which can not only assist in decision-making and intervention for traffic data management to provide strong technical support and guarantee, but also can provide strong technical support for building a green, smart and sustainable urban transportation system.
[0053] Additional advantages, purposes, and features of the present application will be partially described in the following description, and will become partially apparent to those skilled in the art after studying the following, or may be learned from the practice of the present application. The purposes and other advantages of the present application can be achieved and obtained by the structures specifically pointed out in the specification and the drawings.
[0054] Those skilled in the art will understand that the purposes and advantages that can be achieved by the present application are not limited to the above specific description, and the above and other purposes that can be achieved by the present application will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The drawings described herein are used to provide a further understanding of the present application, constitute a part of the present application, and do not constitute a limitation of the present application. The components in the drawings are not drawn to scale, but are only for the purpose of illustrating the principles of the present application. In order to facilitate the illustration and description of some parts of the present application, the corresponding parts in the drawings may be enlarged, that is, they may become larger relative to other components in the exemplary device actually manufactured according to the present application. In the drawings:
[0056] Figure 1 Schematic diagram of the flow of a training method for a traffic situation prediction model in one embodiment of the present application.
[0057] Figure 2 1 is a flow chart of step 100 in a method for training a traffic situation prediction model in an embodiment of the present application.
[0058] Figure 3 2 is a flow chart of step 200 in a method for training a traffic situation prediction model in an embodiment of the present application.
[0059] Figure 4 4 is a flow chart of step 400 in the training method of the traffic situation prediction model in one embodiment of the present application.
[0060] Figure 5 Schematic diagram of the flow of a traffic situation prediction method in one embodiment of the present application.
[0061] Figure 6 Schematic diagram of the structure of a training device for a traffic situation prediction model in one embodiment of the present application.
[0062] Figure 7 Schematic diagram of the structure of a traffic situation prediction device in one embodiment of the present application.
[0063] Figure 8 Schematic diagram of the architecture of a traffic situation prediction system in an application example of the present application.
[0064] Fig. 9 This is a flowchart for constructing portal frame connectivity data and basic data processing in area A in an application example of this application.
[0065] Fig.10 This is a statistical business process diagram in an application example of this application.
[0066] Fig.11 This is a traffic flow and flow rate prediction business process diagram in an application example of this application. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the implementation modes and the accompanying drawings. Here, the illustrative implementation modes and descriptions of the present application are used to explain the present application, but are not intended to limit the present application.
[0068] It should also be noted here that in order to avoid obscuring the present application due to unnecessary details, only the structures and / or processing steps closely related to the scheme according to the present application are shown in the accompanying drawings, while other details that are not very relevant to the present application are omitted.
[0069] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0070] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0071] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0072] In order to accurately and automatically predict the situation of traffic data, the embodiments of the present application respectively provide a method for training a traffic situation prediction model, a device for training a traffic situation prediction model for executing the training method of the traffic situation prediction model, a traffic situation prediction method, a traffic situation prediction device for executing the traffic situation prediction method, an electronic device, a computer-readable storage medium and a computer program product, which can effectively improve the reliability and effectiveness of the data used to train the traffic situation prediction model, and thus can effectively improve the accuracy and reliability of the results of predicting the traffic situation using the trained traffic situation prediction model, and can improve the degree of automation and intelligence of traffic situation prediction.
[0073] The details are described in detail through the following examples.
[0074] Based on this, the embodiment of the present application provides a method for training a traffic situation prediction model that can be implemented by a training device for a traffic situation prediction model, see Figure 1 The training method of the traffic situation prediction model specifically includes the following contents:
[0075] Step 100: Based on the portal frame connectivity basic data of the target area, construct a portal frame connectivity matrix of the target area.
[0076] In one or more embodiments of the present application, the target area refers to an area involving traffic data within a preset area range, and can be set to an area involving traffic data in a region, city, provincial capital or country, etc. according to actual conditions. In order to further improve the comprehensiveness of traffic situation prediction and the effectiveness of the results, in one example, the target area may specifically refer to all areas involving traffic data in a country, and these areas involving traffic data specifically refer to urban traffic and / or highways where ETC gantries and toll collection units are installed and may generate traffic data.
[0077] The traffic data may include various types of traffic-related data such as traffic flow data, traffic event data, collected data of traffic-related facilities, and facility parameters, which may be set according to actual application scenarios.
[0078] It should be noted that the ETC (Electronic Toll Collection) gantry is an important facility for toll booths to realize electronic non-stop toll collection, and has functions such as multi-path identification and automatic billing for passing vehicles. Non-stop toll collection can be realized by communicating with the ETC gantry system in the ETC lane of the toll booth through the on-board electronic tag installed on the windshield of the vehicle. The ETC gantry is set up above areas such as highways like a traffic probe. The information of the on-board ETC is read through a radio frequency device to accurately record the vehicle's driving path, and the vehicle does not have to slow down when passing. Accurate billing is achieved while ensuring fast non-stop passage. In one or more embodiments of the present application, the ETC gantry refers to a physical gantry.
[0079] The charging unit mentioned in this application specifically refers to the toll booths, toll plazas and related billing equipment on the highway. The charging unit is usually set at the entrance and exit of the highway, and the relationship between it and the ETC gantry can be in various forms. According to the logic in the script, there can be no connection relationship, one-way connection relationship and two-way connection relationship between the two:
[0080] 1. No connection relationship means that there is no direct connection path between the toll collection unit and the ETC gantry in the road network topology.
[0081] 2. A one-way connection relationship refers to a connection path from the toll collection unit to the ETC gantry or from the ETC gantry to the toll collection unit in only one direction. This situation is represented in the script through the unitGraph dictionary, in which only one-way key-value pairs exist.
[0082] 3. A two-way connection relationship means that there is a two-way connection path between the toll collection unit and the ETC gantry. In the script, this relationship is represented by the equals dictionary, where the toll collection unit and the corresponding ETC gantry are key values for each other.
[0083] The direction and weight (such as mileage) of the connection are determined based on the data in the all_unit_edge_with_gantry list. This list contains the connection information and corresponding mileage data between toll units and between toll units and gantries.
[0084] The script uses a breadth-first search (BFS) algorithm to traverse these connections and build a more complex gantry graph. The gantry graph takes into account the various connections between the toll units and the gantries, so that the connection paths and cumulative weights (such as total mileage) between the gantries can be calculated.
[0085] In addition, the script also takes into account the type of gantry (such as ROAD, ENTRY, EXIT, etc.), and this information is used to further enrich the properties of the connections between gantries. This detailed topology helps in more accurate path planning and cost calculation.
[0086] In one or more embodiments of the present application, the gantry connectivity basic data refers to data that can be used to represent the connectivity relationship between each ETC gantries in the target area, but the gantry connectivity basic data is not limited to only data that can directly represent the connectivity relationship between each ETC gantries, and can also include other data that can indirectly represent the connectivity relationship between each ETC gantries and other related data, which can be specifically set according to the actual application scenario. In one example, the gantry connectivity basic data may at least include: data for representing the connectivity data between each of the charging units, identification information corresponding to each of the ETC gantries, the corresponding relationship between each of the target gantries and the charging unit, and the connection relationship between each of the ETC gantries.
[0087] In addition, the gantry connectivity matrix in step 100 is composed of connectivity marks corresponding to each of the target gantries, and the connectivity marks are used to indicate whether the two charging units corresponding to the target gantries are adjacent or non-adjacent.
[0088] Step 200: Acquire historical traffic status data of the target area within a historical time period according to the gantry connectivity matrix and the gantry connectivity basic data.
[0089] Step 300: Based on the historical traffic status data, obtain the traffic status average value and traffic status differential learning value of the target area in each preset unit time period in the historical time period, and set a corresponding traffic situation label for each preset unit time period.
[0090] In step 300, the historical time period can be preset, for example, it can be selected as a certain week, a certain month or a certain number of days in the past, etc., and can be set according to actual application requirements. The unit time period refers to the unit that divides the historical time period into time periods. For example, if the historical time period is a certain week or a certain month in the past, the unit time period can be selected as one hour, several hours or one day, etc.
[0091] In one or more embodiments of the present application, the traffic situation label refers to an identifier used to indicate the traffic situation; the traffic situation mentioned in the present application refers to the traffic status and / or trend, and the content contained therein can be set according to the data type required for traffic management.
[0092] In one embodiment of the present application, the historical traffic status data may include: historical traffic flow data and historical traffic flow speed data.
[0093] Correspondingly, the traffic status average value may include: determining the traffic flow average value by calculating the average value of the flow values in unit time periods according to the historical traffic flow data, and determining the traffic flow speed average value by calculating the average value of the flow speed values in unit time periods according to the historical traffic flow speed data.
[0094] The traffic status differential learning value may include: a traffic flow differential learning value and a traffic speed differential learning value; the traffic flow differential learning value refers to a differential learning value calculated based on the flow value of the current unit time period and the flow value of the previous unit time period in the historical traffic flow data for each unit time period; the traffic speed differential learning value refers to a differential learning value calculated based on the flow value of the current unit time period and the flow value of the previous unit time period in the historical traffic speed data for each unit time period.
[0095] The traffic situation label includes: data used to represent the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in a single preset unit time period, such as the corresponding values, value ranges, different levels of color expression or different levels of identifiers of the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in a single preset unit time period, which can be set according to the actual application scenario.
[0096] Step 400: Using the traffic state average value and the traffic state differential learning value in each preset unit time period respectively provided with the traffic state label, a preset hybrid prediction model is trained to train the hybrid prediction model into a traffic state prediction model for predicting the traffic state of the target area in the future unit time period.
[0097] In step 400, a sample training hybrid prediction model is set with unit time periods as units, that is, each sample also has the traffic state average value and the traffic state differential learning value in a unit time period uniquely corresponding to the sample.
[0098] In one or more embodiments of the present application, the hybrid prediction model refers to a hybrid model composed of multiple types of prediction models.
[0099] From the above description, it can be seen that the training method of the traffic situation prediction model provided in the embodiment of the present application can effectively improve the reliability and effectiveness of the data used to train the traffic situation prediction model, and thus can effectively improve the accuracy and reliability of the results of predicting traffic situations using the trained traffic situation prediction model, and can improve the degree of automation and intelligence of traffic situation prediction, and thus can use the prediction results as input data for other downstream traffic applications, which can not only assist in decision-making and intervention for traffic data management to provide strong technical support and guarantee, but also can provide strong technical support for building a green, smart and sustainable urban transportation system.
[0100] In order to further improve the effectiveness and reliability of constructing the gantry connectivity matrix of the target area, and to further improve the effectiveness and reliability of the training of the traffic situation prediction model, in a training method of a traffic situation prediction model provided in an embodiment of the present application, see Figure 2 , step 100 in the training method of the traffic situation prediction model specifically includes the following contents:
[0101] Step 110: Acquire the collected data of the toll stations, toll plazas, ETC gantries, toll collection units, basic road network structures and toll collection unit GPS on the highways in the target area to form the current gantry connectivity basic data of the target area.
[0102] In step 110:
[0103] 1. A toll plaza is a large toll area at the entrance or exit of a highway, usually containing multiple toll lanes (including manual toll lanes and ETC lanes). In the script, this may correspond to certain specific types of records in the fcs_toll_gantry.json file.
[0104] 2. The basic road network structure refers to the topological structure of the highway network, including the connection relationship and distance information between each road section. In the script, this is mainly reflected in the fcs_calc_node_info.json and fcs_calc_node.json files, which contain the connection information between nodes (which may be toll booths or gantries).
[0105] 3. Toll unit GPS refers to the geographic location coordinates of each toll unit (including toll booths and ETC gantry). Although the GPS coordinates are not directly mentioned in the script, this information may be contained in fcs_toll_gantry.json or other data files that are not displayed.
[0106] In addition, other important concepts in the script include:
[0107] (1) ETC gantry: It is identified by the etc_gantry_hex field in the script and represents the key equipment of the electronic toll collection system.
[0108] (2) Charging unit: This may correspond to the unit_id field in the script, representing the basic billing unit in the charging system.
[0109] (3) Basic data of gantry connectivity: The script constructs this data by processing various input files (such as fcs_toll_gantry.json, fcs_calc_node_info.json, etc.), and finally generates data structures including gantryGraph and unitGraph, which describe the connection relationship between the gantry and the toll unit.
[0110] The script uses this data to construct a complex connectivity graph, including connections between units, connections between units and gantries, and the resulting connections between gantries.
[0111] Step 120: Extract connectivity data between each of the charging units from the gantry connectivity basic data, and construct a corresponding charging unit connectivity graph, wherein each vertex in the charging unit connectivity graph represents a different charging unit, and an edge in the charging unit connectivity graph represents a connection relationship between the charging units located at both ends of the edge.
[0112] In an example of step 120, a basic charging unit connectivity graph is constructed based on the connectivity data of charging units in region A of a particular country. The specific implementation process is as follows:
[0113] (1) Obtain the connectivity data of the charging units in region A, including the adjacency information of each charging unit.
[0114] (2) Data preprocessing: Clean the connectivity data of the charging units and remove duplicate and erroneous data.
[0115] (3) Initialize the connected graph structure: Create an empty graph structure, where vertices represent charging units and edges represent the connection relationship between charging units.
[0116] (4) Traverse each charging unit and add vertices and edges to the graph structure based on its adjacency information.
[0117] (5) The construction of the graph structure is completed, and a charging unit connectivity graph is obtained, which can represent the connectivity of the charging units in area A.
[0118] Therefore, step 120 can convert the connectivity data of the charging unit into an operational graph structure, thereby ensuring the integrity and accuracy of the charging unit related data.
[0119] Step 130: Select multiple ETC gantries in the gantry connectivity basic data as target gantries.
[0120] In an example of step 130, taking region A as an example, the gantry data of region A is processed, and clusters are divided according to the same hex code. Each cluster selects the first entity gantry in the lexicographic order (i.e. the aforementioned ETC gantry, which can also be referred to as the gantry) to represent the unique target gantry. The specific implementation process is as follows:
[0121] (1) Obtain the gantry data of area A, where each gantry contains a corresponding hexadecimal code.
[0122] (2) The gantry data is grouped according to the hex code to form multiple clusters.
[0123] (3) Sort the portal frames in each cluster in lexicographic order. The lexicographic order is based on the alphanumeric order of the portal frame ID or name.
[0124] (4) Select the first entity gantry in the lexicographic order in each cluster as the representative gantry of the cluster, i.e., the target gantry.
[0125] (5) Record the relationship between each representative gantry and its corresponding cluster and store it as a mapping table.
[0126] Therefore, step 130 is used to ensure that a unique representative gantry is selected in each hex code cluster to reduce data redundancy and ensure data consistency.
[0127] Step 140: Search the correspondence between each of the target gantries and the charging unit from the gantry connectivity basic data, and construct a gantry connectivity matrix of the target area according to the correspondence between each of the target gantries and the charging unit and the charging unit connectivity map, wherein the gantry connectivity matrix is composed of connectivity marks corresponding to each of the target gantries, and the connectivity marks are used to indicate whether two of the charging units corresponding to the target gantries are adjacent or non-adjacent.
[0128] In an example of step 140, taking region A as an example, according to the corresponding relationship between the target gantry and the charging unit in the gantry data of region A, a gantry connectivity matrix is constructed based on the charging unit connectivity graph. The specific implementation process is as follows:
[0129] (1) Obtain the corresponding relationship data between the target gantry and the charging unit.
[0130] (2) Initialize a matrix, where the rows and columns of the matrix represent the target gantries respectively.
[0131] (3) Traverse the charging unit connectivity graph and find the corresponding target gantry for each pair of adjacent charging units.
[0132] (4) If two charging units are adjacent, the corresponding positions in the gantry connectivity matrix are marked as connected.
[0133] This process can also consider the directionality of each connectivity relationship to ensure that the matrix correctly reflects unidirectional and bidirectional connectivity relationships.
[0134] Therefore, step 140 can further refine the charging unit connectivity diagram by constructing a gantry connectivity matrix, which is convenient for subsequent flow and flow rate statistics and predictions.
[0135] If a certain gantry is bidirectionally connected to a certain charging unit, it means that the charging unit completely corresponds to the gantry, and the gantry will replace the charging unit. The specific implementation process is as follows:
[0136] (1) Traverse the corresponding relationship data between the charging unit and the gantry.
[0137] (2) For each charging unit, check its connection with the gantry.
[0138] (3) If the connection relationship is a bidirectional connection, the charging unit is replaced with the corresponding gantry in the charging unit connectivity graph, ensuring that the topological structure of the charging unit connectivity graph remains consistent after the replacement.
[0139] This process can ensure the accuracy and completeness of the toll unit connectivity map, so that the toll unit connectivity map can better reflect the actual road network structure.
[0140] If a gantry is in a one-way connection with a charging unit, it means that the charging unit is connected to the gantry. Then, the gantry and the edge are added to the charging unit connection graph according to the one-way connection. The specific implementation process is as follows:
[0141] (1) Traverse the corresponding relationship data between the charging unit and the gantry.
[0142] (2) For each charging unit, check its connection with the gantry.
[0143] (3) If the connection is a one-way connection, add an edge to the toll unit connectivity graph to indicate the one-way connection between the toll unit and the gantry. Ensure that the directionality of the added edge is correct and reflects the actual road network structure.
[0144] This process can supplement the data of one-way connection relationships, making the charging unit connectivity map more accurate and complete.
[0145] Step 150: Search the connection relationship between the ETC gantries from the gantry connectivity basic data to construct a gantry connectivity graph of the target area, wherein each vertex in the gantry connectivity graph represents a different ETC gantries, and an edge in the gantry connectivity graph represents the existence of a connection relationship between the ETC gantries located at both ends of the edge.
[0146] In an example of step 150, taking region A as an example, by constructing the portal frame connection data of region A, the connection records of portal frames within and outside the province can be well processed. The specific implementation process is as follows:
[0147] (1) Obtain the connectivity data of the gantries in region A, including the connection relationship between gantries within and outside the province.
[0148] (2) Data preprocessing: Clean the gantry connectivity data and remove duplicate and erroneous data.
[0149] (3) Construct a gantry connectivity diagram to ensure that the gantry connectivity relationships within and outside the province are correctly reflected in the gantry connectivity diagram.
[0150] (4) Process cross-provincial gantry connectivity records and ensure that cross-provincial connectivity relationships are correctly recorded in the gantry connectivity diagram.
[0151] Therefore, step 150 can ensure that the connectivity map can accurately reflect the gantries connectivity relationship within and outside the province, and is applicable to all areas in region A.
[0152] Step 160: storing the gantry connectivity diagram, the gantry connectivity matrix and the gantry connectivity basic data into a preset database.
[0153] In step 160, the portal frame connectivity diagram, the portal frame connectivity matrix and the portal frame connectivity basic data may be stored in a preset info.pkl file. Specifically:
[0154] 1. Door frame connection diagram:
[0155] In the script, this mainly corresponds to the gantryGraph dictionary. It represents the connection relationship between ETC gantries, including the existence and weight (such as mileage) of the connection.
[0156] 2. Gantry connectivity matrix:
[0157] Although the script does not directly generate a matrix data structure, the edges dictionary actually represents a sparse matrix. It uses the index of the gantry as the key and the list of connected gantry indices as the value, which can be easily converted to a connectivity matrix.
[0158] 3. Basic data of gantry connection:
[0159] This includes several key data structures:
[0160] (1) id2idx and idx2id: mapping between gantry ID and index.
[0161] (2) hex2id and id2hex: mapping between the hexadecimal code of the gantry and its ID.
[0162] (3) all_edge: contains a list of all gantry connections, each connection is a triplet [starting gantry ID, ending gantry ID, ending gantry type].
[0163] (4) all_edge_with_weight: Similar to all_edge, but the third element is the weight of the connection (such as mileage) instead of the type.
[0164] In an example of step 160, the gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data stored in the info.pkl file may exist as five data identifiers, namely, id2idx, idx2id, edges, shortest_path and gantry_edges_weight.
[0165] Among them, id2idx, idx2id, edges, shortest path, and gantry_edges_weight have the following meanings:
[0166] (1) id2idx: the mapping between the gantry id and the index of the gantry in the gantry connectivity graph, which can be extracted from the gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data.
[0167] (2) idx2id: The mapping of the gantry index in the gantry connectivity graph and the gantry id, which can be extracted from the gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data.
[0168] (3) edges: a dictionary of the gantry connectivity graph, which represents the connectivity relationship between the gantries and can be extracted from the gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data.
[0169] (4) shortest_path: the number of gantries corresponding to the shortest path between gantries, which can be extracted from the gantries connectivity graph.
[0170] (5) gantry_edges_weight: a dictionary of weighted gantry connectivity graphs, representing the weights of the connectivity relationships between gantries, which can be extracted from the gantry connectivity matrix.
[0171] Step 160 can ensure the integrity and consistency of the data required for statistics and prediction, and provide a basis for subsequent data analysis and model prediction.
[0172] In order to further improve the effectiveness and accuracy of obtaining the historical traffic status data of the target area within the historical time period, so as to further improve the effectiveness and accuracy of the training of the traffic situation prediction model, in a training method of a traffic situation prediction model provided in an embodiment of the present application, see Figure 3 , step 200 in the training method of the traffic situation prediction model specifically includes the following contents:
[0173] Step 210: Obtain the start time and end time of a preset historical time period.
[0174] Step 220: According to the start time and the end time of the historical time period, the gantry connectivity diagram, the gantry connectivity matrix and the gantry connectivity basic data within the historical time period are extracted from the database.
[0175] Step 230: pre-processing the gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data within the historical time period.
[0176] Step 240: Based on the pre-processed gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data within the historical time period, the historical traffic status data of the target area within the historical time period is obtained.
[0177] In a specific example of the above steps 210 to 240, the required data can be loaded from the info.pkl file first, and then the start time (startTime) and end time (endTime) of the historical time period and the time span parameter (span) can be set. The current time can be obtained and corrected to the nearest 15 minutes, and the time difference between the current time and the start time (startTime) can be ensured to be less than the time span parameter (span), that is, sufficient time is ensured to obtain sufficient data.
[0178] Then, in an example of step 300, data can be obtained from the database, and the overall flow rate and flow (road_count) and the flow rate and flow of different vehicle types (road_detail_count) can be calculated. The specific implementation process is as follows:
[0179] (1) Connect to the database, execute SQL query, and obtain the gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data between the start time (startTime) and the end time (endTime) of the historical time period from the database.
[0180] (2) Load the acquired data into memory for preliminary cleaning and processing.
[0181] (3) Calculate the overall flow rate and traffic (road_count): Traverse all data records and count the number of vehicles passing through each gantry and the vehicle speed.
[0182] (4) Calculate the flow speed and volume of different vehicle types (road_detail_count): Classify and count vehicles according to their types, and calculate the number and speed of each type of vehicle.
[0183] (5) Save the calculation results to temporary variables for subsequent use.
[0184] In step 300, the velocity change rate and flow change rate can be calculated based on the velocity and flow data, and each can be multiplied by the weight of different scenarios to obtain the sum of the weighted velocity change rate and the weighted flow change rate. On this basis, the congestion index of 0 to 5 is obtained in combination with the normalization factor. Similarly, a safety index of 0 to 5 is obtained based on the weights and flow difference ratios and flow velocity difference ratios under different situations. At the same time, the historical average calculation (get_history_averages) function is called to calculate the historical average of the flow, flow velocity, congestion index and safety index of each section in the target area based on the historical data of the past 7 days, as a smoothing benchmark for flow and flow velocity prediction. The specific implementation process is as follows:
[0185] (1) Calculate the velocity change rate and flow rate change rate:
[0186] Flow rate change rate = (current flow rate - flow rate in the previous time period) / flow rate in the previous time period;
[0187] Traffic change rate = (current traffic - traffic in the previous time period) / traffic in the previous time period.
[0188] (2) Calculate the weighted rate of change:
[0189] Weighted flow rate change rate = flow rate change rate × flow rate weight;
[0190] Weighted flow rate of change = flow rate of change × flow weight;
[0191] Total rate of change = weighted velocity change + weighted flow rate change rate.
[0192] (3) Calculation of congestion index:
[0193] Congestion index = normalization factor × total change rate;
[0194] The congestion index ranges from 0 to 5, reflecting the degree of congestion.
[0195] (4) Calculation of safety index:
[0196] Safety index = normalization factor × (flow difference ratio × flow weight + velocity difference ratio × velocity weight);
[0197] The safety index ranges from 0 to 5, reflecting the degree of safety.
[0198] (5) Calculate the historical mean:
[0199] Call the historical average calculation (get_history_averages) function to calculate the historical average of the flow rate, flow speed, congestion index and safety index of each road section based on the historical data of the past 7 days.
[0200] The historical mean is used as a smoothing benchmark for flow and velocity forecasts.
[0201] The overall speed and flow (road_count) and the speed and flow of different vehicle types (road_detail_count) can then be saved in the database and saved locally on the server in a comma separated value csv for prediction.
[0202] Then combine historical traffic data including flow, speed, congestion and risk information into a dictionary, and extract data from the database according to the predicted time range. The specific implementation process is as follows:
[0203] (1) Connect to the database and execute SQL queries to extract historical traffic data within a specified time range from the database.
[0204] (2) Load the extracted data into memory for preliminary processing.
[0205] (3) Organize the processed data into a dictionary structure. The key-value pairs of the dictionary include:
[0206] traffic_volume: traffic volume data;
[0207] traffic_speed: traffic speed data;
[0208] congestion_index: congestion index data;
[0209] safety_index: safety index data.
[0210] In order to further improve the training effectiveness and accuracy of the traffic situation prediction model, in a training method for a traffic situation prediction model provided in an embodiment of the present application, see Figure 4 , step 400 in the training method of the traffic situation prediction model specifically includes the following contents:
[0211] Step 410: Taking each unit time period as a unit, the traffic state average value and the traffic state differential learning value in each unit time period with the traffic situation label are used as initial samples.
[0212] Step 420: Perform data cleaning and preset standard format conversion on each of the initial samples to obtain a target sample corresponding to each of the initial samples.
[0213] Step 430: Divide each of the target samples into a training set, an evaluation set, and a test set.
[0214] Step 440: Use the training set to train a preset hybrid prediction model so that the hybrid prediction model outputs corresponding traffic situation prediction data of the target area within a future unit time period.
[0215] Step 450: Use the evaluation set and the test set to evaluate and test the trained hybrid prediction model, so as to determine the hybrid prediction model that has passed the evaluation and test as a traffic situation prediction model for predicting the traffic situation of the target area within a future unit time period.
[0216] In an example of step 410 to step 450, the data may be cleaned to remove noise and outliers, and the data may be converted into a json file suitable for model input. The specific implementation process is as follows:
[0217] (1) Perform a preliminary inspection of the data and mark obvious noise and outliers.
[0218] (2) Use interpolation or other methods to handle labeled noise and outliers.
[0219] (3) Convert the cleaned data into JSON format:
[0220] The data types saved in the json file include flow, flow rate, congestion index and safety index.
[0221] Each data entry contains information such as timestamp and corresponding traffic indicator value.
[0222] (4) Save the json file to the specified path.
[0223] Then, based on the data collection frequency, number of time periods, flow, flow rate, congestion index, and safety index, the data of the current time period is generated into training, evaluation, and test data sets. The specific implementation process is as follows:
[0224] (1) Divide the data into multiple time windows according to the data collection frequency and the number of time periods.
[0225] (2) For each time window, extract the flow rate, flow rate, congestion index and safety index data.
[0226] (3) Organize the data of each time window into a sample. The data content of the sample includes:
[0227] Input features: flow rate, flow rate, congestion index, and safety index in the past N time periods.
[0228] Target tags: flow rate, flow rate, congestion index and safety index in the next time period.
[0229] (4) Divide the samples into training set, evaluation set and test set to ensure the distribution and time continuity of the data set.
[0230] Then set the prediction length (pred_len), generate labels, i.e., data and feature sets within the window time, and train a separate model for each prediction length. The feature set includes the historical mean of the past 7 days as a smoothing benchmark, as well as the flow and velocity differential learning values from the previous time unit. Then, based on the end time of the input file, generate a prediction time period, and use the input speed and flow data to make predictions for each prediction length. Upload the predicted flow, velocity, congestion index, and safety index to the database.
[0231] In order to further improve the effectiveness and accuracy of the traffic situation prediction results of the traffic situation prediction model, in a training method for a traffic situation prediction model provided in an embodiment of the present application, the hybrid prediction model in the training method for the traffic situation prediction model includes: an input layer, a feature extraction layer, a model combination layer and an output layer connected in sequence;
[0232] The input layer is used to receive a target sample, wherein the target sample includes the traffic state average value and the traffic state differential learning value of the target area within the unit time period, and the target sample is provided with the traffic situation label;
[0233] The feature extraction layer is used to extract the feature vector corresponding to the target sample;
[0234] The model combination layer is used to input the feature vectors into a plurality of different types of classification models, so that each of the classification models outputs the traffic situation prediction data corresponding to the feature vectors;
[0235] The output layer is used to perform weighted averaging processing on the traffic situation prediction data corresponding to the characteristic vector output by each of the classification models to obtain the traffic situation prediction result data corresponding to the target sample, wherein the traffic situation prediction result data includes: the prediction result data of traffic flow, traffic flow speed, traffic congestion index and traffic safety index of the target area in a future unit time period.
[0236] In one embodiment of the present application, each of the classification models in the model combination layer may include: a linear regression LR model, a vector autoregression VAR model, and an extreme gradient boosting XGBoost model. In other words, the model architecture adopted by the traffic situation prediction model trained in the present application is a hybrid model, which combines the linear regression (LR), vector autoregression (VAR) and extreme gradient boosting (XGBoost) models. In one example, the input layer can be used to receive the historical mean and differential learning value of the past 7 days. The feature extraction layer can be used to extract features from input data and generate feature vectors. The model combination layer can be used to make predictions using LR, VAR and XGBoost respectively to obtain the predicted values of the three models. The output layer can be used to weighted average the predicted values of the three models to obtain the final prediction result.
[0237] In an example of the model training phase of the hybrid prediction model, the following contents may be included:
[0238] (1) Data preprocessing:
[0239] Normalize the historical data.
[0240] Generate input features, including the historical mean of the past 7 days and the differential learning value from the previous time unit.
[0241] (2) Label settings:
[0242] The target labels are the flow rate, flow rate, congestion index and safety index within the window time.
[0243] (3) Training process:
[0244] The LR, VAR and XGBoost models are trained using the training set.
[0245] During the training process, the cross-validation method is used to adjust the model parameters and optimize the model performance.
[0246] Based on the above-mentioned embodiment of the training method of the traffic situation prediction model, the present application also provides an embodiment of a traffic situation prediction method, see Figure 5 The traffic situation prediction method specifically includes the following contents:
[0247] Step 500: Obtain the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the current unit time period.
[0248] Step 600: Input the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the current unit time period into a preset traffic situation prediction model, so that the traffic situation prediction model correspondingly outputs the prediction result data of the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the future unit time period.
[0249] The traffic situation prediction model is trained in advance using the training method for the traffic situation prediction model provided in the aforementioned embodiment.
[0250] That is to say, during the online application stage of the model, the flow rate, flow rate, congestion index and safety index data of the current time period can be obtained in real time, and then the trained model can be used for prediction to obtain the predicted value of the next time period. The model parameters can also be updated regularly based on the latest data to ensure the timeliness and accuracy of the model.
[0251] From the above description, it can be seen that the traffic situation prediction method provided in the embodiment of the present application can improve the degree of automation and intelligence of traffic situation prediction, and then can use the prediction results as input data for other downstream traffic applications. It can not only assist in decision-making and intervention for traffic data management to provide strong technical support and guarantee, but also provide strong technical support for building a green, smart and sustainable urban transportation system.
[0252] In order to further illustrate the training method of the above-mentioned traffic situation prediction model and the embodiment of the traffic situation prediction method, the present application also provides a process example for the training method of the above-mentioned traffic situation prediction model and the traffic situation prediction method. In this example, taking area A as the target area, it mainly provides a precise traffic flow and flow velocity prediction situation awareness algorithm service based on machine learning using ETC gantry and toll station data for historical traffic analysis, real-time monitoring and future trend prediction, and involves the intersection of highway traffic condition monitoring records and computer science and technology. The specific process can be: based on the basic data of gantry connectivity in area A, a full-network gantry connectivity matrix is constructed; based on the above-mentioned topological structure and basic data, for the target area requesting situation awareness service, the historical flow velocity data of the target area for 7 days is used to calculate the historical mean as the smoothing benchmark of flow and flow velocity, and the historical mean is input into the trained LR, VAR and XGBoost models with the flow and flow velocity differential learning values per unit time to predict the traffic flow, flow velocity, congestion index and safety index of the request area in the future, which is used to characterize the current traffic status of the road section, quickly determine whether congestion occurs, and provide input data for other downstream traffic applications.
[0253] The basic data of gantry connectivity in area A include basic information such as toll stations, toll plazas, ETC gantries, toll units, basic road network structure and toll unit GPS within area A.
[0254] The full-network gantry connectivity matrix is based on the connectivity data of the charging units in area A, a basic charging unit connectivity map is constructed, and then according to the correspondence between the unique entity gantry and the charging unit in the gantry data in area A, a gantry connectivity matrix is constructed based on the charging unit connectivity map.
[0255] The in-transit data refers to the positioning data collected by the vehicle and the gantry information of the vehicle. The data statistics module processes the vehicle information of each gantry in the in-transit data, calculates the road flow velocity and flow data, and calculates the congestion index and safety index based on the calculated flow velocity change rate and flow change rate. The traffic flow and flow velocity prediction module uses the 7-day historical flow velocity average as the smoothing benchmark, combined with the flow and flow velocity differential learning value of the previous unit time, and predicts the traffic flow, flow velocity, congestion index and safety index of the region in the future based on the LR, VAR, and XGBoost machine learning models.
[0256] The steps for implementing the whole network gantry connectivity matrix construction process are as follows:
[0257] Step 1.1: Based on the connectivity data of the charging units in region A, construct a basic charging unit connectivity map.
[0258] Step 1.2: Process the gantry data of region A and divide them into clusters according to the same hex code. In each cluster, the first physical gantry in the lexicographic order is selected to represent the unique physical gantry.
[0259] Step 1.3: According to the correspondence between the unique entity gantry and the charging unit in the gantry data of area A, a gantry connectivity matrix is constructed based on the charging unit connectivity graph.
[0260] Step 1.4: If a certain gantry and a certain charging unit are in a two-way connection relationship, which means that the charging unit completely corresponds to the gantry, then the charging unit will be replaced by the gantry.
[0261] Step 1.5: If a gantry is connected to a charging unit in a one-way manner, it means that the charging unit and the gantry are connected. Then, the gantry and the edge are added to the charging unit connection graph according to the one-way connection relationship.
[0262] Step 1.6: By constructing the gantry connectivity data in region A, the connectivity records of gantries within and outside the province can be well handled.
[0263] Step 1.7: Save the data needed for statistics and prediction in the info.pkl file.
[0264] The steps for implementing the data statistics process are as follows:
[0265] Step 2.1: Load the required data from the info.pkl file, including id2idx, idx2id, edges, shortest_path, and gantry_edges_weight.
[0266] Step 2.2: Set the start time (startTime) and end time (endTime) of the historical time period and the time span parameter (span). Get the current time and correct it to the nearest 15 minutes, and make sure that the time difference between the current time and the startTime is less than the span, that is, ensure that there is enough time to obtain sufficient data.
[0267] Step 2.3: Get data from the database within the time period and calculate the overall flow rate and volume (road_count) and the flow rate and volume of different vehicle types (road_detail_count).
[0268] Step 2.4: Calculate the velocity change rate and flow change rate based on the velocity and flow data, multiply each by the weight of the different scenarios, and obtain the sum of the weighted velocity change rate and the weighted flow change rate. On this basis, combine the normalization factor to obtain a congestion index of 0 to 5. Similarly, according to the weights and flow difference ratios and flow difference ratios under different situations, a safety index of 0 to 5 is obtained. At the same time, call the historical average calculation (get_history_averages) function to calculate the historical average of the flow, flow speed, congestion index and safety index of each section in the target area based on the historical data of the past 7 days, as a smoothing benchmark for flow and flow speed prediction.
[0269] Step 2.5: Save the statistical data road_count and road_detail_count in the database and save them locally on the server in csv format for prediction.
[0270] The steps for implementing the traffic flow and flow rate prediction process are as follows:
[0271] Step 3.1: Combine historical traffic data including flow, speed, congestion and risk information into a dictionary and extract data from the database according to the predicted time range.
[0272] Step 3.2: Clean the data to remove noise and outliers, and convert the data into a json file suitable for model input.
[0273] Step 3.3: Generate the data of the current time period into training, evaluation, and test data sets based on the data collection frequency, number of time periods, flow, flow rate, congestion index, and safety index.
[0274] Step 3.4: Set pred_len, the prediction length, generate labels, i.e., data and feature sets within the window time, and train a separate model for each pred_len. The feature set includes the historical mean of the past 7 days as a smoothing benchmark, and the flow and velocity differential learning values from the previous time unit.
[0275] Step 3.5: Generate a forecast time period based on the end time of the input file, and use the input speed and flow data to make a forecast at each pred_len.
[0276] Step 3.6: Upload the predicted traffic volume, flow rate, congestion index, and safety index to the database.
[0277] From the software level, the present application also provides a training device for a traffic situation prediction model for executing all or part of the training method for the traffic situation prediction model, see Figure 6 The training device of the traffic situation prediction model specifically includes the following contents:
[0278] The matrix construction module 10 is used to construct the gantry connectivity matrix of the target area based on the gantry connectivity basic data of the target area.
[0279] The historical data acquisition module 20 is used to acquire the historical traffic status data of the target area within a historical time period according to the gantry connectivity matrix and the gantry connectivity basic data.
[0280] The training data construction module 30 is used to obtain the traffic status average value and traffic status differential learning value of the target area in each preset unit time period in the historical time period based on the historical traffic status data, and set a corresponding traffic situation label for each preset unit time period.
[0281] The model training module 40 is used to train a preset hybrid prediction model using the average value of the traffic state in each preset unit time period respectively provided with the traffic state label and the traffic state differential learning value, so as to train the hybrid prediction model into a traffic situation prediction model for predicting the traffic situation of the target area in the future unit time period.
[0282] The embodiment of the training device for the traffic situation prediction model provided in the present application can be specifically used to execute the processing flow of the embodiment of the training method for the traffic situation prediction model in the above-mentioned embodiment. Its functions will not be repeated here, and reference can be made to the detailed description of the embodiment of the training method for the traffic situation prediction model in the above-mentioned embodiment.
[0283] The part of the traffic situation prediction model training device that performs the training of the traffic situation prediction model can be executed in the server or completed in the client device. The specific selection can be based on the processing power of the client device and the limitations of the user's usage scenario. This application is not limited to this. If all operations are completed in the client device, the client device may also include a processor for specific processing of the training of the traffic situation prediction model.
[0284] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.
[0285] The server and the client device may communicate with each other using any suitable network protocol, including network protocols that have not yet been developed on the date of filing this application. The network protocols may include, for example, TCP / IP, UDP / IP, HTTP, HTTPS, etc. Of course, the network protocols may also include, for example, RPC (Remote Procedure Call Protocol) and REST (Representational State Transfer) protocols used on top of the above protocols.
[0286] From the above description, it can be seen that the training device of the traffic situation prediction model provided in the embodiment of the present application can effectively improve the reliability and effectiveness of the data used to train the traffic situation prediction model, and thus can effectively improve the accuracy and reliability of the results of predicting the traffic situation using the trained traffic situation prediction model, and can improve the degree of automation and intelligence of traffic situation prediction, and thus can use the prediction results as input data for other downstream traffic applications, which can not only assist in decision-making and intervention for traffic data management to provide strong technical support and guarantee, but also can provide strong technical support for building a green, smart and sustainable urban transportation system.
[0287] From the software level, the present application also provides a traffic situation prediction device for executing all or part of the traffic situation prediction method, see Figure 7 The traffic situation prediction device specifically includes the following contents:
[0288] The data acquisition module 50 is used to acquire the traffic flow, traffic flow speed, traffic congestion index and traffic safety index of the target area in the current unit time period.
[0289] The model prediction module 60 is used to input the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the current unit time period into a preset traffic situation prediction model, so that the traffic situation prediction model correspondingly outputs the prediction result data of the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the future unit time period, wherein the traffic situation prediction model is pre-trained based on the training method of the traffic situation prediction model provided in the aforementioned embodiment.
[0290] The embodiment of the traffic situation prediction device provided in the present application can be specifically used to execute the processing flow of the embodiment of the traffic situation prediction method in the above-mentioned embodiment. Its functions will not be repeated here, and reference can be made to the detailed description of the above-mentioned traffic situation prediction method embodiment.
[0291] From the above description, it can be seen that the traffic situation prediction device provided in the embodiment of the present application can effectively improve the accuracy and reliability of the results of predicting traffic situations using the trained traffic situation prediction model, and can improve the degree of automation and intelligence of traffic situation prediction, and then can use the prediction results as input data for other downstream traffic applications, which can not only assist in decision-making and intervention for traffic data management to provide strong technical support and guarantee, but also provide strong technical support for building a green, smart and sustainable urban transportation system.
[0292] In order to further illustrate the above scheme, the present application also provides a specific application example of a traffic situation prediction system, taking area A as the target area as an example. Figure 8 As described above, the traffic situation prediction system can be composed of a prediction layer, a statistical layer, and a basic data layer, and can use ETC gantry and toll station data based on machine learning to perform historical traffic analysis, real-time monitoring, and future trend predictions to provide accurate traffic flow and velocity prediction situation awareness algorithm services. Aiming at the core issue of accurately counting and predicting traffic flow, velocity, congestion index, and safety index in a unit area of a province, firstly, based on the connectivity data of the toll units in area A, a basic toll unit connectivity map is constructed; secondly, based on the correspondence between the physical gantry and the toll unit in the gantry data in area A, a gantry connectivity matrix is constructed on the basis of the toll unit connectivity map; then, based on the gantry connectivity matrix and the gantry data, road flow, velocity, congestion index, and safety index are counted; then, the historical flow and velocity mean values are calculated based on 7 days of historical data and evaluation sets as a smoothing benchmark for flow and velocity; finally, the statistical data is cleaned to remove noise and outliers, and the data is converted into a file format suitable for model input, and then input into LR, VAR, and XGBoost machine learning algorithms for flow and velocity prediction combining historical mean introduction and differential learning. This situational awareness algorithm uses machine learning technology to achieve traffic flow prediction, statistics and prediction of basic parameters such as flow, flow speed, and traffic density of each road section, characterizing the current traffic status of the road section. It can not only quickly determine whether congestion occurs and provide corresponding information services, but also serve as input data for other downstream traffic applications. Based on the accurate construction of the portal frame connectivity data in area A, it can accurately count and predict the traffic flow, flow speed, congestion index and safety index in a unit area of a province, and save the results in the database; based on the correct road network topology data, historical traffic flow statistics and machine learning models, the training model can be configured by adjusting the algorithm parameters to predict and output the traffic flow, flow speed, congestion index and safety index of any unit area in the entire network for a period of time in the future.
[0293] Hidden in a large amount of traffic data are deep-seated rules of traffic flow, traffic patterns, driving behavior, etc. These rules are difficult to discover and apply with traditional statistical methods. Machine learning technology can automatically extract useful features from a large amount of data and provide a more accurate model for traffic prediction. By using machine learning technology to achieve traffic flow prediction tasks, statistics and predictions of basic parameters such as flow, speed, and traffic density of each road section, and characterize the current traffic status of the road section, it can not only quickly determine whether congestion occurs and provide corresponding information services, but also serve as input data for other downstream traffic applications.
[0294] In response to the expansion of urban traffic scale and the limitations of traditional monitoring methods, this application example proposes a situational awareness algorithm based on the full-network gantry connectivity matrix. This method accurately counts and predicts the traffic flow, flow rate, congestion index and safety index in a unit area, characterizes the current traffic status of the area, and provides input data for other downstream traffic applications.
[0295] The technical solution of this application example is to combine the latest daily basic data of the road network in area A to build a full-network gantry connectivity matrix based on physical gantries and toll units, toll unit GPS, toll unit direction and whether it is a virtual unit and other basic road network data. For the collected gantry transaction records, through data statistics and traffic flow rate prediction algorithms, the flow rate and flow volume of the region in future time periods can be predicted.
[0296] Fig. 9 The figure shows the process of constructing the gantry connectivity data and basic data processing in area A every day: synchronize the toll units, toll unit connectivity relationships, toll gantries and toll plaza data from the database and save them as static files. According to the relationship between the toll unit and the gantry, the longitude and latitude of the gantry are taken as the longitude and latitude of the toll unit. For the toll units of the toll stations that collect the tolls, the longitude and latitude of the toll plaza are taken as the longitude and latitude of the toll unit. After merging, the final longitude and latitude information of the toll unit is generated; according to the corresponding names of the toll units, they are divided according to the opposite direction, uplink and downlink and other fixed characters, and the toll units with the same name are saved in sequence as reverse toll unit pairs. According to the corresponding relationship between the gantry ID and the hex code, a mapping between the unique hex code and the gantry is generated, and the connectivity relationship between the gantries is calculated to obtain the connectivity matrix of the entire network. The above information is used to complete the connectivity matrix of the entire network and the basic data related to the road network, and the results are uploaded to the object storage service. Check whether there is the latest basic data every ten days, and update the connectivity matrix accordingly.
[0297] Fig.10The figure shows the process of implementing the data statistics module: first load the road network data, historical data and related ID mapping data. Then initialize the startTime and endtime variables to define the time range of data processing, and set span to define the size of the processing time window. If the time period is within the required time range, call the computeFlowVel (calculate flow and speed) function to calculate the flow and speed, and call the Compute_CongestSafety (calculate congestion and safety) function to calculate the congestion and safety index. Then move the startTime and endTime forward by span hours, and re-judge whether the new time period is within the required time range. If the time period is not within the required time range, insert the calculation results into the mysqL database and save the results to a csv file with a file name based on startTime.
[0298] Fig.11 The following is the process of implementing the traffic flow and flow rate prediction algorithm: filter the record data (record) in the database and only keep the toll gate records of a certain province. Then create a list of network data and gantry data and establish a mapping relationship. Remove noise and outliers from the data and convert the data into a json file suitable for model input. According to the data collection frequency, number of time periods, flow, flow rate, congestion index, and safety index, the data of the current time period is generated as training, evaluation, and test data sets. Set pred_len, i.e. the prediction length, generate labels, i.e. the data immediately following the window time, feature sets, and train a separate model for each pred_len. Finally, call the api parameter and pass in the model type (modelType) as a parameter. Use different models such as "LR", "VAR", and "XGB" to train different parameters. Save the parameter data after training.
[0299] This application example focuses on the situational awareness task, introduces the gantry connectivity data of area A, and uses a traffic flow and flow rate prediction model based on machine learning to accurately predict the traffic conditions in a province, and updates the data in real time and saves it to the database.
[0300] This application example is applicable to the prediction of traffic flow and velocity in any area of the highway. By combining the gantry connectivity data of area A and related basic data, the traffic flow and velocity of the target area are predicted to characterize the current traffic status of the road section.
[0301] This method is based on computer science algorithms and application programming interface technology, and its implementation requires certain programming, algorithm and operation and maintenance foundations. The specific real-time method of this method is divided into two parts. The first part is based on the combination of Crontab scheduled tasks, Python scripts, Bash programming scripts and object storage services (OBS) and is deployed in Linux servers. Among them, crontab is set to execute a Bash script at a fixed time point every day. The Bash script is used to execute the Python script. The Python script constructs the road network topology structure and related basic data and saves them to OBS; the second part is the situation awareness interface service, which is implemented using the Django framework, written in Python scripts, provides interface services to the outside world, and is deployed on the Linux server through the DockerNginx container.
[0302] A key innovation of this application example is the introduction of a traffic flow and velocity prediction optimization strategy based on historical data. By analyzing the traffic flow data of the target area in the same period of the past seven days, the algorithm can calculate the historical average of the traffic flow, velocity, congestion index and safety index of each road section. This historical average information is added to the feature set of the machine learning model as an important reference benchmark for predicting future traffic flow and velocity trends.
[0303] In addition, the flow rate prediction model of this application example also cleverly integrates the concept of differential learning. For each future time unit to be predicted, the model's feature set not only includes the smoothing benchmark of the historical mean, but also adds the difference feature of the flow rate at the previous moment. By learning this differential feature, the model can keenly perceive the dynamic change trend of the flow rate, thereby making more accurate short-term predictions.
[0304] The combination of historical mean introduction and differential feature learning has greatly improved the accuracy and robustness of the traffic flow velocity prediction method in this application example. On the one hand, the historical mean serves as an important reference, which makes the prediction results stable and continuous from a global perspective; on the other hand, the addition of differential learning gives the model enough flexibility to adapt to dynamically changing traffic conditions. This prediction strategy has strong adaptability to complex scenarios such as abnormal traffic events and holiday traffic peaks.
[0305] In summary, this application example realizes the accurate perception and prediction of traffic flow, flow velocity, congestion index and safety index of highways in a province through the construction of full-network gantry connectivity data, the organic combination of traffic flow and velocity statistics and machine learning prediction, and the optimization strategy of historical mean introduction and differential learning, providing key technical support for intelligent traffic management and travel services. The technical solution of this application example is completely based on the existing ETC gantry data and machine learning algorithms, with strong operability and economy, which is of great significance to accelerate the development of the smart transportation industry.
[0306] In one or more embodiments of the present application and Fig. 9 In the file, fcs_toll_gantry.json indicates the toll station gantry information file; fcs_calc_node_info.json indicates the computing node information file; fcs_calc_node.json indicates the computing node connection file; fcs_hex2id.json indicates the hexadecimal to identifier mapping file; fcs_id2hex.json indicates the identifier to hexadecimal mapping file; fcs_unit2id. indicates the unit to identifier mapping file; fcs_gantry_notexist.json indicates that there is no gantry list file; fcs_all_edges_weight.json indicates all edge weight files; fcs_gantry_edges.json indicates the gantry edge file; info.pkl indicates the information storage file; OBSTemp indicates the object storage temporary file; Temp indicates the temporary file; adj{i}.npy indicates the gantry adjacency matrix block file; fcs_toll_plaz a.json represents the toll plaza information file; gap_trans_info.json represents the toll station information file; virtual.json represents the virtual gantry information file; opposite.json represents the opposite gantry pair information file; travel_risk.fcs_toll_gantry represents the travel risk gantry information table; toll_interval represents the toll interval; unitid represents the gantry unit identifier file; fcs_calc_node_info represents the toll unit information file; gantrys represents the gantry list; fee_estimate.fcs_calc_node represents the fee estimation and billing node table; fee_estimate.fcs_calc_node_info represents the fee estimation and billing node information table; travel_risk.fcs_toll_plaze represents the travel risk toll station information table; real represents the physical gantry; road_name represents the road name.
[0307] The embodiment of the present application also provides an electronic device, which may include a processor, a memory, a receiver and a transmitter, wherein the processor is used to execute the training method of the traffic situation prediction model and / or the traffic situation prediction method mentioned in the above embodiment, wherein the processor and the memory may be connected via a bus or other means, such as by bus connection. The receiver may be connected to the processor and the memory via wired or wireless means.
[0308] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0309] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs, non-transient computer executable programs and modules, such as the training method of the traffic situation prediction model and / or the program instructions / modules corresponding to the traffic situation prediction method in the embodiment of the present application. The processor executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory, that is, implementing the training method of the traffic situation prediction model and / or the traffic situation prediction method in the above method embodiment.
[0310] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0311] The one or more modules are stored in the memory, and when executed by the processor, perform the training method of the traffic situation prediction model and / or the traffic situation prediction method in the embodiment.
[0312] In some embodiments of the present application, the user equipment may include a processor, a memory, and a transceiver unit, which may include a receiver and a transmitter. The processor, memory, receiver, and transmitter may be connected through a bus system. The memory is used to store computer instructions, and the processor is used to execute the computer instructions stored in the memory to control the transceiver unit to send and receive signals.
[0313] As an implementation method, the functions of the receiver and the transmitter in the present application can be considered to be implemented through a transceiver circuit or a dedicated chip for transceiver, and the processor can be considered to be implemented through a dedicated processing chip, a processing circuit or a general chip.
[0314] As another implementation method, it is possible to use a general-purpose computer to implement the server provided in the embodiment of the present application, that is, to store the program code for implementing the functions of the processor, receiver, and transmitter in a memory, and the general-purpose processor implements the functions of the processor, receiver, and transmitter by executing the code in the memory.
[0315] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the training method of the aforementioned traffic situation prediction model and / or the steps of the traffic situation prediction method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0316] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is specifically performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0317] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0318] In the present application, features described and / or illustrated for one embodiment may be used in the same manner or in a similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0319] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A training method for a traffic situation prediction model, characterized in that: include: Based on the portal frame connectivity basic data of the target area, construct the portal frame connectivity matrix of the target area; Acquiring historical traffic status data of the target area within a historical time period according to the portal connection matrix and the portal connection basic data; Based on the historical traffic status data, the traffic status average value and traffic status differential learning value of the target area in each preset unit time period in the historical time period are obtained, and a corresponding traffic situation label is set for each preset unit time period; The preset hybrid prediction model is trained using the traffic state average value and the traffic state differential learning value in each preset unit time period respectively provided with the traffic state label, so as to train the hybrid prediction model as a traffic state prediction model for predicting the traffic state of the target area in the future unit time period.
2. The training method of the traffic situation prediction model according to claim 1, characterized in that: The step of constructing a gantry connectivity matrix of the target area based on the gantry connectivity basic data of the target area includes: Acquire the collected data of toll stations, toll plazas, ETC gantries, toll collection units, basic road network structures and toll collection unit GPS on the highways in the target area to form the current gantries connectivity basic data of the target area; Connectivity data between the charging units are extracted from the gantry connectivity basic data, and a corresponding charging unit connectivity graph is constructed, wherein each vertex in the charging unit connectivity graph represents a different charging unit, and an edge in the charging unit connectivity graph represents that there is a connection relationship between the charging units located at both ends of the edge; Selecting a plurality of the ETC gantries in the gantries connection basic data as target gantries respectively; The correspondence between each of the target gantries and the charging unit is searched from the gantries connectivity basic data, and a gantries connectivity matrix of the target area is constructed according to the correspondence between each of the target gantries and the charging unit and the charging unit connectivity map, wherein the gantries connectivity matrix is composed of connectivity marks corresponding to each of the target gantries, and the connectivity marks are used to indicate whether two charging units corresponding to the target gantries are adjacent or non-adjacent; Searching for connection relationships between the ETC gantries from the gantry connectivity basic data to construct a gantry connectivity graph of the target area, wherein each vertex in the gantry connectivity graph represents a different ETC gantries, and an edge in the gantry connectivity graph represents that there is a connection relationship between the ETC gantries located at both ends of the edge; The gantry connectivity diagram, the gantry connectivity matrix and the gantry connectivity basic data are stored in a preset database.
3. The training method of the traffic situation prediction model according to claim 2, characterized in that: The acquiring of historical traffic status data of the target area within a historical time period according to the portal connectivity matrix and the portal connectivity basic data includes: Get the start and end time of the preset historical time period; According to the start time and the end time of the historical time period, extracting the gantry connectivity diagram, the gantry connectivity matrix and the gantry connectivity basic data within the historical time period from the database; Preprocessing the gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data within the historical time period; Based on the pre-processed gantry connectivity graph, the gantry connectivity matrix and the gantry connectivity basic data within the historical time period, historical traffic status data of the target area within the historical time period is obtained.
4. The training method of the traffic situation prediction model according to claim 1, characterized in that: The historical traffic status data includes: historical traffic flow data and historical traffic flow speed data; Correspondingly, the traffic status average value includes: the traffic flow average value and the traffic flow speed average value; The traffic state differential learning value includes: a traffic flow differential learning value and a traffic flow speed differential learning value; The traffic situation label includes: data for representing the traffic flow, traffic flow speed, traffic congestion index and traffic safety index of the target area in a single preset unit time period.
5. The training method of the traffic situation prediction model according to claim 1, characterized in that: The method of training a preset hybrid prediction model by using the traffic state average value and the traffic state differential learning value in each preset unit time period respectively provided with the traffic state label, so as to train the hybrid prediction model as a traffic state prediction model for predicting the traffic state of the target area in the future unit time period, comprises: Taking each of the unit time periods as a unit, taking the average value of the traffic state and the traffic state difference learning value in each of the unit time periods with the traffic situation label as initial samples; Performing data cleaning and preset standard format conversion on each of the initial samples to obtain target samples corresponding to each of the initial samples; Dividing each of the target samples into a training set, an evaluation set and a test set respectively; The training set is used to train a preset hybrid prediction model, so that the hybrid prediction model outputs the traffic situation prediction data of the target area in a future unit time period; The evaluation set and the test set are used to evaluate and test the trained hybrid prediction model, so as to determine the hybrid prediction model that has passed the evaluation and the test as a traffic situation prediction model for predicting the traffic situation of the target area within a future unit time period.
6. The method for training a traffic situation prediction model according to any one of claims 1 to 5, characterized in that: The hybrid prediction model comprises: an input layer, a feature extraction layer, a model combination layer and an output layer connected in sequence; The input layer is used to receive a target sample, wherein the target sample includes the traffic state average value and the traffic state differential learning value of the target area within the unit time period, and the target sample is provided with the traffic situation label; The feature extraction layer is used to extract the feature vector corresponding to the target sample; The model combination layer is used to input the feature vectors into a plurality of different types of classification models, so that each of the classification models outputs the traffic situation prediction data corresponding to the feature vectors; The output layer is used to perform weighted averaging processing on the traffic situation prediction data corresponding to the characteristic vector output by each of the classification models to obtain the traffic situation prediction result data corresponding to the target sample, wherein the traffic situation prediction result data includes: the prediction result data of traffic flow, traffic flow speed, traffic congestion index and traffic safety index of the target area in a future unit time period.
7. The training method of the traffic situation prediction model according to claim 6, characterized in that: Each of the classification models in the model combination layer includes: a linear regression LR model, a vector autoregression VAR model and an extreme gradient boosting XGBoost model.
8. A traffic situation prediction method, characterized in that: include: Obtain the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the current unit time period; The traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the current unit time period are input into a preset traffic situation prediction model, so that the traffic situation prediction model correspondingly outputs the prediction result data of the traffic flow, traffic speed, traffic congestion index and traffic safety index of the target area in the future unit time period, wherein the traffic situation prediction model is pre-trained based on the training method of the traffic situation prediction model described in any one of claims 1 to 7.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the training method of the traffic situation prediction model as described in any one of claims 1 to 7, and / or implements the traffic situation prediction method as described in claim 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the training method of the traffic situation prediction model as described in any one of claims 1 to 7, and / or implements the traffic situation prediction method as described in claim 8.
