CN115905551A - Traffic state-based knowledge graph generation and traffic state prediction method and device - Google Patents

Traffic state-based knowledge graph generation and traffic state prediction method and device Download PDF

Info

Publication number
CN115905551A
CN115905551A CN202111154108.2A CN202111154108A CN115905551A CN 115905551 A CN115905551 A CN 115905551A CN 202111154108 A CN202111154108 A CN 202111154108A CN 115905551 A CN115905551 A CN 115905551A
Authority
CN
China
Prior art keywords
mapping
road
traffic state
traffic
target
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
Application number
CN202111154108.2A
Other languages
Chinese (zh)
Inventor
叶赛敏
燕丽敬
郝勇刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202111154108.2A priority Critical patent/CN115905551A/en
Publication of CN115905551A publication Critical patent/CN115905551A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Traffic Control Systems (AREA)

Abstract

The embodiment of the application provides a traffic state-based knowledge graph generation method and a traffic state prediction method and device, and relates to the technical field of intelligent traffic, wherein the knowledge graph generation method comprises the following steps: for every two associated road sections, respectively mapping historical traffic states, road section relations and historical moments of the two associated road sections at the historical moments on the basis of a first initial mapping matrix, a second initial mapping matrix and a third initial mapping matrix of a knowledge graph to be trained to obtain corresponding real mapping quadruplets; and adjusting the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix based on the target loss function, and continuing training until the target loss function reaches a convergence condition to obtain the first target mapping matrix, the second target mapping matrix and the third target mapping matrix. Based on the knowledge graph, the traffic state of the road section can be effectively predicted.

Description

