A traffic flow data completion method based on geographic meta-knowledge embedding
By introducing geographic meta-knowledge embedding methods into traffic flow data completion, using meta-learners and tensor decomposition technology, the problem of difficulty in capturing the spatial heterogeneity of traffic flow is solved by existing methods, and a higher accuracy and robust traffic flow data completion is achieved.
Patent Information
- Application Number
- CN202410911745.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-07-09
AI Technical Summary
The existing traffic flow data completion method is difficult to accurately capture the spatial heterogeneity of traffic flow, limiting the accuracy and robustness of traffic flow completion.
Using the method of geographic meta-knowledge embedding, by constructing a structural chart, using the meta-learner to obtain the meta-knowledge of nodes and edges, obtain the space-time embedding matrix, and then construct the tensor decomposition objective function, use the gradient descent method to iteratively solve, update the spatial weight matrix and tensor decomposition process until the cutoff condition is met.
It improves the accuracy of tensor supplementation, enhances the accuracy and robustness of traffic flow data completion, and can more accurately model the spatial heterogeneity of traffic flow.
Smart Images

Figure CN118886485B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field, and in particular to a method for completing traffic flow data by embedding geographic meta-knowledge. Background Art
[0002] Accurate and reliable traffic flow data is the basic data guarantee for traffic engineering research and intelligent transportation system (ITS) applications. The acquisition of road traffic flow information mainly relies on professional fixed detection devices (such as cameras, radar / laser speed meters, etc.). Since their communication and data storage capabilities are easily restricted by extreme weather, power supply, equipment performance and other factors, it is inevitable that traffic data will be sparse or missing, which restricts the accurate and reliable acquisition of urban road network traffic flow information.
[0003] Urban road traffic flow completion is the application of interpolation and extrapolation methods to estimate small-scale sporadic or large-scale periodic missing traffic data. It is mainly divided into two categories: statistical learning and machine learning methods. Matrix / tensor decomposition is an important branch of machine learning methods. This type of method uses the low-rank property of observed sample data to complete missing data by representing the data as a linear combination of low-rank approximations. It has become an important method for traffic flow data completion. Existing studies usually establish similarity relationships between POI types and geographical features such as road networks between different road sections, construct a geographical feature similarity matrix to constrain the tensor decomposition process, and then use the flow of non-adjacent road sections to complete the missing values. Combined with the POI and weather characteristics of the road section, an affinity graph is constructed to obtain the weight matrix of each road section, and the tensor decomposition process is constrained to infer the missing traffic flow. There is also a geographical feature similarity matrix constrained tensor decomposition process with the help of road networks and vehicle trajectories to complete the missing traffic information.
[0004] However, these methods use a fixed geographic feature similarity matrix to constrain the tensor decomposition process, which makes it difficult to accurately capture the spatial heterogeneity of traffic flow, limiting the accuracy and robustness of traffic flow completion. Summary of the invention
[0005] In order to solve the above technical problems, the purpose of the present invention is to provide a method for completing traffic flow data by embedding geographic meta-knowledge. The technical solutions adopted are as follows:
[0006] An embodiment of the present invention provides a method for completing traffic flow data by embedding geographic meta-knowledge, the method comprising:
[0007] Construct a structure graph, and use a meta-learner to obtain node meta-knowledge and edge meta-knowledge of nodes and edges in the structure graph; obtain a spatiotemporal embedding matrix based on the node meta-knowledge and edge meta-knowledge;
[0008] Using the traffic flow tensor to be completed and the spatiotemporal embedding matrix to obtain a first spatial weight matrix and a second spatial weight tensor; using the traffic flow tensor to be completed to obtain a third spatial weight tensor; constructing a tensor decomposition objective function according to the first spatial weight matrix, the second spatial weight tensor and the third spatial weight tensor;
[0009] The tensor decomposition objective function is iteratively solved using the gradient descent method. If the solved completed tensor meets the cutoff condition, the iteration stops and the completed tensor is output. If the number of iterations reaches the maximum and the solved completed tensor does not meet the cutoff condition, the first spatial weight matrix and the second spatial weight tensor are updated.
[0010] The first objective function is constructed using the updated first spatial weight matrix and the second spatial weight tensor; the first objective function is iteratively solved. If the solved completion tensor meets the cutoff condition, the iteration stops and the completion tensor is output. If the number of iterations reaches the maximum and the solved completion tensor does not meet the cutoff condition, the first spatial weight matrix and the second spatial weight tensor are updated again, and the second objective function is constructed for iterative solution. Similarly, when the solved tensor meets the cutoff condition or the number of updates of the first spatial weight matrix and the second spatial weight tensor reaches the maximum, the calculation is stopped to obtain the completion tensor.
[0011] Preferably, the structure graph uses a meta-learner to obtain node meta-knowledge and edge meta-knowledge of nodes and edges in the structure graph, including:
[0012] The nodes in the structure graph represent the monitoring points in the study area, where the structure graph is a fully connected structure, and each node is connected;
[0013] The feature vectors of all nodes are input into the meta-learner, and the node meta-knowledge is output; the feature vectors of all edges are input into the meta-learner, and the edge meta-knowledge is output; the meta-learner is a multi-layer perceptron; a buffer zone is constructed with the monitoring point as the center of the circle, and the feature vector of the node includes the number of POIs of each type in the buffer zone of the node, the road width, the number of intersections and the distance index, and a distance index is the normalized value of the sum of the distances from each POI point in a type of POI to the node; the feature vector of the edge includes the distance, connectivity and association strength between nodes, if the nodes are connected, the connectivity is coded as 1, if not connected, the connectivity is coded as 0, and the association strength is the sum of the distance and connectivity between the nodes.
[0014] Preferably, the calculation formula of the spatiotemporal embedding matrix is:
[0015]
[0016] in, represents the spatiotemporal embedding matrix; h v and h eRepresent node meta-knowledge and edge meta-knowledge respectively; and They represent the feature embedding matrix for each day and the feature embedding matrix for each time interval respectively; ⊙ represents the element-wise product operation.
[0017] Preferably, the method of obtaining the first spatial weight matrix and the second spatial weight tensor by using the traffic flow tensor to be completed and the spatiotemporal embedding matrix includes:
[0018] The traffic flow tensor to be completed is split to obtain the traffic flow of all monitoring points every day. The traffic flow tensor to be completed and the traffic flow of all monitoring points in one day are recorded as traffic flow. Indicates that t represents the time span. When t = D*T, it represents the traffic flow tensor to be completed. When t = T, it represents the traffic flow of N monitoring points in one day.
[0019] The traffic flow is input into the meta-learner to obtain traffic flow features; the traffic flow features and the spatiotemporal embedding matrix are multiplied element by element to generate the first spatiotemporal embedding matrix;
[0020] The heterogeneous relationship between nodes is inferred by multiplying the first spatiotemporal embedding matrix and the transposed multiplication of the first spatiotemporal embedding matrix, a dynamic graph is constructed, and the features of the dynamic graph are normalized to generate a spatial weight matrix. When t = D*T, is the first spatial weight matrix. When t = T, Represents the spatial weight matrix corresponding to the traffic flow of one day. The spatial weight matrices corresponding to each day constitute the second spatial weight tensor.
[0021] Preferably, the calculation formula of the third spatial weight tensor is:
[0022]
[0023] in, represents the third spatial weight tensor; represents the traffic flow tensor to be completed; represents the traffic flow data of the dth day in the traffic flow tensor to be completed, and D represents the total number of days; express The derivative of NND Indicates that the data in the brackets is converted to the same dimension as the second spatial weight tensor.
[0024] Preferably, the tensor decomposition objective function is:
[0025]
[0026] in, A set of known traffic flows representing the traffic flow tensor to be completed; represents the known traffic flow set of the completed traffic flow tensor; λ1, λ2 and λ3 represent the weights of the control regularization term respectively; and N, D, T represent the core tensor and three factor matrices respectively; S, and Represent the first spatial weight matrix, the second spatial weight tensor and the third spatial weight tensor respectively; ‖.‖ 2 represents the l2 norm.
[0027] Preferably, the iterative solution of the tensor decomposition objective function by using the gradient descent method includes:
[0028] According to the tensor decomposition objective function, the partial derivatives corresponding to the core tensor, three factor matrices, the first spatial weight matrix and the second spatial weight tensor are obtained; according to the partial derivatives, the core tensor, the three factor matrices, the first spatial weight matrix and the second spatial weight tensor are updated, and the completion tensor corresponding to each iteration is calculated using the core tensor and the three factor matrices updated after each iteration.
[0029] Preferably, constructing the first objective function using the updated first spatial weight matrix and the second spatial weight tensor includes:
[0030] The first spatial weight matrix and the second spatial weight tensor in the tensor decomposition objective function are replaced with the updated first spatial weight matrix and the second spatial weight tensor to obtain the first objective function.
[0031] Preferably, updating the first spatial weight matrix and the second spatial weight tensor comprises:
[0032] Adjust the parameters of the meta-learner, reacquire the node meta-knowledge and edge meta-knowledge according to the adjusted meta-learner, and obtain the updated first spatial weight matrix and second spatial weight tensor according to the reacquired node meta-knowledge, edge meta-knowledge, the traffic flow tensor to be completed and the adjusted meta-learner.
[0033] Preferably, the cut-off condition includes:
[0034] The cutoff condition is: calculate the sum of the differences between the traffic flow tensor to be completed and the non-missing data in the completed tensor obtained in each iteration, recorded as the first loss. If the first loss is greater than or equal to the loss threshold, continue the iteration. If the first loss is less than the loss threshold, stop the iteration and output the completed tensor.
[0035] The embodiments of the present invention have at least the following beneficial effects: the present invention uses a meta-learner to obtain node meta-knowledge and edge meta-knowledge of nodes and edges in a structural graph, and uses the node meta-knowledge and edge meta-knowledge to obtain a spatiotemporal embedding matrix, uses the traffic flow tensor to be completed and the spatiotemporal embedding matrix to obtain a first spatial weight matrix and a second spatial weight tensor, and then constructs a tensor decomposition objective function, performs high-level semantic feature mapping on the features of the nodes and edges, extracts geographic meta-knowledge that affects the characteristics of the traffic flow, and then generates spatiotemporal embedding by fusing the geographic meta-knowledge with the spatiotemporal information of the traffic flow, models the spatial heterogeneity of the traffic flow, and constrains the decomposition process of the tensor by the first spatial weight matrix and the second spatial weight tensor, taking into account the geographic features of the nodes and edges and the dynamic traffic status, thereby improving the accuracy of tensor supplementation, and at the same time updating the first spatial weight matrix and the second spatial weight tensor to optimize their calculation results, which can further improve the accuracy and robustness of traffic flow number completion. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A method flow chart of a method for completing traffic flow data by embedding geographic meta-knowledge provided by an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of tensor decomposition of a traffic flow data completion method embedded with geographic meta-knowledge provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a traffic flow data completion method embedded with geographic meta-knowledge proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form.
[0040] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0041] The following is a detailed description of a specific solution of a traffic flow data completion method embedded with geographic meta-knowledge provided by the present invention in conjunction with the accompanying drawings.
[0042] Example:
[0043] The main application scenarios of the present invention are: the statistical learning-based method uses mathematical statistics technology to complete the missing values. The structure is simple and easy to understand. Common algorithms include probabilistic principal component model, Bayesian model, kernel probability model, etc. This type of method rarely considers the multidimensional spatiotemporal characteristics implicit in traffic flow, and is more suitable for small-scale occasional missing data completion. The machine learning-based method can capture the complex correlation and nonlinear relationship between data by training the model with a large amount of sample data. It is suitable for the completion of large-scale periodic missing traffic and has become the mainstream method for traffic flow data completion. Matrix / tensor decomposition is an important branch of machine learning methods. This type of method uses the low-rank properties of observed sample data to complete missing data by representing the data as a linear combination of low-rank approximations, and has become an important method for traffic flow data completion. Existing tensor decomposition methods usually only consider the geographical characteristics of nodes, but ignore the geographical characteristics of edges, thereby limiting these methods from accurately modeling the spatial heterogeneity of traffic flow and affecting the completion effect of traffic flow data.
[0044] See also Figure 1 , which shows a method flow chart of a method for completing traffic flow data by embedding geographic meta-knowledge provided by an embodiment of the present invention, the method comprising the following steps:
[0045] Step S1, construct a structure graph, use a meta-learner to obtain node meta-knowledge and edge meta-knowledge of nodes and edges in the structure graph; obtain a spatiotemporal embedding matrix based on the node meta-knowledge and edge meta-knowledge.
[0046] Traffic flow refers to the number of vehicles passing through the road section where the monitoring point is located in the study area within a specific time interval. The traffic flow of N monitoring points within D days and T time intervals can be expressed as a traffic flow tensor to be completed The purpose of the present invention is to complete the missing values in χ, and T time intervals represent T time intervals in one day.
[0047] According to the construction structure diagram, the structure diagram shows the flow monitoring points and the relationship between the monitoring points; the structure diagram is expressed as G = (V, E), where V = {v1, ..., v N} and E={e ij |i≤N,j≤N} are the sets of nodes and edges in the structure graph, respectively. The nodes represent the monitoring points in the study area. The structure graph is a fully connected structure, and each node is connected.
[0048] In a complex urban traffic system, the similarity relationship of traffic flow between monitoring points can be represented by a structural graph, and is jointly affected by node and edge attributes. However, directly using the attributes of nodes and edges as input features is prone to redundant information and noise, and it is difficult to capture the complex relationships and patterns of the structural graph. Therefore, the present invention designs a geographic meta-knowledge extraction module based on meta-learning, which aims to extract node meta-knowledge and edge meta-knowledge from node attributes and edge attributes, and then realize the mapping of high-level semantic features.
[0049] The buffer zone is constructed with the monitoring point as the center. The diameter of the buffer zone needs to be determined by the implementer according to the actual situation. The node attributes are determined by the surrounding environment of the monitoring point, that is, the environment within the buffer zone, which is expressed as a feature vector in Represents the features of node i, including the number of POIs of each type in the buffer zone of node i, road width, number of intersections, and distance index. Get the distance between monitoring point i and each POI point, calculate the sum of the distances corresponding to each POI point in a POI type and normalize them to get a distance index. NF represents the number of features. The edge attributes are determined by the relationship between monitoring points and are represented as feature vectors. in It represents the features between node i and node j. The features include the distance, connectivity and association strength between nodes. EF represents the number of features. Connectivity refers to whether the nodes are connected. If connected, it is coded as 1, and if not connected, it is coded as 0. The association strength is the sum of the distance and connectivity between nodes.
[0050] Construct a meta-learner, which is a multi-layer perceptron (MLP). It takes the feature vectors of all nodes and the feature vectors of all edges as input, extracts node meta-knowledge and edge meta-knowledge, and outputs node meta-knowledge h v and edge element knowledge h e , here h v and h e They represent the meta-knowledge of all nodes and the meta-knowledge of all edges respectively.
[0051] The spatial heterogeneity relationship between urban traffic flows is jointly influenced by node meta-knowledge and edge-element knowledge, and changes with the changes in the traffic status of the road section. The traffic flow status between monitoring points can be characterized from the global scale and the local scale. At the global scale, traffic flow has periodic and seasonal characteristics. For example, on weekdays, traffic flow usually increases significantly during peak hours in the morning and afternoon; on the contrary, on weekends, these peak hours are usually relatively stable. At the local scale, traffic flow may fluctuate or be disturbed due to events or special circumstances within a specific time range. In order to accurately capture the spatial heterogeneity of traffic flow under different time spans from meta-knowledge and traffic flow characteristics, a spatial weight matrix calculation module that takes into account spatial heterogeneity is designed, and a dynamic graph generation method is used to effectively aggregate node meta-knowledge and edge-element knowledge. In particular, in order to effectively capture the changing characteristics of traffic flow.
[0052] Specifically, get the feature embedding matrix for each day And the feature embedding matrix for each time interval Where emb is the embedding dimension, and is expressed as a matrix, Represents the embedding of each day or each moment, which is determined by the time step p = [t-p+1,…,t]. The daily characteristics of traffic flow are embedded and feature embedding for each time interval Perform element-wise product operation with meta-knowledge to obtain the spatiotemporal embedding matrix that integrates geographic meta-knowledge and traffic flow characteristics. Get the spatiotemporal embedding matrix, the formula is as follows,
[0053] in, represents the spatiotemporal embedding matrix; h v and h e Represent node meta-knowledge and edge meta-knowledge respectively; and They represent the feature embedding matrix for each day and the feature embedding matrix for each time interval respectively; ⊙ represents the element-wise product operation.
[0054] Step S2, using the traffic flow tensor to be completed and the spatiotemporal embedding matrix to obtain the first spatial weight matrix and the second spatial weight tensor; using the traffic flow tensor to be completed to obtain the third spatial weight tensor; constructing a tensor decomposition objective function based on the first spatial weight matrix, the second spatial weight tensor and the third spatial weight tensor.
[0055] The traffic flow tensor to be completed is split to obtain the traffic flow of N monitoring points every day. The traffic flow tensor to be completed and the traffic flow of N monitoring points every day are both recorded as traffic flow. Indicates, t represents the time span. When t=D*T, it represents the traffic flow tensor to be completed. When t=T, it represents the traffic flow of N monitoring points in one day. The value of t is D*T or T. Enter the meta-learner to obtain traffic flow characteristics. The formula is:
[0056]
[0057] Among them, I t represents the traffic flow characteristics with a time span of t; Represents traffic flow.
[0058] The traffic flow characteristics I t and the spatiotemporal embedding matrix Element-by-element multiplication generates the first spatiotemporal embedding matrix of the dynamic graph The specific formula is The heterogeneous relationship between nodes is inferred by multiplying the first spatiotemporal embedding matrix and its transpose, and a dynamic graph representing the meta-knowledge and spatial heterogeneity is constructed, and the association strength between nodes is updated. In order to facilitate the calculation of subsequent tensor decomposition, the features of the dynamic graph are normalized to generate a spatial weight matrix The formula is as follows:
[0059]
[0060] in, express The degree matrix of represents the spatial weight matrix; and They represent the first spatiotemporal embedding matrix and the transpose of the first spatiotemporal embedding matrix respectively; ReLU() represents the activation function.
[0061] When t = D*T, is the first spatial weight matrix, which represents the first spatial weight matrix corresponding to the total traffic flow of N monitoring points on D days, that is, the first spatial weight matrix corresponding to the traffic flow tensor to be completed When t = T, Represents the spatial weight matrix corresponding to the traffic flow of one day. The spatial weight matrices corresponding to each day constitute the second spatial weight tensor
[0062] The tensor decomposition model decomposes a high-order tensor into the product of a core tensor and multiple factor matrices. It can process high-dimensional sparse data and extract hidden patterns and features in the data, and is suitable for urban traffic flow completion. However, traditional tensor decomposition methods usually use static geographic feature similarity matrices for constraints, ignoring the geographic features of nodes and edges and the dynamic traffic status, which seriously affects the completion accuracy and robustness of missing data.
[0063] Therefore, the present invention proposes a tensor decomposition method for embedding spatial weight matrix, using the Tucker model to Decompose into initial core tensors And three initial factor matrices in, is the spatial factor matrix of N monitoring points, and are all time series factor matrices, It can reflect the traffic flow characteristics between different days. It can reflect the traffic flow characteristics in T time intervals of a day, the core tensor Represents the change of traffic in different space and time. Based on this, an index set Ω of known traffic is established, then The known traffic flow set can be expressed as As follows:
[0064]
[0065] The original objective function for controlling the core tensor and factor matrix decomposition error is as follows:
[0066]
[0067] in,‖.‖ 2 represents the l2 norm, is the regularization penalty term, which controls the decomposition error; λ is the parameter that controls the degree of penalty for the regularization term; by minimizing the objective function, we can obtain the optimized factor matrix And can be expressed by Complete the traffic flow tensor to be completed The missing values in N Represents the product of a tensor and a matrix; Represents a completed tensor.
[0068] In order to further obtain accurate tensor supplementation results, the present invention uses the first spatial weight matrix and a second spatial weight tensor The process of constraining tensor decomposition, where Represents the spatial weight matrix of different monitoring points, S can be converted to N×(N) T , contains the spatial weight matrix in different time intervals. It can also obtain the traffic flow tensor to be completed Spatial weights in different time intervals Recorded as the third spatial weight tensor, specifically:
[0069]
[0070] in, represents the third spatial weight tensor; represents the traffic flow tensor to be completed; represents the traffic flow data of the dth day in the traffic flow tensor to be completed; express The derivative of NND Indicates that the data in the brackets is converted to the same dimension as the second spatial weight tensor.
[0071] The tensor decomposition objective function is constructed according to the first spatial weight matrix, the second spatial weight tensor and the third spatial weight tensor. The objective function is:
[0072]
[0073] in, A set of known traffic flows representing the traffic flow tensor to be completed; represents the known traffic flow set of the completed traffic flow tensor; λ1, λ2 and λ3 respectively represent the weights of the control regularization term, and their values are obtained by experiments; and N, D, T represent the core tensor and three factor matrices respectively; S, and Represent the first spatial weight matrix, the second spatial weight tensor and the third spatial weight tensor respectively; ‖.‖ 2 represents the l2 norm.
[0074] In the formula, control The decomposition error, ‖SN×N T ‖ 2 The decomposition error of the control factor S is used to constrain the flow relationship at different locations; Control Factors The decomposition error is used to constrain the flow relationship at different times; is a regularization term to prevent the objective function from overfitting.
[0075] Step S3, use the gradient descent method to iteratively solve the tensor decomposition objective function. If the solved completed tensor meets the cutoff condition, the iteration stops and the completed tensor is output. If the number of iterations reaches the maximum and the solved completed tensor does not meet the cutoff condition, the first spatial weight matrix and the second spatial weight tensor are updated, a new tensor decomposition objective function is constructed, and the iterative solution is continued until the completed tensor that meets the cutoff condition is obtained.
[0076] In order to obtain the updated core tensor and factor matrix, the gradient descent method is used to solve the tensor decomposition objective function and obtain N,D,T,S, The partial derivative of N,D,T,S, The partial derivative of is the least squares estimate approximate solution, calculated as follows:
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083] In the formula, represents the Kronecker product of matrices, is the matrix of the tensor expanded along N dimensions, is the matrix of the tensor expanded along the D dimension, is the matrix of the tensor expanded along the T dimension, and The matrices representing the expansion of the core tensor along the N, D, and T dimensions respectively.
[0084] When the gradient descent method is used for iterative solution, the initialized core tensor, three factor matrices, the first spatial weight matrix and the second spatial weight tensor are obtained, wherein the initialized first spatial weight matrix and the second spatial weight tensor are the first spatial weight matrix and the second spatial weight tensor obtained in step S2.
[0085] Each iteration will update the core tensor, three factor matrices, the first spatial weight matrix and the second spatial weight tensor according to the partial derivatives corresponding to the core tensor, the three factor matrices, the first spatial weight matrix and the second spatial weight tensor, and use the updated core tensor and the three factor matrices to calculate the corresponding completion tensor for each iteration. The calculation of the completion tensor is: A completed tensor can be obtained after each iteration. The cutoff condition of the iteration and the maximum number of iterations are set. The cutoff condition is to calculate the sum of the differences between the traffic flow tensor to be completed and the non-missing part of the data in the completed tensor obtained in each iteration, which is recorded as the first loss. If the first loss is greater than or equal to the loss threshold, the iteration continues. If the first loss is less than the loss threshold, the iteration is stopped and the completed tensor is output. The maximum number of iterations is set to DJ, and the value of DJ is determined by the implementer according to actual conditions.
[0086] During the iterative process, if the number of iterations reaches the maximum and the cutoff condition is still not met, the first spatial weight matrix and the second spatial weight tensor need to be updated. Specifically, the parameters of the meta-learner are adjusted, and the node meta-knowledge and edge meta-knowledge are re-acquired according to the meta-learner after parameter adjustment. The updated first spatial weight matrix and the second spatial weight tensor are obtained according to the re-acquired node meta-knowledge, edge meta-knowledge, the traffic flow tensor to be completed and the meta-learner after parameter adjustment. Since the meta-learner has adjusted its parameters, the traffic flow characteristics obtained by the meta-learner will also change.
[0087] The first objective function is constructed by using the updated first spatial weight matrix and the second spatial weight tensor. Specifically, the first spatial weight matrix and the second spatial weight tensor in the tensor decomposition objective function are replaced with the updated first spatial weight matrix and the second spatial weight tensor, wherein the third spatial weight tensor in the first objective function remains unchanged; the first objective function is iteratively solved again by the gradient descent method. If the solved tensor meets the cutoff condition, the iteration stops and the completion tensor is output. If the number of iterations reaches the maximum and the solved tensor does not meet the cutoff condition, the first spatial weight matrix and the second spatial weight tensor are updated again, and the second objective function is constructed for iterative solution. The second objective function is constructed as follows: the first spatial weight matrix and the second spatial weight tensor in the tensor decomposition objective function are replaced with the first spatial weight matrix and the second spatial weight tensor after the update again; and so on, when the solved tensor meets the cutoff condition, or the number of updates of the first spatial weight matrix and the second spatial weight tensor reaches the maximum, the calculation is stopped to obtain the completion tensor. The maximum number of updates of the first spatial weight matrix and the second spatial weight tensor is GJ, and its value is determined by the implementer according to the actual situation. The first objective function and the second objective function are both constructed new tensor decomposition objective functions.
[0088] It should be noted that after updating the tensor decomposition objective function, the only updated quantities in the tensor decomposition objective function are the first spatial weight matrix and the second spatial weight tensor. The process of solving the completed tensor is a cyclic process. If the completed tensor obtained in the iterative solution using the gradient descent method does not meet the requirements, it is necessary to update the first spatial weight matrix and the second spatial weight tensor, and construct a new tensor decomposition objective function for the next gradient descent iterative solution process, and repeat the cycle until a completed tensor that meets the requirements is obtained.
[0089] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The above is a description of a specific embodiment of this specification. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0090] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0091] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A traffic flow data completion method embedded with geographic meta-knowledge, characterized in that: The method includes: Construct a structure graph, and use a meta-learner to obtain node meta-knowledge and edge meta-knowledge of nodes and edges in the structure graph; obtain a spatiotemporal embedding matrix based on the node meta-knowledge and edge meta-knowledge; The traffic flow tensor to be completed is split to obtain the traffic flow of all monitoring points every day. The traffic flow tensor to be completed and the traffic flow of all monitoring points in one day are recorded as traffic flow. Indicates that t represents the time span. When t = D*T, it represents the traffic flow tensor to be completed. When t = T, it represents the traffic flow of N monitoring points in one day. The traffic flow is input into the meta-learner to obtain traffic flow features; the traffic flow features and the spatiotemporal embedding matrix are multiplied element by element to generate the first spatiotemporal embedding matrix; The heterogeneous relationship between nodes is inferred by multiplying the first spatiotemporal embedding matrix and the transposed multiplication of the first spatiotemporal embedding matrix, a dynamic graph is constructed, and the features of the dynamic graph are normalized to generate a spatial weight matrix. When t = D*T, is the first spatial weight matrix. When t = T, Representing the spatial weight matrix corresponding to the traffic flow of one day, the spatial weight matrices corresponding to each day constitute the second spatial weight tensor; using the traffic flow tensor to be completed to obtain the third spatial weight tensor; constructing the tensor decomposition objective function according to the first spatial weight matrix, the second spatial weight tensor and the third spatial weight tensor; The tensor decomposition objective function is iteratively solved using the gradient descent method. If the solved completed tensor meets the cutoff condition, the iteration stops and the completed tensor is output. If the number of iterations reaches the maximum and the solved completed tensor does not meet the cutoff condition, the first spatial weight matrix and the second spatial weight tensor are updated. The first objective function is constructed using the updated first spatial weight matrix and the second spatial weight tensor; the first objective function is iteratively solved. If the solved completion tensor meets the cutoff condition, the iteration stops and the completion tensor is output. If the number of iterations reaches the maximum and the solved completion tensor does not meet the cutoff condition, the first spatial weight matrix and the second spatial weight tensor are updated again, and the second objective function is constructed for iterative solution. Similarly, when the solved tensor meets the cutoff condition or the number of updates of the first spatial weight matrix and the second spatial weight tensor reaches the maximum, the calculation is stopped to obtain the completion tensor.
2. According to claim 1, a method for completing traffic flow data by embedding geographic meta-knowledge is characterized in that: The structure graph uses a meta-learner to obtain node meta-knowledge and edge meta-knowledge of nodes and edges in the structure graph, including: The nodes in the structure graph represent the monitoring points in the study area, where the structure graph is a fully connected structure, and each node is connected; The feature vectors of all nodes are input into the meta-learner, and the node meta-knowledge is output; the feature vectors of all edges are input into the meta-learner, and the edge meta-knowledge is output; the meta-learner is a multi-layer perceptron; a buffer zone is constructed with the monitoring point as the center of the circle, and the feature vector of the node includes the number of POIs of each type in the buffer zone of the node, the road width, the number of intersections and the distance index, and a distance index is the normalized value of the sum of the distances from each POI point in a type of POI to the node; the feature vector of the edge includes the distance, connectivity and association strength between nodes, if the nodes are connected, the connectivity is coded as 1, if not connected, the connectivity is coded as 0, and the association strength is the sum of the distance and connectivity between the nodes.
3. The method for completing traffic flow data by embedding geographic meta-knowledge according to claim 1, characterized in that: The calculation formula of the spatiotemporal embedding matrix is: in, represents the spatiotemporal embedding matrix; h v and h e Represent node meta-knowledge and edge meta-knowledge respectively; and They represent the feature embedding matrix for each day and the feature embedding matrix for each time interval respectively; ⊙ represents the element-wise product operation.
4. The method for completing traffic flow data by embedding geographic meta-knowledge according to claim 1, characterized in that: The calculation formula of the third spatial weight tensor is: The calculation formula of the third spatial weight tensor is: in, represents the third spatial weight tensor; represents the traffic flow tensor to be completed; represents the traffic flow data of the dth day in the traffic flow tensor to be completed, and D represents the total number of days; express The derivative of NND Indicates that the data in the brackets is converted to the same dimension as the second spatial weight tensor.
5. The method for completing traffic flow data by embedding geographic meta-knowledge according to claim 1, characterized in that: The tensor decomposition objective function is: in, A set of known traffic flows representing the traffic flow tensor to be completed; represents the known traffic flow set of the completed traffic flow tensor; λ1, λ2 and λ3 represent the weights of the control regularization term respectively; and N, D, T represent the core tensor and three factor matrices respectively; S, and Represent the first spatial weight matrix, the second spatial weight tensor and the third spatial weight tensor respectively; ||.|| 2 represents the l2 norm.
6. The method for completing traffic flow data by embedding geographic meta-knowledge according to claim 1, characterized in that: The method of iteratively solving the tensor decomposition objective function by using the gradient descent method includes: According to the tensor decomposition objective function, the partial derivatives corresponding to the core tensor, three factor matrices, the first spatial weight matrix and the second spatial weight tensor are obtained; according to the partial derivatives, the core tensor, the three factor matrices, the first spatial weight matrix and the second spatial weight tensor are updated, and the completion tensor corresponding to each iteration is calculated using the core tensor and the three factor matrices updated after each iteration.
7. The method for completing traffic flow data by embedding geographic meta-knowledge according to claim 1, characterized in that: The constructing the first objective function using the updated first spatial weight matrix and the second spatial weight tensor includes: The first spatial weight matrix and the second spatial weight tensor in the tensor decomposition objective function are replaced with the updated first spatial weight matrix and the second spatial weight tensor to obtain the first objective function.
8. The method for completing traffic flow data by embedding geographic meta-knowledge according to claim 1, characterized in that: The updating of the first spatial weight matrix and the second spatial weight tensor includes: Adjust the parameters of the meta-learner, reacquire the node meta-knowledge and edge meta-knowledge according to the adjusted meta-learner, and obtain the updated first spatial weight matrix and second spatial weight tensor according to the reacquired node meta-knowledge, edge meta-knowledge, the traffic flow tensor to be completed and the adjusted meta-learner.
9. The method for completing traffic flow data by embedding geographic meta-knowledge according to claim 1, characterized in that: The cut-off conditions include: Calculate the sum of the differences between the traffic flow tensor to be completed and the non-missing data in the completed tensor obtained in each iteration, and record it as the first loss. If the first loss is greater than or equal to the loss threshold, continue the iteration. If the first loss is less than the loss threshold, stop the iteration and output the completed tensor.
Citation Information
Patent Citations
Traffic data tensor completion method based on space-time constraint
CN115630211A
Adaptive collaborative filtering with extended kalman filters and multi-armed bandits
US20170278114A1