CN114639235A - Method and related device for acquiring traffic data - Google Patents
Method and related device for acquiring traffic data Download PDFInfo
- Publication number
- CN114639235A CN114639235A CN202011490274.5A CN202011490274A CN114639235A CN 114639235 A CN114639235 A CN 114639235A CN 202011490274 A CN202011490274 A CN 202011490274A CN 114639235 A CN114639235 A CN 114639235A
- Authority
- CN
- China
- Prior art keywords
- node
- traffic
- data
- nodes
- entropy
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 104
- 238000010276 construction Methods 0.000 claims description 70
- 238000011156 evaluation Methods 0.000 claims description 55
- 238000012545 processing Methods 0.000 claims description 44
- 230000003068 static effect Effects 0.000 claims description 42
- 238000012549 training Methods 0.000 claims description 22
- 230000015654 memory Effects 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 7
- 238000013507 mapping Methods 0.000 claims description 7
- 239000011159 matrix material Substances 0.000 description 37
- 230000001364 causal effect Effects 0.000 description 35
- 238000004364 calculation method Methods 0.000 description 23
- 238000007726 management method Methods 0.000 description 21
- 230000008859 change Effects 0.000 description 16
- 238000007796 conventional method Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 9
- 230000002829 reductive effect Effects 0.000 description 8
- 230000000694 effects Effects 0.000 description 7
- 238000000605 extraction Methods 0.000 description 7
- 238000013461 design Methods 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 5
- 238000005457 optimization Methods 0.000 description 4
- 230000003044 adaptive effect Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 238000007637 random forest analysis Methods 0.000 description 3
- 230000000717 retained effect Effects 0.000 description 3
- 238000013135 deep learning Methods 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 230000036961 partial effect Effects 0.000 description 2
- 238000011002 quantification Methods 0.000 description 2
- 238000003860 storage Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 125000000217 alkyl group Chemical group 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000008713 feedback mechanism Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006698 induction Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000000670 limiting effect Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002787 reinforcement Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000002459 sustained effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0125—Traffic data processing
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/01—Detecting movement of traffic to be counted or controlled
- G08G1/0104—Measuring and analyzing of parameters relative to traffic conditions
- G08G1/0137—Measuring and analyzing of parameters relative to traffic conditions for specific applications
-
- G—PHYSICS
- G08—SIGNALLING
- G08G—TRAFFIC CONTROL SYSTEMS
- G08G1/00—Traffic control systems for road vehicles
- G08G1/07—Controlling traffic signals
- G08G1/08—Controlling traffic signals according to detected number or speed of vehicles
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Traffic Control Systems (AREA)
Abstract
In the embodiment of the method, traffic time sequence data corresponding to a first position node and a second position node are obtained, and the entropy from the first position node to the second position node is calculated based on the traffic time sequence data of the first position node and the second position node; the entropy is used for indicating the directed edge weight from the first position node to the second position node; finally, the traffic data of the target geographic area is determined according to the directed edge weight from the first position node to the second position node, and the directed edge weight can indicate the spatial incidence relation from the first position node to the second position node.
Description
Technical Field
The present application relates to the field of traffic management technologies, and in particular, to a method for acquiring traffic data and a related device.
Background
The traffic network is composed of a facility network, a link network and an organization network. Wherein the traffic nodes form a facility network, the traffic lines form a network of links, and the combination of nodes and links form an organization network.
The traffic network is the basis of traffic management (for example, control of traffic signals and the like, path planning and the like), and the accuracy and performance of the traffic management are directly influenced by the rationality and scientificity of the construction of the traffic network. For a long time, the construction method of the traffic network mainly regards intersections as nodes in the traffic network and regards paths as edges. And then constructing a topological structure of the traffic network based on the nodes, the paths and the edge weights. When the edge weight between two nodes is "1", it indicates that there is an edge between two nodes, i.e., there is a path between two intersections. When the edge weight between two nodes is "0", it indicates that there is no edge between two nodes, i.e., there is no path between two intersections.
In the current method, a traffic network constructed in such a way of "01" edge weight between nodes can only statically represent whether a path exists between two nodes, and the accuracy of traffic management is not high in the face of the current traffic environment with high complexity and real-time performance.
Disclosure of Invention
The embodiment of the application provides a method and a related device for acquiring traffic data, which are used for providing accurate basic data for applications of traffic management (such as applications including but not limited to traffic light control, traffic flow prediction, path planning and the like), namely for traffic control service. The traffic data is the topology of the traffic network, which is an abstract representation of the network system in the real world (i.e., the actual physical traffic network). The topology of the traffic network (i.e. the traffic data) can be represented by an adjacency list, a cross-linked list or an adjacency matrix.
In a first aspect, an embodiment of the present application provides a method for acquiring traffic data, where the method may be applied to an electronic device, and the electronic device determines a first location node and a second location node of a target geographic area, where the first location node and the second location node are both any two location nodes in a plurality of location nodes in the target geographic area; then, the electronic device acquires traffic time sequence data corresponding to the first position node and the second position node, wherein the traffic time sequence data is as follows: traffic flow data corresponding to the position nodes in a plurality of continuous time units, wherein the traffic flow data (such as vehicle data) comprises but is not limited to vehicle flow, vehicle average speed, vehicle flow density, vehicle congestion degree and the like; the electronic equipment calculates entropy from a first position node to a second position node based on traffic time series data of the first position node and the second position node, wherein the entropy is used for indicating a directional edge weight from the first position node to the second position node, the directional edge weight is an edge weight with a direction, and the edge weight from the first position node to the second position node and the edge weight from the second position node to the first position node can be two different values; the directed edge weight from the first position node to the second position node is used for indicating the spatial association relationship of the first position node to the second position node, for example, the edge weight from the first position node to the second position node is 0.9, which indicates that the first position node has a larger association influence on the second position node; finally, the electronic device determines the topology (i.e., traffic data) of the traffic network of the target geographic area based on the directed edge weights from the first location node to the second location node. The traffic data is used for providing accurate basic data for applications of traffic management (such as applications including but not limited to traffic light control, traffic flow prediction, path planning, and the like), for example, inputting the traffic data into a traffic control model, and outputting data for traffic control through the traffic control model, where the traffic control model includes but is not limited to a traffic flow prediction model, a path planning model, and a signal light optimization control model, in a specific application scenario, the data for traffic control can be obtained through the traffic data acquired in the embodiment of the present application, and the data for traffic control can be used for optimization control of a traffic light, for vehicle flow prediction, for path planning, and the like.
In this embodiment, the edge right from the first position node to the second position node is calculated through traffic time series data corresponding to the first position node and the second position node, because the traffic time series data is dynamically changed data, entropies of any two position nodes are obtained based on the dynamic data of the nodes, and the edge right from the first position node to the second position node is dynamically changed along with time, that is, the traffic data obtained in the present application is dynamic and has real-time performance; the edge right is directional, the directional edge right is used for indicating a spatial association relationship between a first location node and two arbitrary nodes, namely a second location node, and compared with a traditional method of '01 edge right', the non-directly connected location nodes in the application can also indicate a spatial association relationship (or influence relationship) from one location node to another location node through the directional edge right, so that in an application scene of traffic management, traffic data is input into a traffic control model, the spatial association relationship from one location node to another location node is extracted by using the traffic control model, the accuracy of the input traffic data directly influences the accuracy of the extraction of the spatial association relationship between the nodes, and the accuracy of the extraction of the spatial association relationship between the nodes directly influences the accuracy of traffic control, thereby the method provided by the embodiment of the application has real-time performance, the directional traffic data provides more accurate basic data for traffic control.
In a possible implementation manner, the electronic device may further obtain a construction parameter, where the construction parameter includes a first parameter, the first parameter is used to participate in calculating entropy between the first location node and the second location node, methods for calculating entropy are different, the first parameter used to calculate entropy is different, the entropy takes causal entropy as an example, and the first parameter may be time lag; then, the electronic device calculates entropy from the first location node to the second location node based on the traffic timing data and the construction parameter.
In one possible implementation manner, the electronic device inputs the first data into the parameter selection model, and outputs the construction parameters through the parameter selection model; the first data includes type identification of the traffic data and setting parameters used for determining entropy. In the example, the construction parameters are output by using the parameter selection model, the self-adaptive selection of the construction parameters is realized, the parameter selection is not required to be continuously tried manually, and the construction parameters are input in a self-adaptive manner through the parameter selection model, so that the efficiency of selecting the network construction parameters is improved.
In one possible implementation, the method may further include: the electronic device may obtain static data corresponding to the first location node and the second location node, and may then identify the first location node and the second location node as key nodes based on the static data and/or the traffic timing data. The key node is a node having a large influence on traffic management in the traffic network. In the example, the entropy between the key nodes in the target geographic area is calculated, and the entropy between all the nodes does not need to be calculated, so that the calculation amount is reduced, and the calculation power is saved.
In one possible implementation, after the electronic device calculates the entropy of the first location node to the second location node based on the traffic timing data of the first location node and the second location node, the method may further include: when the entropy from the first position node to the second position node is smaller than or equal to the first threshold, the first position node is indicated to have no association influence on the second position node or the association influence is weak, so that the electronic equipment sets the directed edge weight from the first position node to the second position node to be a preset value, and the preset value is used for indicating that the first position node has no association relation with the second position node. For example, the preset value is "0", so that it is possible to reduce the amount of calculation when the traffic data is used in the subsequent traffic management.
In one possible implementation manner, after the electronic device obtains the traffic data of the target geographic area according to the directed edge right from the first location node to the second location node, the method may further include: the electronic equipment can evaluate the traffic data based on the evaluation index to obtain an evaluation result, and if the evaluation result is inferior to the second threshold value and indicates that the traffic data is possibly unreasonable, the electronic equipment can adjust the construction parameters, reconstruct the traffic network and obtain the topological structure of the traffic network again to ensure the accuracy of the traffic data.
In a possible implementation manner, the determining, by the electronic device, the traffic data of the target geographic area according to the directed edge weight from the first location node to the second location node may further specifically include: the electronic equipment can also extract backbone nodes in the plurality of position nodes and directed edge weights among the backbone nodes by a network backbone extraction method, wherein the backbone nodes comprise first position nodes and second position nodes; then, the traffic data of the target geographic area is determined based on the backbone nodes and the directed edge weights among the backbone nodes. In this example, the electronic device removes redundant nodes and redundant side right information in the traffic data to obtain a simplified topology structure of the traffic network (i.e., the traffic data), so that the storage space can be saved.
In one possible implementation, the method further includes: the electronic equipment inputs the sample data set into the first model, and iterative training is carried out on the first model to obtain a parameter selection model; the sample data set comprises a plurality of samples, wherein each sample comprises an input parameter, a label and a mapping relation between the input parameter and the label; the input parameters comprise type identification of the traffic data and setting parameters used for determining entropy, and the labels are construction parameters. In this embodiment, the first model is trained through the sample data set to obtain a parameter selection model, the parameter selection model is used for adaptively outputting construction parameters, the construction parameter is adaptively selected, manual continuous attempts for parameter selection are not needed, and the efficiency of selecting network construction parameters is improved by adaptively inputting the construction parameters through the parameter selection model.
In one possible implementation, the electronic device inputs the sample data set into the first model, and before performing iterative training on the first model, when the number of samples in the sample data set is less than or equal to a third threshold, the method further includes: firstly, generating first sample data; then, inputting the first sample data into a parameter selection model, and outputting a construction parameter through the parameter selection model; the construction parameters are used for calculating the entropy from the first position node to the second position node so as to obtain traffic data; evaluating the traffic data based on the evaluation indexes to obtain an evaluation result; if the evaluation result is inferior to the second threshold value, deleting the first sample data; or if the evaluation result is better than the second threshold, adding the first sample data into the sample data set until the number of samples in the sample data set reaches or exceeds a fourth threshold. In this example, when the amount of the training sample data is small, a sample library needs to be constructed, and the parameter selection model needs to be trained online. In the embodiment, the electronic equipment directly uses the constructed parameter vector in the manufactured sample to participate in the calculation of the entropy between the nodes and the construction of the traffic network, then, the constructed traffic network is evaluated through the evaluation index, whether the traffic network constructed by the network constructed parameter vector in the manufactured sample is reasonable or not can be determined, and if the constructed traffic network is reasonable, the manufactured sample is put into the sample library, so that the manufactured sample can be guaranteed to have authenticity, and the accuracy of the trained parameter selection model is improved.
In one possible implementation, the method may further include: the electronic device obtains static data of a third location node and a fourth location node, wherein the third location node and the fourth location node are any two location nodes in a plurality of location nodes in a target geographic area, and when the static data is less than or equal to a fourth threshold, the method further includes: the electronic equipment calculates entropy between the third position node and the fourth position node based on the traffic time sequence data corresponding to the third position node and the traffic time sequence data corresponding to the fourth position node. When the number of position nodes is large, the calculation amount is large, and the calculation speed is reduced. Therefore, in the present example, the electronic device can selectively calculate the entropy between partial location nodes according to static data (such as path length, geographical connection relationship, etc.), thereby reducing the calculation amount.
In a second aspect, the present application provides an apparatus for acquiring traffic data, comprising:
a processing module for determining a first location node and a second location node of a target geographic area;
the acquisition module is used for acquiring traffic time sequence data corresponding to the first position node and the second position node, and the traffic time sequence data is as follows: traffic flow data corresponding to the location nodes in a plurality of consecutive time units;
the processing module is further used for calculating the entropy from the first position node to the second position node based on the traffic time sequence data of the first position node and the second position node; the entropy is used for indicating directed edge weights from the first position node to the second position node, and the directed edge weights from the first position node to the second position node are used for indicating the spatial incidence relation of the first position node to the second position node;
and the processing module is also used for determining the traffic data of the target geographic area according to the directed edge weight from the first position node to the second position node.
In a possible implementation manner, the processing module is further configured to obtain a construction parameter, where the construction parameter is used to participate in calculating the entropy between the first location node and the second location node; an entropy from the first location node to the second location node is calculated based on the traffic timing data and the build parameter.
In a possible implementation manner, the processing module is further configured to input the first data into a parameter selection model, and output the construction parameter through the parameter selection model; the first data includes type identification of the traffic data and setting parameters used for determining entropy.
In a possible implementation manner, the obtaining module is further configured to obtain static data corresponding to the first location node and the second location node;
the processing module is further used for identifying the first position node and the second position node as key nodes based on the static data and/or the traffic time sequence data.
In a possible implementation manner, the processing module is further configured to set, when the entropy of the first location node to the second location node is less than or equal to a first threshold, a directional edge weight of the first location node to the second location node to a preset value, where the preset value is used to indicate that the first location node has no association with the second location node.
In a possible implementation manner, the processing module is further configured to evaluate the traffic data based on the evaluation index to obtain an evaluation result; and when the evaluation result is worse than the second threshold value, adjusting the construction parameters.
In a possible implementation manner, the processing module is further configured to extract backbone nodes of the plurality of location nodes and directed edge weights among the backbone nodes, where the backbone nodes include a first location node and a second location node; and determining traffic data based on the backbone nodes and the directed edge weights among the backbone nodes.
In a possible implementation manner, the processing module is further configured to input the sample data set to the first model, and perform iterative training on the first model to obtain a parameter selection model; the sample data set comprises a plurality of samples, wherein each sample comprises an input parameter, a label and a mapping relation between the input parameter and the label; the input parameters comprise type identification of the traffic data and setting parameters used for determining entropy, and the labels are construction parameters.
In a possible implementation manner, when the number of samples in the sample data set is less than or equal to the third threshold, the processing module is further specifically configured to: generating first sample data; inputting the first sample data into a parameter selection model, and outputting a construction parameter through the parameter selection model; the construction parameters are used for calculating the entropy from the first position node to the second position node so as to obtain traffic data; evaluating the traffic data based on the evaluation indexes to obtain an evaluation result; if the evaluation result is inferior to the second threshold value, deleting the first sample data; or if the evaluation result is better than the second threshold, adding the first sample data into the sample data set until the number of samples in the sample data set reaches or exceeds a fourth threshold.
In a possible implementation manner, the processing module is further configured to obtain static data of a third location node and a fourth location node; when the static data is smaller than or equal to a fourth threshold value, determining that the entropy from the third position node to the fourth position node needs to be calculated; and calculating the entropy from the third position node to the fourth position node based on the traffic time sequence data corresponding to the third position node and the traffic time sequence data corresponding to the fourth position node.
In a third aspect, an embodiment of the present application provides an electronic device, including: comprising a processor coupled with at least one memory, the processor being configured to read a computer program stored in the at least one memory, such that the electronic device performs the method according to any of the above first aspects.
In a fourth aspect, embodiments of the present application provide a computer-readable medium for storing a computer program or instructions, which when executed, cause a computer to perform the method of any one of the above first aspects.
In a fifth aspect, the present application provides a chip system, which includes a processor for supporting an electronic device to implement the functions recited in the first aspect. In one possible design, the system-on-chip further includes a memory for storing program instructions and data necessary for the electronic device. The chip system may be formed by a chip, or may include a chip and other discrete devices.
Drawings
FIG. 1A is a schematic diagram of an abstraction of a physical traffic network into nodes and edges;
FIG. 1B is a schematic diagram of one example of a topology of a transportation network;
FIG. 1C is a schematic diagram of the impact between intersections in an actual physical traffic network;
FIG. 2 is a schematic diagram of static data in an embodiment of the present application;
FIG. 3 is a flow chart illustrating steps of one embodiment of a method for constructing a transportation network according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an example of a target geographic area in an embodiment of the present application;
FIG. 5 is a schematic diagram of an in-degree and an out-degree of a node in an embodiment of the present application;
FIG. 6 is a schematic diagram of an example of an adjacency matrix in the embodiment of the present application;
FIG. 7 is a diagram illustrating an example of a neighbor order of a node in an embodiment of the present application;
FIG. 8 is a flowchart illustrating an exemplary process for training a parameter selection model according to an embodiment of the present disclosure;
FIG. 9 is a schematic diagram of an example of an apparatus in an embodiment of the present application;
fig. 10 is a schematic structural diagram of another example of an apparatus in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. The term "and/or" appearing in the present application may be an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in this application generally indicates that the former and latter related objects are in an "or" relationship. The terms "first," "second," and the like in the description and in the claims of the present application and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein are capable of operation in other sequences than described or illustrated herein. Moreover, the terms "comprises," "comprising," and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not expressly listed or inherent to such process, method, article, or apparatus.
In the geographic information world, a traffic network (or also referred to as a traffic network model) refers to a mesh system composed of a plurality of interconnected line segments, and is an abstract expression of a network system in the real world (i.e., an actual physical traffic network). For example, in a city traffic network, linear features such as roads are abstracted into line segments, which may be referred to as "edges" in the traffic network model. Point-like ground objects such as intersections and bus stops are abstracted into points and the like, and are called "position nodes" in the traffic network, and can also be simply called "nodes". It is understood that the traffic network is composed of the elements of edges (or lines) and nodes. In the present application, the traffic network may also be referred to simply as "network".
Referring to fig. 1A and 1B, the construction of the traffic network refers to a process of generating a topology structure of the traffic network by abstracting specific entities in an actual physical traffic network (e.g., abstracting intersections as "location nodes" and abstracting roads as "edges"). For example, the topology of the traffic network may be represented by an adjacency list, a cross-linked list, or an adjacency matrix, and in the present application, the topology of the traffic network is described as an example where the adjacency matrix represents the topology of the traffic network, and the topology of the traffic network may also be referred to as "traffic data".
Illustratively, in fig. 1A, a-E represent intersections, a-E represent nodes, each node corresponds to an intersection in the actual physical traffic network (e.g., "intersection a" corresponds to "node a"; "intersection B" corresponds to "node B"; "intersection C" corresponds to "node C", etc.), and the line segments between the nodes generally correspond to roads in the actual physical traffic network. In fig. 1B, the relationship between nodes is represented by a form of an adjacency matrix, where the first row and the first column in the adjacency matrix are both node identifiers (or numbers), and the values in the matrix represent the weights of two node edges (also referred to as "edge weights"). If the weight is "1" to indicate that an "edge" exists between two nodes, and the weight is "0" to indicate that an "edge" does not exist between two nodes. In the conventional method, the association relationship between two nodes is represented by the "01" edge right shown in fig. 1B, and the "01" edge right can only represent whether there is a real "direct connection relationship" between nodes in the actual physical transportation network. The direct connection relationship here is a purely static connection relationship. Referring to fig. 1B, a node a and a node C are connected through a node B, and according to the conventional method, the node a and the node C are not directly connected, and even if the node a and the node C are connected through the node B (indirect connection), a weight value between the node a and the node C is set to "0" in the conventional adjacency matrix, thereby indicating that the node a and the node C are not "directly connected".
In addition, in an actual traffic scene, dynamic information such as traffic flow, average vehicle speed, and vehicle congestion conditions corresponding to nodes changes over time and significantly differs, so that the relationship between nodes represented by the adjacency matrix represented by the "01" edge weight cannot reflect the true "association relationship" between nodes. For example, referring to fig. 1C, in one example, most of the vehicles from intersection a will enter intersection C through intersection B, in other words, if the traffic flow at intersection a is large, the traffic flow at route C will be affected, so it can be seen that, although intersection a and intersection C are not directly connected, these two intersections are logically related, and obviously, the association between nodes (for example, intersection a and intersection C) similar to "not directly connected" cannot be reflected by the adjacency matrix shown in fig. 1B.
Traffic networks are constructed to serve traffic management applications (e.g., applications including, but not limited to, traffic light control, traffic flow prediction, path planning, etc.). The traffic network in the traditional method can only statically represent whether a path exists between two nodes, but faces the current traffic environment with high complexity and real-time performance, the accuracy of traffic management is not high, and the traffic network has little guiding significance for traffic management.
In an embodiment of the present application, a method for acquiring traffic data is provided, which is used for constructing a dynamic, directional, and logical traffic network. The entropy between any two nodes is calculated based on the dynamic data corresponding to each node, the entropy is used for indicating the edge weight of any two nodes, and a traffic network is constructed based on a plurality of nodes and the edge weight between the nodes. First, the traffic network is "directional": entropy is directional, and the edge weight between any two nodes may comprise 2 different values. For example, the edge right in the node a to node B direction is "0.7", and the edge right in the node B to node a direction is "0.6", that is, the traffic network in the present application is a "directed traffic network". Then, the traffic network is "dynamic": the entropy of any two nodes is obtained based on the dynamic data of the nodes, and the edge weights between the nodes can be dynamically changed along with the change of time, namely, the traffic network constructed in the application is a dynamic traffic network. Finally, the traffic network is "logical": entropy is calculated based on dynamic data corresponding to any two nodes, and even if the two nodes are not directly connected in an actual physical traffic network, the two nodes may have an association (or dependency, or cause and effect) relationship, that is, the traffic network constructed in the application is a "logical traffic network". The traffic network provided in the present application can provide an accurate data base for traffic management in the face of complex and real-time traffic environments.
For the convenience of understanding of the present application, a traffic network in the conventional method and a traffic network in the present application will be described first:
first, description is made regarding "static traffic network" in the conventional method and "dynamic traffic network" in the present application.
The static traffic network is to determine an edge weight between two nodes according to static data corresponding to the nodes (i.e., whether the two nodes are directly connected), where the edge weight between the two nodes is "0". If two nodes are not directly connected, the edge weight between the two nodes is "1". The edge weight between two nodes has only two values of '0' or '1', and does not change. For example, the edge weight between node a and node B is "1" and does not change over time. With respect to a static traffic network, a dynamic traffic network means that the edge weights between nodes are determined according to dynamic data corresponding to the nodes, and may change with time. For example, at the n1 time cell, the edge weight for node A to node B may be 0.7, while at the n2 time cell, the edge weight for node A to node B may be 0.9.
Next, a comparison between the "undirected traffic network" in the conventional method and the "directed traffic network" in the present application is described:
in the undirected traffic network, an edge between two nodes that are identical is undirected, i.e., there is only one weight for the edge weight between two nodes. For example, the weight of the edge between node a and node B is 1, and the weight does not distinguish the direction. In a directed traffic network, there may be two weights for an edge between two nodes, and the two weights may not be equal. For example, the weight in the node A to node B direction (A → B) is 0.7, while the weight in the node B to node A direction (B → A) is 0.6.
From the next, the comparison between the "physical transportation network" in the conventional method and the "logical transportation network" in the present application shows:
the physical traffic network corresponds to an actual physical connection situation, and in an actual space, if two nodes are directly connected, an edge exists between the two nodes. If two nodes are not directly connected, there is no edge between the two nodes. The logical traffic network does not completely correspond to the actual physical connection situation, and in the logical traffic network, there may also be an edge right that is not directly connected between two nodes and is used to indicate that there is a logical association relationship (or referred to as a spatial association relationship) between two nodes.
Finally, the description of "frontier" in the conventional method and "frontier" in the present application is referred to.
In the conventional method, the "edge weight" includes only 2 values, i.e., "0" or "1". When the edge weight is "0", it indicates that there is no edge between the two nodes. When the edge weight is "1", it indicates that there is an edge between two nodes. In the present application, the entropies of two nodes are used as edge weights based on dynamic data, and the edge weights are values greater than or equal to 0 and less than or equal to 1. For example, the edge weights are "0.7", "0.6", "0.5", and the like, and the entropy may be used to represent the degree of association (or degree of influence, or degree of dependency) of two nodes.
The following describes an exemplary advantage of the traffic network constructed in the present application through a specific application scenario in traffic management.
Example 1, traffic flow prediction:
most of traffic flow prediction methods predict traffic flow based on deep learning traffic flow prediction models. The adjacency matrix (i.e. traffic data) can be used as part of input data of the traffic prediction model, and the spatial association relation between the nodes is extracted by using a neural network. The accuracy of the input adjacency matrix directly influences the accuracy of the extraction of the spatial incidence relation among the nodes, and the accuracy of the extraction of the spatial incidence relation among the nodes directly influences the accuracy of traffic flow prediction, so that the accuracy of the input adjacency matrix influences the accuracy of the traffic flow prediction.
In actual traffic, spatial association relations among nodes are directional and dynamically change along with time, and significant mutual influence relations may exist among nodes which are not directly connected, and mutual influence degrees among the nodes are different. Compared with the adjacency matrixes of undirected, static and 01 side weights in the traditional method, the adjacency matrixes of directed, dynamic and non 01 side weights in the method can improve the accuracy of the spatial incidence relation between the nodes and improve the accuracy of traffic flow prediction.
For example, the following steps are carried out: in the conventional method, the edge weight of node a → node C and the value of node C → node a are both 0 (i.e. node a and node C are not directly connected), there is no correlation between node a and node C in the deep learning-based traffic prediction process, and actually the spatial correlation between node a and node C may be significant (e.g. node a and node C are on the same trunk). Therefore, in the conventional method, the final traffic flow prediction may cause the accuracy of the traffic flow prediction to be reduced because the spatial association relationship between the node a and the node C is not considered. In the application, the electronic device calculates the entropy between the nodes according to the dynamic data corresponding to the nodes, and may use the entropy as the edge weight in the adjacency matrix, for example, the edge weight of node a → node C is 0.71, and the edge weight of node C → node a is 0.6, and the edge weight may dynamically change and be directional with time, so as to improve the accuracy of the spatial association relationship between the nodes and improve the accuracy of the traffic flow prediction.
Example 2, traffic light control:
the purpose of traffic signal lamp control is to coordinate and control the phase change sequence, the duration, the change time point and the like of signal lamps at a plurality of intersections, so that the overall or local traffic efficiency of a road network can be improved. The basis for realizing the coordination control is to analyze the incidence relation among intersections (nodes), and the more accurate the analysis and quantification of the incidence relation among intersections are, the more the coordination control algorithm effect is easily improved.
For example, the following steps are carried out: in the conventional method, the edge weights of the node a → the node C and the node C → the node a are all 0(a and C are not directly connected but on the same trunk road), the control device cannot judge the mutual influence relationship between the node a and the node C, and thus the control effect on the signal lamp is limited. For example, in the case where the traffic of the node a is large, the node a and the node C are not related according to the conventional method, and therefore, the control device controls the "green light" at the node C according to the normal time period, without considering the traffic of the node a. By adopting the method in the application, similarly, when the traffic flow of the node a is large, the edge weight of the node a → the node C is determined to be 0.9, which indicates that the node a has a relatively large correlation influence on the node C, and the control device can appropriately prolong the duration of the "green light" at the node C, so as to avoid the vehicle congestion at the node C. The method can dynamically learn the mutual influence relationship among the nodes so as to improve the accuracy of the spatial association relationship among the nodes and further improve the accuracy of the control of the traffic signal lamp.
Example 3, path selection:
the goal of route selection is to obtain the best route from one location to another in the shortest time. The influence relationship between real-time road conditions and nodes (for example, congestion of one node may affect another node) needs to be considered in the path selection, so that the accurate interaction relationship between the nodes is helpful to improve the effect of the path selection.
For example, in one example, to realize the shortest time length for the departure from node a to node C (for convenience of description, the departure place is the node a, and the destination is the node C), there may be four paths, i.e., a → D → C, a → B → C, a → D → B → C, and a → E → B → C. Since the traveling time of a vehicle on one road is closely related to traffic conditions, it is necessary to analyze traffic conditions at a future time point of the nodes D, B, E and the links AD, AB, AE, DB, EB, DC, BC, and since traffic conditions (e.g., congestion) are time-varying and have significant conductivity, it is necessary to consider the mutual influence relationship between the nodes. Compared with the traditional method, the directed, dynamic and non-01 logical traffic networks can accurately reflect the dynamic mutual influence relationship among the nodes, and the accuracy of path selection is improved.
Before describing the embodiments of the present application, for a better understanding of the present application, the words that are involved in the present application will be described first.
First, description about "node" and "edge" is: where the nodes represent intersection locations in actual physical traffic, locations of various sensors (e.g., speed sensors), or locations of traffic flow detectors, etc. In the present application, the node is described by taking a representative intersection as an example. Edges represent nodes and paths between nodes.
Then, description is made about "static data" and "dynamic data" in the traffic network.
Static data refers to data that does not change over time over a sustained period of time. For example, the geographic coordinates of the nodes, the connection relationship between intersections, the level of the road, the length and width of the road, and the like.
Referring to fig. 2, the static data is illustrated by taking the length between roads as an example. The static data is a road length adjacency matrix. In the road length adjacency matrix, if two nodes are directly connected, the edge weight between the two nodes is the road length value. If two nodes are not directly connected or disconnected, the edge weight between the two nodes is 0. Taking the 5 nodes a-E as an example, the length of the road between node a and node B is 150m, and the edge weight between node a and node B in the adjacency matrix is "150". For another example, the node a and the node C are not directly connected, and the edge weight between the node a and the node C is "0". For another example, there is no road connection between node C and node E, and the edge weight between node C and node E in the adjacency matrix is "0".
Dynamic data (i.e., traffic time series data) refers to data that dynamically changes with time and/or space, and the traffic time series data refers to traffic flow data corresponding to a plurality of nodes in a plurality of consecutive time units (also referred to as time granularity), and the traffic flow data (e.g., vehicle data) includes, but is not limited to, vehicle flow, vehicle average speed, vehicle density, vehicle congestion degree, etc.
The traffic flow data is illustrated by taking the traffic flow as an example, and the traffic time series data is shown in the following table 1:
TABLE 1
As shown in Table 1 above, a time unit is exemplified by 5 minutes, and successive time units are as follows: 00:00-00:05 for the first time unit, 00:05-00:10 for the second time unit, etc.
Taking the 5 nodes a to E as an example, the traffic timing data of the 5 nodes is represented in the form of a matrix in table 1 above. For example, the second row and the second column have a value of "5" indicating that 5 vehicles pass through intersection a (corresponding to node A) between 00:00 and 00:05 on 29 months of 8 in 2020. For example, the value of the third column in the third row is "2", which indicates that 2 vehicles pass through the intersection B (corresponding to the node B) between 00:05 and 00:10 in 29 months of 8 in 2020, and the description thereof is not repeated herein. The data in table 1 are exemplary only and are not meant to limit the present application.
As can be seen from table 1 above, the traffic flow passing through the same intersection varies with time. For example, traffic flow is high during early peak hours (e.g., 08:00-08:05) and relatively low during nighttime hours (e.g., 00:00-00: 05). That is, the traffic flow data is changed with time.
As can be seen from table 1 above, the traffic flow is also different at different intersections in the same time unit. For example, in the time unit of 08:00-08:05, the traffic flow passing through the intersection B (corresponding to the node B) is 200, and the traffic flow passing through the intersection E (corresponding to the node E) is 58, i.e., the traffic flows passing through different intersections in the same time unit are different. That is, the traffic flow data is changed with the change of the space.
The traffic flow data is illustrated by taking the average speed of the vehicle as an example, and the traffic time series data is shown in the following table 2:
TABLE 2
Similar to table 1 above, the time unit is 5 minutes for example, the nodes are 5 nodes a to E for example, and the average speed of the vehicle passing through the 5 nodes is represented in the form of a matrix in table 2 above. For example, the value of the second row and the second column is "80", which means that the average vehicle speed of all vehicles passing through the intersection a (corresponding to the node a) is 80km/h within 29 days on 8 months in 2020, 00:00-00: 05. For another example, the value in the third row and the third column is "90", which indicates that the average vehicle speed of all vehicles passing through the intersection B (corresponding to the node B) is 90km/h in 29/8/29/2020, and the details in table 2 are not repeated herein. The data in table 2 are exemplary only and are not meant to limit the present application.
The following describes an embodiment of a method for constructing a traffic network, which can be applied to an electronic device. The electronic device may be a server, or the electronic device may be a terminal device, where the terminal device may be an electronic device such as a computer, a Personal Computer (PC), or a computer system. The execution subject of the method is electronic equipment; alternatively, the execution subject of the method may be a processor in the electronic device; alternatively, the main body of the method may be a chip in an electronic device, and in this embodiment, the main body of the method is described by taking the electronic device as an example.
Referring to fig. 3, an embodiment of a method for constructing a traffic network provided by the present application includes:
In one possible implementation manner, the electronic device may determine, according to the target geographic area, a plurality of nodes in the target geographic area, where the plurality of nodes includes a first location node and a second location node, and the first location node and the second location node are any location nodes in the plurality of location nodes. For example, the target geographic region can be a certain city (e.g., Shenzhen city) or multiple cities; alternatively, the target geographic region can be a region in a city (e.g., the Nanshan region of Shenzhen City); alternatively, the target geographic area may be a street; alternatively, the target geographic area may be a user-defined area range or the like, e.g., a plurality of geographic locations where the electronic device receives user input. For example, please refer to fig. 4, the electronic device receives 5 geographic locations, and the electronic device may sequentially connect the 5 geographic locations to obtain a plurality of areas, and use an area with the largest area among the plurality of areas as the target geographic area. In such an implementation, all intersections (or "intersections") within the target geographic area may be treated as nodes in the traffic network without distinguishing the type of road segment within the geographic area. In this example, a plurality of nodes can be determined according to the specific needs of the user (traffic manager), and flexibility is provided. Optionally, the electronic device also receives a network size parameter input by a user. For example, the network size parameter is 100 nodes in a target geographic area, and local traffic networks can be optimized, so that the nodes needing to be monitored can be effectively monitored.
In a second possible implementation manner, the electronic device may determine a plurality of nodes according to the target geographic area and the type of the road segment. For example, the road segment types include, but are not limited to, highways and city highways. Alternatively, the highways include expressways, first-level highways, second-level highways, third-level highways, and the like, according to the level of the highways. For example, the electronic device may receive an input of a target geographic area and a type of road segment. For example, the target geographic region is "Shenzhen" and the road segment type is "urban road". Then, the electronic device takes the intersections of all the urban highways in the Shenzhen as nodes in the constructed traffic network. In this example, the plurality of nodes may be determined according to a specific application scenario of the traffic network to be constructed, which has flexibility. For example, when the traffic network to be constructed is an urban network, intersections in the urban network are taken as nodes in the traffic network, and when the traffic network to be constructed is an expressway network, intersections in the expressway network are taken as nodes in the traffic network.
In a third possible implementation, the plurality of nodes may be nodes selected by a user (e.g., traffic manager). For example, some intersections in a certain road segment are accident-prone areas, or the intersections may be key areas of traffic congestion, and a user may select multiple nodes according to the purpose of traffic management, that is, the electronic device may receive a user selection operation, and determine the multiple nodes selected by the user according to the selection operation. In this example, the user can select the monitored node according to actual needs, and the flexibility is high.
In a fourth possible implementation manner, all of the plurality of nodes may be key nodes, or some of the plurality of nodes may be key nodes. The key node is a node having a large influence on traffic management in the traffic network. The electronic device may also obtain static data corresponding to the plurality of nodes and then identify key nodes based on the static data and/or traffic timing data. The entropy between all the nodes does not need to be calculated, so that the calculation amount is reduced, and the calculation force is saved. The manner of identifying the key node may include: in one example, the key node may be determined from traffic timing data in the network. For example, a key node is a node whose traffic flow is greater than a threshold value in a certain period of time. In another example, the key nodes may be determined from static data in the network. For example, the electronic device may identify the key node according to the number of paths (including lanes and non-lanes, for example) connected to an intersection, or the number of lanes, and determine that the intersection is the key node when the number of paths (or lanes) at the intersection is greater than a threshold. In another example, referring to FIG. 5, the electronic device can identify key nodes based on the in-degree and/or out-degree of the intersection. For example, when the degree of entry and/or the degree of exit of a certain intersection is greater than or equal to a threshold, the node corresponding to the intersection is a key node. The degree of entry of a node refers to the number of directed edges with the node as an end point. The out-degree of a node refers to the number of directed edges starting from the node. As shown in fig. 5, since the directed edge having the node a as the end point has only f1, the degree of entry of the node a is 1. The directed edges starting from node a have f2 and f3, so the out degree of node a is 2. In this example, the method for identifying the key node is merely an exemplary description, and the specific method for identifying the key node is not limited.
For example, in this step, the electronic device determines a plurality of location nodes in the target geographic area, and in this step and subsequent steps, for convenience of description, only the first location node and the second location node are taken as examples for description.
Methods of collecting traffic timing data include, but are not limited to: traffic flow data is collected by various sensors installed at each intersection. For example, in methods such as induction coil detection, microwave detection and video detection, the sensor transmits data collected in real time to the data processing center, and the data processing center can generate traffic time series data as shown in tables 1 and 2 according to the traffic flow data. The electronic device can receive traffic time sequence data of a plurality of nodes sent by the data processing center.
The traffic time series data refers to traffic flow data corresponding to consecutive time units, and the traffic flow data may be at least one of a vehicle flow rate, a vehicle average speed, and a vehicle density. The traffic flow may reflect the congestion degree of the road section. Vehicle density may reflect the spacing between vehicles in the flow. The average speed of the vehicle may reflect how fast the vehicle is running.
The traffic time series data may be one-dimensional data, or may also be multidimensional data, and the like, and is not limited specifically. For example, if the traffic time series data is one-dimensional data, please refer to table 1 or table 2 above for an exemplary case. If the traffic time series data is two-dimensional data, for example, the two-dimensional data is shown in table 3 below:
TABLE 3
As shown in table 3 above, for node a, the data in the second row is vehicle average speed data, the data in the third row is traffic flow data, and the traffic sequence data is two-dimensional data composed of vehicle average speed data and traffic flow data, and it should be noted that table 3 is only an exemplary description and does not limit the present application.
Taking 5 nodes as an example, the first location node to the second location node are any two nodes of the 5 nodes, for example, the first location node is node a, the second location node is node B, or the first location node is node B, the second location node is node a, and so on. The electronic device can determine the entropy of node a with each of the other 4 nodes, such as the entropy (or "entropy") of node a → node B, the entropy of node a → node C, the entropy of node a → node D, and the entropy of node a → node D. Similarly, the electronic device calculates the entropy of node B and each of the other 4 nodes. For example, the entropy of node B → node a, the entropy of node B → node C, etc., which are not described herein for example. The adjacency matrix includes the directed edge weights of any two nodes in all the nodes.
It should be noted that the entropy of "node a → node B" and the entropy of "node B → node a" may be unequal here, i.e., the edge weight between any two nodes in the present application is "directed" and the edge weight between any two nodes is "non-01" edge weight. Referring to FIG. 6, the edge weight of node A → node B is "0.73", and the edge weight of node B → node A is "0.9". As another example, the edge weight for node A → node C is 0.71, and the edge weight for node C → node A is 0.6.
The directional edge weight is used for reflecting the incidence relation (or influence degree) of one node to another node (or in the direction from one node to another node), and the larger the value of the edge weight is, the larger the influence degree is, i.e. the influence degree can be represented by numerical quantification. If "0" indicates no effect, and "1" indicates the greatest degree of effect. The edge weight is a value equal to or greater than 0 and equal to or less than 1. For example, the edge weight for node A → node C is 0.71, and the edge weight for node A → node E is 0.66, the degree of influence of node A on node C is greater than the degree of influence of node A on node E. For example, in an application scenario, there are 10 vehicles passing through the intersection a (corresponding to the node a), 6 vehicles passing through the intersection a may enter the intersection B (corresponding to the node B), and 4 vehicles entering the intersection E (corresponding to the node E) in a certain time unit, that is, the node a affects the node B to a greater extent than the node a affects the node E in the time unit.
In the embodiment of the present application, the method for calculating the entropy between two nodes includes, but is not limited to, mutual information, conditional entropy, transfer entropy, causal entropy, and the like, in which the method for calculating the entropy between two nodes is described with causal entropy as an example, and a calculation formula of the causal entropy is shown in the following equation 1:
Cy→x|Z=I(Xt+τ;Yt|Zt) In the formula 1
Wherein, Cy→x|ZExpressing causal entropy of the nodes y to x; xtTraffic time series data representing x nodes, YtTraffic time series data representing node y, Z representing a set of conditions for X, I (. + -.) representing Xt+τ,YtUnder the condition variable ZtT represents a time unit, and τ represents a time lag. The time lag may be understood as a time lag. For example, a certain distance exists between the intersection a and the intersection b, and it also takes a certain time for the vehicle to enter the intersection b from the intersection a, for example, the traffic flow of the intersection a in a certain time unit is very large, most of the vehicles passing through the intersection a can enter the intersection b, and obviously, the intersection a has an influence on the intersection b. The propagation duration of the effect of one node on another node is denoted by τ.
In this example, node x may also be referred to as a "child node" (or target node), node y may also be referred to as a "parent node", Cy→x|ZRepresenting the entropy of "parent" to "child".
Illustratively, the method by which the electronic device calculates causal entropy is as follows:
s11 randomly selects a condition set in which x is a child node (e.g., node a) and Z is x, and initializes Z ═ x.
S12, calculating the causal entropy of the node x and other nodes y under the condition set Z, selecting the node with the maximum causal entropy, and adding the node with the maximum causal entropy into the node Z in sequence until no node makes the causal entropy larger than 0.
For example, node x is exemplified by node a, and the other nodes y are any of node B, node C, node D, and node E. When the condition set Z only comprises the node A, respectively calculating the causal entropies of the node A and the node B, the causal entropies of the node A and the node C, the causal entropies of the node A and the node D and the causal entropies of the node A and the node E, and adding the node B into the condition set Z if the causal entropies of the node A and the node B are maximum at the moment.
And then, performing iterative computation, computing the causal entropy of the node A and the node C, computing the causal entropy of the node A and the node D, and computing the causal entropy of the node A and the node E under the condition that the condition set Z comprises the node A and the node B, if the causal entropy of the node A and the node C is the maximum at this moment, continuing to add the node C into the condition set Z, and so on. If the nodes included in the final condition set are node A, node B and node C. And the sequence of adding each node into the condition set Z is node B and node C.
The purpose of the step of S12 is: the parent node of the child node a is preliminarily screened, that is, the node which may be the parent node of the node a is retained by this step, and the node which is not the parent node of the node a is filtered.
S13, calculating the causal entropy of x and y after the node y is taken out from the condition set according to the sequence of adding each node into Z, deleting y from Z if the causal entropy is less than 0, and keeping the node y if the causal entropy is greater than or equal to 0.
For example, first, node B is taken out of Z, at this time, node a and node C are included in Z, causal entropies of node a and node B are calculated, and if the causal entropies of node a and node B are less than 0, node B is deleted from Z. If the causal entropy of node a and node B is greater than or equal to 0, node B is retained in Z (in this example, node B is retained as an example). Node C is then taken out of Z, which now includes node A and node B. Calculating the causal entropy of the node A and the node C, and if the causal entropy of the node A and the node C is smaller than 0, deleting the node C from the Z; if the causal entropy of the node A and the node C is greater than or equal to 0, the node C is stored in Z, the node which is not deleted in the process is the parent node of the child node A, and the entropy of the node is the causal entropy between the parent node and the child node A under the condition set Z.
The step of S13 is intended to: and filtering the false parent node of the child node A, and calculating the causal entropy between the child node A and the true parent node thereof.
The node included in Z is the parent node of node x (node x takes node a as an example). For example, node B is included in Z. The entropy from node B to node a is 0.9.
It is understood that node x, node y and Z are variables. In an actual calculation process, node a may be selected as node x (i.e., "child node") first, and the entropy of other nodes to node a is calculated respectively. Then, continuing back to step S11, steps S11-S13 are repeated, and the entropy of the parent node of node B, and other nodes (e.g., node A, node C, node D, and node E) to node B is calculated using the randomly selected node B as node x (i.e., "child node"). And continuously taking other nodes (such as the node C, the node D and the like) as child nodes to calculate the entropy, and circularly calculating the entropy among the nodes.
By calculating the entropy between every two nodes, the nodes without incidence relation can be directly eliminated. For example, in causal entropy calculation, with node a as a child node, if the entropy between node C and node a is less than 0, node C is deleted from Z, and the parent node of node a will not have node C.
In an optional example, before step 303, that is, before calculating the entropy between the nodes, the electronic device may further include: the electronic device may also obtain build parameters (or may also be referred to as "network build parameters"). The electronic device constructs a traffic network based on the traffic timing data and the network construction parameters.
The network construction parameters are used to construct a traffic network (which may be understood as obtaining the topology of the traffic network (i.e., traffic data)), which include the first parameters and/or the second parameters. The first parameter can be understood as an internal parameter for calculating entropy, such as a parameter that needs to be substituted into an entropy formula (such as formula 1). It should be noted that, the method for calculating the entropy is different, and the first parameter for calculating the entropy is different. Illustratively, the entropy is a causal entropy, and as shown in equation 1 above, the first parameter is a time lag. The electronic device can calculate the entropy of any two nodes through the formula 1 according to the traffic time sequence data and the time lag corresponding to the any two nodes.
The second parameter may be understood as an external control parameter for controlling the calculated entropy. The second parameter includes, but is not limited to, an entropy change period, a data amount of traffic time series data, and the like. The entropy change period (as denoted by T) is used to indicate the length of time for which the entropy is calculated, T-nt. Where t represents a time unit (e.g., 5 minutes), and n represents the number of time units (e.g., n is 10), the entropy change period is 50 minutes, i.e., the electronic device updates the adjacency matrix according to the entropy change period, e.g., once in 50 minutes. That is, the traffic network may be dynamically updated according to the entropy change period, thereby providing the latest basic data for traffic management.
In an alternative example, the method for "obtaining network construction parameters" may include two ways:
in a first manner, the electronic device receives user input of network configuration parameters. The network construction parameters can be set directly from empirical values. For example, the electronic device may receive a time lag parameter and an entropy change period input by a user to perform entropy calculation. Compared with the second implementation manner, in the first implementation manner, the calculation amount of the parameter selection model can be reduced, the calculation amount of the electronic equipment is greatly reduced, and the calculation speed is increased.
In the second mode, the electronic device inputs the first data of each node into the parameter selection model, and outputs the network construction parameters through the parameter selection model. The first data includes type identification of the traffic network and setting parameters used for determining entropy, and optionally, the first data may also include data characteristics of the traffic timing data. Wherein the type identifier is used for indicating the type of the traffic network to be constructed. The specific division manner of the type of the traffic network is not limited, as in one division manner, when the identification is "00", the "00" indicates that the network type is "highway network", when the identification is "01", the "01" indicates that the network type is "urban highway network", and the like. In another division, the division into "national road", "provincial road", and "county road" is made in an administrative level, for example, when it is identified as "11", the "110" is used to represent "national road"; when identified as "100," the "100" is used to represent a "dart"; when identified as "111," the "111" is used to represent "county road" or the like. The setting parameters include, but are not limited to, time lag parameters, various thresholds (e.g., thresholds for calculating causal entropy in steps S12 and S13), and the like.
Optionally, the setting parameters may also include parameters for constructing the traffic time series, such as a target time length (or data amount) of the traffic time series data, a time granularity of the traffic time series data, a time lag, and other parameters (such as a neighbor order). The data volume is used for calculating entropy between nodes at the target time. As will be understood with reference to table 4, if the target time is 08:00, the entropy between nodes at the current time (e.g., t in equation 1) can be calculated using the amount of data within 1h before 08:00, the 1h traffic timing data being shown in table 4 below:
TABLE 4
The target time length of the traffic time series data is determined, the data volume for calculating the entropy of the two nodes is determined, as shown in the table 4, and as the target time length is 1h, the traffic flow data corresponding to the target time length can not only ensure the data volume for calculating the entropy between the nodes, but also avoid calculating all traffic flow data, thereby saving calculation power.
The time granularity is as follows: one time unit corresponding to the traffic flow data in the traffic time series data, for example, the time granularity is 5min in this embodiment.
The data characteristics of the traffic time series data include, but are not limited to, the type of traffic flow data (e.g., vehicle flow, average vehicle speed), and the dimensions of the traffic time series data (e.g., one-dimensional data or multi-dimensional data).
It will be appreciated that the "set parameters" may include all or some of the parameters that may be set by the user for calculating entropy, and the network construction parameters include various parameters for constructing the traffic network. And constructing the mapping relation between the first data and the network construction parameters through the parameter selection model. Some of the "setting parameters" and "network construction parameters" may be the same. For example, the input setting parameters may include time-lag parameters, and the network construction parameters output by the parameter selection model may also include time-lag parameters, but the input parameter values and the output parameter values of the same parameter are different, and after adaptive selection by the parameter selection model, the output parameter values are parameter values more suitable for the application scenario. In this example, which parameters are specifically included in the first data may be determined according to a specific application scenario or a type of the traffic network, and is not limited specifically.
In this example, the network construction parameters are output by using the parameter selection model, so as to realize the adaptive selection of the network construction parameters. The method does not need to artificially try to select parameters continuously, and the network construction parameters are input in a self-adaptive mode through the parameter selection model, so that the efficiency of selecting the network construction parameters is improved. The parametric selection model may be pre-trained offline, or the parametric selection model may be trained online.
And step 304, the electronic equipment determines the traffic data of the target geographic area according to the directed edge weight from the first position node to the second position node.
Referring to fig. 6, the electronic device generates a topology according to a plurality of nodes and entropy between the plurality of nodes. The entropy between two nodes can be used as the edge weight between two nodes. The topology of the traffic network can be illustrated by way of example as an adjacency matrix. The adjacency matrix refers to data of the relationship between nodes stored by a two-dimensional array, and the adjacency matrix in the embodiment of the application is a directed graph adjacency matrix. Since the edge weights in this application are directed edge weights, W [ h ] [ q ] denotes the edge weights from node h to node q.
Such as the adjacency matrix shown in fig. 6, in which the first row and the first column are both node identifiers. For example, the node in the first row may be a target node (or may also be referred to as a "child node"), the node in the first column may be a "parent node", and the direction in which the entropy of the two nodes is calculated may be from the "parent node" to the "child node". For example, the entropy W [ A ] [ B ] of node A → node B is "0.73" (i.e., the value of the third column of the second row), i.e., the edge weight of node A → node B is "0.73"; the entropy W [ B ] [ A ] of node B → node A is "0.9" (i.e., the value of the third row and second column), i.e., the edge weight of node B → node A is "0.9"; the entropy W [ A ] [ D ] of node A → node D is "0.79" (i.e. the value of the fifth column of the second row), i.e. the edge weight of node A → node D is "0.79", etc., and the values in the adjacency matrix are not exemplified here.
In the embodiment of the present application, the topology of the constructed traffic network may be represented by an adjacency matrix, in which the edge weight between any two nodes is "directional", for example, the edge weight of node a → node B is different from the edge weight of node B → node a, and the edge weight may be used to indicate the association degree (or influence degree) of two nodes, and the edge weight expressed by entropy may more accurately represent the association degree of one node with another node, for example, the influence degree of node a on node B is "0.73", and the influence degree of node B on node a is "0.9".
In the present application, there may be an edge right between two nodes that are not directly connected, for example, the edge right of node a → node C is "0.71", and the edge right of node C → node a is "0.6". Namely, the traffic network constructed in the application can clearly show the incidence relation (or influence degree) between two nodes which are not directly connected, and the traffic network is obtained based on dynamic data in the traffic network and can better reflect the real contact relation between the nodes. The traffic network can provide a data base for traffic management more accurately.
In an optional example, the plurality of nodes includes a first node and a second node, the first node and the second node are any nodes in the plurality of nodes, and when the entropy of the first node to the second node is greater than a first threshold, the entropy is directly used as the weight of the edge of the first node to the second node. It can be understood that a first node (e.g., node a) is influential on a second node (e.g., node B), and the greater the entropy, the greater the degree of influence of the first node on the second node. When the entropy of the first node to the second node is smaller than or equal to a first threshold, setting the directed edge weight from the first node to the second node to a preset value (such as 0), wherein the preset value is used for indicating that the first node has no causal relationship (no association relationship) or weak causal relationship to the second node. For example, if the entropy of the node a → the node E is 0.4, which indicates that the degree of influence of the node a on the node E is weak, the edge weight of the node a → the node E in the output adjacency matrix may be set to 0, so that the calculation amount may be reduced when the adjacency matrix is used in the subsequent traffic management.
In an alternative example, the electronic device may extract backbone nodes of the plurality of nodes and directed edge weights among the backbone nodes by using a network backbone extraction method, and then construct a traffic network based on the backbone nodes and the directed edge weights among the backbone nodes. It can be understood that: the electronic equipment removes redundant nodes and redundant side weight information in the adjacency matrix to obtain the simplified sparse dynamic adjacency matrix. The sparse adjacent matrix is a matrix with redundant nodes and redundant side weight information removed, and storage space can be saved.
One example of a network backbone extraction method is to remove redundant nodes and redundant edges in a traffic network by an betweenness centrality method. The median center degree of the line describes the ratio of the shortest path number passing through the edge to the total shortest path number in the road network, and the higher the median center degree of the line is, the greater the relative center degree of the line in the road network structure is, the more closely the line is connected with the rest lines in the network, and the index can be considered to represent the importance of the line in the whole network, so that the importance degree of the line can be determined according to the centrality of the line in the network structure.
Wherein, CmIs the median center of the line m; n is the total number of the network nodes; n is a radical of an alkyl radicaljkIs the number of shortest paths between node j and node k, njk(p) is the number of shortest paths between node j and node k that contain line m.
Retention of CmBackbone lines greater than or equal to a threshold, or, C is removedmRedundant lines less than a threshold. The two end points of the redundant line are redundant nodes. The backbone line of the traffic network has a skeleton function, and the bearing capacity of the line in the traffic network can be reflected by adopting a mode of a formula 2. It should be noted that, in this example, the redundant nodes may be determined based on redundant lines, and of course, the redundant nodes may also be determined first by using other methods for extracting a network backbone, that is, redundant lines (i.e., redundant edges) between the redundant nodes may be determined, and a specific manner is not limited in this embodiment.
In an alternative example, in calculating the entropy between nodes, the entropy calculation between multiple nodes may be processed in parallel. Illustratively, the entropy is "directed", and any node will act as a "parent" to compute the entropy from the "parent" to other nodes (children). For example, the entropy between the computing node a and other nodes (such as the computing node B, the computing node C, the computing node D, and the computing node E) and the entropy between the computing node B and other nodes (such as the computing node a, the computing node C, the computing node D, and the computing node E) do not conflict with each other, so that parallel computing can be adopted, any one node is taken as a 'parent node', and the entropy between each 'parent node' and other nodes is computed in parallel, so that the computing speed can be greatly increased.
Meanwhile, if there is no constraint condition, the entropy between any one node and all the remaining nodes needs to be calculated, and when the number of nodes is large, the calculation amount is large, and the calculation speed is reduced. Therefore, the electronic device can selectively calculate the entropy between partial nodes according to static data (such as path length, geographical connection relation and the like), thereby reducing the calculation amount.
For example, the plurality of nodes may further include a third node and a fourth node, where the third node and the fourth node are any two nodes in the plurality of nodes, obtain static data of the third node and the fourth node, and then determine whether to calculate entropy between the third node and the fourth node according to the static data. And when the static data is smaller than or equal to a fourth threshold value, judging that the entropy from the third position node to the fourth position node needs to be calculated. When the entropy from the third node to the fourth node needs to be calculated according to the static data, the electronic equipment calculates the entropy between the third node and the fourth node based on the traffic time sequence data corresponding to the third node and the traffic time sequence data corresponding to the fourth node.
Illustratively, the degree of association between nodes decreases with distance due to geospatial constraints. For example, in an example, a road network includes node a, node B, node C, node D, and node E, a part of vehicles (e.g. 50) driving out from node a drives into node B, a part of vehicles (e.g. 30) driving into node C from node B, a part of vehicles (e.g. 20) driving into node D from node C, and so on, it is obvious that the traffic flow of node a may have a greater influence on node B than on node C or node D.
In one implementation, whether to calculate the entropy between the third node and the fourth node may be determined according to the length of the road between the third node (e.g., node a) and the fourth node (e.g., node C). For example, if the path length between the third node and the fourth node is greater than the fourth threshold, the entropy between the third node and the fourth node does not need to be calculated; and if the path length between the third node and the fourth node is less than or equal to a fourth threshold value, calculating the entropy between the third node and the fourth node. It should be noted that the third node and the fourth node may be directly connected nodes, or may be nodes that are not directly connected, for example, the third node is node a, the fourth node is node C, and node a and node C are connected through node B, for example, the path length between node a and node B is 100m, the path length between node B and node C is 120m, and the path length between node a and node C is 220 m.
In another implementation, whether to calculate the entropy of the third node to the fourth node may be determined according to the geographical connection relationship between the third node and the fourth node. The geographical connection relationship may be represented by a "neighbor order" that indicates a distance between two nodes. As shown in fig. 7, node a and node B are directly connected, that is, there is an edge between node B and node a, and then the neighbor order of node B from node a is 1; a node is arranged between the node C and the node A at an interval, namely 2 edges exist between the node C and the node A, and the neighbor order of the node B from the node A is 2; node a and node D are connected by two nodes (node E and node F), that is, there are 3 edges between node D and node a, then the neighbor order of node D from node a is 3, and so on, and the neighbor order may be the same as the number of edges existing between two nodes. When the neighbor order between the third node and the fourth node is judged to be larger than a fifth threshold (such as the order of 2), the entropy between the third node and the fourth node does not need to be calculated; and when the neighbor order between the third node and the fourth node is judged to be less than or equal to the fifth threshold, calculating the entropy from the third node to the fourth node.
Optionally, in step 305, the electronic device evaluates the traffic data based on the evaluation index to obtain an evaluation result.
The evaluation index includes two categories, wherein the first category of evaluation index is used for evaluating the characteristics of the traffic network. The second type of index is used for evaluating the accuracy of application scenarios (e.g., route planning, signal light control, etc.) of traffic management.
For example, the first type evaluation index will be described: the first type of evaluation index includes, but is not limited to, a topology contact ratio or network efficiency of the physical network and the constructed traffic network.
In one example, such as when the evaluation indicator is a topology goodness-of-fit ratio, the topology of the physical object network can be determined based on static data (e.g., intersection geographical coordinates and path lengths between nodes, etc.). As shown in fig. 6 again, in the constructed adjacency matrix, the edge weights of the node a and other nodes (e.g., the node B, the node C, the node D, and the node E) are all greater than the first threshold, which indicates that the node a has an influence on other nodes, and the distance relationship between any other node and the node a can be determined according to the edge weights of the node a on other nodes, and a larger edge weight from the node a to a node indicates that the node a is closer to the node. For example, the entropy (or edge weight) of node A to node B is 0.73, the edge weight of node A to node C is 0.71, the edge weight of node A to node D is 0.79, and the edge weight of node A to node E is 0.66. According to the principle that the closer the distance between two nodes is, the larger the entropy between the two nodes may be, the positions of a plurality of nodes in the constructed traffic network may be: node a is closer to nodes B and D, node a is relatively farther from nodes C and E, etc. And judging the proportion of the topological contact ratio of the physical network and the constructed traffic network according to the positions and the distances of the nodes in the physical network and the positions and the distances of the nodes in the constructed traffic network. And if the proportion of the topological contact ratio of the physical network and the constructed traffic network is greater than the sixth threshold, the constructed traffic network is reasonable. If the topology contact ratio is less than or equal to the sixth threshold, the constructed traffic network is unreasonable, and the network construction parameters can be reselected and the traffic network can be reconstructed.
In another example, when the evaluation index is the network efficiency, the network efficiency may be evaluated by the following formula 3:
wherein E isglobRepresenting network efficiency, N representing number of nodes, ei→jRepresenting the edge weights of node i to node j.
When E isglobIf the value is larger than the seventh threshold value, the constructed traffic network is reasonable, and when E isglobAnd when the value is less than or equal to the seventh threshold value, the constructed traffic network is possibly unreasonable.
The evaluation index and the evaluation method in the above two examples are only exemplary descriptions for easy understanding, and do not limit the present application.
For example, the second type of evaluation index will be described: and evaluating the rationality of the constructed traffic network based on the application scene, wherein the evaluation index is the accuracy of traffic flow prediction and the like. For example, the application scenario is traffic flow prediction, and the constructed traffic network (i.e. adjacency matrix) is output to the traffic management platform. If the accuracy of the traffic flow prediction based on the constructed traffic network is greater than the seventh threshold, the constructed traffic network is reasonable. If the accuracy of the traffic flow prediction is less than or equal to the seventh threshold, which indicates that the constructed traffic network may be unreasonable, the network construction parameters (such as receiving the input network construction parameters or adaptively selecting the network construction parameters based on the parameter selection model) may be adjusted and the traffic network may be reconstructed. It should be noted that, in general, network construction parameters are different according to different application scenarios.
In an alternative example, a method of training the parameter selection model is described:
in a first implementation, the amount of sample data trained is sufficient, and the parameter selection model may be trained offline. The sample data set includes sample data, each sample data including an input parameter and a tag. Wherein, the input parameters may include: the type identification and the setting parameters, optionally, the input parameters may also include data characteristics of the traffic time series data. The label is a network construction parameter. In a first implementation, under the condition that the number of training samples is sufficient, a sample data set is input to a first model (such as a random forest model), and the random forest model is trained to obtain a parameter selection model. In this example, the training sample data is sufficient, and the accuracy of the parameter selection model is high.
In the second implementation manner, when the amount of the training sample data is small, a sample library needs to be constructed, and the parameter selection model needs to be trained on line.
Referring to FIG. 8, when the sample data size is small, the training of the parameter selection model may mainly include two parts, one of which is the manufacturing process of the sample library, i.e., the following steps S21-S29. Secondly, the parameter selection model is trained based on a large number of samples in the manufactured sample library, i.e., S30 described below. The execution subject of the method for training the parameter selection model and the execution subject of the method for constructing the traffic network are the same electronic equipment, or different electronic equipment. The specific examples are not limited.
First, the sample manufacturing process of the sample library:
and S21, judging whether the number of the samples in the sample library is less than a third threshold (as represented by N1). If the number of samples is less than the third threshold, performing step S22; if the number of samples is greater than or equal to the third threshold, step S23 is executed.
And S22, randomly generating samples. The sample comprises an input parameter vector (X) and a network construction parameter vector (Y); execution continues with step S24.
And S23, generating a new sample based on a Generated Adaptive Network (GAN). Execution continues with step S24, and steps S21-S23 are repeated.
When a certain number of samples have been included in the sample library, the GAN can be used to quickly perform sample fabrication based on the certain number of samples.
First, GAN is briefly explained: the GAN comprises a generating Model (G) and a discriminating Model (D), wherein the generating Model is used for generating a sample similar to real training data, and the target is that the more the real sample is, the better the real sample is; the discriminant model is a two-classifier and is used for estimating the probability that a sample comes from a real training sample, and if the discriminant model estimates that the sample comes from the real training sample, the discriminant model outputs a large probability. If the discriminant model estimation samples come from the samples generated by the generative model, the discriminant model outputs a small probability. It is understood that the goal of generating a model is to try to generate the same sample as the real sample, making the discriminant model indistinguishable. The goal of the discriminant model is to try to detect the samples generated by the generated model. Through the confrontation and game of G and D, the samples generated by the GAN are close to the real samples, so that a large number of samples for training the parameter selection model can be obtained.
Then, when the number of samples in the sample library is greater than N1 in this example, the reason for initiating the GAN to make a new sample is that this number (i.e., greater than N1) of real samples is used to optimize the GAN, thereby increasing the accuracy of the GAN. It can be understood that: when G is fixed, optimization is performed for D. When inputting sample data (i.e. real data) in the sample library, the D-optimization network structure outputs 1 itself. When inputting data from G generation, the D optimized network structure outputs itself 0. When D is fixed, G optimizes the network of itself to make itself output the sample as much as the real data, and makes D output high probability after the generated sample is judged by D.
Optionally, the GAN-based sample manufacturing in this step may be replaced with a learning method with a feedback mechanism, such as meta-learning or reinforcement learning.
And S24, calculating the entropy among the nodes based on the traffic time series data and the network construction parameter vector (Y), and constructing the traffic network based on the entropy among the nodes.
This step is described with reference to the above step 303-step 304, and is not described herein again.
And S25, evaluating the traffic network based on the evaluation index to obtain an evaluation result.
Please refer to the description of step 305, which is not repeated herein.
And S26, judging whether the evaluation result is better than a second threshold value. When the evaluation result is better than the second threshold value, step S26 is executed.
And S27, when the evaluation result is better than the second threshold value, putting the generated sample into a sample library.
And S28, when the evaluation result is inferior to the second threshold value, abandoning the generated sample.
S29, determining whether the number of samples in the sample library is greater than a fourth threshold (as indicated by N2), and if the number of samples in the sample library is greater than the fourth threshold, performing S30; if the number of samples in the sample library is less than or equal to the fourth threshold, step S21 is executed.
And S30, training the first model through a large number of samples in the sample library to obtain a parameter selection model.
When the number of samples in the sample library is sufficient, the parameter selection model can be trained by a large number of samples in the sample library. The first model includes, but is not limited to, machine learning models such as random forest, Xgboost, LightGBM, etc.
When the number of samples manufactured based on the new samples for generating the countermeasure network (GAN) is greater than a certain number N2, the first model may be trained based on the sample library to implement mapping of the input parameter vector (X) and the network construction parameter vector (Y) to obtain the parameter selection model.
It is understood that the above-mentioned training process for manufacturing the sample library and the parameter selection model is an online training process, the above-mentioned step S24 corresponds to the steps 303 to 304 in the example corresponding to fig. 3, and the step S25 corresponds to the step 305 in the embodiment corresponding to fig. 3. In the embodiment, the electronic equipment directly uses the network construction parameter vector (Y) in the manufactured sample to participate in the calculation of the entropy between the nodes and the construction of the traffic network, then, the constructed traffic network is evaluated through the evaluation index, whether the traffic network constructed by the network construction parameter vector (Y) in the manufactured sample is reasonable or not can be determined, and if the constructed traffic network is reasonable, the manufactured sample is put into the sample library, so that the authenticity of the manufactured sample can be ensured, and the accuracy of the trained parameter selection model is improved.
Corresponding to the method provided by the above method embodiment, the embodiment of the present application further provides a corresponding apparatus, which includes a module for executing the above embodiment. The module may be software, hardware, or a combination of software and hardware. Fig. 9 shows a schematic of the structure of an apparatus. The apparatus 900 may be an electronic device, which may be a server, or may also be a terminal (e.g., a computer system, etc.), the apparatus 900 may also be a chip, a chip system, or a processor, etc. that supports the electronic device to implement the method, or may also be a chip, a chip system, or a processor, etc. that supports the electronic device to implement the method. The apparatus may be configured to implement the method described in the method embodiment, and refer to the description in the method embodiment.
The apparatus 900 may include one or more processors 901 that may implement certain control functions. The processor 901 may be a general-purpose processor or a special-purpose processor, etc. The processor may be configured to execute a software program to process data of the software program.
In an alternative design, the processor 901 may also store instructions 903, and the instructions 903 may be executed by the processor, so that the apparatus 900 performs the method described in the above method embodiment.
In an alternative design, processor 901 may include a transceiver unit for performing receive and transmit functions. The transceiving unit may be, for example, a transceiving circuit, or an interface circuit. The transmit and receive circuitry, interfaces or interface circuitry used to implement the receive and transmit functions may be separate or integrated. The transceiver circuit, the interface circuit or the interface circuit may be used for reading and writing code/data, or the transceiver circuit, the interface circuit or the interface circuit may be used for transmitting or transferring signals.
Optionally, the apparatus 900 may include one or more memories 902, on which instructions 904 may be stored, the instructions being executable on the processor to cause the apparatus 900 to perform the methods described in the method embodiments above. Optionally, the memory may further store data therein. Optionally, instructions and/or data may also be stored in the processor. The processor and the memory may be provided separately or may be integrated together. For example, the correspondence described in the above method embodiments may be stored in a memory or in a processor.
Optionally, the apparatus 900 may further comprise a transceiver 905 and/or an antenna 906. The processor 901, which may be referred to as a processing unit, controls the apparatus 900. The transceiver 905 may be referred to as a transceiver unit, a transceiver circuit, a transceiver device, a transceiver module, or the like, and is used for implementing a transceiving function.
In this embodiment of the application, the processor 901 is configured to read the computer program stored in the at least one memory 902, so that the apparatus 900 executes the method executed by the electronic device according to the above method embodiment, which may further refer to the corresponding description in the foregoing corresponding method embodiment, and is not described herein again.
The apparatus has a function of implementing the electronic device described in the embodiment of the present application, for example, the apparatus includes a module or a unit or means (means) corresponding to the electronic device executing the electronic device described in the embodiment of the present application, and the function or the unit or the means (means) may be implemented by software, or implemented by hardware executing corresponding software, or implemented by a combination of software and hardware.
Optionally, each module in the apparatus in the embodiment of the present application may be configured to execute the method executed by the electronic device in the above method embodiment. Referring to fig. 10, the apparatus 1000 includes a processing module 1001 and an obtaining module 1002, and in one design, the processing module 1001 and the obtaining module 1002 may be executed by the processor 901 in the embodiment corresponding to fig. 9. Optionally, in another design, the processing module 1001 may be executed by the processor 901 in the embodiment corresponding to fig. 9 described above, and the obtaining module 1002 may be executed by the transceiver 905 corresponding to fig. 9 described above.
A processing module 1001 for determining a first location node and a second location node of a target geographical area;
an obtaining module 1002, configured to obtain traffic timing data corresponding to the first location node and the second location node, where the traffic timing data is: traffic flow data corresponding to the location nodes in a plurality of consecutive time units;
the processing module 1001 is further configured to calculate an entropy from the first location node to the second location node based on the traffic timing data of the first location node and the second location node; the entropy is used for indicating the directed edge weight of the first position node to the second position node, and the directed edge weight of the first position node to the second position node is used for indicating the spatial incidence relation of the first position node to the second position node;
the processing module 1001 is further configured to determine traffic data of the target geographic area according to the directional edge right from the first location node to the second location node.
The processing module 1001 is configured to execute the steps 301 and 303 to 305 in the example corresponding to fig. 3, and the steps S21 to S30 in the example corresponding to fig. 8, and please refer to corresponding descriptions in the foregoing method embodiments in detail, which is not described herein again. The obtaining module 1002 is configured to execute step 302 in the example corresponding to fig. 3, please refer to corresponding descriptions in the foregoing method embodiments in detail, which is not described herein again.
Specifically, the processing module 1001 is further configured to obtain a construction parameter, where the construction parameter is used to participate in calculating the entropy between the first location node and the second location node; calculating an entropy of the first location node to the second location node based on the traffic timing data and the build parameter.
Optionally, the processing module 1001 is further configured to input the first data into a parameter selection model, and output the construction parameter through the parameter selection model; the first data includes type identification of the traffic data and setting parameters used for determining entropy.
Optionally, the obtaining module 1002 is further configured to obtain static data corresponding to the first location node and the second location node;
the processing module 1001 is further configured to identify the first location node and the second location node as key nodes based on the static data and/or the traffic timing data.
Optionally, the processing module 1001 is further configured to set a directional edge weight from the first location node to the second location node to a preset value when entropy of the first location node to the second location node is smaller than or equal to a first threshold, where the preset value is used to indicate that the first location node has no association with the second location node.
Optionally, the processing module 1001 is further configured to evaluate the traffic data based on an evaluation index to obtain an evaluation result; adjusting the build parameter when the evaluation result is worse than a second threshold.
Optionally, the processing module 1001 is further configured to extract backbone nodes of a plurality of location nodes and directional edge weights among the backbone nodes, where the backbone nodes include the first location node and the second location node; determining the traffic data based on the backbone nodes and directed edge weights between the backbone nodes.
Optionally, the processing module 1001 is further configured to input the sample data set into a first model, and perform iterative training on the first model to obtain the parameter selection model; the sample data set comprises a plurality of samples, wherein each sample comprises an input parameter and a label, and a mapping relation between the input parameter and the label; wherein the input parameters comprise type identification of the traffic data and setting parameters used for determining entropy, and the label is the construction parameter.
Optionally, when the number of samples in the sample data set is less than or equal to a third threshold, the processing module 1001 is further specifically configured to:
generating first sample data; inputting first sample data into the parameter selection model, and outputting the construction parameters through the parameter selection model; the construction parameters are used for calculating the entropy from the first position node to the second position node so as to obtain the traffic data; evaluating the traffic data based on the evaluation indexes to obtain an evaluation result; if the evaluation result is inferior to a second threshold value, deleting the first sample data; or, if the evaluation result is better than the second threshold, adding the first sample data into the sample data set until the number of samples in the sample data set reaches or exceeds the fourth threshold.
Optionally, the processing module 1001 is further configured to obtain static data of a third location node and a fourth location node; when the static data is smaller than or equal to a fourth threshold value, determining that the entropy from the third position node to the fourth position node needs to be calculated; and calculating the entropy from the third position node to the fourth position node based on the traffic time sequence data corresponding to the third position node and the traffic time sequence data corresponding to the fourth position node.
It is understood that the processor in the embodiments of the present application may be an integrated circuit chip having signal processing capability. In implementation, the steps of the above method embodiments may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The processor may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
The approaches described herein may be implemented in a variety of ways. For example, these techniques may be implemented in hardware, software, or a combination of hardware and software. For a hardware implementation, the processing units used to perform these techniques at a communication device (e.g., a base station, terminal, network entity, or chip) may be implemented in one or more general-purpose processors, DSPs, digital signal processing devices, ASICs, programmable logic devices, FPGAs, or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combinations of the above. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
It will be appreciated that the memory in the embodiments of the subject application can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), double data rate SDRAM, enhanced SDRAM, SLDRAM, Synchronous Link DRAM (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
The present application also provides a computer-readable medium, on which a computer program is stored, which, when executed by a computer, implements the functionality of the electronic device in any of the above-described method embodiments.
The present application also provides a computer program product, which when executed by a computer implements the functions of the electronic device in any of the above method embodiments.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.
Claims (22)
1. A method of obtaining traffic data, comprising:
determining a first location node and a second location node of a target geographic area;
acquiring traffic time sequence data corresponding to the first position node and the second position node, wherein the traffic time sequence data is as follows: traffic flow data corresponding to the location nodes in a plurality of consecutive time units;
calculating an entropy of the first location node to the second location node based on traffic timing data of the first location node and the second location node; the entropy is used to indicate a directed edge weight of the first location node to the second location node;
and determining the traffic data of the target geographic area according to the directed edge right from the first position node to the second position node.
2. The method of claim 1, further comprising:
obtaining a construction parameter for participating in calculating an entropy between the first location node and the second location node;
the calculating an entropy of the first location node to the second location node based on the traffic timing data of the first location node and the second location node comprises:
calculating an entropy of the first location node to the second location node based on the traffic timing data and the build parameter.
3. The method of claim 2, wherein the obtaining the build parameters comprises:
inputting first data into a parameter selection model, and outputting the construction parameters through the parameter selection model; the first data includes an identification of a type of the traffic data and setting parameters used to determine the entropy.
4. The method according to any one of claims 1-3, further comprising:
acquiring static data corresponding to the first position node and the second position node;
identifying the first location node and the second location node as critical nodes based on the static data and/or the traffic timing data.
5. The method of any of claims 1-4, wherein after calculating the entropy for the first location node to the second location node based on the traffic timing data for the first location node and the second location node, the method further comprises:
when the entropy from the first position node to the second position node is smaller than or equal to a first threshold value, setting the directed edge weight from the first position node to the second position node to be a preset value, wherein the preset value is used for indicating that the first position node has no association relation with the second position node.
6. The method of claim 2, wherein after obtaining traffic data for the target geographic area according to the directed edge rights from the first location node to the second location node, the method further comprises:
evaluating the traffic data based on the evaluation indexes to obtain an evaluation result;
and if the evaluation result is inferior to a second threshold value, adjusting the construction parameters.
7. The method of any one of claims 1-6, wherein determining traffic data for the target geographic area based on a directed edge weight from a first location node to the second location node comprises:
extracting backbone nodes in a plurality of position nodes and directed edge weights among the backbone nodes, wherein the backbone nodes comprise the first position node and the second position node;
determining traffic data for the target geographic area based on the backbone nodes and directed edge weights between the backbone nodes.
8. The method of claim 4, further comprising:
inputting a sample data set into a first model, and performing iterative training on the first model to obtain the parameter selection model; the sample data set comprises a plurality of samples, wherein each sample comprises an input parameter and a label, and a mapping relation between the input parameter and the label; wherein the input parameters comprise type identification of the traffic data and setting parameters used for determining entropy, and the label is the construction parameter.
9. The method of claim 8, wherein the input of a sample data set to a first model, prior to iterative training of the first model, when a number of samples in the sample data set is less than or equal to a third threshold, the method further comprises:
generating first sample data;
inputting first sample data into the parameter selection model, and outputting the construction parameters through the parameter selection model; the construction parameters are used for calculating the entropy from the first position node to the second position node so as to obtain the traffic data;
evaluating the traffic data based on the evaluation indexes to obtain an evaluation result;
if the evaluation result is inferior to a second threshold value, deleting the first sample data;
or,
and if the evaluation result is better than the second threshold value, adding the first sample data into the sample data set until the number of samples in the sample data set reaches or exceeds the third threshold value.
10. The method of claim 1, further comprising:
acquiring static data and traffic time sequence data of a third position node and a fourth position node;
when the static data is less than or equal to a fourth threshold, determining that the entropy of the third location node to the fourth location node needs to be calculated, the method further comprising:
and calculating the entropy from the third position node to the fourth position node based on the traffic time sequence data corresponding to the third position node and the traffic time sequence data corresponding to the fourth position node.
11. An apparatus for obtaining traffic data, comprising:
a processing module for determining a first location node and a second location node of a target geographic area;
an obtaining module, configured to obtain traffic timing sequence data corresponding to the first location node and the second location node, where the traffic timing sequence data is: traffic flow data corresponding to the location nodes in a plurality of consecutive time units;
the processing module is further used for calculating the entropy from the first position node to the second position node based on the traffic time sequence data of the first position node and the second position node; the entropy is used to indicate a directed edge weight of the first location node to the second location node;
the processing module is further configured to determine traffic data of the target geographic area according to the directed edge right from the first location node to the second location node.
12. The apparatus of claim 11,
the processing module is further configured to obtain a construction parameter, where the construction parameter is used to participate in calculating entropy between the first location node and the second location node; calculating an entropy of the first location node to the second location node based on the traffic timing data and the build parameter.
13. The apparatus of claim 12,
the processing module is further used for inputting the first data into a parameter selection model and outputting the construction parameters through the parameter selection model; the first data includes an identification of a type of the traffic data and setting parameters used to determine the entropy.
14. The apparatus according to any one of claims 11-13,
the acquisition module is further configured to acquire static data corresponding to the first location node and the second location node;
the processing module is further configured to identify the first location node and the second location node as critical nodes based on the static data and/or the traffic timing data.
15. The apparatus according to any one of claims 11-14,
the processing module is further configured to set a directed edge weight from the first location node to the second location node to a preset value when an entropy from the first location node to the second location node is smaller than or equal to a first threshold, where the preset value is used to indicate that the first location node has no association with the second location node.
16. The apparatus of claim 12,
the processing module is further used for evaluating the traffic data based on the evaluation indexes to obtain an evaluation result; adjusting the build parameter when the evaluation result is worse than a second threshold.
17. The apparatus according to any one of claims 11-16,
the processing module is further configured to extract backbone nodes of the plurality of location nodes and directed edge weights among the backbone nodes, where the backbone nodes include the first location node and the second location node; determining the traffic data based on the backbone nodes and directed edge weights between the backbone nodes.
18. The apparatus of claim 14,
the processing module is further configured to input the sample data set to a first model, and perform iterative training on the first model to obtain the parameter selection model; the sample data set comprises a plurality of samples, wherein each sample comprises an input parameter and a label, and a mapping relation between the input parameter and the label; wherein the input parameters comprise type identification of the traffic data and setting parameters used for determining entropy, and the label is the construction parameter.
19. The apparatus of claim 18, wherein when the number of samples in the sample data set is less than or equal to a third threshold, the processing module is further specifically configured to:
generating first sample data;
inputting first sample data into the parameter selection model, and outputting the construction parameters through the parameter selection model; the construction parameters are used for calculating the entropy from the first position node to the second position node so as to obtain the traffic data;
evaluating the traffic data based on the evaluation indexes to obtain an evaluation result;
if the evaluation result is inferior to a second threshold value, deleting the first sample data;
or,
and if the evaluation result is better than the second threshold, adding the first sample data into the sample data set until the number of samples in the sample data set reaches or exceeds the third threshold.
20. The apparatus of claim 11,
the processing module is also used for acquiring static data and traffic time sequence data of a third position node and a fourth position node; when the static data is smaller than or equal to a fourth threshold value, calculating entropy between the third position node and the fourth position node based on the traffic time sequence data corresponding to the third position node and the traffic time sequence data corresponding to the fourth position node.
21. An electronic device, comprising: comprising a processor coupled with at least one memory, the processor being configured to read a computer program stored by the at least one memory so as to cause the electronic device to perform the method of any of claims 1-10.
22. A computer-readable medium for storing a computer program or instructions which, when executed, cause a computer to perform the method of any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011490274.5A CN114639235A (en) | 2020-12-16 | 2020-12-16 | Method and related device for acquiring traffic data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011490274.5A CN114639235A (en) | 2020-12-16 | 2020-12-16 | Method and related device for acquiring traffic data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114639235A true CN114639235A (en) | 2022-06-17 |
Family
ID=81944716
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011490274.5A Pending CN114639235A (en) | 2020-12-16 | 2020-12-16 | Method and related device for acquiring traffic data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114639235A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160358021A1 (en) * | 2015-06-05 | 2016-12-08 | University Of Washington | Visual representations of distance cartograms |
CN107153896A (en) * | 2017-07-03 | 2017-09-12 | 北方工业大学 | Traffic network path prediction method and system based on node pair entropy |
CN108447255A (en) * | 2018-03-21 | 2018-08-24 | 北方工业大学 | Urban road dynamic traffic network structure information system |
CN111613047A (en) * | 2019-02-26 | 2020-09-01 | 阿里巴巴集团控股有限公司 | Information processing method and device |
-
2020
- 2020-12-16 CN CN202011490274.5A patent/CN114639235A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160358021A1 (en) * | 2015-06-05 | 2016-12-08 | University Of Washington | Visual representations of distance cartograms |
CN107153896A (en) * | 2017-07-03 | 2017-09-12 | 北方工业大学 | Traffic network path prediction method and system based on node pair entropy |
CN108447255A (en) * | 2018-03-21 | 2018-08-24 | 北方工业大学 | Urban road dynamic traffic network structure information system |
CN111613047A (en) * | 2019-02-26 | 2020-09-01 | 阿里巴巴集团控股有限公司 | Information processing method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Kim et al. | A capsule network for traffic speed prediction in complex road networks | |
CN104462190B (en) | A kind of online position predicting method excavated based on magnanimity space tracking | |
CN111080029B (en) | Urban traffic road speed prediction method and system based on multi-path segment space-time correlation | |
CN112561191B (en) | Prediction model training method, prediction device, prediction apparatus, prediction program, and program | |
Fang et al. | FTPG: A fine-grained traffic prediction method with graph attention network using big trace data | |
CN107230351A (en) | A kind of Short-time Traffic Flow Forecasting Methods based on deep learning | |
WO2018224354A1 (en) | Computer system and method for state prediction of a traffic system | |
CN106652534A (en) | Method for predicting arrival time of bus | |
JP2011138487A (en) | Method and system for traffic prediction based on space-time relation | |
CN106652441A (en) | Urban road traffic condition prediction method based on spatial-temporal data | |
CN106845703B (en) | Urban road network time-varying K shortest path searching method considering steering delay | |
CN110543978A (en) | Traffic flow data prediction method and device based on wavelet neural network | |
Kim et al. | Urban traffic prediction using congestion diffusion model | |
CN114330126A (en) | Training method of traffic signal control model and traffic signal control method | |
JP2013506184A (en) | Method and system for predicting travel time | |
CN114639235A (en) | Method and related device for acquiring traffic data | |
Lee et al. | Comparative analysis of machine learning algorithms to urban traffic prediction | |
CN116151478A (en) | Short-time traffic flow prediction method, device and medium for improving sparrow search algorithm | |
Zhou et al. | Sa-sgan: A vehicle trajectory prediction model based on generative adversarial networks | |
CN114566048B (en) | Traffic control method based on multi-view self-adaptive space-time diagram network | |
Du et al. | Comparison between CBR and CA methods for estimating land use change in Dongguan, China | |
CN113903171B (en) | Vehicle crowd sensing node optimization method based on spatial-temporal characteristics of highway network | |
CN115600744A (en) | Method for predicting population quantity of shared space-time attention convolutional network based on mobile phone data | |
CN115691140A (en) | Analysis and prediction method for space-time distribution of automobile charging demand | |
Fukuda | Effects of data prevalence on species distribution modelling using a genetic takagi-sugeno fuzzy system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220617 |