A vector representation method for the entire urban road network
Through multiple graph construction and random walk strategies, the problem of insufficient representation efficiency and accuracy of urban road networks in the existing technology is solved, and efficient representation and accurate representation of the full road network is realized, which improves the accuracy of travel time estimation.
Patent Information
- Application Number
- CN202210576515.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-25
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-05-25
AI Technical Summary
The existing urban road network indicates that learning methods cannot efficiently and accurately realize the characterization of the full road network, and it is difficult to adapt to complex traffic rules and vehicle driving modes, resulting in poor characterization efficiency, accuracy and adaptability.
Multiple graph construction, topological transfer matrix and Markov transfer matrix calculation are used, combined with graph segmentation, edge repair and index construction, to generate a walk sequence library, and learn section vector representation through a random walk strategy.
Through expressway network segmentation and Markov modeling, a comprehensive representation of road network information is achieved, which significantly improves the accuracy of travel time estimation tasks and reduces computing resource occupation and time consumption.
Smart Images

Figure CN114969234B_ABST
Abstract
Description
Technical Field
[0001] The disclosed embodiments relate to the field of data processing technology, and in particular to a vector representation method for a full urban road network. Background Art
[0002] At present, urban road traffic networks, as the basic analysis object and computing unit of the core functions of intelligent transportation systems (ITS), play an important role in tasks such as traffic flow prediction and travel time estimation. However, with the popularity of data-driven mining methods represented by deep learning, road networks, as a complex graph structure data, cannot effectively complete end-to-end algorithm embedding. Therefore, how to finely and completely realize the digital modeling and vectorized expression of large-scale urban road networks is the primary basic feature engineering to solve traffic analysis tasks with roads as information media.
[0003] Most of the existing methods are based on graph embedding models. According to the different basic assumptions in the representation process, the existing methods can be divided into two categories: representation methods based on topological similarity and representation methods based on attribute similarity. The representation methods based on topological similarity are derived from the representation research of general graph structures. For example, the DeepWalk model originally proposed, its main idea is to rely on the random walk process in the graph to construct a corpus to organize the local structural information of its graph in a sequential manner, and learn its representation vector based on the word2vec framework in the natural language processing neighborhood. However, this method ignores the more complex telecorrelation in the graph. In response to this, Grove proposed the Node2Vec model, which fits richer multi-level topological information by targetedly improving the original random walk process. Furthermore, in view of the scale differentiation effect of graph information, Ribeiro proposed the struct2vec framework, which defines a multi-layer graph random walk algorithm to learn the similarity of graph nodes at different scales. Although the representation method based on topological similarity can extract the association rules of roads in spatial structure, it is difficult to truly reflect the actual driving mode and transfer mode of vehicles on the road network due to the limitations of various road attributes and traffic rules in the urban road network.
[0004] The representation method based on attribute similarity assumes that the attribute information of two road sections is similar, and their feature vectors are also in a similar position in the latent space. For example, Wang et al. analyzed the defects of the word2vec-based method in representing multiple attribute information of roads, and designed the IRN2vec and RN2vec representation learning models using the idea of multiple classification losses; the IRN2vec model learns the representation vector of the intersection road section based on the attribute features such as the geographical location, complex topological structure and interactive behavior of road users, while the RN2vec model simulates the behavior of road users based on the dual perspective of the road section and supplements the actual trajectory based on the shortest path algorithm to generate its representation vector; in the process of verifying downstream tasks related to traffic analysis such as travel time estimation, the performance of the IRN2vec and RN2vec models has obvious accuracy advantages. Although the representation method based on attribute similarity can solve the inherent differentiation relationship between roads to a certain extent, it still cannot accurately express the differentiated characteristics of the connectivity relationship between roads.
[0005] At the algorithmic level, the existing urban road network representation learning methods are unable to efficiently and cost-effectively represent the entire road network due to the limitations of the actual road network scale, and have great application limitations in the actual algorithm implementation process.
[0006] It can be seen that there is an urgent need for an efficient, accurate and adaptable vector representation method for the entire urban road network. Summary of the invention
[0007] In view of this, an embodiment of the present disclosure provides a vector representation method for the entire urban road network, which at least partially solves the problems of poor representation efficiency, accuracy and adaptability in the prior art.
[0008] The embodiment of the present disclosure provides a vector representation method for a full urban road network, including:
[0009] Step 1: Collect the full road network vector data and GPS trajectory data of the target city;
[0010] Step 2, constructing a multigraph according to the full road network vector data and the GPS trajectory data, wherein the multigraph includes a node set, a topological edge set and a transfer edge set;
[0011] Step 3, calculating the value of the topological transfer matrix according to the topological edge set;
[0012] Step 4, calculating the value of the Markov transfer matrix according to the node set and the transfer edge set;
[0013] Step 5, performing graph segmentation operations, edge repair operations and index building operations on the multiple graphs to establish fast indexes within and between graphs;
[0014] Step 6, generating a walking sequence library based on the fast indexing within and between graphs;
[0015] Step 7: Generate a vector representation of each road section in the target city according to each sequence in the walking sequence library.
[0016] According to a specific implementation of the embodiment of the present disclosure, step 3 specifically includes:
[0017] Step 3.1, based on the topological edge set E (P) The elements in the adjacency matrix are constructed If Then let the corresponding element value o in the adjacency matrix O be ij for o ij =1, otherwise o ij =0:
[0018]
[0019] Step 3.2, calculating the topological transfer matrix W according to the adjacency matrix O (P) for:
[0020] W (P) =diag(Ο1) -1 Ο.
[0021] According to a specific implementation of the embodiment of the present disclosure, step 4 specifically includes:
[0022] Step 4.1: For all the N road segments consisting of two pairs of road segments (v i ,v j ),i,j∈[1,N],i≠j, count all GPS trajectories, and the road segments (v i ,v j ) for the number of occurrences γ ij , and form the matrix Γ:
[0023]
[0024] Step 4.2, calculate the Markov transfer matrix W according to the matrix Γ (M) :
[0025] W (M) =diag(Γ1) -1 Gamma.
[0026] According to a specific implementation of the embodiment of the present disclosure, step 5 specifically includes:
[0027] Step 5.1, divide the multigraph G into N snode-independent subgraphs {G(1),G(2),...,G(N s )},satisfy and Get the optimal segmentation result;
[0028] Step 5.2: Perform edge repair on the optimal graph segmentation result to form a new sub-graph set.
[0029] Step 5.3, based on the topological and spatial relationship of the new sub-graph set coupling graph, establish a fast index within and between graphs.
[0030] According to a specific implementation of the embodiment of the present disclosure, step 5.1 specifically includes:
[0031] Step 5.1.1, define the objective function Q, where the objective function Q is in Indicates the subgraph to which each node belongs, such as node v i ∈G(j) then c ij =1, otherwise, c ij =0;
[0032] Step 5.1.2, calculate the optimal segmentation result according to the objective function
[0033] According to a specific implementation of the embodiment of the present disclosure, step 5.2 specifically includes:
[0034] definition is the k-order neighborhood set of node v in the multigraph G. Taking the node topology of the complete multigraph G as the core, all nodes in all subgraphs are judged. If Then the node set As a patch, add it to the subgraph G(j) to complete the edge repair of the subgraph and form a new subgraph set Where k is a preset parameter.
[0035] According to a specific implementation of the embodiment of the present disclosure, step 5.3 specifically includes:
[0036] Step 5.3.1: For each original subgraph G(i), according to its multiple edges E = {E (P) ,E (M)}Relationship builds an index within its graph;
[0037] Step 5.3.2, for the node patch set {V patch (1),V patch (2),...,V patch (Ns )}, based on the spatial coordinates of its nodes, R-tree is used to build spatial indexes between its nodes as fast indexes within and between graphs.
[0038] According to a specific implementation of the embodiment of the present disclosure, step 6 specifically includes:
[0039] Step 6.1, introduce the artificially set parameters p, q, r, and adjust the matrix by the following definition
[0040]
[0041] Step 6.2, defining the comprehensive transfer matrix Π(G) followed by the random walk according to the topological transfer matrix and the Markov transfer matrix:
[0042] Π(G)=W (P) ⊙W (Π) +W (M) ⊙(1-W (Π) ), where ⊙ represents the Hadamard product;
[0043] Step 6.3, based on the comprehensive transfer matrix Π(G), taking each node in the graph G as a starting point, respectively generate R walking sequences of length L to form the walking sequence library.
[0044] According to a specific implementation of the embodiment of the present disclosure, step 6.3 specifically includes:
[0045] Step 6.3.1, take node v in graph G i As the starting point, select the next node v according to the probability of the i-th row in the comprehensive transfer matrix Π j , and query v based on the fast index within and between graphs j , as the starting point for the next transfer;
[0046] Step 6.3.2, repeat step 6.3.1 until the number of transfers reaches L times, and store all the transferred sections as a sequence in the wandering sequence library seq(i) (k) ;
[0047] Step 6.3.3, repeat step 6.3.2R times, until there are R sequences stored in the walking sequence library [seq(i) (k) ],k∈[1,R];
[0048] Step 6.3.4, set i to 1 to N, and repeat steps 6.3.1, 6.3.2, and 6.3.3. Finally, N×R sequences of length L are stored in the walking sequence library [seq(i) (k)],k∈[1,R],i∈[1,N].
[0049] According to a specific implementation of the embodiment of the present disclosure, step 7 specifically includes:
[0050] Step 7.1, construct the objective function f:
[0051]
[0052] Where nei is the neighborhood parameter, seq(i) (k) j Indicates that the wandering sequence library is v i The jth element of the kth sequence starting from
[0053] Step 7.2, based on the SGD optimizer, maximize the objective function f and select the vector representation Em(v i ),i∈[1,N] is the optimal vector representation result of the entire road network.
[0054] The vector representation scheme for the full urban road network in the embodiment of the present disclosure includes: step 1, collecting the full road network vector data and GPS trajectory data of the target city; step 2, constructing a multi-graph based on the full road network vector data and the GPS trajectory data, wherein the multi-graph includes a node set, a topological edge set and a transfer edge set; step 3, calculating the value of the topological transfer matrix based on the topological edge set; step 4, calculating the value of the Markov transfer matrix based on the node set and the transfer edge set; step 5, performing graph segmentation operations, edge repair operations and index construction operations on the multi-graph to establish a fast index within and between graphs; step 6, generating a walk sequence library based on the fast index within and between graphs; step 7, generating a vector representation of each road section in the target city based on each sequence in the walk sequence library.
[0055] The beneficial effects of the embodiments of the present disclosure are as follows: through the scheme of the present disclosure, (1) the urban road network is divided into subnets through a fast large-scale road network segmentation algorithm, solving the problems of memory usage and time consumption in the calculation process;
[0056] (2) The urban road network mobility model is modeled using Markov modeling, and a multi-view random walk sampling strategy is designed. Finally, the representation vector is learned through the representation learning model to achieve a comprehensive representation of the road network information.
[0057] (3) In the downstream task of travel time estimation, the road segment representation vector obtained by the method of the present invention can significantly improve the accuracy of the downstream task compared with the existing method. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0059] Figure 1 A schematic diagram of a process flow of a vector representation method for a full urban road network provided in an embodiment of the present disclosure;
[0060] Figure 2 A schematic diagram of a process flow of another vector representation method for a full urban road network provided in an embodiment of the present disclosure;
[0061] Figure 3 A schematic diagram of a process of graph segmentation, edge repair and index construction of multiple graphs provided in an embodiment of the present disclosure;
[0062] Figure 4 A schematic diagram of the effects of parameters in an adjustment matrix provided by an embodiment of the present disclosure;
[0063] Figure 5 A schematic diagram of memory usage and computing efficiency provided for an embodiment of the present disclosure. DETAILED DESCRIPTION
[0064] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0065] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0066] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0067] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0068] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0069] The embodiments of the present disclosure provide a vector representation method for a full urban road network, which can be applied to a vector representation process of an urban road network in an urban road statistics scenario.
[0070] See also Figure 1 , is a flow chart of a vector representation method for a full urban road network provided by an embodiment of the present disclosure. Figure 1 and Figure 2 As shown, the method mainly comprises the following steps:
[0071] Step 1: Collect the full road network vector data and GPS trajectory data of the target city;
[0072] For example, place A can be taken as the target city, and then the actual full urban road network of place A (including 8,651,005 road sections) and the GPS trajectory data of online ride-hailing vehicles from August 1, 2020 to August 31, 2020 can be combined as actual data sets for the specific implementation of the invention to illustrate the implementation process of the present invention.
[0073] Step 2, constructing a multigraph according to the full road network vector data and the GPS trajectory data, wherein the multigraph includes a node set, a topological edge set and a transfer edge set;
[0074] In specific implementation, the urban road network can be constructed as a multi-graph G = (V, E = {E (P) ,E (M)},W={W (P) ,W (M)}), where V = {v i =[x i ,y i ],i∈[1,N]} is a node set, representing the set of all N road sections in the city, [x i ,y i ] indicates the corresponding road segment v i The geospatial coordinates, E (P) is a topological edge set, which represents the topological connectivity of the road segment. If two road segments v i With v j Directly connected topologically, E (M) is the transfer edge set, which represents the connectivity of the road segment in the GPS trajectory. If there is a link from the road segment v in the GPS i Directly to section v j records, then W (P) With W (M) are the topological transfer matrix and the Markov transfer matrix, representing the edge set E respectively. (P) With E (M) The weight of the corresponding edge in .
[0075] Step 3, calculating the value of the topological transfer matrix according to the topological edge set;
[0076] Furthermore, the step 3 specifically includes:
[0077] Step 3.1, based on the topological edge set E (P) The elements in the adjacency matrix are constructed If Then let the corresponding element value o in the adjacency matrix O be ij for o ij =1, otherwise o ij =0:
[0078]
[0079] Step 3.2, calculating the topological transfer matrix W according to the adjacency matrix O (P) for:
[0080] W (P) =diag(Ο1) -1 Ο.
[0081] In specific implementation, calculating the value of the topological transfer matrix according to the topological edge set mainly includes the following steps:
[0082] According to the topological edge set E (P) The elements in the adjacency matrix are constructed If Then let the corresponding element value o in the adjacency matrix O be ij for o ij =1, otherwise o ij =0:
[0083]
[0084] Further based on the adjacency matrix O, the topological transfer matrix W can be obtained according to formula (2): (P) :
[0085] W (P) =diag(Ο1) -1 Ο (2)
[0086] Where diag(·) represents the diagonal matrix formed by the vectors, and 1 represents a column vector whose elements are all 1.
[0087] Step 4, calculating the value of the Markov transfer matrix according to the node set and the transfer edge set;
[0088] Furthermore, the step 4 specifically includes:
[0089] Step 4.1: For all the N road segments consisting of two pairs of road segments (v i ,v j ),i,j∈[1,N],i≠j, count all GPS trajectories, and the road segments (v i ,v j ) for the number of occurrences γ ij , and form the matrix Γ:
[0090]
[0091] Step 4.2, calculate the Markov transfer matrix W according to the matrix Γ (M) :
[0092] W (M) =diag(Γ1) -1 Gamma.
[0093] In specific implementation, calculating the value of the Markov transfer matrix according to the node set and the transfer edge set mainly includes the following steps:
[0094] For all the pairs of N road segments, that is, (v i ,v j ),i,j∈[1,N],i≠j, count all GPS trajectories, and the road segments (v i ,vj ) for the number of occurrences γ ij , and form the matrix Γ:
[0095]
[0096] Further based on the matrix Γ, the Markov transfer matrix W can be obtained according to formula (4): (M) :
[0097] W (M) =diag(Γ1) -1 Γ (4)
[0098] Step 5, performing graph segmentation operations, edge repair operations and index building operations on the multiple graphs to establish fast indexes within and between graphs;
[0099] Based on the above embodiment, step 5 specifically includes:
[0100] Step 5.1, divide the multigraph G into N s node-independent subgraphs {G(1),G(2),...,G(N s )},satisfy and Get the optimal segmentation result;
[0101] Step 5.2: Perform edge repair on the optimal graph segmentation result to form a new sub-graph set.
[0102] Step 5.3, based on the topological and spatial relationship of the new sub-graph set coupling graph, establish a fast index within and between graphs.
[0103] Optionally, the step 5.1 specifically includes:
[0104] Step 5.1.1, define the objective function Q, where the objective function Q is in Indicates the subgraph to which each node belongs, such as node v i ∈G(j) then c ij =1, otherwise, c ij =0;
[0105] Step 5.1.2, calculate the optimal segmentation result according to the objective function
[0106] Optionally, the step 5.2 specifically includes:
[0107] definition is the k-order neighborhood set of node v in the multigraph G. Taking the node topology of the complete multigraph G as the core, all nodes in all subgraphs are judged. If Then the node set As a patch, add it to the subgraph G(j) to complete the edge repair of the subgraph and form a new subgraph set Where k is a preset parameter.
[0108] Optionally, the step 5.3 specifically includes:
[0109] Step 5.3.1: For each original subgraph G(i), according to its multiple edges E = {E (P) ,E (M)}Relationship builds an index within its graph;
[0110] Step 5.3.2, for the node patch set {V patch (1),V patch (2),...,V patch (N s )}, based on the spatial coordinates of its nodes, R-tree is used to build spatial indexes between its nodes as fast indexes within and between graphs.
[0111] When implementing it, Figure 3 As shown in the figure, (a) is the original network, (b) is the graph segmentation, (c) is the edge repair, and (d) is the index construction. Considering that the scale of the multigraph G representing the real road network is very large, in order to improve the computational efficiency and memory efficiency of the subsequent random walk process, it is necessary to perform graph segmentation, edge repair and index construction on the multigraph G. It mainly includes the following steps:
[0112] 5.1) First, the multigraph G is partitioned to divide the complete multigraph G into N s node-independent subgraphs {G(1),G(2),...,G(N s )},satisfy and The main steps include:
[0113] 5.1.1) Define graph partitioning as an optimization problem. The optimization goal is to ensure the uniformity of the complexity of the subgraph structure and the relative independence between subgraphs, and to meet the requirements of parallel computing and lossless walking. Therefore, the objective function is defined as formula (5):
[0114]
[0115] in Indicates the subgraph to which each node belongs, such as node v i ∈G(j) then cij =1, otherwise, c ij =0.
[0116] 5.1.2) Furthermore, the optimal graph segmentation result {G(1),G(2),...,G(N s )} By solving the optimization problem represented by formula (7), we can obtain:
[0117]
[0118] The specific solution process mainly includes the following steps:
[0119] 5.1.2.1) First, treat all nodes as independent subgraphs, representing the result of the first partition {G(1), G(2), ..., G(N s )}1,N s =N, and calculate the target value Q1.
[0120] 5.1.2.2) Then, based on the previous division, any two subgraphs are merged And calculate the objective function value Q1(i,j) at this time.
[0121] 5.1.2.3) Select the subgraph set corresponding to the maximum value of Q1(i,j) as the result of the second partition, {G(1), G(2), ..., G(N-1)}2, and update the target value at this time to
[0122] 5.1.2.4) Repeat steps 5.1.2.2) and 5.1.2.3) until the number of divisions reaches N. Select The corresponding partition results {G(1),G(2),...,G(N s -k+1)} k The optimal graph segmentation result.
[0123] 5.2) To ensure that the random walk process between subsequent subgraphs can perfectly simulate the information of the complete road network, the edge repair of the optimal graph segmentation result is required. The main steps include:
[0124] 5.2.1) Definition is the k-order neighborhood set of node v in the multigraph G. Taking the node topology of the complete multigraph G as the core, all nodes in all subgraphs are judged. If Then the node set As a patch, add it to the subgraph G(j) to complete the edge repair of the subgraph and form a new subgraph set Where k is a manually set parameter.
[0125] 5.3) Furthermore, in order to improve the efficiency of path query during random walk, this paper couples the topology and spatial relationship of the graph to establish fast indexing within and between graphs. The main steps include:
[0126] 5.3.1) First, for each original subgraph G(i), according to its multiple edges E = {E (P) ,E (M)}relationship establishes an index within its graph.
[0127] 5.3.2) For the node patch set {V patch (1),V patch (2),...,V patch (N s )}, based on the spatial coordinates of its nodes, use R-tree to build the spatial index between its nodes, that is, the index between graphs.
[0128] Step 6, generating a walking sequence library based on the fast indexing within and between graphs;
[0129] Based on the above embodiment, step 6 specifically includes:
[0130] Step 6.1, introduce the artificially set parameters p, q, r, and adjust the matrix by the following definition
[0131]
[0132] Step 6.2, defining the comprehensive transfer matrix Π(G) followed by the random walk according to the topological transfer matrix and the Markov transfer matrix:
[0133] Π(G)=W (P) ⊙W (Π) +W (M) ⊙(1-W (Π) ), where ⊙ represents the Hadamard product;
[0134] Step 6.3, based on the comprehensive transfer matrix Π(G), taking each node in the graph G as a starting point, respectively generate R walking sequences of length L to form the walking sequence library.
[0135] Furthermore, the step 6.3 specifically includes:
[0136] Step 6.3.1, take node v in graph G i As the starting point, select the next node v according to the probability of the i-th row in the comprehensive transfer matrix Π j , and query v based on the fast index within and between graphs j , as the starting point for the next transfer;
[0137] Step 6.3.2, repeat step 6.3.1 until the number of transfers reaches L times, and store all the transferred sections as a sequence in the wandering sequence library seq(i) (k) ;
[0138] Step 6.3.3, repeat step 6.3.2R times, until there are R sequences stored in the walking sequence library [seq(i) (k) ],k∈[1,R];
[0139] Step 6.3.4, set i to 1 to N, and repeat steps 6.3.1, 6.3.2, and 6.3.3. Finally, N×R sequences of length L are stored in the walking sequence library [seq(i) (k) ],k∈[1,R],i∈[1,N].
[0140] In specific implementation, In addition, a multiple random walk mechanism that couples topological structure information and vehicle transfer patterns is proposed to generate a walk sequence library that can comprehensively represent road network information. It mainly includes the following steps:
[0141] 6.1) First, we introduce the artificially set parameters p, q, and r, and define the adjustment matrix through formula (8): The values of p, q, and r determine whether the walking process tends to be breadth-first traversal or depth-first traversal. Figure 4 , where (a) is the effect of p, q, and r in the random walk, (b) is the preferred walk path when q and r are large, and (c) is the preferred walk path when q and r are small:
[0142]
[0143] 6.2) Further, based on the topological transfer matrix W calculated in step 3 (P) and the Markov transition matrix W calculated in step 4 (M) Based on this, the comprehensive transfer matrix Π(G) followed by the random walk is defined by formula (9):
[0144] Π(G)=W (P) ⊙W (Π) +W (M) ⊙(1-W (Π) ) (9)
[0145] Here, ⊙ represents the Hadamard product.
[0146] 6.3) Based on the comprehensive transfer matrix Π(G), each node in the graph G is used as the starting point to generate R walk sequences of length L to form a walk sequence library. The main steps include:
[0147] 6.3.1) Take the node v in the graph G i As the starting point, select the next node v according to the probability of the i-th row in the comprehensive transfer matrix Π j , and query v based on the index constructed in step 5.3) j , as the starting point for the next transfer.
[0148] 6.3.2) Repeat step 6.3.1) until the number of transfers reaches L, and store all the transferred sections as a sequence in the walking sequence library seq(i) (k) .
[0149] 6.3.3) Repeat step 6.3.2) R times until there are R sequences stored in the walking sequence library [seq(i) (k) ],k∈[1,R].
[0150] 6.3.4) Set i to 1 to N, and repeat steps 6.3.1), 6.3.2) and 6.3.3), and finally store N×R sequences of length L in the walking sequence library [seq(i) (k) ],k∈[1,R],i∈[1,N].
[0151] Step 7: Generate a vector representation of each road section in the target city according to each sequence in the walking sequence library.
[0152] Based on the above embodiment, step 7 specifically includes:
[0153] Step 7.1, construct the objective function f:
[0154]
[0155] Where nei is the neighborhood parameter, seq(i) (k) j Indicates that the wandering sequence library is v i The jth element of the kth sequence starting from
[0156] Step 7.2, based on the SGD optimizer, maximize the objective function f and select the vector representation Em(v i ),i∈[1,N] is the optimal vector representation result of the entire road network.
[0157] In the specific implementation, based on the N×R sequences in the walking sequence library, the Word2vec model is used to set the length parameter d of the representation vector to generate each section vi , vector representation of i∈[1,N] i∈[1,N]. It mainly includes the following steps:
[0158] 7.1) Construct the objective function f:
[0159]
[0160] Where nei is the neighborhood parameter, seq(i) (k) j Indicates that the wandering sequence library is v i The jth element (road section) of the kth sequence starting from the starting point.
[0161] 7.2) Based on the SGD optimizer, the objective function f is maximized and the vector representation Em(v i ),i∈[1,N] is the optimal vector representation result of the entire road network.
[0162] In order to verify the effectiveness and advancement of the method of the present invention, travel time estimation (ETA) is selected as the downstream task, and the accuracy of the segment representation vector obtained by the method of the present invention and the internationally popular representation methods: DeepWalk and Node2Vec in the travel time estimation task is compared. The main steps include:
[0163] Choose from a variety of common accuracy evaluation indicators, including mean absolute percentage error (MAPE), root mean square error (RMSE), and mean absolute error (MAE):
[0164]
[0165]
[0166]
[0167] in, With τ (i) Respectively represent the estimated value and true value of the travel time corresponding to the i-th data.
[0168] Table 1 shows the accuracy comparison between the proposed method and the comparative method on downstream tasks.
[0169]
[0170] Table 1
[0171] It can be found that the vector representation obtained by the method of the present invention has a smaller error than the internationally popular method in the travel time estimation task, and has certain advantages.
[0172] At the same time, if Figure 5As shown, (a) is a schematic diagram of the correlation between the existence of occupation and the threshold k, and (b) is a schematic diagram of the correlation between the running speed and the number of parallel computing threads. Figure 5 In the paper, different neighborhood size thresholds k are set, and the memory usage of each subgraph is observed. The theoretical memory usage of the full road network of the example data is 375GB. It can be found that the method of the present invention can maintain efficient memory utilization under different thresholds k, and is more convenient for parallel computing, thereby improving computing efficiency.
[0173] The vector representation method for the entire urban road network provided in this embodiment solves the problems of memory usage and time consumption in the calculation process by dividing the urban road network into subnetworks through a fast large-scale road network segmentation algorithm; Markov modeling is used for the urban road network mobility model, and a multi-view random walk sampling strategy is designed, and finally the representation vector is obtained through learning by a representation learning model to achieve a comprehensive representation of the road network information; in the downstream task of travel time estimation, the road segment representation vector obtained by the method of the present invention can significantly improve the accuracy of the downstream task compared with the existing method.
[0174] The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware.
[0175] It should be understood that various parts of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
[0176] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A vector representation method for the entire urban road network, characterized in that: include: Step 1: Collect the full road network vector data and GPS trajectory data of the target city; Step 2, constructing a multigraph according to the full road network vector data and the GPS trajectory data, wherein the multigraph includes a node set, a topological edge set and a transfer edge set; Step 3, calculating the value of the topological transfer matrix according to the topological edge set; Step 4, calculating the value of the Markov transfer matrix according to the node set and the transfer edge set; Step 5, performing graph segmentation operations, edge repair operations and index building operations on the multiple graphs to establish fast indexes within and between graphs; Step 6, generating a walking sequence library based on the fast indexing within and between graphs; Step 7: Generate a vector representation of each road section in the target city according to each sequence in the walking sequence library.
2. The method according to claim 1, characterized in that , the step 3 specifically includes: Step 3.1, based on the topological edge set E (P) The elements in the adjacency matrix are constructed If Then let the corresponding element value o in the adjacency matrix O ij for o ij =1, otherwise o ij =0: Step 3.2, calculating the topological transfer matrix W according to the adjacency matrix O (P) for: W (P) =diag(O1) -1 O。 3. The method according to claim 1, characterized in that , the step 4 specifically includes: Step 4.1: For all the N road segments consisting of two pairs of road segments (v i ,v j ),i,j∈[1,N],i≠j, count all GPS trajectories, and the road segments (v i ,v j ) for the number of occurrences γ ij , and form the matrix Γ: Step 4.2, calculate the Markov transfer matrix W according to the matrix Γ (M) : W (M) =diag(Γ1) -1 C.
4. The method according to claim 1, characterized in that , the step 5 specifically includes: Step 5.1, divide the multigraph G into N s node-independent subgraphs {G(1),G(2),...,G(N s )},satisfy and Get the optimal segmentation result; Step 5.2: Perform edge repair on the optimal graph segmentation result to form a new sub-graph set. Step 5.3, based on the topological and spatial relationship of the new sub-graph set coupling graph, establish a fast index within and between graphs.
5. The method according to claim 4, characterized in that , the step 5.1 specifically includes: Step 5.1.1, define the objective function Q, where the objective function Q is in Indicates the subgraph to which each node belongs, such as node v i ∈G(j) then c ij =1, otherwise, c ij =0; Step 5.1.2, calculate the optimal segmentation result according to the objective function 6. The method according to claim 5, characterized in that , the step 5.2 specifically includes: definition is the k-order neighborhood set of node v in the multigraph G. Taking the node topology of the complete multigraph G as the core, all nodes in all subgraphs are judged. If Then the node set As a patch, add it to the subgraph G(j) to complete the edge repair of the subgraph and form a new subgraph set Where k is a preset parameter.
7. The method according to claim 6, characterized in that , the step 5.3 specifically includes: Step 5.3.1: For each original subgraph G(i), according to its multiple edges E = {E (P) ,E (M) }Relationship builds an index within its graph; Step 5.3.2, for the node patch set {V patch (1),V patch (2),...,V patch (N s )}, based on the spatial coordinates of its nodes, R-tree is used to build spatial indexes between its nodes as fast indexes within and between graphs.
8. The method according to claim 7, characterized in that , the step 6 specifically includes: Step 6.1, introduce the artificially set parameters p, q, r, and adjust the matrix by the following definition Step 6.2, defining the comprehensive transfer matrix Π(G) followed by the random walk according to the topological transfer matrix and the Markov transfer matrix: Π(G)=W (P) ⊙W (Π) +W (M) ⊙(1-W (Π) ), where ⊙ represents the Hadamard product; Step 6.3, based on the comprehensive transfer matrix Π(G), taking each node in the graph G as a starting point, respectively generate R walking sequences of length L to form the walking sequence library.
9. The method according to claim 8, characterized in that , the step 6.3 specifically includes: Step 6.3.1, take node v in graph G i As the starting point, select the next node v according to the probability of the i-th row in the comprehensive transfer matrix Π j , and query v based on the fast index within and between graphs j , as the starting point for the next transfer; Step 6.3.2, repeat step 6.3.1 until the number of transfers reaches L times, and store all the transferred sections as a sequence in the wandering sequence library seq(i) (k) ; Step 6.3.3, repeat step 6.3.2R times, until there are R sequences stored in the walking sequence library [seq(i) (k) ],k∈[1,R]; Step 6.3.4, set i to 1 to N, and repeat steps 6.3.1, 6.3.2, and 6.3.
3. Finally, N×R sequences of length L are stored in the walking sequence library [seq(i) (k) ],k∈[1,R],i∈[1,N].
10. The method according to claim 9, characterized in that , the step 7 specifically includes: Step 7.1, construct the objective function f: Where nei is the neighborhood parameter, seq(i) (k) j Indicates that the wandering sequence library is v i The jth element of the kth sequence starting from Step 7.2, based on the SGD optimizer, maximize the objective function f and select the vector representation Em(v i ),i∈[1,N] is the optimal vector representation result of the entire road network.
