A traffic data filling method based on context-enhanced graph network
Patent Information
- Application Number
- CN202611281492.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2046-08-24
AI Technical Summary
Existing methods fail to effectively utilize the continuous operational relationships, path or destination relationships, environmental similarity relationships, and operational status similarity relationships of the same traffic entity in multi-source traffic data scenarios. Furthermore, they do not make sufficient use of the conditional context of observed variables in the same sample, resulting in insufficient accuracy and stability of missing value completion.
A sample-variable bipartite graph is constructed and traffic business relationship enhancement edges are added. Graph neural networks are used for node representation learning, and adaptive fusion correction is performed by combining observation context and global missing rate to generate the final imputation value.
It improves the accuracy and stability of missing data completion for multi-source traffic data, effectively utilizes business association information of the same entity, the same path, similar environment and operating status, and enhances the perception of conditional dependencies between variables within the same record.
Smart Images

Figure CN122796375B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electrical data processing technology, and more specifically to a traffic data imputation method based on context-enhanced graph networks. Background Technology
[0002] With the development of traffic sensing technology, traffic data analysis has gradually shifted from single-source data to multi-source data collaborative modeling. Taking shipping scenarios as an example, Automatic Identification System (AIS) data is used to record vessel position, speed, and distance traveled; monitoring, reporting, and verification data reflect voyage transport tasks and energy consumption; and static vessel data and meteorological and sea state data describe vessel technical attributes and external environmental conditions, respectively. These data collectively form a multi-source traffic data system where transport tasks, entity attributes, operational status, and the external environment are interconnected. However, due to differences in collection frequency, recording scale, and operational definitions among different data sources, missing values inevitably appear after data fusion.
[0003] Existing methods for handling missing values in tabular data mainly fall into three categories. The first category comprises traditional statistical methods, such as mean imputation, K-nearest neighbor imputation, and iterative regression. These methods rely on statistical characteristics of variables or local numerical similarity, making it difficult to capture the complex nonlinear relationships in traffic data. The second category includes deep learning methods, such as autoencoders and generative adversarial networks. These methods can characterize complex relationships between variables, but they typically treat multi-source traffic data as general tabular data, underutilizing the traffic business connections within it. The third category consists of graph neural network-based methods. Among these, schemes such as Sample-Variable Bipartite Graph (GRAPE) connect sample nodes and variable nodes through observed values, using graph message passing to learn node representations, providing a new technical path for missing value completion in tabular data.
[0004] However, the GRAPE method and its derivatives still have two shortcomings in multi-source traffic data scenarios. First, the graph structure is mainly based on the sample-variable observation relationship, failing to incorporate the continuous operation relationship, path or destination relationship, environmental similarity relationship, and operational status similarity relationship of the same traffic entity into the graph structure. Sample nodes cannot effectively aggregate information of business-related samples. Second, when predicting missing units, it mainly relies on the embedding of target sample nodes and variable nodes, making insufficient use of the conditional context formed by other observed variables in the same sample. It is also difficult to adjust the correction intensity according to the completeness of observation information, and it is easy to introduce additional noise when there is little available observation information. These shortcomings limit the accuracy and stability of existing methods in multi-source traffic data missing data completion tasks. Summary of the Invention
[0005] To address the aforementioned problems in the existing technology, this invention proposes a traffic data imputation method based on context-enhanced graph networks, comprising the following steps: S1: Merge multi-source traffic data into a data matrix containing traffic operation records and related variables, construct an observation mask matrix to identify the observation status of data units at corresponding locations in the data matrix, and calculate the global missing rate; S2: Using each record as a sample node and each variable as a variable node, establish observation edges based on the observed values to form a sample-variable bipartite graph, and establish relationship enhancement edges between sample nodes based on traffic business relationships; S3: Input the bipartite graph and relation-enhanced edges into the graph neural network to obtain the embeddings of each sample node and variable node. Based on the missing units identified by the observation mask matrix, embed the corresponding sample node and the variable node of the variable to which the missing unit belongs into the basic decoder to obtain the basic completion value. S4: Extract the observed variables other than the target variable from the observed variables of the sample node to which the current missing unit belongs as the observation context, aggregate the context variables through the attention mechanism with the target variable node embedding as the query, and generate the observation context vector; S5: Calculate the observation coverage based on the number of observation contexts, input the sample node embedding, target variable node embedding, context vector and observation coverage into the context adapter, and generate residual correction and gating coefficients; S6: Construct adaptive fusion coefficients based on observation coverage and global missing rate, and combine them with gating coefficients to fuse residual corrections into basic imputation values; S7: Traverse each missing unit to obtain the final completion value and fill it into the corresponding position in the data matrix.
[0006] This invention captures business relationships between samples through a relation-enhancing graph neural network to generate basic estimates, and constructs an observation context using observed variables within the same sample. Then, selective incremental correction is performed through an adaptive gating residual mechanism jointly controlled by observation coverage and global missing rate, thereby achieving a synergistic improvement in the accuracy and stability of missing data completion for multi-source traffic data.
[0007] Furthermore, in step S2, the traffic business relationship includes at least one of the following types: entity continuity relationship between operation records of the same traffic entity that are adjacent in time; path or destination relationship between records with the same or similar operation paths, routes or destinations; external environment similarity relationship between records with similar weather, sea conditions or other external environmental conditions; and operation status similarity relationship between records with similar transportation tasks, load levels, operating speeds or durations.
[0008] Furthermore, for any traffic business relationship type, the relationship edge weight is calculated based on the feature distance or business attribute difference between two sample nodes under that relationship type. The smaller the feature distance or business attribute difference between the two sample nodes, the larger the relationship edge weight, and the relationship edge weight decreases exponentially with the increase of feature distance.
[0009] Further, in step S4, the attention mechanism uses the target variable node embedding after linear transformation as the query vector, and the joint encoding of the observed values of each context variable and the corresponding variable node embedding after linear transformation as the key vector. It calculates the attention score between the target variable and each context variable and obtains the attention weight by Softmax normalization. Then, it uses the joint encoding of each context variable after linear transformation as the value vector, and sums them according to the attention weight to obtain the observation context vector.
[0010] Furthermore, in step S5, the context adapter includes parallel residual generation branches and gated branches: The residual generation branch takes sample node embedding, target variable node embedding, observation context vector and observation coverage as inputs, and outputs residual correction amount; The gating branch takes sample node embedding, target variable node embedding, observation context vector and observation coverage as inputs, and after nonlinear transformation, it is mapped to the (0,1) interval through the Sigmoid function to output the gating coefficients.
[0011] Furthermore, in step S6, the adaptive fusion coefficient is constructed according to the following rules: when the observation coverage is lower than a preset threshold, the adaptive fusion coefficient is zero; when the observation coverage is not lower than the preset threshold, the adaptive fusion coefficient increases with the increase of the observation coverage and decreases with the increase of the global missing rate.
[0012] Furthermore, the adaptive fusion coefficients are calculated according to the following formula: In the formula, The adaptive fusion coefficients for the currently missing units. To observe coverage, For the preset threshold, For indicator functions, For the Sigmoid function, For coverage center parameters, This is the coverage sensitivity coefficient. The global missing rate of the current data. Adjust the weights to account for the global missing rate. This means that the calculation result will be limited to the range of 0 to 1.
[0013] Furthermore, in step S6, the final completed value is obtained by adding an incremental correction term to the basic completed value; the incremental correction term is the product of the residual correction intensity coefficient, the adaptive fusion coefficient, the gating coefficient, and the residual correction amount.
[0014] Furthermore, in step S6, when there are no observed variables other than the target variable in the sample node to which the current missing unit belongs, the observation context vector is set to a zero vector, the adaptive fusion coefficient is set to zero, and the final completion value is directly adopted from the basic completion value.
[0015] Compared with the prior art, the present invention has at least the following beneficial effects: (1) The present invention proposes a traffic data filling method based on context-enhanced graph network. By constructing a sample-variable bipartite graph and superimposing traffic business relationship enhancement edges, the graph neural network can utilize multi-dimensional business association information such as the same entity, the same path, similar environment and operating status during message transmission, which makes up for the problem of insufficient utilization of domain knowledge in pure data-driven modeling. (2) For each missing unit, the observed variables are extracted from the same sample as context, and differential attention aggregation is performed with the target variable as the guide, so that the completion process can perceive the conditional dependencies between different variables within the same record; (3) Instead of directly replacing the basic completion value generated by the graph structure with context information, the basic completion value is selectively incrementally corrected by an adaptive fusion coefficient and gating mechanism jointly controlled by observation coverage and global missing rate. Attached Figure Description
[0016] Figure 1 This is a step diagram of a traffic data imputation method based on context-enhanced graph networks. Detailed Implementation
[0017] The following are specific embodiments of the present invention, which are described in conjunction with the accompanying drawings to further illustrate the technical solutions of the present invention. However, the present invention is not limited to these embodiments.
[0018] Multi-source traffic data fusion and gap filling is a fundamental prerequisite task for the operation analysis of intelligent transportation systems. Taking shipping as an example, a complete voyage record typically involves multiple data sources: monitoring, reporting, and verification data record voyage number, vessel identification number, fuel consumption, sailing distance, and other transportation task and energy consumption information; Automatic Identification System (AIS) data provides dynamic operational information such as the vessel's position, speed, course, distance, and sailing time during the voyage; static vessel data describes the vessel's inherent technical attributes such as type, gross tonnage, deadweight tonnage, and main engine power; and meteorological and sea state data records external environmental conditions such as wind speed, wind direction, wave height, and visibility during the voyage. The collection frequency, recording scale, business scope, and spatiotemporal matching accuracy of the above four types of data vary, inevitably resulting in a large number of missing values in the complete data matrix formed after fusion. Taking fuel consumption as an example, its value is not only affected by the vessel's own technical characteristics but also closely related to the speed, sailing time, cargo load, and meteorological conditions of the sea area traversed during the same voyage. Traditional statistical methods such as mean imputation, K-nearest neighbor imputation, and multiple imputation mainly rely on the numerical distribution characteristics or local similarity of variables for estimation, making it difficult to effectively utilize the aforementioned multiple business relationships. In recent years, sample-variable bipartite graph-based completion methods have provided a new technical approach for handling missing data in tabular data. However, existing methods have not yet solved two key problems in multi-source traffic data scenarios: first, insufficient ability to explicitly introduce traffic business relationships into the graph structure; and second, insufficient utilization of conditional information of observed variables within the same sample. Therefore, this invention proposes a multi-source traffic data missing data completion method that integrates observation context and relationship enhancement graphs, such as... Figure 1 As shown, the method mainly includes the following steps: S1: Merge multi-source traffic data into a data matrix containing traffic operation records and related variables, construct an observation mask matrix to identify the observation status of data units at corresponding locations in the data matrix, and calculate the global missing rate; S2: Using each record as a sample node and each variable as a variable node, establish observation edges based on the observed values to form a sample-variable bipartite graph, and establish relationship enhancement edges between sample nodes based on traffic business relationships; S3: Input the bipartite graph and relation-enhanced edges into the graph neural network to obtain the embeddings of each sample node and variable node. Based on the missing units identified by the observation mask matrix, embed the corresponding sample node and the variable node of the variable to which the missing unit belongs into the basic decoder to obtain the basic completion value. S4: Extract the observed variables other than the target variable from the observed variables of the sample node to which the current missing unit belongs as the observation context, aggregate the context variables through the attention mechanism with the target variable node embedding as the query, and generate the observation context vector; S5: Calculate the observation coverage based on the number of observation contexts, input the sample node embedding, target variable node embedding, context vector and observation coverage into the context adapter, and generate residual correction and gating coefficients; S6: Construct adaptive fusion coefficients based on observation coverage and global missing rate, and combine them with gating coefficients to fuse residual corrections into basic imputation values; S7: Traverse each missing unit to obtain the final completion value and fill it into the corresponding position in the data matrix.
[0019] Specifically, before implementing the method of this invention, traffic data from different data sources must first be organized according to a unified recording granularity. For shipping data scenarios, the voyage is used as the basic recording unit, with each voyage number serving as a unique identifier for a traffic operation record. Various monitoring data from different sources are then correlated and aligned according to the voyage dimension. Specifically, for any given voyage, variables such as fuel consumption, distance traveled, and time are extracted from monitoring, reporting, and verification data; variables such as average speed, maximum speed, and mileage are extracted from Automatic Identification System (AIS) data; variables such as gross tonnage, deadweight tonnage, main engine power, and age of the vessel corresponding to the voyage are extracted from static vessel data; and variables such as average wind speed, maximum wind speed, and average wave height during the voyage are extracted from meteorological and sea state data. Variables from each source are correlated according to a unified voyage number, forming a data set containing... voyage records and A multi-source traffic data matrix with 1 variable ,in, This represents the value of the j-th variable recorded in the i-th flight. Since the original dimensions of each variable are different, continuous variables need to be standardized or normalized before being included in the model, and categorical variables need to be numerically encoded to eliminate the adverse effects of dimension differences on model training. Simultaneously, an observation mask matrix is constructed based on the actual observation status of each data unit. ,in express These are the observed values. express This represents a missing value. The mask matrix is used uniformly as the basis for determining the observation state in subsequent bipartite graph construction, observation context extraction, and model training.
[0020] In the graph structure construction phase, each voyage record is set as a sample node, and each voyage-related variable is set as a variable node, thus forming two sets of heterogeneous nodes. For any observed unit in the matrix... In its corresponding sample node With variable nodes An observation edge is established between the observed units, and the standardized value of the unit is used as the edge attribute. After traversing all observed units, the basic structure of the sample-variable bipartite graph is formed. On this basis, relationship enhancement edges are further established between sample nodes according to traffic business relationships. The selection of traffic business relationships can be flexibly configured according to specific application scenarios and data conditions, and one or more of the following four types are preferred for construction: First, entity continuity relationship edges, used to connect voyage records of the same vessel that are adjacent or close in time. This relationship reflects the continuity of the operation of the same transportation entity between different voyages and can be determined based on the vessel identification number and voyage time. Second, path or destination relationship edges, used to connect records with the same or similar operating paths, routes or destinations. This relationship reflects the spatial similarity of transportation tasks and can be determined based on the origin and destination ports or route numbers. Third, external environment similarity relationship edges, used to connect records with similar weather, sea state or other external environmental conditions. This relationship reflects the similarity of external constraints of navigation conditions and can be determined based on the characteristic distance of environmental variables such as wind speed and wave height. Fourth, similarity edges in operational status are used to connect records with similar transportation tasks, load levels, operating speeds, durations, or other operational states. This relationship reflects the similarity of ship operating conditions and can be determined based on characteristic distances of operational variables such as deadweight tonnage, speed, and sailing time. For any two relationship types, corresponding business rules or nearest neighbor filtering rules are preset to determine the sample node pairs that need to be connected. For relationship type r, the two sample nodes to be connected are determined. and Based on the differences in business attributes or feature distance between the two parties under this relationship type. Calculate relation edge weights ,in The decay scale parameter under relation type r indicates that the smaller the feature distance or business attribute difference between two samples, the higher their business correlation, and the larger the corresponding relation edge weight. The edge weight decays exponentially with increasing feature distance. This exponential decay ensures that closer samples receive a larger edge weight contribution while avoiding the introduction of excessive noise from farther samples. When multiple relation types are used simultaneously, multiple different types of relation edges may exist between the same pair of sample nodes. In this case, all relation edges participate in information aggregation simultaneously in subsequent graph message passing, enabling sample nodes to receive information from different related samples from multiple business dimensions.
[0021] After constructing the graph structure, the sample-variable observation edges and the edges enhancing the relationships between samples are input into the graph neural network for node representation learning. The graph neural network adopts a multi-layer message-passing architecture, in which sample nodes and variable nodes alternately aggregate and update information in each layer. For sample nodes, let... Let be the current layer number of the graph neural network, then its is in the _th ... The layer's embedding update receives information from two sources: one is observation information transmitted from connected variable nodes via observation edges, where the observed values of the sample on each variable are encoded by the variable nodes and then transmitted back to the sample node; the other is business relationship information transmitted from other business-related sample nodes via relationship enhancement edges, where the current embeddings of related samples are aggregated to the current sample node after weighted edge calculation. The sample node's update function fuses these two types of information with the current embedding to generate a new embedding representation for that layer. The variable node's update mainly aggregates information from connected sample nodes, receiving the value information of each sample on the variable through observation edges, thereby obtaining an embedding representation that reflects the semantics of the variable and its observation distribution characteristics. After multiple layers of message passing iterations, each sample node and each variable node obtains a final embedding representation containing multi-source information. The embedding of a sample node integrates its own observation features, the semantic features of connected variables, and the structural features of business-related samples, while the embedding of a variable node integrates its value distribution characteristics and related sample features.
[0022] After obtaining the final embeddings of the sample nodes and variable nodes, for any missing unit to be completed, the corresponding sample node embedding and variable node embedding are concatenated and input into the basic decoder. The basic decoder adopts a multilayer perceptron structure, containing at least one layer of nonlinear transformation, which maps the input concatenated vector to the value space of the target variable, and outputs the basic completion value generated by the relationship-enhancing graph neural network. The calculation process of this basic completion value utilizes sample-variable observation information and traffic business relationship information between samples, reflecting the best estimate of the missing unit from the perspective of global graph structure.
[0023] Building upon this, we further construct and extract the observation context for the missing unit. For the j-th target variable in the i-th flight record, we extract the values of all observed variables other than the target variable j and their corresponding variable indices to form an observation context set. Based on the number of observed variables in this set... Calculate observation coverage This ratio reflects the sufficiency of conditional information in the target sample that can be used to aid in completion. For each context variable k in the context set, its observed values are... Embedded with the corresponding variable node Joint encoding is performed to obtain a comprehensive representation of the context variable. Then, the target variable's variable node embedding, after linear transformation, is used as the query vector, and the comprehensive representation of each context variable, after linear transformation, is used as the key vector. Attention scores between the target variable and each context variable are calculated, and then normalized using Softmax to obtain attention weights. These attention weights reflect the contribution of each context variable to the estimation of the target variable's value under the current semantic conditions. Based on this, the comprehensive representation of each context variable, after linear transformation, is used as the value vector, and a weighted sum is obtained according to the aforementioned attention weights to obtain the observation context vector corresponding to the current missing unit. This context vector is a condensed expression of the observed conditional information within the target sample for the current target variable, preserving the differentiated influence of different context variables on the target variable. When there are no observed variables other than the target variable in the target sample, the context set is empty. In this case, the observation context vector is set to zero, and context residual correction is disabled in subsequent processing.
[0024] Embedding sample nodes Target variable node embedding Observation context vector and observation coverage A common input context adapter. The context adapter consists of two parallel branches. The residual generation branch... Given four inputs, the system outputs a residual correction to the base complement value through a multi-level nonlinear transformation. ,in The residual generation function, denoted as , reflects the incremental adjustment to the global graph structure estimation result inferred from the observation context within the same sample. Its value can be positive or negative, and the specific value is determined by training data-driven learning. The gating branch, conditioned on four identical inputs, undergoes independent multi-level nonlinear transformations and is then mapped to the (0,1) interval via the Sigmoid function, outputting gating coefficients. ,in For gated generation functions, The sigmoid function maps any real number to the (0,1) interval, allowing the gating coefficients to have a probabilistic interpretation. The gating coefficients characterize the reliability of the residual correction output by the current context adapter: when the context information is strongly correlated with the target variable and noise interference is low, the gating coefficients approach 1, allowing the residual correction to be injected at a relatively high proportion; when the context information is insufficient to support reliable correction judgments, the gating coefficients approach 0, suppressing the injection of residual correction. The residual generation branch and the gating branch are computed in parallel, without interference, sharing input but learning parameters independently.
[0025] Obtaining the residual correction amount and gating coefficient Then, construct adaptive fusion coefficients. To further control the injection strength of context correction, adaptive fusion coefficients are constructed according to the following rules. First, the observation coverage is determined. Is it below the preset threshold? If the value is below this threshold, it indicates that the available context information in the current target sample is too sparse to generate a reliable correction signal. In this case, the adaptive fusion coefficient is directly set to zero, completely suppressing context residual correction. If the observation coverage is not lower than the preset threshold, then the observation coverage is used as the basis for the correction. Center parameter, with The value mapped by the Sigmoid function to the sensitivity coefficient is the base term. Then multiply by the global missing rate penalty term. ,in This represents the global missing rate of the current data matrix, which is the ratio of the total number of missing cells to the total number of cells in the matrix. The weights are adjusted to a preset global missing rate, with values ranging from [0,1]. The final product is then constrained to the [0,1] interval. The global missing rate penalty term means that the higher the global missing rate, the less observational information is available in the entire dataset, and the lower the reliability of the correction signal generated based on the observation context. Therefore, the value of the adaptive fusion coefficient is reduced accordingly. The penalty term is 1 when the data is completely complete and without missing data. The time penalty term is 0. Based on the above construction rules, the adaptive fusion coefficient... The formula for calculation is: , in, This is an indicator function that takes the value 1 when the condition is met and 0 otherwise. This is an interval truncation function that restricts input values to between 0 and 1. The physical meaning of this formula is clear: when the observation coverage is below a threshold, context correction is completely turned off (hard threshold control); when the observation coverage is sufficient, context correction is allowed to be injected with a controlled intensity (soft decay control); and the higher the global missing rate, the lower the overall correction intensity (global condition control). The typical value can be selected based on the completion performance on the validation set; The coverage center parameter represents the median point of the Sigmoid function; As a coverage sensitivity coefficient, it controls the steepness of the Sigmoid function near the center point. The larger the value, the more sensitive the fusion coefficient is to changes in coverage. The smaller the value, the smoother the change. The settings are based on the sensitivity requirements for the global missing rate.
[0026] The final completion value is derived from the base completion value. This is obtained by adding the incremental correction term. The incremental correction term is the residual correction strength coefficient. Adaptive fusion coefficient Gating coefficient With residual correction The product of the four is Among them, the residual correction intensity coefficient These are preset positive hyperparameters used to adjust the overall range of context residual correction. Context correction is completely off when The residual correction is amplified and can be adjusted based on performance on the validation set. As can be seen from the calculation formula, the basic completion value is always used as the baseline term for the final prediction, and the residual correction is only added incrementally rather than replaced. This ensures that even in the extreme case where the context signal is completely missing, the model can still output the basic estimate provided by the graph structure information. Adaptive fusion coefficients Controlling the correction strength from the perspective of data conditions, the gating coefficient The model-judgment dimension controls the reliability of the correction, and the two together form a product to constitute a double constraint on the residual correction amount, realizing the coordinated use of global graph structure information and local observation condition information. When the observation coverage is below the threshold... The final completion value degenerates into the basic completion value; when the observation coverage is sufficient but the gating coefficient is close to 0, the model judges the current context as unreliable, and the final completion value also approaches the basic completion value; only when the observation coverage is sufficient and the gating coefficient is close to 1, the context correction is injected with full strength.
[0027] During model training, a portion of the observed units in the training data are randomly selected and artificially masked, with the original observations of the masked units serving as supervision labels. The artificially masked units are not used as input edges during graph structure construction, nor are they included in the context set during context extraction. This forces the model to learn to reconstruct missing data using other information when the target value is not visible. Unmasked observed units in the training data are used normally to construct observation edges and observation context. To further enhance the model's generalization ability and adaptability to missing patterns, a portion of the observation edges can be randomly masked in each training epoch according to a preset ratio, allowing the model to face different observation structures in different epochs and reducing dependence on fixed combinations of observation edges. The model's training loss function is the sum of the mean squared error between the predicted and true values (weighted by variable weights) and the regularization term of the model parameters. Specifically, the supervision set consists of artificially masked units and observed units participating in reconstruction constraints. The loss function is: , in, Let be the model's predicted value for the j-th variable in the i-th record. For the corresponding actual observed values, Here, the loss weight corresponds to the j-th variable and is used to adjust the fitting priority of different variables. The regularization coefficient is . For all learnable parameters of the model, This is the L2 regularization term. The model uses the backpropagation algorithm for parameter optimization and iterative training until the loss function converges.
[0028] After model training is complete, the multi-source traffic data matrix to be completed and its corresponding observation mask matrix are input into the trained model. All missing units in the matrix are iterated sequentially, and the final completion value is calculated for each missing unit according to the aforementioned context extraction, attention aggregation, residual generation, and adaptive fusion processes. For observed units already present in the original data matrix, their original values are preserved without any replacement or modification. After iteration, continuous variables are de-standardized or de-normalized to restore their original dimensions, and categorical variables are restored to their original class labels based on their original encoding mapping. Finally, a complete multi-source traffic dataset with the same structure and dimensions as the original data matrix is output for subsequent tasks such as traffic energy consumption estimation, emissions accounting, and operational analysis.
[0029] In summary, this invention constructs a sample-variable bipartite graph and overlays multiple traffic business relationship enhancement edges, enabling the graph neural network to utilize multi-dimensional business association information such as the same entity, the same path, similar environment, and operational status during message transmission. This compensates for the insufficient utilization of domain knowledge in pure data-driven modeling. Simultaneously, for each missing unit, observed variables are extracted from the same sample as context, and differentiated attention aggregation is performed guided by the target variable, allowing the completion process to perceive the conditional dependencies between different variables within the same record. Furthermore, this scheme does not directly replace the basic completion value generated by the graph structure with context information. Instead, it selectively incrementally corrects the basic completion value through an adaptive fusion coefficient and gating mechanism jointly controlled by observation coverage and global missing rate: when the context is sufficient, in-line conditional information is appropriately introduced to improve accuracy; when the context is sparse or global missing is severe, the correction is automatically reduced or even turned off, ensuring the model remains stable even with insufficient information.
[0030] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a specific posture. If the specific posture changes, the directional indication will also change accordingly.
[0031] Furthermore, in this invention, descriptions involving terms such as "first," "second," and "a" are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0032] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0033] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
Claims
1. A traffic data imputation method based on context-enhanced graph networks, characterized in that, Including the following steps: S1: Merge multi-source traffic data into a data matrix containing traffic operation records and related variables, construct an observation mask matrix to identify the observation status of data units at corresponding locations in the data matrix, and calculate the global missing rate; S2: Using each record as a sample node and each variable as a variable node, establish observation edges based on the observed values to form a sample-variable bipartite graph, and establish relationship enhancement edges between sample nodes based on traffic business relationships; S3: Input the bipartite graph and relation-enhanced edges into the graph neural network to obtain the embeddings of each sample node and variable node. Based on the missing units identified by the observation mask matrix, embed the corresponding sample node and the variable node of the variable to which the missing unit belongs into the basic decoder to obtain the basic completion value. S4: Extract the observed variables other than the target variable from the observed variables of the sample node to which the current missing unit belongs as the observation context, aggregate the context variables through the attention mechanism with the target variable node embedding as the query, and generate the observation context vector; S5: Calculate the observation coverage based on the number of observation contexts, input the sample node embedding, target variable node embedding, context vector and observation coverage into the context adapter, and generate residual correction and gating coefficients; S6: Construct adaptive fusion coefficients based on observation coverage and global missing rate, and combine them with gating coefficients to fuse residual corrections into basic imputation values; S7: Traverse each missing unit to obtain the final completion value and fill it into the corresponding position in the data matrix; In step S5, the context adapter includes parallel residual generation branches and gated branches: The residual generation branch takes sample node embedding, target variable node embedding, observation context vector and observation coverage as inputs, and outputs residual correction amount; The gating branch takes sample node embedding, target variable node embedding, observation context vector and observation coverage as inputs, and after nonlinear transformation, it is mapped to the [0,1] interval by the Sigmoid function to output the gating coefficients. In step S6, the adaptive fusion coefficient is constructed according to the following rule: when the observation coverage is lower than a preset threshold, the adaptive fusion coefficient is zero. When the observation coverage is not lower than the preset threshold, the adaptive fusion coefficient increases with the increase of the observation coverage and decreases with the increase of the global missing rate. The adaptive fusion coefficient is calculated according to the following formula: In the formula, The adaptive fusion coefficients for the currently missing units. To observe coverage, For the preset threshold, For indicator functions, For the Sigmoid function, For coverage center parameters, This is the coverage sensitivity coefficient. The global missing rate of the current data. Adjust the weights to account for the global missing rate. This means that the calculation result will be limited to the range of 0 to 1.
2. The traffic data imputation method based on context-enhanced graph networks as described in claim 1, characterized in that, In step S2, the traffic business relationship includes at least one of the following types: entity continuity relationship between operation records of the same traffic entity that are adjacent in time; path or destination relationship between records with the same or similar operation paths, routes or destinations; external environment similarity relationship between records with similar weather, sea conditions or other external environmental conditions; and operation status similarity relationship between records with similar transportation tasks, load levels, operating speeds or durations.
3. The traffic data imputation method based on context-enhanced graph networks as described in claim 2, characterized in that, For any traffic business relationship type, the relationship edge weight is calculated based on the feature distance or business attribute difference between two sample nodes under that relationship type. The smaller the feature distance or business attribute difference between the two sample nodes, the larger the relationship edge weight, and the relationship edge weight decreases exponentially with the increase of feature distance.
4. The traffic data imputation method based on context-enhanced graph networks as described in claim 1, characterized in that, In step S4, the attention mechanism uses the target variable node embedding after linear transformation as the query vector, and the joint encoding of the observed values of each context variable and the corresponding variable node embedding after linear transformation as the key vector. It calculates the attention score between the target variable and each context variable and obtains the attention weight by Softmax normalization. Then, it uses the joint encoding of each context variable after linear transformation as the value vector, and sums them according to the attention weight to obtain the observation context vector.
5. The traffic data imputation method based on context-enhanced graph networks as described in claim 1, characterized in that, In step S6, the final completed value is obtained by adding an incremental correction term to the basic completed value; the incremental correction term is the product of the residual correction strength coefficient, the adaptive fusion coefficient, the gating coefficient, and the residual correction amount.
6. The traffic data imputation method based on context-enhanced graph networks as described in claim 1, characterized in that, In step S6, when there are no observed variables other than the target variable in the sample node to which the current missing unit belongs, the observation context vector is set to zero, the adaptive fusion coefficient is set to zero, and the final completion value is directly adopted from the basic completion value.
Citation Information
Patent Citations
Time sequence continuous missing value intelligent filling method and system based on context awareness generative adversarial network
CN122332724A
Power grid data missing complementation method for adversarial generative network and graph embedding
CN122364667A