Traffic state-based knowledge graph generation and traffic state prediction method and device
Technical Field
The application relates to the technical field of intelligent traffic, in particular to a traffic state-based knowledge graph generation and traffic state prediction method and device.
Background
With the continuous popularization of vehicles, more and more users choose to drive to go out. In addition, traffic events frequently occur in road traffic, for example, traffic accidents, vehicle breakdown, road maintenance, major events, and the like. Such traffic events can have an effect on the traffic capacity of the road and, in turn, the traffic of the vehicle.
Disclosure of Invention
The embodiment of the application aims to provide a method and a device for generating a knowledge graph and predicting a traffic state based on the traffic state, which can effectively predict the traffic state of a road section. The specific technical scheme is as follows:
in a first aspect, to achieve the above object, an embodiment of the present application discloses a method for generating a knowledge graph based on traffic conditions, where the method includes:
acquiring a first initial mapping matrix aiming at a traffic state, a second initial mapping matrix aiming at a road section relation and a third initial mapping matrix aiming at time in a knowledge graph spectrum to be trained;
for every two associated road segments in a target road network, respectively mapping historical traffic states of the two associated road segments at historical time, road segment relations between the two associated road segments and the historical time based on the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix to obtain real mapping quadruplets corresponding to the two associated road segments;
acquiring a fragmentation mapping quadruple corresponding to each real mapping quadruple;
based on a target loss function, adjusting the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix, and continuing training until the target loss function reaches a convergence condition to obtain a first target mapping matrix for a traffic state, a second target mapping matrix for a road section relation and a third target mapping matrix for time in the knowledge graph;
wherein the target loss function is: and obtaining the difference value between the score function corresponding to the real mapping quadruple and the score function corresponding to the fragmentation mapping quadruple.
Optionally, the mapping, for each two associated road segments in the target road network, based on the first initial mapping matrix, the second initial mapping matrix, and the third initial mapping matrix, the historical traffic states of the two associated road segments at the historical time, the road segment relationship between the two associated road segments, and the historical time, respectively, to obtain a true mapping quadruple corresponding to the two associated road segments, includes:
aiming at each road section in the target road network, acquiring each original four-tuple corresponding to the road section; wherein, an original four-tuple comprises the historical traffic state of the road segment at the historical moment, the historical traffic state of another road segment associated with the road segment at the historical moment, the road segment relation between the road segment and the associated another road segment, and the historical moment;
mapping the historical traffic state in each original quadruple according to the first initial mapping matrix to obtain a mapping traffic state; mapping the road section relation in the original four-tuple according to the second initial mapping matrix to obtain a mapping road section relation; mapping the historical time in the original four-tuple according to the third initial mapping matrix to obtain mapping historical time so as to obtain an alternative mapping four-tuple corresponding to the original four-tuple;
converting each alternative mapping quadruple based on the first conversion matrix to obtain a linear matrix corresponding to the alternative mapping quadruple;
converting each linear matrix based on the second conversion matrix to obtain the weight of the alternative mapping quadruple corresponding to the linear matrix;
based on the respective weights, calculating the weighted sum of the alternative mapping quadruples corresponding to the road section to obtain the embedded vector of the historical traffic state of the road section;
and aiming at every two associated road sections in the target road network, respectively replacing the historical traffic state, the road section relation and the historical moment of the road sections in the original four-tuple corresponding to the two associated road sections with the corresponding embedded vector, the mapping road section relation and the mapping historical moment to obtain the corresponding real mapping four-tuple.
Optionally, the historical traffic state includes at least one of: the actual traffic flow of the road segment, the maximum traffic flow supported by the road segment, the vehicle density of the road segment, the length of the road segment, the type of the road segment and the vehicle average traveling speed of the road segment.
Optionally, the link relation between two associated links includes at least one of: the relative positions of the two road sections, whether an intersection exists between the two road sections, whether traffic separation exists between the two road sections, whether traffic combination exists between the two road sections, and the ratio of the actual traffic flow of the two road sections.
In a second aspect, in order to achieve the above object, an embodiment of the present application discloses a traffic state prediction method, including:
determining a first road segment of a target road network, wherein a target traffic event occurs, and a second road segment related to the first road segment;
acquiring the traffic state of the first road section at a future moment as a first traffic state;
calculating the traffic state of the second road section at the future moment according to the first traffic state, the road section relation between the first road section and the second road section, the future moment and a knowledge graph to serve as a second traffic state;
the knowledge graph is generated based on any one of the knowledge graph generation methods based on the traffic state.
Optionally, after the calculating a traffic state of the second road segment at a future time as a second traffic state according to the first traffic state, the link relationship between the first road segment and the second road segment, and a knowledge graph, the method further includes:
determining whether the second road segment is a road segment affected by the target traffic event based on the second traffic state.
Optionally, the second traffic state includes: a vehicle density of the second road segment;
the determining whether the second road segment is the road segment affected by the target traffic event based on the second traffic state includes:
and if the vehicle density of the second road section is greater than a preset density threshold value, determining that the second road section is the road section influenced by the target traffic incident.
Optionally, the calculating, according to the first traffic state, the link relationship between the first link and the second link, the future time, and the knowledge graph, the traffic state of the second link at the future time as the second traffic state includes:
respectively mapping the first traffic state, the road section relation between the first road section and the second road section and the future time based on a first target mapping matrix aiming at the traffic state, a second target mapping matrix aiming at the road section relation and a third target mapping matrix aiming at the time in the knowledge graph to obtain a target mapping quadruple of the first road section and the second road section at the future time;
and calculating the optimal solution when the score function corresponding to the target mapping quadruple takes the minimum value to obtain the second traffic state of the second road segment at the future moment.
In order to achieve the above object, an embodiment of the present application discloses a traffic state-based knowledge graph generating apparatus, including:
the initial mapping matrix acquisition module is used for acquiring a first initial mapping matrix aiming at a traffic state, a second initial mapping matrix aiming at a road section relation and a third initial mapping matrix aiming at time in a knowledge graph spectrum to be trained;
the real mapping quadruplet acquisition module is used for mapping the historical traffic states of the two associated road sections at the historical moment, the road section relation between the two associated road sections and the historical moment respectively according to the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix for every two associated road sections in the target road network to obtain real mapping quadruplets corresponding to the two associated road sections;
the system comprises a fragmentation mapping quadruple acquisition module, a fragmentation mapping quadruple acquisition module and a fragmentation mapping quadruple analysis module, wherein the fragmentation mapping quadruple acquisition module is used for acquiring a fragmentation mapping quadruple corresponding to each real mapping quadruple;
the training module is used for adjusting the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix based on a target loss function, continuing training until the target loss function reaches a convergence condition, and obtaining a first target mapping matrix aiming at a traffic state, a second target mapping matrix aiming at a road section relation and a third target mapping matrix aiming at time in the knowledge graph;
wherein the target loss function is: and obtaining the difference value between the score function corresponding to the real mapping quadruple and the score function corresponding to the fragmentation mapping quadruple.
Optionally, the real mapping quadruple obtaining module includes:
the original four-tuple obtaining submodule is used for obtaining each original four-tuple corresponding to each road section in the target road network; wherein, an original four-tuple comprises the historical traffic state of the road segment at the historical moment, the historical traffic state of another road segment associated with the road segment at the historical moment, the road segment relation between the road segment and the associated another road segment, and the historical moment;
the alternative mapping quadruplet acquisition submodule is used for mapping the historical traffic state in each original quadruplet according to the first initial mapping matrix to obtain a mapping traffic state; mapping the road section relation in the original quadruple according to the second initial mapping matrix to obtain a mapping road section relation; mapping the historical time in the original quadruple according to the third initial mapping matrix to obtain mapping historical time so as to obtain an alternative mapping quadruple corresponding to the original quadruple;
the linear matrix obtaining submodule is used for converting each alternative mapping quadruple based on the first conversion matrix to obtain a linear matrix corresponding to the alternative mapping quadruple;
the weight obtaining submodule is used for converting each linear matrix based on the second conversion matrix to obtain the weight of the alternative mapping quadruple corresponding to the linear matrix;
the embedded vector acquisition submodule is used for calculating the weighted sum of each alternative mapping quadruple corresponding to the road section based on the respective weight to obtain the embedded vector of the historical traffic state of the road section;
and the real mapping quadruplet acquisition submodule is used for respectively replacing the historical traffic state, the road section relation and the historical moment of the road section in the original quadruplet corresponding to each two associated road sections in the target road network with the corresponding embedded vector, the mapping road section relation and the mapping historical moment to obtain the corresponding real mapping quadruplet.
Optionally, the historical traffic state includes at least one of: the actual traffic flow of the road segment, the maximum traffic flow supported by the road segment, the vehicle density of the road segment, the length of the road segment, the type of the road segment and the vehicle average traveling speed of the road segment.
Optionally, the link relation between two associated links includes at least one of: the relative positions of the two road sections, whether an intersection exists between the two road sections, whether traffic separation exists between the two road sections, whether traffic combination exists between the two road sections, and the ratio of the actual traffic flow of the two road sections.
In a fourth aspect, in order to achieve the above object, an embodiment of the present application discloses a traffic state prediction apparatus, including:
the road section determining module is used for determining a first road section of a target traffic event in a target road network and a second road section related to the first road section;
the first traffic state acquisition module is used for acquiring the traffic state of the first road section at a future moment as a first traffic state;
the second traffic state calculation module is used for calculating the traffic state of the second road section at the future moment according to the first traffic state, the road section relation between the first road section and the second road section, the future moment and the knowledge graph to serve as the second traffic state;
the knowledge graph is generated based on any one of the knowledge graph generation methods based on the traffic state.
Optionally, the apparatus further comprises:
and the processing module is used for calculating the traffic state of the second road section at the future moment according to the first traffic state, the road section relation between the first road section and the second road section and the knowledge graph to serve as a second traffic state, and then determining whether the second road section is the road section influenced by the target traffic event or not based on the second traffic state.
Optionally, the second traffic state includes: a vehicle density of the second road segment;
the processing module is specifically configured to determine that the second road segment is a road segment affected by the target traffic event if the vehicle density of the second road segment is greater than a preset density threshold.
Optionally, the second traffic state calculating module includes:
a target mapping quadruplet acquisition sub-module, configured to map the first traffic state, the road segment relationship between the first road segment and the second road segment, and the future time based on a first target mapping matrix for a traffic state, a second target mapping matrix for a road segment relationship, and a third target mapping matrix for time in the knowledge graph, to obtain a target mapping quadruplet of the first road segment and the second road segment at the future time;
and the second traffic state calculation submodule is used for calculating an optimal solution when the score function corresponding to the target mapping quadruple takes the minimum value, and obtaining a second traffic state of the second road segment at a future moment.
In another aspect of this application, in order to achieve the above object, an embodiment of this application further discloses an electronic device, where the electronic device includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method for generating a traffic state-based knowledge map or the method for predicting a traffic state as described in any of the above descriptions when executing the program stored in the memory.
In yet another aspect of the present application, there is also provided a computer-readable storage medium having a computer program stored therein, where the computer program is executed by a processor to implement the method for generating a traffic state-based knowledge graph or the method for predicting a traffic state as described in any one of the above.
Embodiments of the present application further provide a computer program product containing instructions, which when executed on a computer, cause the computer to perform any one of the above-mentioned methods for generating a traffic state-based knowledge graph, or methods for predicting a traffic state.
The embodiment of the application has the following beneficial effects:
according to the traffic state-based knowledge graph generation method provided by the embodiment of the application, a first initial mapping matrix aiming at a traffic state, a second initial mapping matrix aiming at a road section relation and a third initial mapping matrix aiming at time in a knowledge graph to be trained can be obtained; aiming at every two associated road sections in a target road network, respectively mapping historical traffic states of the two associated road sections at historical time, road section relations between the two associated road sections and the historical time based on a first initial mapping matrix, a second initial mapping matrix and a third initial mapping matrix to obtain real mapping quadruplets corresponding to the two associated road sections; acquiring a fragmentation mapping quadruple corresponding to each real mapping quadruple; based on a target loss function, adjusting the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix, and continuing training until the target loss function reaches a convergence condition to obtain a first target mapping matrix for a traffic state, a second target mapping matrix for a road section relation and a third target mapping matrix for time in the knowledge graph; wherein the target loss function is: based on the difference value between the score function corresponding to the real mapping quadruple and the score function corresponding to the fragmentation mapping quadruple.
Based on the above processing, the trained knowledge graph includes the first target mapping matrix, the second target mapping matrix, and the third target mapping matrix, and the knowledge graph can learn the relationship among the traffic states of each link, so that the traffic states of other links can be predicted based on the traffic states of existing links, that is, the traffic states of the links can be effectively predicted.
Of course, it is not necessary for any product or method of the present application to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and it is also obvious for a person skilled in the art to obtain other embodiments according to the drawings.
Fig. 1 is a flowchart of a method for generating a knowledge graph based on traffic conditions according to an embodiment of the present application;
FIG. 2 is a flow chart of another method for generating a traffic state-based knowledge graph according to an embodiment of the present disclosure;
fig. 3A is a schematic diagram of dividing a road network according to an embodiment of the present application;
fig. 3B is another schematic diagram of dividing a road network according to the embodiment of the present disclosure;
fig. 3C is another schematic diagram of dividing a road network according to the embodiment of the present application;
fig. 4 is a flowchart of a traffic state prediction method according to an embodiment of the present application;
fig. 5 is a flowchart of another traffic state prediction method according to an embodiment of the present application;
fig. 6 is a flowchart of another traffic state prediction method according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of traffic state prediction according to an embodiment of the present application;
fig. 8 is a block diagram of a knowledge graph generating apparatus based on traffic conditions according to an embodiment of the present application;
fig. 9 is a structural diagram of a traffic state prediction apparatus according to an embodiment of the present application;
fig. 10 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the description herein are intended to be within the scope of the present disclosure.
The embodiment of the application provides a traffic state-based knowledge graph generation method, which can be applied to electronic equipment, wherein the electronic equipment can acquire historical traffic states of road sections in a road network and road section relations among the road sections, and generates a knowledge graph based on the traffic state-based knowledge graph generation method provided by the embodiment of the application. In addition, the electronic equipment can also predict the traffic state of the road section based on the generated knowledge graph.
For example, the traffic state of the road segment can be detected by a detection device installed on the road side, and the electronic device can communicate with the detection device, and accordingly, the electronic device can acquire the traffic state of the road segment from the detection device and perform processing based on the method provided by the embodiment of the application.
For another example, the electronic device may also be a detection device installed on the road side, and accordingly, the electronic device may directly detect the traffic state of the road section, and perform processing based on the method provided in the embodiment of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a traffic state-based knowledge graph generation method provided in an embodiment of the present application, where the method may include the following steps:
s101: and acquiring a first initial mapping matrix aiming at the traffic state, a second initial mapping matrix aiming at the road section relation and a third initial mapping matrix aiming at time in a knowledge graph spectrum to be trained.
S102: for every two associated road segments in the target road network, mapping historical traffic states of the two associated road segments at historical time, road segment relations between the two associated road segments and the historical time respectively based on the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix to obtain real mapping quadruplets corresponding to the two associated road segments.
S103: and acquiring a fragmentation mapping quadruple corresponding to each real mapping quadruple.
S104: and adjusting the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix based on the target loss function, and continuing training until the target loss function reaches a convergence condition to obtain a first target mapping matrix aiming at the traffic state, a second target mapping matrix aiming at the road section relation and a third target mapping matrix aiming at the time in the knowledge graph.
Wherein the target loss function is: based on the score function corresponding to the real mapping quadruple, and the difference value of the score function corresponding to the breaking mapping quadruple.
Based on the knowledge graph generation method provided by the embodiment of the application, the trained knowledge graph comprises the first target mapping matrix, the second target mapping matrix and the third target mapping matrix, and the knowledge graph can learn the relation among the traffic states of all the road sections, so that the traffic states of other road sections can be predicted based on the existing traffic states of the road sections, namely, the traffic states of the road sections can be effectively predicted.
Because the road sections in the target road network have an association relationship, the road sections can be influenced, namely the traffic states of the road sections are associated with each other. The knowledge graph constructed based on the historical traffic states can effectively reflect the incidence relation among the traffic states of all road sections, and further can predict the traffic states of the road sections based on the knowledge graph. For example, if a traffic accident occurs on a road section, the traffic accident may cause the road section to prohibit the vehicle from passing through. Further, it can be determined that the downstream road segment of the road segment is not affected by the target traffic event according to the traffic flow direction, and the actual traffic flow and the vehicle density of the road segment are continuously reduced with time because no vehicle enters the upstream road segment. The actual flow and the vehicle density of the upstream road section are continuously increased until the upstream road section is blocked by the traffic flow until the upstream road section is blocked.
The knowledge-graph may be represented by "instance-relationship-instance", in the embodiment of the present application, one instance represents one road segment; the relationship between the two instances represents a link relationship between the corresponding two links.
The two associated road segments may be two road segments directly adjacent to each other in the target road network, or two road segments indirectly adjacent to each other. Therefore, the number of links associated with one link may be one or more.
For the traffic state of the road sections, the road section relation among the road sections and the time, the road sections are respectively in different vector spaces, because for the convenience of calculation, the information can be respectively projected to the same hyperplane to obtain the embedded vectors corresponding to the road sections. Each embedded vector also constitutes a true mapped quadruple.
In one implementation, after each real mapping quadruple is obtained, elements in each real mapping quadruple may be randomly combined, and each quadruple obtained by combining may be referred to as a fragmentation mapping quadruple. It can be understood that breaking up the mapping quadruples can be used as an erroneous sample to train the knowledge graph, and the real mapping quadruples can be used as a correct sample to train the knowledge graph.
In one implementation, for two associated road segments, the traffic state of one road segment is represented by h, the traffic state of the other road segment is represented by τ, the link relationship between the two road segments is represented by r, and the corresponding time is represented by t.
For a quadruple (h, r, τ, t) of the above information, when it is true, then h + r + t ≈ τ (i.e. the trailing instance τ can be determined by the time t, the leading instance h, and the link relation r). Therefore, the goal of training the knowledge-graph is to continuously adjust h, r, and t so that (h + r + t) and τ are equal. In addition, the degree of h + r + t ≈ τ can be measured by a scoring function, as in formula (1):
f(h,r,τ,t)=d(h+r+t,τ) (1)
wherein f (h, r, τ, t) represents the scoring function corresponding to the quadruple. For example, d (h + r + t, τ) = | e h +e r +e t -e τ Iiii | may be an L1 norm, or, alternatively, an L2 norm. e.g. of the type h ,e r ,e t ,e τ Respectively, the embedding representation of h, r, τ, t, i.e. the respective corresponding embedding vector.
The target loss function can be seen in equation (2).
Figure BDA0003287992310000111
Wherein L represents a target loss function, S represents a set consisting of true mapping quadruples, and S' (h,r,τ,t) Representing a set of fracture mapping quadruplets. [ x ]] + Represents the hinge loss function, if x>At 0, [ x ]] + = x; if x is less than or equal to 0, then [ x ]] + =0。γ>And 0, representing a preset hyper-parameter.
For h, r, t and τ in the above formula (2), they can be replaced with the respective corresponding embedding vectors. Wherein, heuristic search algorithms such as gradient descent and the like can be adopted for training.
Illustratively, the respective embedding vectors may be derived based on equation (3).
e h =hM h ,e r =rM r ,e τ =τM h ,e t =tM t (3)
Wherein, M h Representing a first initial mapping matrix, M r Representing a second initial mapping matrix, M t Representing a third initial mapping matrix; corresponding to (e) h Representing the result of mapping the traffic situation h, e τ Representing the result of mapping the traffic situation τ, e r Representing the result of the mapping of the road segment relation r, e t Indicating the result of the mapping at time t.
In one implementation, the result of the mapping may be used as the embedding vector corresponding to each, and a quadruple formed by each embedding vector, that is, a mapping quadruple candidate in the following text, is obtained.
In one embodiment, the alternative mapping quadruples may be directly used as the corresponding real mapping quadruples.
In another embodiment, referring to fig. 2, the step S102 may include the following steps:
s1021: and acquiring each original four-tuple corresponding to each road section in the target road network.
Wherein one original four-tuple contains the historical traffic state of the road segment at the historical moment, the historical traffic state of another road segment associated with the road segment at the historical moment, the road segment relation between the road segment and the associated another road segment, and the historical moment.
S1022: mapping the historical traffic state in each original quadruple according to a first initial mapping matrix to obtain a mapping traffic state; mapping the road section relation in the original four-tuple according to the second initial mapping matrix to obtain a mapping road section relation; and mapping the historical time in the original four-tuple according to the third initial mapping matrix to obtain mapping historical time so as to obtain an alternative mapping four-tuple corresponding to the original four-tuple.
S1023: and converting each alternative mapping quadruple based on the first conversion matrix to obtain a linear matrix corresponding to the alternative mapping quadruple.
S1024: and converting each linear matrix based on the second conversion matrix to obtain the weight of the alternative mapping quadruple corresponding to the linear matrix.
S1025: and calculating the weighted sum of the alternative mapping quadruples corresponding to the road section based on the respective weights to obtain the embedded vector of the historical traffic state of the road section.
S1026: and aiming at every two associated road sections in the target road network, respectively replacing the historical traffic state, the road section relation and the historical moment of the road sections in the original four-tuple corresponding to the two associated road sections with the corresponding embedded vector, the mapping road section relation and the mapping historical moment to obtain the corresponding real mapping four-tuple.
In one embodiment, the original quadruple corresponding to road segment i and road segment j is represented as (h) i ,r k ,h j ,t p ),h i Represents the historical traffic state h of the road section i j Representing historical traffic conditions, r, for road segment j k Representing a link relationship, t, between link i and link j p Indicating the corresponding historical time.
The alternative mapping quadruplet corresponding to the original quadruplet can be expressed as
Figure BDA0003287992310000121
The corresponding linear matrix can be represented by equation (4):
Figure BDA0003287992310000122
wherein, c ijkp Representing the corresponding linear matrix, W 1 A first transformation matrix is represented that is,
Figure BDA0003287992310000123
the preset processing of four elements in the alternative mapping quadruple is shown, for example, the product of the four elements may be shown to be calculated, or the weighted sum of the four elements may also be shown to be calculated.
Further, the weights of the candidate mapping quadruples corresponding to the linear matrix can be obtained based on the formula (5).
b ijkp =W 2 c ijkp (5)
Wherein, b ijkp Weight, W, representing the alternative mapping quadruple to which the linear matrix corresponds 2 Representing a second transformation matrix.
In an embodiment, the weights of the alternative mapping quadruples may also be normalized to obtain normalized weights, and then, based on the normalized weights, a weighted sum of the alternative mapping quadruples corresponding to the road segment is calculated to obtain an embedded vector of the historical traffic state of the road segment.
For example, the weights of the alternative mapping quadruples may be normalized based on equation (6).
Figure BDA0003287992310000131
/>
N i Representing a set of road segments, R, associated with a road segment i in Representing a set of link relations, T, between a link i and an associated link i Representing a set of historical time instants.
Further, an embedded vector of the historical traffic state of the link i may be calculated based on equation (7).
Figure BDA0003287992310000132
Wherein the content of the first and second substances,
Figure BDA0003287992310000133
an embedded vector, R, representing the historical traffic status of a road segment i ij Representing link relations between links i and jThe set, σ, represents a preset activation function, which may be, for example, a Sigmoid function, or may be a Relu (The Rectified Linear Unit) function.
Further, h in the formula (2) may be replaced with an embedded vector of the traffic state h, and r in the formula (2) may be replaced with an embedded vector of the traffic state r, to obtain an objective loss function including a weight.
The link relation between two road segments may be determined from the relative positions of the two road segments in the target road network. Referring to fig. 3A, fig. 3A is a schematic diagram illustrating dividing a road network according to an embodiment of the present disclosure.
In fig. 3A, arrows indicate the traffic direction. For a road in a traffic flow direction, i represents the ith road segment and i +1 represents the (i + 1) th road segment according to the traffic flow direction, and in fig. 3A, the ith road segment and the (i + 1) th road segment are both mixed road segments, and the mixed road segments represent road segments without dividing lanes.
Referring to fig. 3B, fig. 3B is another schematic diagram of dividing a road network according to an embodiment of the present disclosure.
In fig. 3B, arrows indicate the direction of traffic flow. For a road in a traffic flow direction, i represents the ith road segment, i +1 represents the (i + 1) th road segment, and in fig. 3B, the ith road segment is a mixed road segment, and the (i + 1) th road segment is a channeled road segment, that is, the channeled road segment represents a road segment divided into a plurality of lanes.
Referring to fig. 3C, fig. 3C is another schematic diagram for dividing a road network according to the embodiment of the present application.
In fig. 3C, the arrows indicate the traffic direction. For a road in a traffic flow direction, i represents the ith road segment and i-1 represents the ith-1 road segment according to the traffic flow direction, and in fig. 3C, the ith road segment is a mixed road segment and the ith-1 road segment is a channelized road segment, that is, the ith-1 road segment is divided into a plurality of lanes.
In one embodiment, the link relationship between two associated links includes at least one of: the relative positions of the two road sections, whether an intersection exists between the two road sections, whether traffic separation exists between the two road sections, whether traffic combination exists between the two road sections, and the ratio of the actual traffic flow of the two road sections.
In the embodiment of the present application, the link relationship between two links may be determined according to the vehicle direction in the two links. Referring to fig. 3A, in fig. 3A, there is no intersection between the ith road segment and the (i + 1) th road segment. Referring to fig. 3C, in fig. 3C, an intersection exists between the i-1 th road segment and the i-th road segment. Referring to fig. 3B, in fig. 3B, there is traffic flow separation between the ith road segment and the (i + 1) th road segment, that is, from the ith road segment to the (i + 1) th road segment, according to the vehicle direction, the mixed road segment is changed into the channelized road segment. Referring to fig. 3C, in fig. 3C, there is a merging of traffic between the i-1 th road segment and the i-th road segment, that is, from the i-1 th road segment to the i-th road segment, a road segment is changed from a channeling road segment to a mixing road segment according to the vehicle direction.
In one embodiment, the historical traffic state includes at least one of: actual traffic flow for a road segment, maximum traffic flow supported by a road segment, vehicle density for a road segment, length of a road segment, road segment type for a road segment, and vehicle average travel speed for a road segment.
In the embodiment of the application, the traffic state of a road section represents the traffic condition of the road section within a certain time period.
For example, the current actual traffic flow for a road segment may represent the total number of vehicles passing within a predetermined time period before the current time.
The maximum traffic flow supported by a road segment may represent the maximum number of vehicles permitted for the road segment for a predetermined duration prior to the current time.
The vehicle density for a road segment may represent a ratio of a total number of vehicles in the road segment to a length of the road segment at the current time.
The link type of a link may be a mixed-traveling link, or a channeled link.
For each vehicle passing through the road section within the preset time before the current moment, the time required for the vehicle to run through the road section can be calculated, and then the ratio of the length of the road section to the time is calculated and used as the running speed of the vehicle. Then, an average value of the traveling speeds of the respective vehicles is calculated as an average traveling speed of the vehicle in the link.
Based on the same inventive concept, an embodiment of the present application further provides a traffic state prediction method, referring to fig. 4, where fig. 4 is a flowchart of the traffic state prediction method provided in the embodiment of the present application, and the method may include the following steps:
s401: a first road segment of a target road network where a target traffic event occurs and a second road segment associated with the first road segment are determined.
S402: and acquiring the traffic state of the first road segment at a future moment as a first traffic state.
S403: and calculating the traffic state of the second road section at the future moment as a second traffic state according to the first traffic state, the road section relation between the first road section and the second road section, the future moment and the knowledge graph.
Wherein the knowledge graph is generated based on any one of the knowledge graph generation methods.
According to the traffic state prediction method provided by the embodiment of the application, the trained knowledge graph comprises the first target mapping matrix, the second target mapping matrix and the third target mapping matrix, and the knowledge graph can learn the relation among the traffic states of all the road sections, so that the traffic states of other road sections can be predicted based on the existing traffic states of the road sections, namely, the traffic states of the road sections can be effectively predicted.
For step S401, the first road segment may be any road segment in the target road network, and a traffic event (i.e., a target traffic event) currently occurs in the first road segment. The target traffic event can be a traffic accident, a vehicle break down, road maintenance, a large-scale activity and other events.
With respect to step S402, if a target traffic event occurs for a first road segment, a first traffic status for the first road segment may be determined based on the target traffic event. For example, if the target traffic event is a traffic accident, it may be determined that the first road segment prohibits the vehicle from passing through, and accordingly, the first traffic state of the first road segment corresponds to the congestion state, for example, the traffic capacity of the first road segment at the future time is 0, and the average driving speed of the vehicle is 0.
In one embodiment, the step S403 may include the following steps:
the method comprises the following steps: and respectively mapping the first traffic state, the road section relation between the first road section and the second road section and the future time based on a first target mapping matrix aiming at the traffic state, a second target mapping matrix aiming at the road section relation and a third target mapping matrix aiming at the time in the knowledge graph to obtain a target mapping quadruple of the first road section and the second road section at the future time.
Step two: and calculating the optimal solution when the score function corresponding to the target mapping quadruple takes the minimum value to obtain the second traffic state of the second road segment at the future moment.
In the embodiment of the application, after the first traffic state, the link relationship between the first link and the second link, and the future time are obtained, respective embedding vectors may be respectively calculated based on the first target mapping matrix, the second target mapping matrix, and the third target mapping matrix.
Furthermore, based on each obtained embedded vector, a mapping quadruple of the first road segment and the second road segment at a future time may be determined, and the embedded vector corresponding to the second traffic state in the mapping quadruple may be an unknown quantity. Then, an optimal solution when the score function corresponding to the mapping quadruple takes the minimum value can be calculated, and the embedded vector corresponding to the second traffic state can be obtained. Further, the second traffic state can be obtained by performing a reverse calculation based on the above equations (4) to (7).
In the embodiment of the application, the knowledge graph can be regularly trained and updated, historical data does not need to be accumulated all the time, namely, a huge database does not need to be maintained all the time, and therefore the efficiency of traffic state prediction can be improved.
In one embodiment, referring to fig. 5, on the basis of fig. 4, after the step S403, the method may further include the steps of:
s404: and determining whether the second road section is the road section influenced by the target traffic event or not based on the second traffic state.
In an embodiment of the present application, after determining the second traffic state, it may be determined whether the second road segment is affected by the target traffic event in the first road segment based on the second traffic state. Correspondingly, if the second road segment is influenced by the target traffic event, the user can be reminded to carry out traffic control on the second road segment so as to avoid traffic jam of the second road segment.
In one embodiment, the second traffic state includes: vehicle density of the second road segment. Accordingly, referring to fig. 6, on the basis of fig. 5, the step S404 may include:
s4041: and if the vehicle density of the second road section is greater than the preset density threshold value, determining that the second road section is the road section influenced by the target traffic incident.
In this embodiment of the application, if the predicted vehicle density of the second road segment is greater than the preset density threshold, it indicates that the target traffic event occurring in the first road segment has a greater influence on the second road segment, which may cause congestion of the second road segment, and therefore, it may be determined that the second road segment is influenced by the target traffic event. Based on the above processing, the influence range of the target traffic event can be determined.
Referring to fig. 7, fig. 7 is a schematic diagram of a traffic state prediction according to an embodiment of the present disclosure.
The road network is divided in advance to obtain a plurality of road sections, and further, a knowledge graph can be constructed based on the historical traffic state of each road section and the road section relation among the road sections.
When a traffic event causes a change in traffic status of a road segment (i.e., a first road segment), the traffic status of upstream and downstream road segments (i.e., a second traffic status of a second road segment) may be inferred by the knowledge-graph based on the traffic status of the first road segment.
Further, the impact range of traffic events can be predicted: that is, based on the second traffic state, a second road segment affected by the traffic event is determined.
Based on the same inventive concept, an embodiment of the present application further provides a traffic state-based knowledge graph generating apparatus, referring to fig. 8, where fig. 8 is a structural diagram of a traffic state-based knowledge graph generating apparatus provided in an embodiment of the present application, and the apparatus may include:
an initial mapping matrix obtaining module 801, configured to obtain a first initial mapping matrix for a traffic state, a second initial mapping matrix for a road segment relationship, and a third initial mapping matrix for time in a knowledge graph to be trained;
a real mapping quadruplet obtaining module 802, configured to map, for every two associated road segments in the target road network, historical traffic states of the two associated road segments at a historical time, a road segment relationship between the two associated road segments, and the historical time based on the first initial mapping matrix, the second initial mapping matrix, and the third initial mapping matrix, respectively, to obtain a real mapping quadruplet corresponding to the two associated road segments;
a fragmentation mapping quadruple acquisition module 803, configured to acquire a fragmentation mapping quadruple corresponding to each real mapping quadruple;
a training module 804, configured to adjust the first initial mapping matrix, the second initial mapping matrix, and the third initial mapping matrix based on a target loss function, and continue training until the target loss function reaches a convergence condition, to obtain a first target mapping matrix for a traffic state, a second target mapping matrix for a road segment relation, and a third target mapping matrix for time in the knowledge graph;
wherein the target loss function is: and obtaining the difference value between the score function corresponding to the real mapping quadruple and the score function corresponding to the fragmentation mapping quadruple.
Optionally, the real mapping quadruple obtaining module 802 includes:
the original four-tuple obtaining submodule is used for obtaining each original four-tuple corresponding to each road section in the target road network; wherein, an original four-tuple comprises the historical traffic state of the road segment at the historical moment, the historical traffic state of another road segment associated with the road segment at the historical moment, the road segment relation between the road segment and the associated another road segment, and the historical moment;
the alternative mapping quadruplet acquisition submodule is used for mapping the historical traffic state in each original quadruplet according to the first initial mapping matrix to obtain a mapping traffic state; mapping the road section relation in the original quadruple according to the second initial mapping matrix to obtain a mapping road section relation; mapping the historical time in the original four-tuple according to the third initial mapping matrix to obtain mapping historical time so as to obtain an alternative mapping four-tuple corresponding to the original four-tuple;
the linear matrix acquisition submodule is used for converting each alternative mapping quadruple based on the first conversion matrix to obtain a linear matrix corresponding to the alternative mapping quadruple;
the weight obtaining submodule is used for converting each linear matrix based on the second conversion matrix to obtain the weight of the alternative mapping quadruple corresponding to the linear matrix;
the embedded vector acquisition submodule is used for calculating the weighted sum of each alternative mapping quadruple corresponding to the road section based on the respective weight to obtain the embedded vector of the historical traffic state of the road section;
and the real mapping quadruplet acquisition submodule is used for respectively replacing the historical traffic state, the road section relation and the historical moment of the road section in the original quadruplet corresponding to each two associated road sections in the target road network with the corresponding embedded vector, the mapping road section relation and the mapping historical moment to obtain the corresponding real mapping quadruplet.
Optionally, the historical traffic state includes at least one of: the actual traffic flow of the road segment, the maximum traffic flow supported by the road segment, the vehicle density of the road segment, the length of the road segment, the type of the road segment and the vehicle average traveling speed of the road segment.
Optionally, the link relation between two associated links includes at least one of: the relative positions of the two road sections, whether an intersection exists between the two road sections, whether traffic separation exists between the two road sections, whether traffic combination exists between the two road sections, and the ratio of the actual traffic flow of the two road sections.
Based on the same inventive concept, an embodiment of the present application further provides a traffic status prediction apparatus, referring to fig. 9, where fig. 9 is a structural diagram of the traffic status prediction apparatus provided in the embodiment of the present application, and the apparatus may include:
a road segment determining module 901, configured to determine a first road segment in a target road network where a target traffic event occurs, and a second road segment associated with the first road segment;
a first traffic state obtaining module 902, configured to obtain a traffic state of the first road segment at a future time as a first traffic state;
a second traffic state calculation module 903, configured to calculate a traffic state of the second road segment at a future time as a second traffic state according to the first traffic state, a road segment relationship between the first road segment and the second road segment, the future time, and a knowledge graph;
the knowledge graph is generated based on any one of the knowledge graph generation methods based on the traffic state.
Optionally, the apparatus further comprises:
and the processing module is used for calculating the traffic state of the second road section at the future moment according to the first traffic state, the road section relation between the first road section and the second road section and the knowledge graph to serve as a second traffic state, and then determining whether the second road section is the road section influenced by the target traffic event or not based on the second traffic state.
Optionally, the second traffic state includes: a vehicle density of the second road segment;
the processing module is specifically configured to determine that the second road segment is a road segment affected by the target traffic event if the vehicle density of the second road segment is greater than a preset density threshold.
Optionally, the second traffic state calculating module 903 includes:
a target mapping quadruplet acquisition sub-module, configured to map the first traffic state, the road segment relationship between the first road segment and the second road segment, and the future time based on a first target mapping matrix for a traffic state, a second target mapping matrix for a road segment relationship, and a third target mapping matrix for time in the knowledge graph, to obtain a target mapping quadruplet of the first road segment and the second road segment at the future time;
and the second traffic state calculation sub-module is used for calculating an optimal solution when the score function corresponding to the target mapping quadruple takes the minimum value to obtain a second traffic state of the second road section at a future moment.
The embodiment of the present application further provides an electronic device, as shown in fig. 10, including a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, where the processor 1001, the communication interface 1002, and the memory 1003 complete mutual communication through the communication bus 1004,
a memory 1003 for storing a computer program;
the processor 1001 is configured to implement any one of the above-described methods for generating a traffic state-based knowledge map or a method for predicting a traffic state when executing the program stored in the memory 1003.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In yet another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements any of the above-mentioned traffic state-based knowledge graph generation methods, or the steps of the traffic state prediction method.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the above-described traffic state-based knowledge graph generation methods, or traffic state prediction methods.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (13)

