A dynamic flow OD inference method
Through the improved wide&deep model and graph convolutional neural network, combined with generalized linear model, the infinite multi-solution problem in reverse inference is solved, and efficient estimation of dynamic OD traffic is achieved. It is suitable for real-time OD traffic in multi-city and multi-type road networks. infer.
Patent Information
- Application Number
- CN202411140156.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-08-20
AI Technical Summary
In the prior art, reverse inference method has infinite solutions in dynamic OD traffic inference, resulting in low inference efficiency. Especially in large-scale road networks, the number of OD pairs is much larger than the number of observed road sections, and the space-time of OD pairs and detection road sections. The relationship is complex and it is difficult to achieve accurate estimation of real-time dynamic OD traffic.
Using the improved wide&deep model, combined with graph convolutional neural network and generalized linear model, the dynamic OD flow and its section flow are estimated through feature extraction between road segments and the weight relationship between OD and road segments.
It improves the accuracy and efficiency of dynamic OD traffic inference, can be applied to real-time travel induction and traffic control, adapts to multi-city and multiple types of OD traffic inference, and achieves rapid output of real-time calculation results.
Smart Images

Figure CN118658306B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a dynamic flow OD inference method, belonging to the technical field of traffic demand analysis. Background Art
[0002] Dynamic traffic travel demand reflects the spatial mobility needs of individuals for different purposes and at different times, and is an important part of traffic management and control. With the application and promotion of sensing technology and communication technology in the field of transportation, the estimation of dynamic OD flow of road traffic based on multi-source data such as mobile phone signaling, GPS, and checkpoint passing data has been realized. According to the differences in research perspectives, it can be divided into two categories: First, forward inference, considering the characteristics of individual activities, regional land use properties and other attributes, to realize the estimation of regional generation, attraction and dynamic OD flow. However, the update cycle of input data in the forward inference method is long (updated by year, month or day), and it is difficult to reflect the dynamic OD flow change characteristics at different times of the day. Second, reverse inference, using the road traffic flow, driving speed and other attributes identified by the road detector, by building a linear or nonlinear model, using linear solution, heuristic algorithm, machine learning method and deep learning method to solve, to realize the reverse inference of dynamic individual OD flow. Compared with the forward inference method, the reverse inference method can more easily realize the dynamic estimation of real-time OD flow. However, the reverse inference of OD flow through road traffic flow belongs to the inverse problem solution, which has the following limitations:
[0003] 1) The number of OD pairs of unknown OD flow is often greater than the number of road sections observed on the road surface, and the difference is more obvious in large-scale road networks;
[0004] 2) The spatiotemporal relationship between OD pairs and detection sections is complex. Vehicles arrive at the same observation section from different starting points, and their travel time is affected by factors such as the driving distance from the departure point to the observation section and the vehicle's driving speed. This means that multiple vehicles passing the same observation section in the same period have different departure points and departure time periods.
[0005] This limitation results in the number of decision variables (OD traffic in the last N time periods) being much larger than the number of constraints (the observed road traffic in the last M time periods, where M≤N is usually the case) when modeling this type of problem. When solving the problem, there are infinitely many solutions that can reproduce the traffic flow status in the current road network, resulting in low inference efficiency. Summary of the invention
[0006] A brief overview of the present invention is provided below in order to provide a basic understanding of certain aspects of the present invention. It should be understood that this overview is not an exhaustive overview of the present invention. It is not intended to identify key or important parts of the present invention, nor is it intended to limit the scope of the present invention. Its purpose is merely to present certain concepts in a simplified form as a prelude to a more detailed description discussed later.
[0007] In view of this, in order to solve the technical problems existing in the prior art, the present invention provides a dynamic flow OD inference method. Based on real-time road traffic flow data and historical OD flow data, the present invention proposes a dynamic OD flow inference method of an improved wide&deep model. First, a graph convolutional neural network is used in the deep module to realize feature extraction between road sections, and a generalized linear model is used in the wide module to construct the weight relationship between road sections and OD. Then, the dynamic OD flow and its section flow estimation are realized through module fusion. Finally, the adam optimization method is used to solve it, providing dynamic OD inference results for real-time travel induction, traffic control and other aspects.
[0008] Solution 1: A dynamic traffic OD inference method, including:
[0009] Step 1: Obtain road network, road section traffic flow and OD traffic flow data;
[0010] Step 2: Generate a multi-layered road section adjacency matrix based on the spatiotemporal relationship between the cell OD and the arc segment; the road section adjacency matrix includes a road section adjacency matrix based on the OD path relationship and a road section adjacency matrix based on the road network topology relationship;
[0011] Step 3: Generate the time characteristics of the road section based on the traffic flow of the road section and the historical OD flow;
[0012] Step 4: Build a dynamic traffic OD inference method based on the Wide&Deep model;
[0013] Step 5: Using the section flow and OD flow error as the loss function, use Adam to solve the model parameters.
[0014] Preferably, the temporal and spatial relationship between the cell OD and the arc segment is specifically as follows:
[0015] Choose the one with the shortest travel time OD pair The set of optional reasonable paths is defined as , where OD is No. Path It is composed of multiple continuous arc segments. Indicates the path The number of arc segments passed, ; Vehicle at the specified time Departure route The travel time and arrival time of each arc segment in turn, for the first arc segment The time when the vehicle arrives at the first arc is the departure time For any arc segment The vehicle arrival time is ;
[0016] Assume that the specified OD pair In time period The amount of travel The OD flow is uniformly distributed and the travel time remains unchanged in the same time period. Arrival Arc The moments are evenly distributed, Interval, covering two consecutive time periods and , time period The formula is:
[0017] ;
[0018] in, Indicates the vehicle's driving path To Arc segment Journey time;
[0019] OD travel volume reaches the arc segment The traffic ratio and Defined as the arrival time interval Falling in time period and The ratio, formula:
[0020] ;
[0021] ;
[0022] OD flow From the time period Departure, during the time period Arrival Arc Traffic flow formula:
[0023] ;
[0024] In time period Arrival Arc The traffic flow is defined as the optional paths of all OD pairs starting from different time periods and in the time period Can reach the arc The sum of the traffic volume, formula:
[0025] ;
[0026] in, Indicates OD Select The probability of the path; Represents all OD pairs and path relationships, with dimensions of ; Indicates OD No. Path Whether it passes through the road section , 1-passed, 0-did not pass; Represents the physical relationship between each path of all OD pairs and the road segment with detectors, with dimension , represents the total number of paths of all OD pairs, Indicates the number of road segments with detectors.
[0027] Preferably, the road segment adjacency matrix based on the OD path relationship is specifically:
[0028] Using the node set in the road network and segment collection , for any Arc segment To Arc segment , The downstream node of the arc segment and the If the upstream nodes of the arc segments are the same nodes, they are connected. The formula is:
[0029] ;
[0030] in, Represents the topological adjacency relationship between two arcs. ; Represents the road segment adjacency matrix based on the road network topology.
[0031] Preferably, the road section adjacency matrix based on the road network topology relationship is specifically:
[0032] Based on OD, the set of optional reasonable paths , for any Arc segment and Arc segment , calculate the number of paths that pass through these two arcs at the same time, formula:
[0033] ;
[0034] ;
[0035] in, Indicates Arc segment and Arc segment Whether to pass OD at the same time No. Path , 1-yes, 0-no; Indicates the number of OD paths between two arcs, ; Represents the adjacency matrix based on OD path relations.
[0036] Preferably, the multi-layered road section adjacency matrix is specifically: Contains adjacency matrix based on road network topology And the adjacency matrix based on OD path relationship ,Right now .
[0037] Preferably, the road section time characteristics include weekday characteristics, day of the week characteristics and time period characteristics;
[0038] Working day features: The one-hot encoding method is used to extract working day, weekend and holiday information. Working days are coded as 100, weekends are coded as 010, and holidays are coded as 001.
[0039] Day of the week feature: Use sine and cosine encoding to extract the periodic features of the day of the week in the date. The formula is:
[0040] ;
[0041] ;
[0042] in, Indicates the day of the week; and Calculate and output the weekday coding features for each day of the week;
[0043] Time period features: Use sine and cosine encoding to extract the time period features of the date. The formula is:
[0044] ;
[0045] ;
[0046] in, Indicates a time period; Indicates the length of the time period; and The time period coding features for their calculation output are respectively.
[0047] Preferably, dynamic flow OD inference model:
[0048] ;
[0049] in, Represents the dynamic OD flow calculation result, with dimensions of , for each record Indicates the time period Calculate the nearest Time period , , …, Internal OD pair The amount of travel; and They are the OD feature extraction results and weight parameters of the wide module respectively; and They are the OD feature extraction results and weight parameters of the deep module respectively; Represents the fully connected function, which realizes the feature fusion of the two modules; The result of specifying a pair of ODs in the dynamic OD flow estimation result; the dynamic OD flow estimation result is a two-dimensional matrix, where the rows represent the OD pairs and the columns represent the flow in the time slice;
[0050] wide module: ;
[0051] Among them, the road section characteristics Contains basic attributes of road sections, traffic flow of road sections, and time characteristic information of road sections, with dimensions of , represents the number of road sections with detectors, Indicates the number of features; on a specified date Week Time period Section The feature is represented as , ; Indicates the basic attribute characteristics of the road segment. , Indicates road segment Free flow speed, Indicates road segment length; represents the traffic flow of the road section, , Indicates road segment In time period traffic flow, Indicates road segment In time period traffic flow; represents the time characteristics of the road section, , Indicates the weekday code, Indicates based on the day of the week Sinusoidal coding; Indicates based on the day of the week Cosine encoding of ; Indicates based on time period Sinusoidal coding; Indicates based on time period Cosine coding; OD feature It represents the calculation result based on the interaction of basic attributes of road section, traffic flow and time characteristics, and its dimension is , represents the number of OD pairs, represents the number of time periods for which OD flow needs to be inferred; Indicates the physical relationship between each path of all OD pairs and the road section with detectors, and the value is 0 or 1, 1 means the path passes through the specified road section, otherwise it is 0; The dimension is , represents the total number of paths of all OD pairs; Represents all OD pairs and path relationships, each record Indicates OD Select The probability of the shortest path; The dimension is ; and They represent the feature relationship weights and biases of OD pairs and road sections with detectors, which are parameters that need to be trained and calculated in the model. The dimension of feature relationship weight is , the feature relationship deviation dimension is ;
[0052] deep module: ;
[0053] in, Indicates The road segment features extracted by layer, Indicates the number of layers, ; is the road segment adjacency matrix, which contains the adjacency matrix based on the road network topology relationship And the adjacency matrix based on OD path relationship , both dimensions are ; represents the activation function; and The weight parameters and bias parameters that need to be trained and calculated in the model have dimensions of and , and Indicated in Layer and The number of extracted features set;
[0054] Flatten, fully connect, and reshape the feature variables:
[0055] ;
[0056] ;
[0057] ;
[0058] ;
[0059] in, Represents the flattening function, which converts the feature into a one-dimensional tensor ; and Respectively represent the output dimensions and dimensions are A single-layer neural network, , , , are its weight parameters and bias; Represents a reshape function that takes an input tensor Convert to Tensor, that is, the calculation result of the deep module ;
[0060] Based on the spatiotemporal relationship between the cell OD and the arc segment and the dynamic flow OD inference results, the real-time estimated flow of the road section is obtained :
[0061] Set in a specified time period Next, the most recent All OD traffic in a time period , , which corresponds to the time period Arrival section flow Calculation, formula: .
[0062] Solution 2: An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a dynamic flow OD inference method described in Solution 1 are implemented.
[0063] Solution three: A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a dynamic flow OD inference method described in Solution one.
[0064] The beneficial effects of the present invention are as follows: the dynamic traffic OD inference model proposed in the present invention is based on the improved wide&deep model adapted to the dynamic OD traffic inference problem, establishes the spatiotemporal relationship between OD and road arc segments, self-learns the transfer weights between the time states of the two, and realizes the extraction of dynamic spatiotemporal relationship features, which is not limited to the static spatiotemporal relationship between OD and the passing road segments in the traditional method; the present invention is suitable for real-time calculation, and can be pre-trained and rolled-refreshed through historical data to realize OD traffic inference based on real-time road traffic flow data, and quickly output real-time calculation results; it can be adapted to OD traffic inference in multiple cities and multiple types (highway networks, urban road networks). BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0066] Figure 1 It is a flow chart of a dynamic flow OD inference method;
[0067] Figure 2 A schematic diagram of the travel time and arrival time of a vehicle that sets out on a driving path at a specified time and arrives at each arc segment in sequence;
[0068] Figure 3 Dynamic traffic OD inference model framework diagram;
[0069] Figure 4 Flowchart for solving the parameters of the dynamic flow OD inference model. DETAILED DESCRIPTION
[0070] In order to make the technical solutions and advantages of the embodiments of the present invention more clearly understood, the exemplary embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0071] Example 1: Reference Figure 1-Figure 4 The present embodiment describes a dynamic flow OD inference method, comprising:
[0072] Step 1: Obtain road network, road section traffic flow and OD traffic flow data;
[0073] The road network data is as follows: , including node set N, arc set A, cell set Z and OD set W, each node Contains information such as longitude and latitude; each arc Including its free flow speed , arc length , Upstream and downstream node numbers etc.; each community Indicates the location where the vehicle departs or arrives, including the latitude and longitude of the community entrance and exit; each OD , indicating that from the community To the community ;
[0074] The specific traffic flow of the road section is: road section traffic flow LF, each record represents the traffic volume detected in arc segment a during the current time period t, , Represents a collection of arcs with detectors (such as coils, radars);
[0075] OD traffic flow is specifically: historical OD flow WF, each record represents the departure volume of OD for w in the specified time period t, .
[0076] Step 2: Generate a multi-layered road section adjacency matrix based on the spatiotemporal relationship between the cell OD and the arc segment; the road section adjacency matrix includes a road section adjacency matrix based on the OD path relationship and a road section adjacency matrix based on the road network topology relationship;
[0077] The link adjacency matrix indicates whether there is a relationship between links, including 1) the physical relationship formed by the road network topology, that is, whether the links are connected; 2) the flow relationship formed under the OD path selection, that is, the more the number of overlapping OD paths between links, the closer the relationship between the two.
[0078] The temporal and spatial relationship between the cell OD and the arc segment indicates that the arc segment from the specified cell in the specified time period t The departing vehicles choose different routes to reach the destination During the process, in the time period The proportion of traffic flow passing through arc segment a; key factors such as departure time, travel time, departure location and destination, and path selection preference all affect the dynamic spatiotemporal relationship between OD flow and arc segment flow.
[0079] Select K paths with the shortest travel time as the set of optional reasonable paths for OD to W, defined as , where OD is the Kth path to W It is composed of multiple continuous arcs, r represents the number of arcs that path k passes through, ; The vehicle starts its driving path at the specified time T The travel time and arrival time of each arc segment are referenced in sequence Figure 2 As shown, for the first arc , the time when the vehicle arrives at the first arc is the departure time T; for any arc The vehicle arrival time is .
[0080] Assume that the specified OD pair W is in the time period The amount of travel The OD flow is uniformly distributed and the travel time remains unchanged in the same time period. Arrival Arc The moments are evenly distributed, Interval, covering two consecutive time periods and , time period The formula is:
[0081] (1)
[0082] in, Indicates the vehicle's driving path To Arc segment Journey time;
[0083] OD travel volume reaches the arc segment The traffic ratio and Defined as the arrival time interval Falling in time period and The ratio, formula:
[0084] (2)
[0085] (3)
[0086] OD flow From the time period Departure, during the time period Arrival Arc Traffic flow formula:
[0087] (4)
[0088] In time period Arrival Arc The traffic flow is defined as the optional paths of all OD pairs starting from different time periods and in the time period Can reach the arc The sum of the traffic volume, formula:
[0089] (5)
[0090] in, Indicates OD Select The probability of the path; Represents all OD pairs and path relationships, with dimensions of ; Indicates OD No. Path Whether it passes through the road section , 1-passed, 0-did not pass; Represents the physical relationship between each path of all OD pairs and the road segment with detectors, with dimension , represents the total number of paths of all OD pairs, Indicates the number of road segments with detectors.
[0091] The road segment adjacency matrix based on OD path relationship is as follows:
[0092] Using the node set in the road network and segment collection , for any Arc segment To Arc segment , The downstream node of the arc segment and the If the upstream nodes of the arc segments are the same nodes, they are connected. The formula is:
[0093] (6)
[0094] in, Represents the topological adjacency relationship between two arcs. ; Represents the road segment adjacency matrix based on the road network topology;
[0095] The road section adjacency matrix based on the road network topology is as follows:
[0096] OD-based path collection , for any Arc segment and Arc segment , calculate the number of paths that pass through these two arcs at the same time, formula:
[0097] (7)
[0098] (8)
[0099] in, Indicates Arc segment and Arc segment Whether to pass OD at the same time No. Path , 1-yes, 0-no; Indicates the number of OD paths between two arcs, ; Represents the adjacency matrix based on OD path relations.
[0100] The road segment adjacency matrix of multi-layer relationships is as follows:
[0101] Link adjacency matrix Contains adjacency matrix based on road network topology And the adjacency matrix based on OD path relationship ,Right now .
[0102] Step 3: Generate the time characteristics of the road section based on the traffic flow of the road section and the historical OD flow;
[0103] The time characteristics of the road section include weekday characteristics, day of the week characteristics and time period characteristics;
[0104] Working day features: The one-hot encoding method is used to extract working day, weekend and holiday information. Working days are coded as 100, weekends are coded as 010, and holidays are coded as 001.
[0105] Day of the week feature: Use sine and cosine encoding to extract the periodic features of the day of the week in the date. The formula is:
[0106] (9)
[0107] (10)
[0108] in, Indicates the day of the week; and Calculate and output the weekday coding features for each day of the week;
[0109] Time period features: Use sine and cosine encoding to extract the time period features of the date. The formula is:
[0110] (11)
[0111] (12)
[0112] in, Indicates a time period; Indicates the length of the time period (such as 300 seconds, 600 seconds); and The time period coding features for their calculation output are respectively.
[0113] Step 4: Build a dynamic traffic OD inference method based on the Wide&Deep model;
[0114] (13)
[0115] in, Represents the dynamic OD flow calculation result, with dimensions of , for each record Indicates the time period Calculate the nearest Time period , , …, Internal OD pair The amount of travel; and They are the OD feature extraction results and weight parameters of the wide module respectively; and They are the OD feature extraction results and weight parameters of the deep module respectively; Represents the fully connected function, which realizes the feature fusion of the two modules.
[0116] wide module:
[0117] Wide module is based on road segment features is the input, OD feature is the output generalized linear model, as shown in formula (14):
[0118] (14)
[0119] Among them, the road section characteristics Contains basic attributes of road sections, traffic flow of road sections, and time characteristic information of road sections, with dimensions of , represents the number of road sections with detectors, Indicates the number of features; on a specified date Week Time period Section The feature is represented as , ; Indicates the basic attribute characteristics of the road segment. , Indicates road segment Free flow speed, Indicates road segment length; represents the traffic flow of the road section, , Indicates road segment In time period traffic flow, Indicates road segment In time period traffic flow; represents the time characteristics of the road section, , Indicates the weekday code, Indicates based on the day of the week Sinusoidal coding; Indicates based on the day of the week Cosine encoding of ; Indicates based on time period Sinusoidal coding; Indicates based on time period Cosine coding; OD feature It represents the calculation result based on the interaction of basic attributes of road section, traffic flow and time characteristics, and its dimension is , represents the number of OD pairs, represents the number of time periods for which OD flow needs to be inferred; Indicates the physical relationship between each path of all OD pairs and the road section with detectors, and the value is 0 or 1, 1 means the path passes through the specified road section, otherwise it is 0; The dimension is , represents the total number of paths of all OD pairs; Represents all OD pairs and path relationships, each record Indicates OD Select The probability of the shortest path; The dimension is ; and They represent the feature relationship weights and biases of OD pairs and road sections with detectors, which are parameters that need to be trained and calculated in the model. The dimension of feature relationship weight is , the feature relationship deviation dimension is ;
[0120] deep module:
[0121] The deep module uses a feedforward network for modeling. Considering that there is an adjacency relationship between road segments on the traffic network, the driving of vehicles on the road network depends on the adjacency relationship between road segments. Therefore, the deep module uses a multi-layer graph neural network to realize high-dimensional feature extraction, see formula (15):
[0122] (15)
[0123] in, Indicates The road segment features extracted by the layer, Indicates the number of layers, ; is the road segment adjacency matrix, which contains the adjacency matrix based on the road network topology relationship And the adjacency matrix based on OD path relationship , both dimensions are ; represents the activation function; and are the weight parameters and bias parameters that need to be trained and calculated in the model, and their dimensions are ( and , and Indicated in Layer and The number of extracted features set;
[0124] After the multi-layer graph neural network extracts features, the feature variables need to be flattened, fully connected, and reshaped to achieve further transformation of the features and support the fusion of subsequent and wide modules, see formulas (16)-(19):
[0125] (16)
[0126] (17)
[0127] (18)
[0128] (19)
[0129] in, Represents the flattening function, which converts the feature into a one-dimensional tensor ; and Respectively represent the output dimensions and dimensions are A single-layer neural network, , , , are its weight parameters and bias; Represents a reshape function that takes an input tensor Convert to Tensor, that is, the calculation result of the deep module ;
[0130] Step 5: Using the section flow and OD flow error as the loss function, Adam is used to solve the model parameters;
[0131] The model uses OD flow error and section flow error as loss functions, and uses the adaptive moment estimation (Adam) optimization method to train and solve the model parameters. The Adam optimization method combines the Momentum algorithm and the RMSProp algorithm, and uses the first-order and second-order moments of the gradient to adaptively adjust the parameter learning rate, so that each parameter can quickly converge in its own optimization direction. The solution process refers to Figure 4 As shown:
[0132] Loss function calculation:
[0133] The loss function is divided into two measurement indicators: 1) OD flow error; 2) section flow error.
[0134] Historical OD flow error metric;
[0135] By calculating the sum of the absolute values of the difference between the estimated OD flow value and the historical OD flow value, and then comparing it with the sum of the historical OD flow, the error measurement index between the two is output, as shown in formula (20): represents the OD flow error measurement result in time period t, including its inference of the most recent The calculation results of the time period;
[0136] (20)
[0137] Road flow error metrics:
[0138] The mean absolute percentage error is used to calculate the error metric between the estimated section flow and the observed section flow, see formula (21): It represents the measurement result of the road traffic error in time period t, that is, the most recent The average absolute percentage error of the road traffic in the time period is:
[0139] (twenty one)
[0140] Adaptive moment estimation is used to update model parameters;
[0141] Referring to Formula 22, the real-time estimated traffic volume of the road section is obtained based on the spatiotemporal relationship between the cell OD and the arc segment and the dynamic traffic OD inference result: :
[0142] Assume that in the specified time period t, the most recent All OD traffic in a time period , , which corresponds to the time period Traffic volume at section a Calculation, formula: (twenty two).
[0143] Embodiment 2: The computer device of the present invention may be a device including a processor and a memory, such as a single chip microcomputer including a central processing unit, etc. Moreover, the processor is used to implement the steps of the above-mentioned dynamic flow OD inference method when executing the computer program stored in the memory.
[0144] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0145] The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0146] Embodiment 3: Computer readable storage medium embodiment.
[0147] The computer-readable storage medium of the present invention can be any form of storage medium that can be read by the processor of a computer device, including but not limited to non-volatile memory, volatile memory, ferroelectric memory, etc. The computer-readable storage medium stores a computer program. When the processor of the computer device reads and executes the computer program stored in the memory, the steps of the above-mentioned dynamic flow OD inference method can be implemented.
[0148] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer readable media do not include electric carrier signals and telecommunication signals.
[0149] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.
Claims
1. A dynamic flow OD inference method, characterized in that: include: Step 1: Obtain road network, road section traffic flow and OD traffic flow data; Step 2: Generate a multi-layered road section adjacency matrix based on the spatiotemporal relationship between the cell OD and the arc segment; the road section adjacency matrix includes a road section adjacency matrix based on the OD path relationship and a road section adjacency matrix based on the road network topology relationship; Step 3: Generate the time characteristics of the road section based on the traffic flow of the road section and the historical OD flow; Step 4: Build a dynamic traffic OD inference method based on the Wide&Deep model; Step 5: Using the section flow and OD flow error as the loss function, Adam is used to solve the model parameters; The specific temporal and spatial relationship between the cell OD and the arc segment is: Select K paths with the shortest travel time as the set of optional reasonable paths for OD to w, defined as P w , where the kth path p of OD to w w,k =(a w,k,1 , ..., a w,k,r ) consists of multiple continuous arcs, r represents the number of arcs passed by path k, k = 1, 2, ..., K; the vehicle starts the driving path at the specified time T The travel time and arrival time of each arc segment in turn, for the first arc segment a w,k,1 The time when the vehicle arrives at the first arc is the departure time T; for any arc a w,k,j , j = (2, 3, ..., r), the vehicle arrival time is T + tt (p w,k , a w,k,j-1 ); Assume that the travel volume of a given OD pair w in time period t = [T, T + δt) The OD flow is uniformly distributed and the travel time remains unchanged in the same time period. Arrival arc a w,k,j The moments are evenly distributed, The interval covers two consecutive time periods τ and τ+1. The formula for the time period τ is: Among them, tt(p w,k , a w,kj-1 ) represents the vehicle travel path p w,k To the jth arc segment a w,k,j The travel time; δt represents the length of the time period; OD travel volume arrives at arc segment a w,k,j The traffic ratios r1 and r2 are defined as the arrival time intervals The proportion falling in time period τ and T+1, formula: OD flow Starting from time period t, we reach arc a in time period τ′ w,k,j Traffic flow formula: The traffic flow reaching arc a in time period τ is defined as the sum of the traffic flows of all OD pairs starting from different time periods and reaching arc a in time period τ. The formula is: Among them, λ w,k ∈λ WP represents the probability that OD chooses the kth path for w; λ WP Represents all OD pairs and path relationships, with a dimension of (n W , n P ); w,k,a ∈λ WPA represents the kth path P of OD to w w,k Whether to pass through section a, 1-pass, 0-not pass; λ WPA Represents the physical relationship between each path of all OD pairs and the road segment with detectors, with a dimension of (n P , n A′ ), n P represents the total number of paths of all OD pairs, n A′ Indicates the number of road sections with detectors; The dynamic traffic OD inference method based on the Wide&Deep model is: the W =f0(ω wide the wide +ω deep the deep ) Among them, y W Represents the dynamic OD flow calculation result, the dimension is (n w ,fea W ), for each record Indicates that the most recent fea is calculated in time period t W time periods t, t-1, ..., t-fea W The travel volume of internal OD to w; y wide and ω wide are the OD feature extraction results and weight parameters of the wide module respectively; y deep and ω deep They are the OD feature extraction results and weight parameters of the deep module respectively; f0 represents the fully connected function to achieve feature fusion of the two modules; wide module:y wide =λ WP l WPA xω α +b α Among them, the road section feature x includes the basic attributes of the road section, the traffic flow of the road section, and the time characteristic information of the road section, and the dimension is (n A′ ,fea A′ ), n A′ Indicates the number of road sections with detectors, fea A′ Represents the feature number; the feature of road section a in the time period τ of the specified date d week dt is expressed as attra represents the basic attribute characteristics of the road section. represents the free flow speed of section a, l a Indicates the length of section a; flow a τ,φ represents the traffic flow of the road section, lf a τ represents the traffic flow of road section a in time period τ, lf a τ-φ represents the traffic flow of road section a in the time period τ-φ; time d,dt,τ Indicates the time characteristics of the road section, time d,dt,τ =(e d ,esin dt ,ecos dt ,esin τ ,ecos τ ), e d Indicates the weekday code, esin dt Represents the sinusoidal code based on the day of the week dt; ecos dt Indicates the cosine encoding based on the day of the week dt; esin τ represents the sinusoidal coding based on the time period τ; ecos τ represents the cosine coding based on the time period τ; OD feature y wide It represents the calculation result based on the interaction of basic attributes of road section, traffic flow and time characteristics, and the dimension is (n W ,fea W ), n W Indicates the number of OD pairs, fea W represents the number of time periods for which OD flow needs to be inferred; WPA Indicates the physical relationship between each path of all OD pairs and the road section with detectors, and takes the value of 0 or 1, 1 means the path passes through the specified road section, otherwise it is 0; λ WPA The dimension is (n P , n A′ ), n P represents the total number of paths of all OD pairs; λ WP Represents all OD pairs and path relationships, each record λ w,k represents the probability that OD chooses the kth shortest path for w; λ WP The dimension is (nw, n P );ω α and b α They represent the feature relationship weights and biases of OD pairs and road sections with detectors, which are parameters that need to be trained and calculated in the model. The dimension of feature relationship weight is (fea A′ ,fea W ), the feature relationship deviation dimension is (n W ,fea W ); deep module: in, represents the road segment features extracted from the first layer, l represents the number of layers, M is the road segment adjacency matrix, which contains the adjacency matrix M based on the road network topology relationship net And the adjacency matrix M based on OD path relationship OD , both dimensions are (n A′ , n A′ ); f1 represents the activation function; and The weight parameters and bias parameters that need to be trained and calculated in the model have dimensions of and and represents the number of extracted features set at layer l and l+1; Flatten, fully connect, and reshape the feature variables: H1 deep =ω γ1 Flatten deep +b γ1 H2 deep =ω γ2 H1 deep +b γ2 and deep =f4(n W ,ugly W )(H2 deep ) Among them, f2 represents the flattening function, which converts the feature into a one-dimensional tensor Flatten deep ;H1 deep and H2 deep Respectively represent the output dimensions and dimension n W ×fea W A single-layer neural network, ω γ1 ,ω γ2 、b γ1 、b γ2 Its weight parameter and bias; f4(n W ,fea W ) represents the reshape function, which takes the input tensor H2 deep Convert to (n W ,fea W ), which is the calculation result y of the deep module deep ; Taking the error between the section flow and OD flow as the loss function, the steps of using Adam to solve the model parameters include: The model uses OD flow error and section flow error as loss functions, and uses adaptive moment estimation optimization method to train and solve model parameters. Loss function calculation: The loss function is divided into two metrics: 1) OD flow error; 2) section flow error; Historical OD flow error metrics By calculating the sum of the absolute values of the difference between the estimated OD flow value and the historical OD flow value, and then comparing it with the sum of the historical OD flow, the error measurement index between the two is output. represents the OD flow error measurement result in time period t, including its inference of the most recent fea W The calculation results of the time period; Road flow error metrics: The mean absolute percentage error is used to calculate the error metric between the estimated and observed section flow. It represents the measurement result of the road traffic error in time period t, that is, the average absolute percentage error of the road traffic in the last φ time periods: Adaptive moment estimation is used to update model parameters; Based on the spatiotemporal relationship between the cell OD and the arc segment and the dynamic flow OD inference results, the real-time estimated flow y of the road segment is obtained. A ′: Assume that in the specified time period t, the most recent fea has been calculated W All OD traffic in a time period w∈W, which corresponds to the flow rate arriving at section a in the time period τ∈[t-φ, t] Calculation, formula:
2. A dynamic flow OD inference method according to claim 1, characterized in that: The road segment adjacency matrix based on OD path relationship is as follows: Using the node set N and arc set A in the road network, for any i-th arc a i To the jth arc segment a j , i, j = (1, 2, ..., n), if the downstream node of the i-th arc and the upstream node of the jth arc If they are the same nodes, they are connected. The formula is: in, Represents the topological adjacency relationship between two arcs. M net Represents the road segment adjacency matrix based on the road network topology.
3. A dynamic flow OD inference method according to claim 2, characterized in that: The road section adjacency matrix based on the road network topology is as follows: Based on OD, the set of optional reasonable paths P w , for any i-th arc segment a i and the jth arc segment a j , calculate the number of paths that pass through these two arcs at the same time, formula: in, represents the i-th arc segment a i and the jth arc segment a j Whether the kth path p of OD pair w passes through the same time w,k =(a w,k,1 , ..., a w,k,r ), 1-yes, 0-no; Indicates the number of OD paths between two arcs, M OD Represents the adjacency matrix based on OD path relations.
4. A dynamic flow OD inference method according to claim 3, characterized in that: The road section adjacency matrix of multi-layer relationship is as follows: The road section adjacency matrix M contains the adjacency matrix M based on the road network topology relationship net And the adjacency matrix M based on OD path relationship OD , that is, M=(M net , M OD ).
5. A dynamic flow OD inference method according to claim 1, characterized in that: The time characteristics of the road section include weekday characteristics, day of the week characteristics and time period characteristics; Working day features: The one-hot encoding method is used to extract working day, weekend and holiday information. Working days are coded as 100, weekends are coded as 010, and holidays are coded as 001. Day of the week feature: Use sine and cosine encoding to extract the periodic features of the day of the week in the date. The formula is: Among them, dt represents the day of the week; esin dt and ecos dt Calculate and output the weekday coding features for each day of the week; Time period features: Use sine and cosine encoding to extract the time period features of the date. The formula is: Where t represents the time period; δt represents the length of the time period; esin t and ecos t The time period coding features for their calculation output are respectively.
6. An electronic device, characterized in that: It comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of a dynamic flow OD inference method as described in any one of claims 1-5 when executing the computer program.
7. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, a dynamic flow OD inference method as described in any one of claims 1-5 is implemented.
Citation Information
Patent Citations
Traffic flow prediction method based on multiple tasks
CN112382081A
OD demand prediction method and system based on dynamic space-time correlation
CN116311939A
Construction method and system of traffic volume prediction model
CN116386312A
System and method of sending an arrival time estimate
US20110231091A1
Traffic density estimation system and a method thereof
WO2023014311A1
