Regional coal price difference prediction method based on graph neural network
By constructing a multi-layered coal logistics graph and a spatiotemporal neural network, the directionality of price transmission and transportation delays are explicitly captured, solving the problems of large errors and lag in coal price difference prediction in existing technologies, and realizing robust price difference prediction and abnormal link identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUADIAN GROUP BEIJING FUEL LOGISTICS CO LTD
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies lack graph awareness in coal price spread prediction, do not explicitly encode the topology of the coal logistics network, and ignore transportation time lags, resulting in large prediction errors, slow response, and poor performance under sparse data.
A multi-layered coal logistics graph structure is constructed, and a spatiotemporal graph neural network is used for price spread prediction. By association mining and virtual edge construction, the directionality of price transmission and transportation delay are explicitly captured. Combined with sparse graph learning and delay-aware message passing, the price spread prediction results are optimized.
It achieves accurate and timely coal price difference prediction, meets economic and physical constraints, improves the robustness of the model under network disturbances and data anomalies, and can identify and correct abnormal transmission links.
Smart Images

Figure CN121921050A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of coal price spread prediction technology, and more specifically, to a regional coal price spread prediction method based on graph neural networks. Background Technology
[0002] Coal prices across different logistics hubs (including mines, railway hubs, ports, and power plants) exhibit cross-regional price differences, which are influenced by transportation costs, network congestion, inventory imbalances, and demand shocks. Traditional price spread forecasting methods typically model each location in isolation or use coarse spatial proxy variables, leading to inaccurate short-term price spread forecasts, delayed responses to network disturbances, and instability when data is sparse or missing.
[0003] In price spread prediction methods, existing well-known technologies include: Graph Neural Networks (GNNs): a class of neural architectures defined on graph-structured data. In this architecture, nodes exchange "messages" along "edges" and update their hidden representations through learnable aggregation functions. Spatio-temporal Graph Neural Networks (ST-GNNs): an extension of GNNs. It combines graph message passing mechanisms with temporal modeling modules (e.g., GRUs, gated recurrent units; or TCNs, temporal convolutional networks) to handle time-varying graphs and dynamic node / edge features. Price Spread: the difference in prices observed at two different locations. In the coal sector, feasible price spreads are constrained by transportation costs, transit times, and delivery delays on the target logistics network. Coal Logistics Graph: an abstract graph representation of the coal supply chain. Nodes correspond to mines, railway hubs, inland river ports, seaports, and power plants; directed edges correspond to transportation routes, such as railway lines, inland waterway sections, coastal routes, and road transport routes. Edges are typically associated with a range of attributes, including freight rates, transit times, available capacity, congestion levels, and queue lengths. Classical prediction models refer to time series methods, such as ARIMA (Autoregressive Integral Moving Average) and VAR (Video Autoregressive); and recurrent neural networks, such as LSTM (Long Short-Term Memory), supplemented by exogenous variables. In most existing applications, each location is modeled as an independent time series, with models sharing only common covariates, without explicitly representing the transportation network connecting the various locations.
[0004] The existing technical solutions most relevant to this invention are mainly divided into two categories. One category is: multivariate time series models and exogenous variables, whose method steps are: (1) For each region, construct a feature sequence containing local prices, inventory, meteorological indicators and macroeconomic indices. (2) Train a multivariate time series model (e.g. LSTM or Transformer) to predict the future prices of each region. (3) Derive the regional price difference after the fact by subtracting the predicted prices of two regions. In this type of method, each region corresponds to an independent output head, and the spatial structure is only implicitly reflected through shared covariates. The model does not explicitly construct a coal logistics map, does not model the "edge" level attributes, and does not characterize the directionality or propagation delay of price transmission along the transportation trunk line. The other category is: spatiotemporal graph models for traffic flow prediction, whose method steps are: (1) Construct a graph based on road adjacency, where nodes represent traffic sensors and edges are used to encode the static connection relationship between road segments. (2) Apply spatiotemporal GNN architectures, such as Diffused Recurrent Convolutional Networks (DCRNN) or Spectral Spatiotemporal Graph Convolutional Networks (ST-GCN), and typically combine them with RNN or TCN temporal modules to predict future traffic speeds or flows at each node. (3) Optimize the node-wise regression loss (e.g., mean squared error, MSE) for the predicted sensor values and observations. Such methods possess powerful spatiotemporal modeling capabilities, but their application is specialized to traffic variables on physical road networks. Their "edges" are typically static and untyped, rarely incorporating specific domain economic quantities (e.g., freight costs or transport capacity). Their prediction targets are node-level physical variables (speed or flow), rather than the price differences constrained by arbitrage conditions and inter-regional freight boundaries that this invention focuses on.
[0005] Based on the foregoing analysis, the shortcomings of existing technologies can be summarized as follows: (1) Lack of graph awareness in prediction: LSTM or Transformer models that rely on exogenous variables do not explicitly encode the topology of the coal logistics network, especially ignoring the directionality of logistics channels and transportation time delays. As a result, the predicted cross-regional price differences often contradict the observable transportation modes and exhibit significant errors when the network is disturbed (e.g., line closures or sudden reductions in capacity). (2) Ignoring message passing of "edge" information: Existing spatiotemporal GNNs oriented towards traffic flow typically operate on static, weakly typed adjacency graphs. They lack rich "edge" attributes to distinguish different transportation modes (e.g., rail, barge, coastal shipping, highway) and their time-varying costs and delays. This deficiency limits their applicability to the coal price formation mechanism, because in the coal sector, the economic characteristics of the "edge" level are the core driving factors of price difference dynamics. (3) Lagging response to shocks: Due to the lack of an explicit delayed perception propagation mechanism along directed channels, supply or demand shocks at source nodes require multiple time steps to indirectly affect the prediction of target nodes. This results in a sluggish response and inaccurate timing of the model to price spreads. (4) Unconstrained learning process: Existing models typically optimize unconstrained regression loss functions. The resulting price spread predictions may exceed reasonable freight boundary limits, or imply continuous arbitrage opportunities, or even violate basic flow conservation relationships. This will increase prediction errors and reduce model stability under volatile market conditions. (5) Vulnerability to sparse or noisy data: When key regional indicators such as inventory or TP throughput data are sparse, lagging, or noisy, the ability of node-by-node models to compensate for information using network structure is limited. Without layer-level information redundancy and a propagation mechanism along channels, the model's prediction performance will deteriorate sharply in data-scarce environments.
[0006] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention
[0007] To address the problems in related technologies, this invention proposes a regional coal price difference prediction method based on graph neural networks, in order to overcome the aforementioned technical problems existing in the current related technologies.
[0008] Therefore, the specific technical solution adopted by the present invention is as follows:
[0009] A regional coal price spread prediction method based on graph neural networks includes the following steps:
[0010] S1. Obtain coal logistics data, preprocess the coal logistics data to obtain preprocessed coal logistics data, and construct a coal logistics map based on the preprocessed coal logistics data.
[0011] S2. Perform correlation mining on the coal logistics map and generate a potential correlation map based on the correlation mining results. Overlay the coal logistics map with the potential correlation map to obtain a multi-layer coal logistics map structure.
[0012] S3. Input the multi-layer coal logistics diagram structure into the spatiotemporal neural network model to generate the potential representation of the nodes. Perform anomaly transmission analysis based on the potential representation of the nodes to obtain candidate anomaly transmission links. Then, perform price difference prediction and correction based on the candidate anomaly transmission links to obtain the optimized price difference prediction value.
[0013] Furthermore, coal logistics data is acquired, preprocessed, and then a coal logistics map is constructed based on this preprocessed data, including:
[0014] S11. Obtain coal logistics data, clean the coal logistics data to obtain cleaned coal logistics data, and align the cleaned coal logistics data to obtain pre-processed coal logistics data.
[0015] S12. Based on the preprocessed coal logistics data, construct the node set and directed edge set of coal logistics, and construct a coal logistics graph with timestamps based on the node set and directed edge set.
[0016] Furthermore, correlation mining is performed on the coal logistics map, and a potential correlation map is generated based on the correlation mining results. The coal logistics map is then overlaid with the potential correlation map to obtain a multi-layered coal logistics map structure, including:
[0017] S21. Based on the nodes of the coal logistics map, construct a regression model, use the regression model to remove global and regional common factors of the nodes in the coal logistics map, and generate residual space.
[0018] S22. In the residual space, the potential association structure between all nodes in the coal logistics graph is jointly inferred using the sparse graph learning method with structural constraints, and the symmetric weight matrix is obtained by solving.
[0019] S23. Based on the symmetric weight matrix, the node pairs that meet the preset conditions are used as candidate potential association pairs to generate virtual edges, and a potential association graph is constructed. The coal logistics graph and the potential association graph are overlaid hierarchically to obtain a multi-layer coal logistics graph structure.
[0020] Furthermore, the optimized solution expression for the symmetric weight matrix is as follows:
[0021] ;
[0022] In the formula, Represents a symmetric weight matrix; Represents a node The residual sequence; Represents the weight of a potential associated edge from node u to node v; Represents the residual sequence of node u; Represents the sparse regularization coefficient; Represents the topology consistency regularity coefficient; This represents the topology consistency penalty; u represents the source node; v represents the target node.
[0023] Furthermore, the multi-layered coal logistics graph structure is input into a spatiotemporal neural network model to generate latent representations of nodes. Based on these latent representations, anomaly transmission analysis is performed to obtain candidate anomaly transmission links. Price difference prediction and correction are then performed based on these candidate links to obtain optimized price difference prediction values, including:
[0024] S31. Input the multi-layer coal logistics graph structure into the delayed-aware spatiotemporal graph neural network model, and implement delayed-aware message passing based on the spatiotemporal graph neural network model to obtain the message set of neighboring nodes, and combine attention aggregation to generate the potential representation of the nodes.
[0025] S32. Based on the potential representation of nodes, identify abnormal target nodes and perform abnormal transmission chain tracing analysis on abnormal target nodes to obtain candidate abnormal transmission links.
[0026] S33. Construct a soft shortest path cost estimate based on candidate abnormal transmission links, and combine it with the price difference prediction header to predict the price difference, obtain the initial price difference prediction result, and perform structured error reconstruction and differentiability optimization on the initial price difference prediction result to obtain the optimized price difference prediction value.
[0027] Furthermore, the multi-layered coal logistics graph structure is input into a delayed-aware spatiotemporal graph neural network model, and delayed-aware message passing is implemented based on the spatiotemporal graph neural network model to obtain the message set of neighboring nodes. This is then combined with attention aggregation to generate the latent representations of the nodes, including:
[0028] S311. A delay-aware spatiotemporal graph neural network model is used to define dynamic transportation delay for each directed edge of a multi-layer coal logistics graph structure, and the dynamic transportation delay is used as a learnable function of edge attributes.
[0029] S312. Based on a learnable function, perform linear interpolation between the nearest discrete-time indices in the preset circular buffer, and retrieve the delayed source state.
[0030] S313. Combine the delayed source state with the edge type weight matrix and the edge gating of local features, and calculate the message from the source node to the target node to obtain the message set of the neighboring nodes.
[0031] S314. Use attention aggregation to combine the message sets of neighboring nodes to generate weighted messages, and fuse the spatial context of the weighted messages with the historical memory state of the nodes, and drive the dynamic evolution of the node's potential state in the time dimension to generate the node's potential representation.
[0032] Furthermore, based on the potential representations of nodes, abnormal target nodes are identified, and abnormal transmission chain tracing analysis is performed on the abnormal target nodes to obtain candidate abnormal transmission links, including:
[0033] S321. Utilize the price difference prediction residual and a robust scalarization function to perform node-level anomaly measurement calculation on the potential representation of nodes, and identify abnormal target nodes based on the node-level anomaly measurement combined with a preset dynamic threshold to obtain an abnormal target node set.
[0034] S322. Construct the edge-level instantaneous transmission strength based on the edge gating coefficient, attention weight, and source node historical state under the effect of score delay generated during message transmission, and conduct a comprehensive influence assessment of the edge-level instantaneous transmission strength along the multi-hop path from the upstream node to the abnormal target node to obtain the comprehensive contribution of the price difference state.
[0035] S323. Using the set of valid paths with the abnormal target node as the endpoint and consistent time as candidates, and combining the comprehensive contribution and the path-level symbol weight of the path direction with the abnormal direction to construct an abnormal transmission optimization problem, optimize and solve the abnormal transmission optimization problem to obtain the most compact transmission subgraph.
[0036] S324. Based on the most compact transmission subgraph, calculate the abnormal link score for each edge, and sort the edges in the most compact transmission subgraph in descending order according to the abnormal link score results to obtain candidate abnormal transmission links.
[0037] Furthermore, the expression for the anomaly transport optimization problem is:
[0038] ;
[0039] In the formula, This represents a directed subgraph containing a set of candidate edges; This represents the set of valid paths within a subgraph that have all abnormal target nodes v as their endpoints and are consistent in time. This indicates that the path-level symbol weights are given by combining the anomaly direction and the path direction; This represents a measure of subgraph complexity. This represents the threshold for controlling the size of the source tracing subgraph; This indicates that path P is related to the abnormal target node v at time 1. The overall contribution of the price spread status; This represents the set of all edges in a multi-layered coal logistics graph structure.
[0040] Furthermore, a soft shortest path cost estimate is constructed based on candidate abnormal transmission links, and a price difference prediction is performed using the price difference prediction header to obtain an initial price difference prediction result. The initial price difference prediction result is then subjected to structured error reconstruction and differentiability optimization to obtain optimized price difference prediction values, including:
[0041] S331. Extract the embedded representation of nodes based on candidate abnormal transmission links, and calculate the cost of each edge by combining edge freight rate and duration;
[0042] S332. Construct a differentiable soft shortest path cost estimate based on the cost of all paths and each edge of the candidate abnormal transmission link, and input the node embedding representation and the soft shortest path cost estimate into the price difference prediction head of the sensing path to generate the initial price difference prediction result.
[0043] S333. Construct a convex quadratic programming problem based on the initial price difference prediction results, and solve the convex quadratic programming problem through a differentiable optimization layer to obtain the corrected price difference. Then, correct the initial price difference prediction results based on the corrected price difference to obtain the optimized price difference prediction value.
[0044] Furthermore, a convex quadratic programming problem is constructed based on the initial price spread prediction results. This problem is then solved using a differentiable optimization layer to obtain the corrected price spread. The initial price spread prediction results are then corrected based on this corrected price spread, resulting in optimized price spread prediction values, including:
[0045] S3331. Using the initial price difference prediction result as the prior and the corrected price difference as the optimization variable, a convex optimization problem with economic and physical constraints is constructed by introducing an arbitrage penalty term and a flow conservation deviation term.
[0046] S3332. Apply three types of linear constraints to the convex optimization problem to obtain a convex quadratic programming problem. Solve the convex quadratic programming problem through a differentiable optimization layer to obtain the corrected price difference.
[0047] S3333: The corrected price difference and the error of the actual observation are included in the total loss. The spatiotemporal graph neural network model, the price difference prediction head and the optimization layer parameters are updated by joint backpropagation. The price difference is corrected by forward inference to obtain the optimized price difference prediction value.
[0048] The beneficial effects of this invention are as follows:
[0049] 1. This invention solves the problem of accurate and timely prediction of regional coal price differences by using a multi-layer coal logistics graph structure and a spatiotemporal graph neural network model. The approach is to construct a spatiotemporal prediction model that can perceive the transportation network to explicitly capture the directionality and propagation delay of price transmission along the logistics trunk line; and to integrate the attributes of the "edge" level in the logistics network, including but not limited to freight rates, effective transport capacity, and transport time; at the same time, to embed basic economic logic and physical consistency constraints into the training and inference process of the model to ensure that the model output is consistent with logistics costs and can fit the conservation relationship.
[0050] 2. This invention achieves edge-by-edge, differentiable fractional-order delays through transport delays and circular buffers, and uses these delays to retrieve the potential state of the source node during message passing. Combined with gated message passing, this enables transport mode-specific propagation behavior for different transport corridors (such as railways, barges, offshore shipping, and highways).
[0051] 2. This invention employs structured error reconstruction and differentiable optimization. First, a spatiotemporal graph neural network and a price difference prediction head provide prior predictions of node price differences and path costs. Then, a quadratic programming problem is solved under constraints of no arbitrage, soft boundary freight costs, and approximate flow conservation to structurally correct the initial price difference. This optimization is embedded in the training process in a differentiable manner, ensuring that the final output price difference approximates the observed data while satisfying economic and physical constraints, thus maintaining better robustness under network disturbances and data anomalies.
[0052] 3. This invention, through potential association mining and virtual edge construction, first removes macroeconomic and common factors from the node price sequence, and then infers potential associations between nodes in the residual space through sparse graph learning with structural constraints. Subsequently, "virtual edges" are generated based on the obtained weight matrix and superimposed with the physical transportation graph to form a multi-layer graph structure. The delayed-aware graph neural network performs message passing on both the physical and potential layers, and achieves data-driven layer weight learning through inter-layer gating, thereby surpassing conventional schemes that rely solely on physical topology in terms of graph construction performance and quality.
[0053] 4. This invention employs anomaly transmission chain tracing analysis based on delay-aware message passing. It utilizes internal quantities of delay-aware message passing for path-level analysis of abnormal price differences. When anomalies in price differences at target nodes are detected, it comprehensively utilizes edge gating, attention weights, and fractional delays to construct a path influence index. Through budget-constrained path subgraph optimization, it automatically selects the upstream transmission link most strongly explanatory to the anomaly. Furthermore, it generates anomaly link scores for each edge to support capacity scheduling, flow control optimization, and risk warning, distinguishing it from conventional anomaly detection methods based on static graphs or simple correlation analysis. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a flowchart of a regional coal price difference prediction method based on graph neural networks according to an embodiment of the present invention;
[0056] Figure 2 This is a block diagram illustrating the principle of a regional coal price difference prediction system based on a graph neural network according to an embodiment of the present invention.
[0057] Figure 3 This is a schematic diagram of the hardware operating environment involved in the embodiments of the present invention;
[0058] Figure 4 This is a general framework diagram of a regional coal price difference prediction method based on graph neural networks according to an embodiment of the present invention;
[0059] Figure 5 This is a flowchart of step S3 in the regional coal price difference prediction method based on graph neural networks according to an embodiment of the present invention.
[0060] In the picture:
[0061] 1. Coal logistics map construction module; 2. Potential correlation map generation module; 3. Price difference prediction module. Detailed Implementation
[0062] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention.
[0063] According to an embodiment of the present invention, a method for predicting regional coal price differences based on graph neural networks is provided.
[0064] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 1 As shown, the regional coal price difference prediction method based on graph neural networks according to an embodiment of the present invention includes the following steps:
[0065] S1. Obtain coal logistics data, preprocess the coal logistics data to obtain preprocessed coal logistics data, and construct a coal logistics map based on the preprocessed coal logistics data.
[0066] Specifically, the process involves acquiring coal logistics data, preprocessing the coal logistics data to obtain preprocessed coal logistics data, and constructing a coal logistics map based on the preprocessed coal logistics data, including:
[0067] S11. Obtain coal logistics data, clean the coal logistics data to obtain cleaned coal logistics data, and align the cleaned coal logistics data to obtain pre-processed coal logistics data.
[0068] S12. Based on the preprocessed coal logistics data, construct the node set and directed edge set of coal logistics, and construct a coal logistics graph with timestamps based on the node set and directed edge set.
[0069] Specifically, the data model and graph construction operate on a time-indexed coal logistics graph. Nodes (V): Nodes represent mines, railway transshipment yards, inland river ports, seaports, and power plants. For each node v at time t, a feature vector is constructed:
[0070] .
[0071] Should Vectors are constructed after preprocessing. Directed edges (E) t ): Directed edges represent transportation corridors (railways, barges, offshore shipping, highways). For each directed edge e=(u→v) at time t, define an eigenvector: These characteristics can change over time. Graph snapshot: At each discrete time t (e.g., hourly or daily), a graph snapshot (i.e., a coal logistics graph) is constructed: ;in, It is a set of nodes. It is the edge set at time t. Price spread target: For a specific ordered pair of nodes (i,j) (usually representing economically related pairs of nodes, such as inland hubs and ports), the target price spread during the prediction period h is:
[0072] ;
[0073] in, and This represents the future spot prices of nodes i and j.
[0074] S2. Perform correlation mining on the coal logistics map and generate a potential correlation map based on the correlation mining results. Overlay the coal logistics map with the potential correlation map to obtain a multi-layer coal logistics map structure.
[0075] Specifically, association mining is performed on the coal logistics map, and a potential association map is generated based on the association mining results. The coal logistics map and the potential association map are then overlaid to obtain a multi-layered coal logistics map structure, including:
[0076] S21. Based on the nodes of the coal logistics map, construct a regression model, use the regression model to remove global and regional common factors of the nodes in the coal logistics map, and generate residual space.
[0077] S22. In the residual space, the potential association structure between all nodes in the coal logistics graph is jointly inferred using the sparse graph learning method with structural constraints, and the symmetric weight matrix is obtained by solving.
[0078] Specifically, the optimization solution for the symmetric weight matrix is as follows:
[0079] ;
[0080] In the formula, Represents a symmetric weight matrix; Represents a node The residual sequence; Represents the weight of a potential associated edge from node u to node v; Represents the residual sequence of node u; Represents the sparse regularization coefficient; Represents the topology consistency regularity coefficient; This represents the topology consistency penalty; u represents the source node; v represents the target node.
[0081] S23. Based on the symmetric weight matrix, the node pairs that meet the preset conditions are used as candidate potential association pairs to generate virtual edges, and a potential association graph is constructed. The coal logistics graph and the potential association graph are overlaid hierarchically to obtain a multi-layer coal logistics graph structure.
[0082] Specifically, the potential correlation mining and virtual edge construction involve the fact that in a basic graph (i.e., a coal logistics graph) built solely based on physical transportation corridors, the edges between nodes primarily reflect relationships of "direct transportation." However, the resonance of regional coal price differences is often influenced by factors such as indirect paths, shared demand-side shocks, and substitute coal types, resulting in a large number of implicitly correlated node pairs that are "physically not directly connected but highly correlated in price difference behavior." If these are not utilized, it will weaken the model's ability to model in sparse data regions and make it difficult for the graph structure to adapt to newly emerging effective transmission relationships. Therefore, this invention adds "potential correlation mining and virtual edge construction" to the original graph construction process. Through multi-step statistical analysis and structural learning of historical price and logistics characteristics, a "potential correlation graph" is inferred at the node level, and the basic coal logistics graph is enhanced with virtual edges. The process includes the following steps:
[0083] (1) Correlation measurement in residual space: To avoid misjudging macroscopic common shocks as direct correlations between nodes, this invention first removes global and regional common factors at each node. Specifically, for the original price sequence of node v... Construct the following regression model:
[0084] ;
[0085] in, This indicates macroeconomic and demand-side characteristics. This represents the price curves for coal futures and alternative fuels. Representing local features of nodes, This is a trained nonlinear regression model (e.g., a multilayer perceptron). Residuals are used. Instead of using raw prices to measure the statistical association between nodes, this distinguishes "common factors" from "network structural associations".
[0086] (2) Sparse Graph Learning with Structure Constraints: In the residual space, this invention employs a sparse graph learning method with structure constraints to jointly infer the potential association structure between all nodes. In a representative embodiment, a symmetric weight matrix is introduced. And use it as an optimization variable:
[0087] ;
[0088] In the formula, This represents the sparsity regularization coefficient, which controls the sparsity of potential associated edges; This represents the topological consistency regularization coefficient, controlling the degree of consistency between the "potential correlation graph" and the physical / prior topology. The first term characterizes the linear representability of the residuals; the second term is L1 regularization to obtain a sparse structure; the third term... Topology consistency penalty is used to constrain potential associations within a feasible region that is "weakly consistent" with the physical network. For example, it restricts the path length of node pairs in the physical network from being extremely long. The upper bound is set; for node pairs with high capacity and low cost connected by multiple paths, the sparsity penalty is relaxed. This optimization problem can be viewed as graph structure learning with prior constraints, and its solution results... It depicts the "functional association" induced by the network and market structure after removing public factors.
[0089] (3) Virtual edge generation and weight fusion: After obtaining Subsequently, the present invention will satisfy The node pairs are considered as candidate potential association pairs. This represents the threshold for association strength, and "virtual edges" are generated for it. These virtual edges have characteristics and edge type markers independent of physical edges, including: based on The correlation strength characteristics; the potential time lag characteristics, given by the peak position of the residual cross-correlation function; and the relationship with physical path cost. The deviation characteristics are used to characterize "atypical but stable" relationships. This invention employs a multi-layer graph structure, superimposing the physical graph (i.e., the coal logistics graph) and the potential relationship graph into a two- or multi-layer graph structure (i.e., a multi-layer coal logistics graph structure): one layer is the physical transportation layer, and the other is the potential relationship layer. The delayed-aware GNN performs message passing on both layers separately, and uses learnable inter-layer gating. , Weighted fusion of messages from different layers.
[0090] (4) Improvement in graph construction quality and performance: Compared with graph construction schemes that rely solely on static physical topology, the latent association mining and virtual edge construction of this invention have the following technical effects: In regions where physical edges are sparse or observations are missing, information bypasses are introduced through the latent association layer, enabling the model to share information using node pairs that are “similar in price behavior but not geographically adjacent”; In addition, structural constraints are used to limit the latent associations to a range compatible with feasible logistics paths, avoiding the introduction of large-scale spurious correlations; and by learning the relative importance of the physical layer and the latent layer in different scenarios through inter-layer gating, the robustness and accuracy of the overall price difference prediction are improved.
[0091] S3. Input the multi-layer coal logistics diagram structure into the spatiotemporal neural network model to generate the potential representation of the nodes. Perform anomaly transmission analysis based on the potential representation of the nodes to obtain candidate anomaly transmission links. Then, perform price difference prediction and correction based on the candidate anomaly transmission links to obtain the optimized price difference prediction value.
[0092] Specifically, the multi-layered coal logistics graph structure is input into a spatiotemporal neural network model to generate latent representations of nodes. Anomaly transmission analysis is performed based on these representations to obtain candidate anomaly transmission links. Price difference prediction and correction are then performed based on these candidate links, resulting in optimized price difference prediction values, including:
[0093] S31. Input the multi-layer coal logistics graph structure into the delayed-aware spatiotemporal graph neural network model, and implement delayed-aware message passing based on the spatiotemporal graph neural network model to obtain the message set of neighboring nodes, and combine attention aggregation to generate the potential representation of the nodes.
[0094] Specifically, the multi-layered coal logistics graph structure is input into a delayed-aware spatiotemporal graph neural network model, and delayed-aware message passing is implemented based on the spatiotemporal graph neural network model to obtain the message set of neighboring nodes. Then, attention aggregation is combined to generate the latent representations of the nodes, including:
[0095] S311. A delay-aware spatiotemporal graph neural network model is used to define dynamic transportation delay for each directed edge of a multi-layer coal logistics graph structure, and the dynamic transportation delay is used as a learnable function of edge attributes.
[0096] S312. Based on a learnable function, perform linear interpolation between the nearest discrete-time indices in the preset circular buffer, and retrieve the delayed source state.
[0097] S313. Combine the delayed source state with the edge type weight matrix and the edge gating of local features, and calculate the message from the source node to the target node to obtain the message set of the neighboring nodes.
[0098] S314. Use attention aggregation to combine the message sets of neighboring nodes to generate weighted messages, and fuse the spatial context of the weighted messages with the historical memory state of the nodes, and drive the dynamic evolution of the node's potential state in the time dimension to generate the node's potential representation.
[0099] S32. Based on the potential representation of nodes, identify abnormal target nodes and perform abnormal transmission chain tracing analysis on abnormal target nodes to obtain candidate abnormal transmission links.
[0100] Specifically, abnormal target nodes are identified based on their potential representations, and abnormal transmission chain tracing analysis is performed on these abnormal target nodes to obtain candidate abnormal transmission links, including:
[0101] S321. Utilize the price difference prediction residual and a robust scalarization function to perform node-level anomaly measurement calculation on the potential representation of nodes, and identify abnormal target nodes based on the node-level anomaly measurement combined with a preset dynamic threshold to obtain an abnormal target node set.
[0102] S322. Construct the edge-level instantaneous transmission strength based on the edge gating coefficient, attention weight, and source node historical state under the effect of score delay generated during message transmission, and conduct a comprehensive influence assessment of the edge-level instantaneous transmission strength along the multi-hop path from the upstream node to the abnormal target node to obtain the comprehensive contribution of the price difference state.
[0103] S323. Using the set of valid paths with the abnormal target node as the endpoint and consistent time as candidates, and combining the comprehensive contribution and the path-level symbol weights of the path direction and the abnormal direction to construct an abnormal transmission optimization problem, optimize and solve the abnormal transmission optimization problem to obtain the most compact transmission subgraph.
[0104] Specifically, the expression for the anomaly transport optimization problem is:
[0105] ;
[0106] In the formula, This represents a directed subgraph containing a set of candidate edges; This represents the set of all valid paths within the subgraph that terminate at the abnormal target node v and are of the same time. This indicates that the path-level symbol weights are given by combining the anomaly direction and the path direction; This represents a measure of subgraph complexity. This represents the threshold for controlling the size of the source tracing subgraph; This reflects the effect of path P on the abnormal target node v at time t. The overall contribution of the price spread status; This represents the set of all edges in a multi-layered coal logistics graph structure.
[0107] S324. Based on the most compact transmission subgraph, calculate the abnormal link score for each edge, and sort the edges in the most compact transmission subgraph in descending order according to the abnormal link score results to obtain candidate abnormal transmission links.
[0108] S33. Construct a soft shortest path cost estimate based on candidate abnormal transmission links, and combine it with the price difference prediction header to predict the price difference, obtain the initial price difference prediction result, and perform structured error reconstruction and differentiability optimization on the initial price difference prediction result to obtain the optimized price difference prediction value.
[0109] Specifically, a soft shortest path cost estimate is constructed based on candidate abnormal transmission links, and a price difference prediction is performed using a price difference prediction header to obtain an initial price difference prediction result. The initial price difference prediction result is then subjected to structured error reconstruction and differentiability optimization to obtain optimized price difference prediction values, including:
[0110] S331. Extract the embedded representation of nodes based on candidate abnormal transmission links, and calculate the cost of each edge by combining edge freight rate and duration;
[0111] S332. Construct a differentiable soft shortest path cost estimate based on the cost of all paths and each edge of the candidate abnormal transmission link, and input the node embedding representation and the soft shortest path cost estimate into the price difference prediction head of the sensing path to generate the initial price difference prediction result.
[0112] S333. Construct a convex quadratic programming problem based on the initial price difference prediction results, and solve the convex quadratic programming problem through a differentiable optimization layer to obtain the corrected price difference. Then, correct the initial price difference prediction results based on the corrected price difference to obtain the optimized price difference prediction value.
[0113] Specifically, a convex quadratic programming problem is constructed based on the initial price spread prediction results. This problem is then solved using a differentiable optimization layer to obtain the corrected price spread. The initial price spread prediction results are then corrected based on this corrected price spread to obtain the optimized price spread prediction values, including:
[0114] S3331. Using the initial price difference prediction result as the prior and the corrected price difference as the optimization variable, a convex optimization problem with economic and physical constraints is constructed by introducing an arbitrage penalty term and a flow conservation deviation term.
[0115] S3332. Apply three types of linear constraints to the convex optimization problem to obtain a convex quadratic programming problem. Solve the convex quadratic programming problem through a differentiable optimization layer to obtain the corrected price difference.
[0116] S3333: The corrected price difference and the error of the actual observation are included in the total loss. The spatiotemporal graph neural network model, the price difference prediction head and the optimization layer parameters are updated by joint backpropagation. The price difference is corrected by forward inference to obtain the optimized price difference prediction value.
[0117] Specifically, a core component of this invention is a delay-aware message passing mechanism that takes into account the transport delay along directed edges. The edge delay buffer includes: for each directed edge e=(u→v), the model defines a dynamic transport delay. This can be used as a learnable function of the "edge" attribute, for example:
[0118] ;
[0119] in , , It is the time-varying feature of edge e, and , , These are learnable parameters.
[0120] For each edge e, the system maintains a circular buffer to store the historical potential states of the source node u. When computing a message sent along edge e at time t, the model retrieves a delayed source state by performing linear interpolation between the nearest discrete-time indices in the buffer. This interpolation is implemented in a differentiable manner, therefore the gradient can be obtained through... Propagation. Message computation includes: in the network... The layer, from u to v at time t, is defined as follows:
[0121] ;
[0122] in, It is a weight matrix specific to the edge type; Indicates that node u is at the th Hidden states in a layered graph neural network It is a side-gating mechanism derived from local features:
[0123] ;
[0124] in, [·,·,·] represents the sigmoid activation function, and [·,·,·] represents feature concatenation. This represents the original node feature vector of source node u at time t, specifically including local spot price, inventory level, coal inflow / outflow volume, coal quality embedded representation, meteorological indicators, and load indicators.
[0125] Attention aggregation includes: for each target node v, the attention from its incoming neighbors. Messages are combined using attention weights:
[0126] ;
[0127] ;
[0128] Where 'a' is a learnable attention vector. It is a self-transformation matrix. This represents a non-linear activation function (such as ReLU or GELU). This formula allows the model to focus on the incoming edges whose "delayed states" and "attributes" are most relevant to the current state of node v. Indicates the first Layered network, time t, normalized attention weights from source node u to target node v; This indicates that node v is at time t, the first... The potential state after the layer is updated; This indicates that node v is at time t, the first... The input potential state of the layer.
[0129] The weighted message sum generated by attention aggregation is not directly used as the final next-moment state, but rather passed as an "input signal" to the subsequent "time update module." The time update module then combines this spatial context with the node's own historical memory state. By integrating these elements, the dynamic evolution of the potential states of nodes over time can be driven, thereby achieving joint modeling of spatiotemporal features.
[0130] Time updates include: the temporal evolution of node states is modeled using the following cyclic timing module. One embodiment uses a GRU (Gated Cyclic Unit):
[0131] ;
[0132] ;
[0133] STAGG(·) is a spatial aggregation operator (e.g., summation or mean) for the input message. Another embodiment replaces GRU with TCN (Temporal Convolutional Network), where historical latent states are combined through causal, dilated convolutions. This represents the spatial aggregation context vector of node v at time t; This indicates that node v is at time t, the first... The potential state after the layer is updated; Indicates that point v is at the ( +1) The intermediate hidden state at time t; Indicates that node v is at the ( +1) layer, the hidden state of the previous time step (t-1).
[0134] Delayed source state Retrieved from the buffer specific to that "edge", the state is transformed by the "edge type weight matrix" and then... The state is gated and then combined at the target node v by an attention-based aggregator to produce the updated latent state. .
[0135] For anomaly transmission chain tracing analysis based on delay-aware message passing, delay-aware ST-GNN generates a wealth of intermediate quantities during the prediction process, including edge-by-edge fractional delay, edge gating coefficients, attention weights, and node-level prediction residuals. In the basic version of this invention, these quantities are primarily used to improve prediction accuracy but are not systematically utilized for "source tracing analysis" and "scheduling decision support." To improve the accuracy of logistics network scheduling decisions, this invention adds "anomaly transmission chain tracing analysis" to delay-aware message passing. When an abnormal deviation in regional price differences is detected, it automatically constructs the best-matching upstream transmission link and provides a link-level anomaly score.
[0136] (1) Anomaly Measurement and Target Node Selection: For each target node v and its associated price difference prediction, this invention first defines anomaly measurement on the prediction period h:
[0137] ;
[0138] in This represents the observation price difference vector associated with node v. This represents the final price spread prediction output after structured error reconstruction. For robust scalarized functions (e.g., Huberian or piecewise functions). When When the dynamic threshold is exceeded, node v is marked as an abnormal target node.
[0139] (2) Path influence modeling based on message passing weights: In the process of delay-aware message passing, the influence from upstream node u to downstream node v is determined by the following three types of quantities: edge gating coefficient Describes the information channel opening at the current time step on that side; attention weight Characterizes the importance of the edge among all incoming edges; source node history state under fractional delay. This depicts the source state of those who actually participated in this dissemination.
[0140] This invention defines edge instantaneous conduction strength:
[0141] ;
[0142] in, This is the edge type weight matrix, where ⊙ denotes element-wise multiplication; This represents the gating coefficient of u→v at time t; This indicates the hidden state of node u aligned to the delayed time. Indicates the propagation delay of edge u→v; This represents the attention weight from the edge u→v in the neighbor aggregation of node v. Furthermore, for multi-hop paths P=(u0→u1→···→u k =v) Define the overall influence along the path:
[0143] ;
[0144] Where g(·) is a monotonically compressible function, It is composed of the fractional delays of each side and is used to align the actual arrival time; Represents a node via edge The intensity of instantaneous information transmission at a certain time alignment point. This reflects the comprehensive contribution of path P to the price difference state of node v at time t.
[0145] (3) Optimization solution of abnormal transmission chain: Given the abnormal target node v and its abnormality degree The present invention constructs the following optimization problem to search for the "most compact transport subgraph" that explains this anomaly:
[0146] ;
[0147] in: It is a directed subgraph containing a set of candidate edges; This is the set of all valid paths within the subgraph that end at v and have the same time. Path-level sign weights are given by combining the direction of anomalies with the direction of the path (such as the sign of price spreads and the direction of inventory changes); A measure of subgraph complexity (e.g., a combination of edge count and total transportation cost). A threshold for controlling the size of the source tracing subgraph; This represents the set of all edges in the original graph (i.e., the multi-layered coal logistics graph structure).
[0148] In practice, the optimal or suboptimal solution can be approximated by performing budget-constrained dynamic programming or heuristic bundle search on the time unfolded graph. This yields a set of the most compelling transmission paths and corresponding edge sets for explaining anomalies.
[0149] (4) Abnormal link scoring and scheduling decision support: After obtaining Subsequently, this invention defines anomaly link scores for each edge e:
[0150] ;
[0151] in For edge-level transportation cost or capacity penalties, the denominator is used to distribute the explanatory weights among multiple downstream anomalous nodes; This represents the edges in path P other than the current edge, used to calculate the total cost or normalization term of the path. Indicates the index of the downstream abnormal node involved in path P; This indicates the anomalous strength of node 𝑣 during the prediction period ℎ; This represents the same anomaly intensity quantity, used as a weighting factor in path or edge-level scoring; This represents the set of downstream abnormal nodes participating in anomaly tracing and scoring calculation. High-scoring edges are considered as a candidate set of "abnormal transmission links" and serve scheduling decisions in the following ways: providing the scheduling system with a sorted list of abnormal channels for manual or algorithmic review; using the abnormal link score as a penalty or priority input in subsequent capacity allocation or temporary flow restriction optimization; and providing interpretive labels for the risk warning system to help locate the transportation path and time window behind abnormal price differences. Unlike traditional anomaly analysis based solely on statistical thresholds or simple shortest paths, the tracing analysis of this invention utilizes the gating, attention, and score delay structures learned internally by the delay-aware GNN to model "anomaly interpretation" as an optimization problem tightly coupled with spatiotemporal message transmission. This allows for interpretable path-level decision-making basis for logistics scheduling while maintaining predictive performance.
[0152] For a path-aware price spread head with freight cost boundaries, this invention further introduces a path-aware price spread prediction head, the output of which is constrained by the estimated freight cost. This is for predicting price spreads. The model uses node embeddings from the last layer of the GNN. , And a soft shortest path freight estimator . , These represent the final node embeddings of nodes i and j at time t, respectively.
[0153] Among them, soft path cost: For each edge e, define an "edge" cost:
[0154] ;
[0155] in and It is the current freight rate and effective transit time on edge e. , These are learnable or predetermined coefficients. Let... Let represent the set of all paths from node i to node j. The cost of a differentiable soft shortest path is defined as:
[0156] ;
[0157] in, >0 controls the degree of concentration of the "soft minimum" around the true shortest cost path. Smaller It will produce a smoother average across multiple paths; larger This approximates the hard minimum.
[0158] Price spread prediction head calculation:
[0159] ;
[0160] Where g(·) is an MLP (Multilayer Perceptron), It aggregates global exogenous signals (such as coal futures prices, exchange rates, and demand indices). This is achieved by embedding nodes... , and The coupled, price spread forecast head generates forecasts that are not only data-driven, but also anchored to the concept of economically interpretable transportation costs between regions i and j.
[0161] For constraint and loss design, the training objective combines the main prediction loss with auxiliary constraint penalty terms. Specifically, the main loss for price spread prediction is the observed price spread. Price difference with forecast Huber loss between:
[0162] ;
[0163] In some embodiments, the model adds an additional auxiliary node-level price loss L. nodeThis stabilizes node embeddings and improves the model's predictive performance for sparsely traded locations. No-arbitrage constraint: For directed node pairs (i,j), a no-arbitrage penalty ensures that the predicted price difference does not systematically exceed the estimated freight cost plus a small basis term δ.
[0164] ;
[0165] in[·] + This represents the ReLU (linear rectification) operator max(·, 0). This term penalizes predictions that show unrealistically high price differences relative to estimated transportation costs. Conservation constraint term: for the set of incoming edges... Outbound set The defined region segmentation, with a flow conservation penalty term, will (implicitly in the model) gate the flow. Compared with observed inventory changes Connecting them:
[0166] ;
[0167] This improves the consistency between the model's implied net flow and the measured inventory dynamics. Total Loss: The total training loss is a weighted combination:
[0168] ;
[0169] in, , , , It is a non-negative hyperparameter used to control the relative strength of the prediction and constraint terms.
[0170] Training process: Historical data is divided into training, validation, and test sets. A sliding window mechanism is used to generate the input sequence [t-L+1,…,t], and the prediction period is... For each batch, the "Delay-Aware ST-GNN" and "Spread Header" perform a forward propagation once to generate spread predictions. The total loss L is calculated as described above, followed by backpropagation and parameter updates using an optimizer (e.g., Adam (Adaptive Moment Estimation) with gradient pruning). Early stopping and hyperparameter search are performed using the mean absolute error on the validation set to select the final model.
[0171] Hardware / Software Implementation: This method can be implemented on one or more processors (CPU and / or GPU) equipped with associated memory, persistent storage, and a network interface. A non-transitory computer-readable medium stores executable instructions, which, when executed by the processor, perform steps such as data access, graph construction, GNN inference, loss calculation, and parameter optimization. Training outputs, including normalized parameters, graph patterns, and network weights learned by the model, are serialized and loaded by the "online inference module."
[0172] Online Inference and Graph Update: During inference, the system constructs a new graph snapshot based on the latest data. Features are normalized using previously stored parameters. The "edge delay buffer" is updated with the new latent state. The "delay-aware ST-GNN" performs a forward propagation to generate node embeddings, and the "spread head" outputs spread predictions for the system-configured node pairs. An optional post-processing step enforces soft freight boundaries and calibration adjustments before the results are published via API. A monitoring component tracks changes in the graph topology (e.g., the addition or closure of corridors) and systematic shifts in delay patterns, which trigger incremental updates or recalibration of delay parameters without requiring a full model retraining.
[0173] The timing diagram of the side buffer: The "side buffer" stores the discrete latent states h0, h1, h2, h3 for past time steps t-3, t-2, t-1, t. The current delay of edge e at time t... At (hours), the model performs linear interpolation between h1 and h2 to obtain... This interpolation method allows the gradient to propagate back to the buffer state and the delay function. Parameters in This enables end-to-end learning of delayed behavior along each transport corridor.
[0174] Structured Error Reconstruction and Differentiable Optimization: In the context of "Delay-Aware Spatiotemporal GNN" and "Price Spread Prediction Head," initial price spread predictions for node pairs (i,j) over the prediction period h are provided. Subsequently, this invention introduces a "structured error reconstruction and optimization" after the output layer, treating these initial predictions as "priorities," and performs secondary correction on the price difference by solving a convex optimization problem with economic and physical constraints. (1) Construction of the optimization problem: For a set of ordered node pairs with economic connections Define the variable to be optimized as the corrected price difference. And optional correction node prices The present invention constructs the following objective function:
[0175] ;
[0176] in, The weights assigned to nodes based on traffic and transaction activity are as follows. The soft-path freight cost estimate is obtained from the "perceived path price difference prediction head". This refers to inventory changes in the corresponding region; This represents the predicted prior price difference between node i and node j, obtained from the model front-end and not yet corrected by structured constraint optimization. This represents the corrected price difference between node i and node j obtained after structured error reconstruction and differentiability optimization during the prediction period h.
[0177] Penalties for no-arbitrage deviations, for example:
[0178] ;
[0179] in, For the allowable basis; This represents the predicted effective transportation cost (or path cost) between node i and node j, estimated by the model based on graph structure and path information.
[0180] Characterize the approximate flow conservation deviation between corrected spreads, corrected prices, and inventory changes, such as constraining the consistency between cross-regional net spread signals and inventory changes on a given cut set.
[0181] (2) Setting of constraints: To ensure that the optimization results are consistent with the price structure, this invention sets the following constraints: and Apply the following linear constraints: 1. Price spread – price consistency:
[0182] ;
[0183] This represents the predicted price of node j after correction by the structured optimization module during the prediction period h.
[0184] 2. Soft boundary of freight:
[0185] ;
[0186] in As slack variables, and in Additional penalties are included.
[0187] 3. Local smoothness: For several node pairs sharing a relay node, the difference in adjacent price differences is constrained to not exceed a preset threshold in order to suppress local noise.
[0188] Since the objective function is quadratic and the constraints are affine, the overall problem constitutes a convex quadratic programming problem (QP).
[0189] (3) Differentiable solution and end-to-end training: This invention adopts a differentiable optimization layer implementation method to embed the above QP into the forward computation graph. During training, the total loss is based on the original prediction error term and the no-arbitrage and conservation penalty term, and adds a penalty for the error between the corrected price difference output by the optimization layer and the actual observation, thereby jointly updating the parameters in GNN, price spread head and optimization layer.
[0190] Through the above-mentioned structured error reconstruction, this invention introduces "constraint-driven secondary correction" on top of "data-driven initial prediction". Compared with the scheme that only adds constraints through loss function, it can output a more stable price difference surface that conforms to economic and physical logic when facing network disturbances, local abnormal samples and distribution drift.
[0191] In summary, such as Figure 4 As shown, the present invention includes the following functions: data access and preprocessing, graph builder, potential association mining and virtual edge construction, delay-aware spatiotemporal graph neural network, price difference prediction head, constraint and loss module, structured error reconstruction and optimization, anomaly transmission chain tracing analysis, training engine, and online inference.
[0192] Multi-source data is first cleaned and aligned by the "Data Access and Preprocessing" and "Graph Builder," and then converted into timestamped graph snapshots. A "Delay-Aware Spatiotemporal GNN" generates latent representations of the nodes. The "Price Spread Prediction Head" combines these representations with route-level freight information, mapping them to predicted price spreads. The "Constraints and Loss Module" incorporates economic and physical consistency terms into the training objective, with optimization performed by the "Training Engine." The trained model is then deployed via the "Online Inference Module," which provides an open prediction API and performs monitoring and post-processing.
[0193] The purpose of this invention is to provide a spatiotemporal graph neural network capable of sensing delays and distinguishing edge types, specifically designed for predicting regional coal price spreads. The proposed system introduces a learnable edge-time delay buffer, a path-aware price spread prediction head, and a constraint-enhanced training process. Its aim is to ensure that the model output remains consistent with logistics costs and fits conservation relationships. The architecture is designed to simultaneously support offline batch training and near real-time inference, and can adapt to dynamically evolving transportation topologies and edge attributes through incremental graph updates. The edge delay buffer is an edge-by-edge, differentiable fractional-order delay mechanism. This mechanism is used to retrieve the latent state of the source node during message passing, and the edge delay within it... It is a learnable function of time-varying edge features. Edge-type gated message passing is a gated message passing scheme. In this scheme, "edge gating"... It is calculated simultaneously based on the "edge" attribute and endpoint node features, enabling the model to achieve transport mode-specific propagation behavior for different transport corridors (such as rail, barge, offshore shipping, and road). The perceptual path price difference prediction head is a type of price difference prediction. This prediction embeds nodes with a differentiable soft shortest path freight cost. The following methods are used to generate directed spread predictions, explicitly constrained by estimated path costs between regions. A constraint-enhanced learning framework integrates explicit no-arbitrage and flow conservation penalties into the training loss function. This regularizes the model, making its predictions more consistent with economic and physical logic, and improves its stability in volatile market environments. A joint multi-task architecture for nodes and spreads is a multi-task design. In addition to the main spread prediction head, an auxiliary node-level price prediction head is introduced in parallel. This aims to improve the quality of the model's underlying representations and reduce the prediction variance of nodes with sparse or noisy observation data. An online graph updater with latency adaptation is an online update mechanism. This mechanism supports incremental modifications to the graph topology and "edge delay" parameters without requiring full model retraining; simultaneously, it preserves and reuses the state of the "edge buffer" in each update for low-latency deployment. Structured error reconstruction and differentiability optimization is a two-layer spread prediction structure based on convex optimization. First, a spatiotemporal graph neural network and a price spread prediction head provide prior predictions of node price spreads and path costs. Then, a quadratic programming problem is solved under constraints of no arbitrage, soft freight boundaries, and approximate flow conservation to structurally correct the initial price spread. This optimization is embedded in the training process in a differentiable manner, ensuring that the final output price spread approximates the observed data while satisfying economic and physical constraints, thus maintaining better robustness under network disturbances and data anomalies. Potential association mining and virtual edge construction is a graph structure learning and reinforcement scheme for price spread prediction tasks. This scheme first removes macroeconomic and common factors from the node price series, and infers potential associations between nodes in the residual space through sparse graph learning with structural constraints. Then, "virtual edges" are generated based on the obtained weight matrix and superimposed with the physical transportation graph to form a multi-layer graph structure. The delayed-aware graph neural network performs message passing on both the physical and potential layers, and achieves data-driven layer weight learning through inter-layer gating, thus surpassing conventional schemes that rely solely on physical topology in terms of graph construction performance and quality. Anomaly transmission chain tracing analysis based on delay-aware message passing is a path-level analysis scheme that utilizes internal quantities of delay-aware message passing to trace the source of abnormal price differences. When anomalies in price differences at a target node are detected, this scheme constructs a path influence index by comprehensively utilizing edge gating, attention weights, and fractional delays. Through budget-constrained path subgraph optimization, it automatically selects the upstream transmission link most strongly explaining the anomaly. Furthermore, it generates anomaly link scores for each edge to support capacity scheduling, flow control optimization, and risk warning, distinguishing it from conventional anomaly detection methods based on static graphs or simple correlation analysis.
[0194] The advantages of this invention lie in its improved accuracy under network disturbances: By modeling the directed, perceived-delay propagation along explicit logistics corridors, this invention enables the model to transmit supply and demand shocks in the network in a time-consistent manner. Compared to baseline models lacking graph awareness, this invention exhibits lower prediction lag and significantly reduces price spread prediction errors (e.g., mean absolute error over prediction periods h=1 to h=7). Enhanced consistency with economic logic: This invention incorporates soft freight boundaries and flow conservation penalties into the training objective and performs secondary optimization of the initial predictions during the inference phase through structured error reconstruction. These two constraints allow the model's output to avoid price spread patterns that violate arbitrage principles or are physically invalid. As a result, the model's predictions are more stable and more usable in practical applications such as trading, scheduling, and risk management. Enhanced robustness with sparse or noisy data: When local observations (e.g., inventory or throughput) are missing, lagging, or noisy, graph-based aggregation and edge-level gating mechanisms allow the model to compensate using information from neighboring nodes and channels. Compared to node-by-node predictors lacking network information redundancy, this invention exhibits significantly superior robustness. Improved interpretability and auditability: The model's explicit decomposition of path costs and the attention weights distributed along the edges reveal which routes and channels contribute most to specific spread changes. This transparency facilitates model auditing, ex-post interpretation of predictive behavior, and risk reviews at the internal or regulatory levels.
[0195] Local Alternatives: Graph Transformer Replaces Attention-Based GNNs; Neighborhood-level attention in spatiotemporal GNNs can be replaced by a graph transformer architecture. This architecture employs sparse full-graph attention, coupled with relative spatial encoding and explicit temporal delay embedding. This approach retains the core idea of "perceiving delay and distance propagation" but alters the original attention mechanism and receptive field. Line Graph Message Passing: Instead of performing message passing on the original node graph, this approach shifts computation to the line graph. In the line graph, the "edges" of the original graph are treated as "nodes." Edge-to-edge propagation is then learned directly on the line graph, while delay buffers are appended to these "edge-transformed nodes." The resulting representation is projected back into the original node space for price and spread prediction. Kernelized Temporal Translation: Fractional delay buffers can be replaced by edge-defined, causal, dilated temporal convolutions. In this approach, the dilation factor acts as a learnable integer proxy variable for transport delay. This method provides a discretized alternative to continuous fractional-order delay interpolation while preserving the model's latency-awareness. An alternative expression for path cost: soft shortest path cost. This can be instantiated in ways such as: performing log-sum-exp aggregation on the k shortest paths; or by computing the entropy-regularized optimal transport between the source and sink nodes. Both expressions can produce differentiable, path-aware cost estimates that can replace the baseline softmin definition.
[0196] A completely different, complete solution: Probabilistic graphical model implementation: The transportation network can be modeled as a dynamic Bayesian network containing explicitly delayed nodes. In this network, coal prices and spreads are random variables connected along the graph structure. The spread is then inferred through probabilistic message passing and maximum a posteriori estimation; simultaneously, the model's no-arbitrage and flow conservation constraints are enforced through appropriately chosen prior and structural constraints. A neural differential equation framework for physical constraints: Node states can be defined in continuous time and evolve according to a neural ordinary differential equation; this equation incorporates transportation terms along the "edges". Discretizing the ODE provides a numerical scheme for model inference, while the coal price spread is read from the continuous-time embedding. Economic and physical constraints can be incorporated into the ODE structure or as penalty terms for its evolutionary trajectory. A two-stage hybrid architecture: In a decompositional solution, the first-stage model is responsible for predicting channel-level freight rates and effective delays from logistics and market data; while the second stage, a simpler attention-based recurrent network, is responsible for predicting regional price differences, using the freight and delay variables predicted in the first stage as exogenous inputs. In this design, freight-based boundary constraints can be implemented as hard constraints in the second stage, rather than soft regularization terms as in the aforementioned schemes.
[0197] The data interface is designed to access heterogeneous data streams, including but not limited to: port inventory levels, railway throughput statistics, freight rates, ship arrival and departure data from AIS (Automatic Identification System), meteorological data, power system load, foreign exchange (FX) rates, and coal-related futures curves. All data sources are integrated through a timed ETL (Extract-Transform-Load) pipeline and employ explicit schema version control to ensure data traceability and backward compatibility. Hyperparameters: Representative hyperparameter configurations include: historical backtracking length L between 28 and 60 time steps; prediction period... The spatiotemporal GNN has a depth of 2 to 4 layers; the hidden layer dimension is between 64 and 256; the dropout rate (random inactivation rate) ranges from 0.1 to 0.3; and the concentration parameter of "soft paths" in the path cost module. The range is 1 to 10. These ranges can be adjusted through hyperparameter optimization without altering the essence of the invention. Service Level Objectives: The goal of the online inference pipeline is to achieve an end-to-end latency of less than 50 milliseconds (ms) for processing a single graph snapshot in a GPU-based deployment environment. This latency covers feature normalization, buffer updates, and GNN forward computation. The service stack supports warm-start reconfiguration to adapt to changes in topology (e.g., adding or removing transport trunks) and A / B testing via feature flags to ensure controlled model version releases. Compliance and Traceability: All external data feeds are timestamped upon access and stored along with the source identifier. Model artifacts (including parameters, normalized statistics, and graph patterns) are versioned and archived. To ensure interpretability, the system records interpretability logs, such as recording the top k attention-weighted edges that contribute the most to each spread prediction. This facilitates internal audits, model risk management, and potential regulatory reviews.
[0198] Definitions of relevant technical terms: Graph Neural Network (GNN): A neural network architecture defined on graph-structured data. In this architecture, nodes exchange information through message passing along "edges" and update their latent representations through learnable aggregation functions. Spatio-temporal Graph Neural Network (ST-GNN): A graph neural network supplemented with temporal modeling components (such as GRU or TCN) to jointly capture spatial dependencies on the graph and the temporal dynamics of node and "edge" features. Gated Recurrent Unit (GRU): A recurrent neural network unit equipped with update and reset gates, designed to model temporal dependencies while mitigating the vanishing gradient effect. Temporal Convolutional Network (TCN): A temporal convolutional architecture based on causal convolution and often employing dilated convolution, used for sequence modeling and allowing explicit control of the model's temporal receptive field. Multi-Layer Perceptron (MLP): A feedforward neural network consisting of one or more hidden layers with non-linear activation functions. This invention uses a general function approximator for regression or classification tasks. Huber loss is a regression loss function. Its shape is quadratic for small residuals and linear for large residuals. Therefore, it is more robust to outliers than mean squared error. Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and Mean Absolute Percentage Error (MAPE) are standard regression evaluation metrics. Soft Shortest Path: A differentiable approximation of the cost of the shortest path on a graph. It is typically achieved by aggregating path costs using log-sum-exp(log-sum-exponential), thus supporting gradient-based learning. No Arbitrage: An economic consistency condition. It requires that directed price differences do not systematically exceed the sum of transportation costs and any permissible basis, thus eliminating persistent risk-free arbitrage opportunities. Flow Conservation: An approximate conservation relationship. It correlates net inflows and outflows across network boundaries with observed inventory changes within the region corresponding to that boundary. Edge gating: A scalar or vector-valued weight applied to messages transmitted along an "edge." It is calculated based on the characteristics of the "edge" and endpoint nodes to adjust the strength and relevance of information propagation. Fractional delay: A mechanism for retrieving latent states at non-integer time offsets.It is achieved by interpolating between time-discrete buffer entries, thus characterizing the delay of continuous values in a discrete-time model. A cutset is a set of "edges". Removing an "edge" from this set disconnects a specific region of the graph from the rest of the network. Cutsets are often used to define boundaries for flow conservation calculations.
[0199] like Figure 2 As shown, according to another embodiment of the present invention, a regional coal price difference prediction system based on graph neural networks is also provided, the system comprising:
[0200] The coal logistics map construction module 1 is used to acquire coal logistics data, preprocess the coal logistics data to obtain preprocessed coal logistics data, and construct a coal logistics map based on the preprocessed coal logistics data.
[0201] The potential association graph generation module 2 is used to perform association mining on the coal logistics graph and generate a potential association graph based on the association mining results. The coal logistics graph is then overlaid with the potential association graph to obtain a multi-layer coal logistics graph structure.
[0202] The price difference prediction module 3 is used to input the multi-layer coal logistics diagram structure into the spatiotemporal neural network model, generate the potential representation of the nodes, perform abnormal transmission analysis based on the potential representation of the nodes, obtain candidate abnormal transmission links, and perform price difference prediction and correction based on the candidate abnormal transmission links to obtain the optimized price difference prediction value.
[0203] Furthermore, the present invention also provides an electronic device. For example... Figure 3 The diagram illustrates the hardware operating environment of an electronic device, which may include: a processor (e.g., CPU), memory, a user interface, a network interface, and a communication bus. The communication bus is used to enable communication between components. The user interface may include a display screen and an input unit such as a keyboard; optionally, the user interface may also include a standard wired interface or a wireless interface. The network interface may optionally include a standard wired interface or a wireless interface. The memory may be high-speed RAM or stable non-volatile memory, such as disk storage. Alternatively, the memory may be a storage device independent of the aforementioned processor.
[0204] Those skilled in the art will understand that Figure 3 The electronic devices shown do not constitute a limitation on electronic devices and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0205] like Figure 3As shown, a memory, as a type of computer storage medium, may include an operating system, a network communication module, a user interface module, and device management programs. The operating system is a program that manages and controls the hardware and software resources of electronic devices, supporting the operation of electronic devices and other software or programs. Figure 3 In the electronic device shown, the user interface is mainly used to connect to the terminal and communicate with the terminal, such as receiving user signaling data sent by the terminal; the network interface is mainly used to communicate with the backend server; the processor can be used to call the program stored in the memory and execute the steps of the method or system described above.
[0206] Furthermore, the present invention also proposes a computer-readable storage medium storing a device management program, which, when executed by a processor, implements the steps of the method or system described above.
[0207] The specific embodiments of the computer-readable storage medium of the present invention are basically the same as those of the above-described methods or systems, and will not be repeated here. Furthermore, to achieve the above objectives, the present invention also provides a computer program product, comprising: a computer program, which, when executed by a processor, implements the steps of the methods or systems described above.
[0208] Those skilled in the art will recognize that the units and algorithm steps described in conjunction with the embodiments herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0209] 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 principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A regional coal price difference prediction method based on graph neural networks, characterized in that, The method includes: S1. Obtain coal logistics data, preprocess the coal logistics data to obtain preprocessed coal logistics data, and construct a coal logistics map based on the preprocessed coal logistics data. S2. Perform correlation mining on the coal logistics map and generate a potential correlation map based on the correlation mining results. Overlay the coal logistics map with the potential correlation map to obtain a multi-layer coal logistics map structure. S3. Input the multi-layer coal logistics diagram structure into the spatiotemporal neural network model to generate the potential representation of the nodes. Perform anomaly transmission analysis based on the potential representation of the nodes to obtain candidate anomaly transmission links. Then, perform price difference prediction and correction based on the candidate anomaly transmission links to obtain the optimized price difference prediction value.
2. The regional coal price difference prediction method based on graph neural networks according to claim 1, characterized in that, The steps of acquiring coal logistics data, preprocessing the coal logistics data to obtain preprocessed coal logistics data, and constructing a coal logistics map based on the preprocessed coal logistics data include: S11. Obtain coal logistics data, clean the coal logistics data to obtain cleaned coal logistics data, and align the cleaned coal logistics data to obtain pre-processed coal logistics data. S12. Based on the preprocessed coal logistics data, construct the node set and directed edge set of coal logistics, and construct a coal logistics graph with timestamps based on the node set and directed edge set.
3. The regional coal price difference prediction method based on graph neural networks according to claim 1, characterized in that, The process of performing correlation mining on the coal logistics map, generating a potential correlation map based on the correlation mining results, and overlaying the coal logistics map with the potential correlation map to obtain a multi-layered coal logistics map structure includes: S21. Based on the nodes of the coal logistics map, construct a regression model, use the regression model to remove global and regional common factors of the nodes in the coal logistics map, and generate residual space. S22. In the residual space, the potential association structure between all nodes in the coal logistics graph is jointly inferred using the sparse graph learning method with structural constraints, and the symmetric weight matrix is obtained by solving. S23. Based on the symmetric weight matrix, the node pairs that meet the preset conditions are used as candidate potential association pairs to generate virtual edges, and a potential association graph is constructed. The coal logistics graph and the potential association graph are overlaid hierarchically to obtain a multi-layer coal logistics graph structure.
4. The regional coal price difference prediction method based on graph neural networks according to claim 3, characterized in that, The optimal solution expression for the symmetric weight matrix is: ; In the formula, Represents a symmetric weight matrix; Represents a node The residual sequence; Represents the weight of a potential associated edge from node u to node v; Represents the residual sequence of node u; Represents the sparse regularization coefficient; Represents the topology consistency regularity coefficient; This represents the topology consistency penalty; u represents the source node; v represents the target node.
5. The regional coal price difference prediction method based on graph neural networks according to claim 1, characterized in that, The process involves inputting a multi-layered coal logistics graph structure into a spatiotemporal neural network model to generate latent representations of nodes. Based on these latent representations, anomaly transmission analysis is performed to obtain candidate anomaly transmission links. Price difference prediction and correction are then performed based on these candidate links to obtain optimized price difference prediction values, including: S31. Input the multi-layer coal logistics graph structure into the delayed-aware spatiotemporal graph neural network model, and implement delayed-aware message passing based on the spatiotemporal graph neural network model to obtain the message set of neighboring nodes, and combine attention aggregation to generate the potential representation of the nodes. S32. Based on the potential representation of nodes, identify abnormal target nodes and perform abnormal transmission chain tracing analysis on abnormal target nodes to obtain candidate abnormal transmission links. S33. Construct a soft shortest path cost estimate based on candidate abnormal transmission links, and combine it with the price difference prediction header to predict the price difference, obtain the initial price difference prediction result, and perform structured error reconstruction and differentiability optimization on the initial price difference prediction result to obtain the optimized price difference prediction value.
6. The regional coal price difference prediction method based on graph neural networks according to claim 5, characterized in that, The process of inputting a multi-layered coal logistics graph structure into a delayed-aware spatiotemporal graph neural network model, implementing delayed-aware message passing based on the spatiotemporal graph neural network model to obtain the message set of neighboring nodes, and generating the latent representation of the nodes by combining attention aggregation includes: S311. A delay-aware spatiotemporal graph neural network model is used to define dynamic transportation delay for each directed edge of a multi-layer coal logistics graph structure, and the dynamic transportation delay is used as a learnable function of edge attributes. S312. Based on a learnable function, perform linear interpolation between the nearest discrete-time indices in the preset circular buffer, and retrieve the delayed source state. S313. Combine the delayed source state with the edge type weight matrix and the edge gating of local features, and calculate the message from the source node to the target node to obtain the message set of the neighboring nodes. S314. Use attention aggregation to combine the message sets of neighboring nodes to generate weighted messages, and fuse the spatial context of the weighted messages with the historical memory state of the nodes, and drive the dynamic evolution of the node's potential state in the time dimension to generate the node's potential representation.
7. The regional coal price difference prediction method based on graph neural networks according to claim 5, characterized in that, The node-based potential representation is used to identify abnormal target nodes, and abnormal transmission chain tracing analysis is performed on the abnormal target nodes to obtain candidate abnormal transmission links, including: S321. Utilize the price difference prediction residual and a robust scalarization function to perform node-level anomaly measurement calculation on the potential representation of nodes, and identify abnormal target nodes based on the node-level anomaly measurement combined with a preset dynamic threshold to obtain an abnormal target node set. S322. Construct the edge-level instantaneous transmission strength based on the edge gating coefficient, attention weight, and source node historical state under the effect of score delay generated during message transmission, and conduct a comprehensive influence assessment of the edge-level instantaneous transmission strength along the multi-hop path from the upstream node to the abnormal target node to obtain the comprehensive contribution of the price difference state. S323. Using the set of valid paths with the abnormal target node as the endpoint and consistent time as candidates, and combining the comprehensive contribution and the path-level symbol weight of the path direction with the abnormal direction to construct an abnormal transmission optimization problem, optimize and solve the abnormal transmission optimization problem to obtain the most compact transmission subgraph. S324. Based on the most compact transmission subgraph, calculate the abnormal link score for each edge, and sort the edges in the most compact transmission subgraph in descending order according to the abnormal link score results to obtain candidate abnormal transmission links.
8. The regional coal price difference prediction method based on graph neural networks according to claim 7, characterized in that, The expression for the abnormal transmission optimization problem is: ; In the formula, This represents a directed subgraph containing a set of candidate edges; This represents the set of all valid paths within the subgraph that terminate at the abnormal target node v and are of the same time. This indicates that the path-level symbol weights are given by combining the anomaly direction and the path direction; This represents a measure of subgraph complexity. This represents the threshold for controlling the size of the source tracing subgraph; This indicates that path P is related to the abnormal target node v at time 1. The overall contribution of the price spread status; This represents the set of all edges in a multi-layered coal logistics graph structure.
9. The regional coal price difference prediction method based on graph neural networks according to claim 5, characterized in that, The process involves constructing a soft shortest path cost estimate based on candidate abnormal transmission links, combining it with a price difference prediction header to predict the price difference, obtaining an initial price difference prediction result, and then performing structured error reconstruction and differentiability optimization on the initial price difference prediction result to obtain optimized price difference prediction values, including: S331. Extract the embedded representation of nodes based on candidate abnormal transmission links, and calculate the cost of each edge by combining edge freight rate and duration; S332. Construct a differentiable soft shortest path cost estimate based on the cost of all paths and each edge of the candidate abnormal transmission link, and input the node embedding representation and the soft shortest path cost estimate into the price difference prediction head of the sensing path to generate the initial price difference prediction result. S333. Construct a convex quadratic programming problem based on the initial price difference prediction results, and solve the convex quadratic programming problem through a differentiable optimization layer to obtain the corrected price difference. Then, correct the initial price difference prediction results based on the corrected price difference to obtain the optimized price difference prediction value.
10. The regional coal price difference prediction method based on graph neural networks according to claim 9, characterized in that, The process involves constructing a convex quadratic programming problem based on the initial price spread prediction results, solving the convex quadratic programming problem through a differentiable optimization layer to obtain the corrected price spread, and then correcting the initial price spread prediction results based on the corrected price spread to obtain the optimized price spread prediction value, including: S3331. Using the initial price difference prediction result as the prior and the corrected price difference as the optimization variable, a convex optimization problem with economic and physical constraints is constructed by introducing an arbitrage penalty term and a flow conservation deviation term. S3332. Apply three types of linear constraints to the convex optimization problem to obtain a convex quadratic programming problem. Solve the convex quadratic programming problem through a differentiable optimization layer to obtain the corrected price difference. S3333: The corrected price difference and the error of the actual observation are included in the total loss. The spatiotemporal graph neural network model, the price difference prediction head and the optimization layer parameters are updated by joint backpropagation. The price difference is corrected by forward inference to obtain the optimized price difference prediction value.