1. A traffic state-based knowledge graph generation method is characterized by comprising the following steps:
acquiring a first initial mapping matrix aiming at a traffic state, a second initial mapping matrix aiming at a road section relation and a third initial mapping matrix aiming at time in a knowledge graph spectrum to be trained;
for every two associated road segments in a target road network, respectively mapping historical traffic states of the two associated road segments at historical time, road segment relations between the two associated road segments and the historical time based on the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix to obtain real mapping quadruplets corresponding to the two associated road segments;
acquiring a fragmentation mapping quadruple corresponding to each real mapping quadruple;
based on a target loss function, adjusting the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix, and continuing training until the target loss function reaches a convergence condition to obtain a first target mapping matrix for a traffic state, a second target mapping matrix for a road section relation and a third target mapping matrix for time in the knowledge graph;
wherein the target loss function is: and obtaining the difference value between the score function corresponding to the real mapping quadruple and the score function corresponding to the fragmentation mapping quadruple based on the score function corresponding to the real mapping quadruple.
2. The method according to claim 1, wherein for every two associated road segments in the target road network, mapping historical traffic states of the two associated road segments at historical time instants, a road segment relationship between the two associated road segments, and the historical time instants respectively based on the first initial mapping matrix, the second initial mapping matrix, and the third initial mapping matrix to obtain real mapping quadruplets corresponding to the two associated road segments comprises:
aiming at each road section in the target road network, acquiring each original four-tuple corresponding to the road section; wherein, an original four-tuple comprises the historical traffic state of the road segment at the historical moment, the historical traffic state of another road segment associated with the road segment at the historical moment, the road segment relation between the road segment and the associated another road segment, and the historical moment;
for each original quadruple, mapping the historical traffic state in the original quadruple according to the first initial mapping matrix to obtain a mapping traffic state; mapping the road section relation in the original four-tuple according to the second initial mapping matrix to obtain a mapping road section relation; mapping the historical time in the original four-tuple according to the third initial mapping matrix to obtain mapping historical time so as to obtain an alternative mapping four-tuple corresponding to the original four-tuple;
converting each alternative mapping quadruple based on the first conversion matrix to obtain a linear matrix corresponding to the alternative mapping quadruple;
converting each linear matrix based on the second conversion matrix to obtain the weight of the alternative mapping quadruple corresponding to the linear matrix;
based on the respective weights, calculating the weighted sum of the alternative mapping quadruples corresponding to the road section to obtain the embedded vector of the historical traffic state of the road section;
and aiming at every two associated road sections in the target road network, respectively replacing the historical traffic state, the road section relation and the historical moment of the road sections in the original four-tuple corresponding to the two associated road sections with the corresponding embedded vector, the mapping road section relation and the mapping historical moment to obtain the corresponding real mapping four-tuple.
3. The method of claim 1, wherein the historical traffic state comprises at least one of: actual traffic flow for a road segment, maximum traffic flow supported by a road segment, vehicle density for a road segment, length of a road segment, road segment type for a road segment, and vehicle average travel speed for a road segment.
4. The method of claim 1, wherein the link relationship between two associated links comprises at least one of: the relative positions of the two road sections, whether an intersection exists between the two road sections, whether traffic separation exists between the two road sections, whether traffic combination exists between the two road sections, and the ratio of the actual traffic flow of the two road sections.
5. A traffic state prediction method, characterized in that the method comprises:
determining a first road segment of a target road network, wherein a target traffic event occurs, and a second road segment associated with the first road segment;
acquiring the traffic state of the first road section at a future moment as a first traffic state;
calculating the traffic state of the second road section at the future moment according to the first traffic state, the road section relation between the first road section and the second road section, the future moment and a knowledge graph to serve as a second traffic state;
wherein the knowledge-graph is generated based on the method of any one of claims 1-4.
6. The method of claim 5, wherein after calculating the traffic status of the second road segment at a future time as a second traffic status based on the first traffic status, the link relationship between the first road segment and the second road segment, and a knowledge-graph, the method further comprises:
and determining whether the second road segment is the road segment influenced by the target traffic event or not based on the second traffic state.
7. The method of claim 6, wherein the second traffic state comprises: a vehicle density of the second road segment;
the determining whether the second road segment is the road segment affected by the target traffic event based on the second traffic state includes:
and if the vehicle density of the second road section is greater than a preset density threshold value, determining that the second road section is the road section influenced by the target traffic incident.
8. The method of claim 5, wherein the calculating the traffic state of the second road segment at the future time as the second traffic state based on the first traffic state, the link relationship between the first road segment and the second road segment, the future time, and a knowledge-graph comprises:
respectively mapping the first traffic state, the road section relation between the first road section and the second road section and the future time based on a first target mapping matrix aiming at the traffic state, a second target mapping matrix aiming at the road section relation and a third target mapping matrix aiming at the time in the knowledge graph to obtain a target mapping quadruple of the first road section and the second road section at the future time;
and calculating the optimal solution when the score function corresponding to the target mapping quadruple takes the minimum value to obtain the second traffic state of the second road segment at the future moment.
9. A traffic state-based knowledge graph generation apparatus, the apparatus comprising:
the initial mapping matrix acquisition module is used for acquiring a first initial mapping matrix aiming at a traffic state, a second initial mapping matrix aiming at a road section relation and a third initial mapping matrix aiming at time in a knowledge graph spectrum to be trained;
the real mapping quadruplet acquisition module is used for mapping the historical traffic states of the two associated road sections at the historical moment, the road section relation between the two associated road sections and the historical moment respectively according to the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix for every two associated road sections in the target road network to obtain real mapping quadruplets corresponding to the two associated road sections;
the system comprises a fragmentation mapping quadruple acquisition module, a fragmentation mapping quadruple acquisition module and a fragmentation mapping quadruple analysis module, wherein the fragmentation mapping quadruple acquisition module is used for acquiring a fragmentation mapping quadruple corresponding to each real mapping quadruple;
the training module is used for adjusting the first initial mapping matrix, the second initial mapping matrix and the third initial mapping matrix based on a target loss function, continuing training until the target loss function reaches a convergence condition, and obtaining a first target mapping matrix aiming at a traffic state, a second target mapping matrix aiming at a road section relation and a third target mapping matrix aiming at time in the knowledge graph;
wherein the target loss function is: and obtaining the difference value between the score function corresponding to the real mapping quadruple and the score function corresponding to the fragmentation mapping quadruple.
10. The apparatus of claim 9, wherein the real mapping quadruple acquisition module comprises:
the original four-tuple obtaining submodule is used for obtaining each original four-tuple corresponding to each road section in the target road network; wherein, an original four-tuple comprises the historical traffic state of the road segment at the historical moment, the historical traffic state of another road segment associated with the road segment at the historical moment, the road segment relation between the road segment and the associated another road segment, and the historical moment;
the alternative mapping quadruplet acquisition submodule is used for mapping the historical traffic state in each original quadruplet according to the first initial mapping matrix to obtain a mapping traffic state; mapping the road section relation in the original four-tuple according to the second initial mapping matrix to obtain a mapping road section relation; mapping the historical time in the original four-tuple according to the third initial mapping matrix to obtain mapping historical time so as to obtain an alternative mapping four-tuple corresponding to the original four-tuple;
the linear matrix obtaining submodule is used for converting each alternative mapping quadruple based on the first conversion matrix to obtain a linear matrix corresponding to the alternative mapping quadruple;
the weight obtaining submodule is used for converting each linear matrix based on the second conversion matrix to obtain the weight of the alternative mapping quadruple corresponding to the linear matrix;
the embedded vector acquisition submodule is used for calculating the weighted sum of each alternative mapping quadruple corresponding to the road section based on the respective weight to obtain the embedded vector of the historical traffic state of the road section;
and the real mapping quadruplet acquisition submodule is used for respectively replacing the historical traffic state, the road section relation and the historical moment of the road section in the original quadruplet corresponding to each two associated road sections in the target road network with the corresponding embedded vector, the mapping road section relation and the mapping historical moment to obtain the corresponding real mapping quadruplet.
11. A traffic state prediction apparatus, characterized in that the apparatus comprises:
the road section determining module is used for determining a first road section of a target traffic event in a target road network and a second road section related to the first road section;
the first traffic state acquisition module is used for acquiring the traffic state of the first road section at a future moment as a first traffic state;
the second traffic state calculation module is used for calculating the traffic state of the second road section at the future moment according to the first traffic state, the road section relation between the first road section and the second road section, the future moment and the knowledge graph to serve as the second traffic state;
wherein the knowledge-graph is generated based on the method of any one of claims 1-4.
12. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-4, or 5-8 when executing a program stored in a memory.
13. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1 to 4, or 5 to 8.
CN202111154108.2A 2021-09-29 2021-09-29 Traffic state-based knowledge graph generation and traffic state prediction method and device Pending CN115905551A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111154108.2A CN115905551A (en) 2021-09-29 2021-09-29 Traffic state-based knowledge graph generation and traffic state prediction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111154108.2A CN115905551A (en) 2021-09-29 2021-09-29 Traffic state-based knowledge graph generation and traffic state prediction method and device

Publications (1)

Publication Number Publication Date
CN115905551A true CN115905551A (en) 2023-04-04

Family

ID=86493709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111154108.2A Pending CN115905551A (en) 2021-09-29 2021-09-29 Traffic state-based knowledge graph generation and traffic state prediction method and device

Country Status (1)

Country Link
CN (1) CN115905551A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117671979A (en) * 2023-12-25 2024-03-08 中傲智能科技(苏州)有限公司 Smart city data management system and method based on knowledge graph

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117671979A (en) * 2023-12-25 2024-03-08 中傲智能科技(苏州)有限公司 Smart city data management system and method based on knowledge graph

Similar Documents

Publication Publication Date Title
Jahangiri et al. Red-light running violation prediction using observational and simulator data
Park et al. Real-time prediction and avoidance of secondary crashes under unexpected traffic congestion
Wang et al. Expressway crash risk prediction using back propagation neural network: A brief investigation on safety resilience
Li et al. Optimal mainline variable speed limit control to improve safety on large‐scale freeway segments
Vlahogianni et al. Fuzzy‐entropy neural network freeway incident duration modeling with single and competing uncertainties
Weng et al. Rear‐end crash potential estimation in the work zone merging areas
CN113870564B (en) Traffic jam classification method and system for closed road section, electronic device and storage medium
CN112507121B (en) Customer service violation quality inspection method and device, computer equipment and storage medium
Rao et al. Interval data‐based k‐means clustering method for traffic state identification at urban intersections
Wang et al. The impact of vehicle moving violations and freeway traffic flow on crash risk: An application of plugin development for microsimulation
Li et al. Detecting stealthy cyberattacks on automated vehicles via generative adversarial networks
CN112116263A (en) Traffic intersection risk level assessment method and device, electronic equipment and storage medium
Li et al. Assessing injury severity of secondary incidents using support vector machines
CN115905551A (en) Traffic state-based knowledge graph generation and traffic state prediction method and device
Zhang et al. Exploring the Influence of Truck Proportion on Freeway Traffic Safety Using Adaptive Network‐Based Fuzzy Inference System
Li et al. Conditional inference tree‐based analysis of hazardous traffic conditions for rear‐end and sideswipe collisions with implications for control strategies on freeways
Keramati et al. A crash severity analysis at highway-rail grade crossings: The random survival forest method
Nadimi et al. Introducing novel statistical-based method of screening and combining currently well-known surrogate safety measures
Ghoul et al. Dynamic identification of short-term and longer-term hazardous locations using a conflict-based real-time extreme value safety model
Liu et al. A Dynamic Bayesian Network‐Based Real‐Time Crash Prediction Model for Urban Elevated Expressway
Du et al. Learning‐Based Lane‐Change Behaviour Detection for Intelligent and Connected Vehicles
Wen et al. Analysis of discretionary lane-changing behaviours of autonomous vehicles based on real-world data
Lu et al. A support vector regression approach for investigating multianticipative driving behavior
Sun et al. A dynamic time warping algorithm based analysis of pedestrian shockwaves at bottleneck
Jafarpour et al. Using hierarchical mixture of experts model for fusion of outbreak detection methods

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