Task scene spatio-temporal data prediction method, system and device and medium
By performing graph attention extraction and node causal inference intervention on the data to be predicted in the task scenario, the spatiotemporal data is obtained, and the problems of high difficulty and low quality prediction of spatiotemporal data in the prior art are solved, and higher quality and wider applicable spatiotemporal data prediction are achieved.
Patent Information
- Application Number
- CN202510150980.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-02-11
AI Technical Summary
The existing spatiotemporal data prediction technology is difficult to effectively reduce the difficulty of spatiotemporal data prediction, and the quality of the predicted spatiotemporal data is unsatisfactory, especially when the dynamic graph structure and the authenticity of spatiotemporal features are not fully considered.
By extracting the data to be predicted in the task scenario, obtaining the scene adaptive graph structure, and performing node causal inference and causal intervention, obtaining the causal graph structure, and finally performing spatiotemporal extraction of the causal graph structure to obtain the spatiotemporal data of the task scenario.
This method can reduce the difficulty of spatial and temporal data prediction, improve the data quality of spatial and temporal data prediction, and is suitable for non-Euclidean space spatiotemporal prediction scenarios, expanding the scope of application of spatial and temporal data prediction.
Smart Images

Figure CN120180073A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular, to a spatio-temporal data prediction method, system, device and medium for a task scenario. Background Art
[0002] Spatio-temporal data prediction refers to predicting the transformation of data in the future time dimension and space dimension based on historical observation data and known correlation relationships, and it can be applied in multiple fields (such as meteorology, traffic planning, urban development, natural disaster management, etc.) and has attracted much attention.
[0003] Currently, existing spatio-temporal data prediction technologies are mainly implemented based on graph neural networks (GNNs) or graph convolutional neural networks (GCNs). This method requires obtaining a fixed static prior graph structure and realizing spatio-temporal data prediction through this fixed static prior graph structure. It is difficult to perform spatio-temporal data prediction in this way, and the quality of the predicted spatio-temporal data is not satisfactory.
[0004] In addition, there are also some spatio-temporal data prediction technologies that realize spatio-temporal data prediction through an adaptive graph that can learn a dynamic graph structure. However, since this method does not consider the authenticity of spatio-temporal features in the adaptive graph, the quality of the predicted spatio-temporal data is also not satisfactory.
[0005] Therefore, the problems existing in the prior art still need to be solved and optimized urgently. Summary of the Invention
[0006] An object of the present invention is to solve at least to some extent one of the technical problems existing in the related art.
[0007] To this end, an object of an embodiment of the present invention is to provide a spatio-temporal data prediction method, system, device and medium for a task scenario, wherein the method can reduce the difficulty of spatio-temporal data prediction and improve the data quality of spatio-temporal data prediction.
[0008] To achieve the above technical object, the technical solutions adopted in the embodiments of the present application include:
[0009] In a first aspect, an embodiment of the present application provides a spatio-temporal data prediction method for a task scenario, including:
[0010] Obtain the data to be predicted for the task scenario;
[0011] Perform graph attention extraction on the data to be predicted to obtain a scene adaptive graph structure;
[0012] Perform node causal inference on the scene adaptive graph structure to obtain a first environmental node, where the first environmental node is the graph node with the smallest normalized attention value among all graph nodes in the scene adaptive graph structure;
[0013] Perform node causal intervention on the scene adaptive graph structure according to the first environmental node to obtain a causal graph structure;
[0014] Perform spatio-temporal extraction on the causal graph structure to obtain spatio-temporal data of the task scene.
[0015] In addition, according to the method of the above embodiments of the present application, the following additional technical features may also be provided:
[0016] Further, in an embodiment of the present application, the performing graph attention extraction on the data to be predicted to obtain a scene adaptive graph structure includes:
[0017] Obtain a plurality of original node feature representations according to the data to be predicted;
[0018] Perform a linear transformation on all the original node feature representations to obtain a plurality of intermediate node feature representations;
[0019] Perform multi-head attention aggregation on all the intermediate node feature representations to obtain the scene adaptive graph structure.
[0020] Further, in an embodiment of the present application, the performing node causal inference on the scene adaptive graph structure to obtain a first environmental node includes:
[0021] Obtain the total attention weight of each graph node of the scene adaptive graph structure, where the total attention weight is the sum of the attention weights of the target node and all its neighbor nodes, and the target node is any graph node of the scene adaptive graph structure;
[0022] Perform attention normalization on all the total attention weights to obtain a normalized attention value corresponding to each total attention weight;
[0023] Perform minimum value screening on all the normalized attention values to obtain a target attention value;
[0024] According to the target attention value, perform node screening on the graph nodes of the scene adaptive graph structure to obtain the first environmental node.
[0025] Further, in an embodiment of the present application, obtaining the total attention weight of the target node includes:
[0026] According to the scene adaptive graph structure, obtain a plurality of neighbor nodes of the target node and the corresponding neighbor attention weights for each neighbor node;
[0027] Sum up all the neighbor attention weights according to the node attention weight of the target node to obtain the total attention weight of the target node.
[0028] Further, in an embodiment of the present application, the performing node causal intervention on the scene adaptive graph structure according to the first environmental node to obtain a causal graph structure includes:
[0029] Obtain the time step index of the first environmental node;
[0030] Perform node causal update on the scene adaptive graph structure according to the time step index and the first environmental node to obtain the causal graph structure.
[0031] Further, in an embodiment of the present application, the performing node causal update on the scene adaptive graph structure according to the time step index and the first environmental node to obtain the causal graph structure includes:
[0032] Obtain the spatial neighboring nodes of the first environmental node in the scene adaptive graph structure, and obtain the time historical nodes of the first environmental node according to the time step index;
[0033] Perform spatio-temporal sampling on the spatial neighboring nodes and the time historical nodes to obtain spatio-temporal adjacent nodes;
[0034] Perform node update on the first environmental node in the scene adaptive graph structure according to the time step index, the spatial neighboring nodes, the time historical nodes, and the spatio-temporal adjacent nodes to obtain the causal graph structure.
[0035] Further, in an embodiment of the present application, the performing node update on the first environmental node in the scene adaptive graph structure according to the time step index, the spatial neighboring nodes, the time historical nodes, and the spatio-temporal adjacent nodes to obtain the causal graph structure includes:
[0036] Obtain the observation step index of the time historical nodes, and obtain the spatial node similarity, where the spatial node similarity is used to characterize the similarity between the spatial neighboring nodes and the first environmental node;
[0037] Perform time coefficient calculation on the time step index according to the observation step index to obtain a time decay coefficient;
[0038] Perform spatial coefficient calculation on the spatial node similarity to obtain a spatial mixing coefficient;
[0039] Update the spatio-temporal adjacent nodes according to the time decay coefficient and the space mixing coefficient to obtain the second environmental nodes;
[0040] Replace the first environmental nodes in the scene adaptive graph structure according to the second environmental nodes to obtain the causal graph structure.
[0041] In a second aspect, an embodiment of the present application provides a spatio-temporal data prediction system for a task scenario, including:
[0042] A first processing unit, configured to obtain data to be predicted for a task scenario;
[0043] A second processing unit, configured to perform graph attention extraction on the data to be predicted to obtain a scene adaptive graph structure;
[0044] A third processing unit, configured to perform node causal inference on the scene adaptive graph structure to obtain first environmental nodes, where the first environmental nodes are the graph nodes with the smallest normalized attention value among all graph nodes in the scene adaptive graph structure;
[0045] A fourth processing unit, configured to perform node causal intervention on the scene adaptive graph structure according to the first environmental nodes to obtain a causal graph structure;
[0046] A fifth processing unit, configured to perform spatio-temporal extraction on the causal graph structure to obtain spatio-temporal data of the task scenario.
[0047] In a third aspect, an embodiment of the present application further provides an electronic device, including:
[0048] At least one processor;
[0049] At least one memory, configured to store at least one program;
[0050] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0051] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a program executable by a processor is stored, and the program executable by the processor is used to implement the above method when executed by the processor.
[0052] The advantages and beneficial effects of the present application will be partially given in the following description, partially will become obvious from the following description, or be understood through the practice of the present application:
[0053] A method, system, device, and medium for predicting spatio-temporal data of a task scenario disclosed in an embodiment of the present application. In this method, data to be predicted in the task scenario is obtained; graph attention extraction is performed on the data to be predicted to obtain a scene-adaptive graph structure; node causal inference is performed on the scene-adaptive graph structure to obtain a first environmental node, where the first environmental node is the graph node with the smallest normalized attention value among all graph nodes in the scene-adaptive graph structure; based on the first environmental node, node causal intervention is performed on the scene-adaptive graph structure to obtain a causal graph structure; spatio-temporal extraction is performed on the causal graph structure to obtain the spatio-temporal data of the task scenario. By performing graph attention extraction on the data to be predicted in the task scenario, this method can obtain an adaptive graph structure corresponding to the task scenario, which is beneficial to reducing the difficulty of subsequent spatio-temporal data prediction and improving the data quality of spatio-temporal data prediction. In addition, this method also performs node causal inference on the scene-adaptive graph, specifically evaluating the authenticity of node associations in the adaptive graph structure through the environmental node with the smallest normalized attention value, which can further improve the data quality of subsequent spatio-temporal data prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following introduces the accompanying drawings related to the technical solutions in the embodiments of the present application or the prior art. It should be understood that the accompanying drawings below are only for conveniently and clearly expressing some embodiments of the technical solutions in the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.
[0055] Figure 1 It is a schematic flowchart of a method for predicting spatio-temporal data of a task scenario provided by an embodiment of the present application;
[0056] Figure 2 It is a schematic structural framework diagram of a system for predicting spatio-temporal data of a task scenario provided by an embodiment of the present application;
[0057] Figure 3 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0058] Embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present application, and should not be construed as a limitation of the present application. For the step numbers in the following embodiments, they are only set for the convenience of description and illustration, and no limitation is imposed on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0060] Currently, existing spatio-temporal data prediction technologies are mainly implemented based on graph neural networks (GNNs) or graph convolutional neural networks (GCNs). This approach requires obtaining a fixed static prior graph structure and realizing spatio-temporal data prediction through this fixed static prior graph structure. However, due to factors such as data protection and privacy protection, it is often difficult to obtain the real prior graph structure, and the fixed static prior graph structure has certain limitations on the ability of the model to learn cross-time and space dynamic evolution patterns. It is difficult to perform spatio-temporal data prediction through this method, and the quality of the predicted spatio-temporal data is not satisfactory.
[0061] In addition, there are also some spatio-temporal data prediction technologies that realize spatio-temporal data prediction through adaptive graphs that can learn dynamic graph structures. For example, using a learnable regional graph structure and a dynamic spatio-temporal graph network to model spatial correlations; for example, improving the ability of a graph convolutional neural network-gated recurrent unit to capture the spatio-temporal heterogeneity of the model by establishing a meta-node library; and for example, improving the performance of spatio-temporal data prediction through methods such as a self-supervised learning framework. Although the above spatio-temporal data prediction methods can capture different time-period characteristics and dynamic spatial characteristics, since they regard the adaptive graph as accurate and effective, they do not consider the authenticity of the spatio-temporal characteristics of the adaptive graph. Specifically, in practice, the graph structure obtained from the adaptive graph may observe uncorrelated nodes that have a certain connection in the actual space, that is, a completely adaptive graph is prone to generating spatial false associations, resulting in unsatisfactory data quality for subsequent spatio-temporal data prediction.
[0062] In addition, there are also extremely few spatio-temporal data prediction technologies that apply causal feature perception to spatio-temporal data prediction modeling. For example, they use vision transformers to identify causal regions in pictures; or they use interpretable causal frameworks to identify and intervene in spurious attributes across environments. None of the above spatio-temporal data prediction technologies consider spatio-temporal prediction scenarios in non-Euclidean spaces, and the applicable scope of spatio-temporal data prediction is relatively small.
[0063] In view of this, embodiments of the present invention provide a spatio-temporal data prediction method, system, device, and medium for a task scenario. Among them, this method can obtain an adaptive graph structure corresponding to the task scenario by performing graph attention extraction on the data to be predicted in the task scenario, so that this method not only does not need to pre-obtain a prior graph structure, but also helps to reduce the difficulty of subsequent spatio-temporal data prediction and improve the data quality of spatio-temporal data prediction. In addition, this method also performs node causal inference on the scene adaptive graph. Specifically, it evaluates the authenticity of node associations in the adaptive graph structure by normalizing the environmental nodes with the smallest attention values, which is conducive to judging whether the implicit associations between nodes that deviate from the real structure are accurate, thereby improving the data quality of subsequent spatio-temporal data prediction. Moreover, this method performs node causal inference and causal inference on the scene adaptive graph structure in sequence. Specifically, by screening the spatial information of the nodes in the scene adaptive graph structure, it can accurately eliminate the spurious spatio-temporal associations brought by the adaptive graph structure, effectively avoid the accumulation of false information from affecting the subsequent model's analysis of spatio-temporal evolution patterns, and at the same time fully consider spatio-temporal prediction scenarios in non-Euclidean spaces, thereby effectively expanding the applicable scope of spatio-temporal data prediction.
[0064] Refer to Figure 1 , in an embodiment of this application, a spatio-temporal data prediction method for a task scenario includes:
[0065] Step 110: Obtain the data to be predicted in the task scenario;
[0066] In an embodiment of this application, the task scenario can be an actual application scenario in fields such as meteorology, traffic planning, urban development, and natural disaster management. For example, in a wind power and photovoltaic power generation application scenario in the field of meteorology, the data to be predicted can be load data in a wind power and photovoltaic power generation net load prediction task, as well as data related to specific geographical locations such as wind power, photovoltaic power generation, wind speed, sunshine duration, and solar radiation intensity of a certain specific node. Or, in a traffic flow prediction application scenario in the field of traffic planning, the data to be predicted can be data related to spatial nodes such as taxi trip records and bicycle trajectories. Similarly, the data to be predicted in other fields can be simply deduced by analogy, and this application will not elaborate further here.
[0067] Step 120: Perform graph attention extraction on the data to be predicted to obtain a scene-adaptive graph structure;
[0068] In the embodiment of the present application, first, a graph attention network (GAT) based on the spatial domain can be obtained, and the data to be predicted is input into the graph attention network. The graph attention network performs graph attention extraction on the data to be predicted, thereby obtaining an explicit scene-adaptive graph structure output by the graph attention network.
[0069] In some embodiments, Step 120: Perform graph attention extraction on the data to be predicted to obtain a scene-adaptive graph structure, includes:
[0070] A1. Obtain a plurality of original node feature representations according to the data to be predicted;
[0071] A2. Perform a linear transformation on all the original node feature representations to obtain a plurality of intermediate node feature representations;
[0072] A3. Perform multi-head attention aggregation on all the intermediate node feature representations to obtain the scene-adaptive graph structure.
[0073] In the embodiment of the present application, first, the corresponding original node feature representations can be obtained based on the attributes or feature information of the data to be predicted; then, a linear transformation is performed on each original node feature representation respectively, thereby projecting each original node feature representation into a low-dimensional space to obtain an intermediate node feature representation corresponding to each original node feature representation.
[0074] It can be understood that for a certain intermediate node feature representation, Step A3 can be to calculate the attention weights between this intermediate node feature representation and each of its neighboring intermediate node feature representations based on the multi-head attention mechanism, and then aggregate the feature information of this intermediate node feature representation and its neighboring intermediate node feature representations through the obtained attention weights to obtain the aggregated intermediate node feature representation. The same applies to the remaining intermediate node feature representations and can be simply deduced by analogy. After obtaining all the aggregated intermediate node feature representations, the graph attention network can dynamically generate an explicit graph structure (i.e., the scene-adaptive graph structure) based on all the aggregated intermediate node feature representations.
[0075] Step 130: Perform node causal inference on the scene-adaptive graph structure to obtain a first environmental node, where the first environmental node is the graph node with the smallest normalized attention value among all the graph nodes in the scene-adaptive graph structure;
[0076] In the embodiments of the present application, based on the attention weights of each graph node in the scene adaptive graph structure, the first environmental node with the smallest normalized attention value in the scene adaptive graph structure can be determined, and the first environmental node is used to represent the spatial false association of the scene adaptive graph structure.
[0077] In some embodiments, step 130, performing node causal inference on the scene adaptive graph structure to obtain a first environmental node, includes:
[0078] B1. Obtain the total attention weight of each graph node in the scene adaptive graph structure, where the total attention weight is the sum of the attention weights between the target node and all its neighbor nodes, and the target node is any graph node in the scene adaptive graph structure;
[0079] Further, obtaining the total attention weight of the target node includes:
[0080] B11. According to the scene adaptive graph structure, obtain several neighbor nodes of the target node and the corresponding neighbor attention weights for each neighbor node;
[0081] B12. Perform attention weight summation on all the neighbor attention weights according to the node attention weight of the target node to obtain the total attention weight of the target node.
[0082] In the embodiments of the present application, step B1 may first be to obtain the attention weight matrix corresponding to all graph nodes of the scene adaptive graph structure, and this attention weight matrix can be obtained in the aforementioned step A3 multi-head attention aggregation stage; then, for one graph node (i.e., the target node), the node attention weight corresponding to the target node in the attention weight matrix and the neighbor attention weights corresponding to each neighbor node of the target node in the attention weight matrix can be obtained; next, based on weighted summation of the node attention weight and all neighbor attention weights, the total attention weight of the target node can be obtained.
[0083] It can be understood that in the attention weight matrix corresponding to the scene adaptive graph structure, the following relationship exists for each matrix row, which can be expressed as:
[0084]
[0085] where a i,* is the attention weight relationship of the i-th matrix row in the attention weight matrix; N is the total number of matrix columns of the attention weight matrix; a i,j is the attention weight of the j-th matrix column in the i-th matrix row of the attention weight matrix, that is, the attention weight of the i-th graph node in the scene adaptive graph structure to the j-th graph node.
[0086] It should be noted that, due to the above relationships existing in each row of the attention weight matrix, the rows of the attention weight matrix cannot distinguish the importance of each graph node in the scene adaptive graph structure. Therefore, in the embodiments of the present application, by summing the attention weights of the target node and its neighbor nodes, the total attention weight obtained can effectively reflect the importance of the neighbor nodes to the target node, and the total attention weight of the target node can be expressed as:
[0087]
[0088] where a *,j is the total attention weight of the target node; N is the total number of rows of the attention weight matrix.
[0089] It is worth noting that the excellent performance of the spatio-temporal prediction model is accompanied by a large number of complex operations. In the embodiments of the present application, the importance of the target node is described by the attention weight, which can achieve node causal inference without introducing any additional variables, facilitating the reduction of the computing resources required for the spatio-temporal prediction model to perform spatio-temporal data prediction and improving the efficiency of spatio-temporal data prediction.
[0090] B2. Perform attention normalization on all the total attention weights to obtain a normalized attention value corresponding to each total attention weight;
[0091] B3. Perform minimum value screening on all the normalized attention values to obtain a target attention value;
[0092] B4. According to the target attention value, perform node screening on the graph nodes of the scene adaptive graph structure to obtain the first environmental node.
[0093] In the embodiments of the present application, for a certain target node, step B2 may be to perform attention normalization on the target node based on the corresponding total attention weight, so as to obtain a normalized attention value corresponding to the target node, and the normalized attention value can be expressed as:
[0094]
[0095] where a j is the normalized attention value of the target node.
[0096] It can be understood that after obtaining the normalized attention values of each graph node in the scene adaptive graph structure, step B3 may be to perform comparison and screening on all the normalized attention values, and determine the smallest normalized attention value among all the normalized attention values as the target attention value; step B4 may be to determine the graph node corresponding to the target attention value in the scene adaptive graph structure as the first environmental node.
[0097] Step 140: Perform node causal intervention on the scene adaptive graph structure according to the first environmental node to obtain a causal graph structure;
[0098] In the embodiment of the present application, based on the first environmental node, causal intervention can be performed on the false associations of the nodes in the scene adaptive graph structure, so as to reduce the unstable influence brought by the false associations of the nodes on the scene adaptive graph structure, thereby obtaining a causal graph structure.
[0099] In some embodiments, step 140: Perform node causal intervention on the scene adaptive graph structure according to the first environmental node to obtain a causal graph structure, includes:
[0100] C1: Obtain the time step index of the first environmental node;
[0101] C2: Perform node causal update on the scene adaptive graph structure according to the time step index and the first environmental node to obtain the causal graph structure.
[0102] Further, step C2: Perform node causal update on the scene adaptive graph structure according to the time step index and the first environmental node to obtain the causal graph structure, includes:
[0103] C21: Obtain the spatial neighboring nodes of the first environmental node in the scene adaptive graph structure, and obtain the time historical nodes of the first environmental node according to the time step index;
[0104] C22: Perform spatio-temporal sampling on the spatial neighboring nodes and the time historical nodes to obtain spatio-temporally adjacent nodes;
[0105] In the embodiment of the present application, first, the time step index of the first environmental node and the spatial neighboring nodes of the first environmental node in the scene adaptive graph structure can be obtained. The spatial neighboring nodes are neighbor nodes that are directly or indirectly associated with the first environmental node in the topological structure of the scene adaptive graph structure, and they may be connected to the first environmental node through physical or logical edges. Additionally, based on the time step index of the first environmental node, the time historical nodes of the first environmental node before the time point indicated by the time step index are obtained. The time historical nodes are used to indicate the state of the first environmental node itself at past time points.
[0106] It can be understood that step C22 may be to use spatially adjacent nodes as node data in the spatial dimension and time historical nodes as node data in the time dimension, and then perform mixed sampling on the spatially adjacent nodes and the time historical nodes to obtain spatio-temporal adjacent nodes, which are used to represent nodes having a true causal relationship with the first environmental node, including both the spatial information of the spatially adjacent nodes and the dynamic changes of the time historical nodes, which is beneficial to improving the subsequent model's ability to capture the spatio-temporal dependence relationship of the data.
[0107] C23. Update the first environmental node in the scene adaptive graph structure according to the time step index, the spatially adjacent nodes, the time historical nodes, and the spatio-temporal adjacent nodes to obtain the causal graph structure.
[0108] Further, step C23, updating the first environmental node in the scene adaptive graph structure according to the time step index, the spatially adjacent nodes, the time historical nodes, and the spatio-temporal adjacent nodes to obtain the causal graph structure, includes:
[0109] C231. Obtain the observation step index of the time historical node and obtain the spatial node similarity, where the spatial node similarity is used to represent the similarity between the spatially adjacent node and the first environmental node;
[0110] C232. Calculate the time coefficient of the time step index according to the observation step index to obtain the time decay coefficient;
[0111] C233. Calculate the spatial coefficient of the spatial node similarity to obtain the spatial mixing coefficient;
[0112] C234. Update the spatio-temporal adjacent nodes according to the time decay coefficient and the spatial mixing coefficient to obtain the second environmental node;
[0113] C235. Replace the first environmental node in the scene adaptive graph structure according to the second environmental node to obtain the causal graph structure.
[0114] In the embodiment of the present application, step C231 may be to obtain the observation step index corresponding to the time historical node and the similarity between the first environmental node and the spatially adjacent node; then, capture the time dependence between the time historical node and the first environmental node in the historical time series by the observation step index and the time step index to obtain the time decay coefficient, and the time decay coefficient can be expressed as:
[0115]
[0116] Among them, is the time decay coefficient; t is the time step index; r is the observation step index; ζ is the standard deviation.
[0117] It can be understood that step C233 can calculate the spatial mixing coefficient based on the spatial node similarities of several spatially adjacent nodes, and the spatial mixing coefficient can be expressed as:
[0118]
[0119] Among them, is the spatial mixing coefficient; is the spatial node similarity between the m-th spatially adjacent node and the first environmental node; M is the maximum index number of the spatially adjacent nodes.
[0120] It should be noted that after obtaining the time decay coefficient and the spatial mixing coefficient, the spatio-temporal adjacent nodes can be updated based on the obtained time decay coefficient and spatial mixing coefficient, so as to obtain a second environmental node for updating the scene adaptive graph structure, and the second environmental node can be expressed as:
[0121]
[0122] Among them, is the second environmental node; R is the maximum total length of time steps of the observation step index; is the spatio-temporal adjacent node.
[0123] It is worth mentioning that after obtaining the second environmental node, the corresponding first environmental node in the scene adaptive graph structure can be replaced based on the second environmental node, so as to obtain a replaced and updated scene adaptive graph structure, and the replaced and updated scene adaptive graph structure is determined as the causal graph structure.
[0124] Step 150: Perform spatio-temporal extraction on the causal graph structure to obtain the spatio-temporal data of the task scene.
[0125] In the embodiment of the present application, the spatial encoder can be used to extract spatial features of the graph nodes in the causal graph structure, so as to obtain spatial prediction data corresponding to the data to be predicted in the task scene; and the gated recurrent unit (GRU) in the RNN network can be used to extract time features of the graph nodes in the causal graph structure, so as to obtain time prediction data corresponding to the data to be predicted in the task scene; then the spatial prediction data and the time prediction data are integrated to obtain the spatio-temporal data of the task scene.
[0126] Next, a spatio-temporal data prediction system for a task scene proposed according to an embodiment of the present application will be described in detail with reference to the accompanying drawings.
[0127] Refer toFigure 2 , a spatio-temporal data prediction system for a task scenario proposed in an embodiment of the present application, includes:
[0128] A first processing unit 101, configured to obtain data to be predicted for the task scenario;
[0129] A second processing unit 102, configured to perform graph attention extraction on the data to be predicted to obtain a scene-adaptive graph structure;
[0130] A third processing unit 103, configured to perform node causal inference on the scene-adaptive graph structure to obtain a first environmental node, where the first environmental node is the graph node with the smallest normalized attention value among all graph nodes in the scene-adaptive graph structure;
[0131] A fourth processing unit 104, configured to perform node causal intervention on the scene-adaptive graph structure according to the first environmental node to obtain a causal graph structure;
[0132] A fifth processing unit 105, configured to perform spatio-temporal extraction on the causal graph structure to obtain the spatio-temporal data of the task scenario.
[0133] It can be understood that the content in the above method embodiments is applicable to the system embodiments of the present application. The functions specifically implemented by the system embodiments of the present application are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.
[0134] Referring to Figure 3 , an embodiment of the present application further provides an electronic device, including:
[0135] At least one processor 201;
[0136] At least one memory 202, configured to store at least one program;
[0137] When the at least one program is executed by the at least one processor 201, the at least one processor 201 implements the above method embodiments.
[0138] Similarly, it can be understood that the content in the above method embodiments is applicable to the device embodiments of the present application. The functions specifically implemented by the device embodiments of the present application are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.
[0139] An embodiment of the present application further provides a computer-readable storage medium, in which a program executable by a processor 201 is stored, and the program executable by the processor 201 is used to implement the above method embodiments when executed by the processor 201.
[0140] Similarly, the content in the above method embodiments is applicable to this computer-readable storage medium embodiment. The functions specifically implemented in this computer-readable storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.
[0141] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order mentioned in the operation diagrams. For example, depending on the functions / operations involved, two consecutive blocks shown may actually be executed substantially simultaneously or the blocks can sometimes be executed in the reverse order. Additionally, the embodiments presented and described in the flowcharts of the present application are provided by way of example for the purpose of providing a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated where the order of various operations is changed and where sub-operations described as part of a larger operation are executed independently.
[0142] Furthermore, although the present application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It can also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present application. Rather, considering the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the modules will be understood within the ordinary skills of an engineer. Thus, those skilled in the art can implement the present application as set forth in the claims without undue experimentation. It can also be understood that the specific concepts disclosed are illustrative only and are not intended to limit the scope of the present application, which is determined by the full scope of the appended claims and their equivalents.
[0143] If a function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0144] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definable sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in conjunction with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0145] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection part (electronic device) having one or more wirings, a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, a computer-readable medium can even be paper or other suitable media on which a program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then stored in a computer memory.
[0146] It should be understood that various parts of the present application can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having suitable combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), and the like.
[0147] In the above description of this specification, the description with reference to the terms "one embodiment / Example", "another embodiment / Example", or "certain embodiments / Examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0148] Although embodiments of the present application have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present application. The scope of the present application is defined by the claims and their equivalents.
[0149] The above has specifically described the preferred embodiments of the present application, but the present application is not limited to the embodiments. Those skilled in the art can make various equivalent deformations or substitutions without violating the spirit of the present application, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present application.
Claims
1. A method for predicting spatiotemporal data of a task scenario, characterized in that: include: Obtain the data to be predicted for the task scenario; Performing graph attention extraction on the data to be predicted to obtain a scene-adaptive graph structure; Performing node causal inference on the scene adaptive graph structure to obtain a first environment node, where the first environment node is a graph node with a minimum normalized attention value among all graph nodes in the scene adaptive graph structure; According to the first environment node, performing node causal intervention on the scene adaptive graph structure to obtain a causal graph structure; Performing spatiotemporal extraction on the causal graph structure to obtain spatiotemporal data of the task scenario.
2. The method according to claim 1, characterized in that The step of performing graph attention extraction on the data to be predicted to obtain a scene adaptive graph structure includes: According to the data to be predicted, obtaining several original node feature representations; Performing linear transformation on all the original node feature representations to obtain several intermediate node feature representations; Multi-head attention aggregation is performed on all the intermediate node feature representations to obtain the scene adaptive graph structure.
3. The method according to claim 1, characterized in that The performing node causal inference on the scene adaptive graph structure to obtain a first environment node includes: Obtaining a total attention weight of each graph node of the scene adaptive graph structure, where the total attention weight is the sum of the attention weights of a target node and all neighboring nodes of the target node, and the target node is any graph node of the scene adaptive graph structure; Performing attention normalization on all the total attention weights to obtain a normalized attention value corresponding to each total attention weight; Perform minimum value screening on all the normalized attention values to obtain a target attention value; According to the target attention value, node screening is performed on the graph nodes of the scene adaptive graph structure to obtain the first environment node.
4. The method according to claim 3, characterized in that Obtain the total attention weight of the target node, including: According to the scene adaptive graph structure, a plurality of neighbor nodes of the target node and a neighbor attention weight corresponding to each of the neighbor nodes are obtained; According to the node attention weight of the target node, the attention weights of all the neighbor attention weights are summed to obtain the total attention weight of the target node.
5. The method according to claim 1, characterized in that: The step of performing node causal intervention on the scene adaptive graph structure according to the first environment node to obtain a causal graph structure includes: Obtaining a time step index of the first environment node; According to the time step index and the first environment node, the scene adaptive graph structure is causally updated to obtain the causal graph structure.
6. The method according to claim 5, characterized in that The step of performing node causal updating on the scene adaptive graph structure according to the time step index and the first environment node to obtain the causal graph structure includes: Acquire spatial neighboring nodes of the first environment node in the scene adaptive graph structure, and acquire a time history node of the first environment node according to the time step index; Performing spatiotemporal sampling on the spatially adjacent nodes and the temporal historical nodes to obtain spatiotemporal adjacent nodes; According to the time step index, the spatial neighboring node, the time history node and the spatiotemporal neighboring node, a node update is performed on the first environment node in the scene adaptive graph structure to obtain the causal graph structure.
7. The method according to claim 6, characterized in that The step of updating the first environment node in the scene adaptive graph structure according to the time step index, the spatial neighboring node, the time history node, and the spatiotemporal neighboring node to obtain the causal graph structure includes: Obtaining an observation step index of the time history node, and obtaining a spatial node similarity, wherein the spatial node similarity is used to characterize a similarity between the spatial neighboring node and the first environment node; According to the observation step index, a time coefficient is calculated for the time step index to obtain a time attenuation coefficient; Calculating the spatial coefficient of the spatial node similarity to obtain a spatial mixing coefficient; According to the time attenuation coefficient and the space mixing coefficient, updating the spatiotemporal adjacent nodes to obtain a second environment node; According to the second environment node, the first environment node in the scene adaptive graph structure is replaced to obtain the causal graph structure.
8. A spatiotemporal data prediction system for a task scenario, characterized in that: include: A first processing unit, used to obtain data to be predicted for a task scenario; A second processing unit is used to perform graph attention extraction on the data to be predicted to obtain a scene adaptive graph structure; A third processing unit is used to perform node causal inference on the scene adaptive graph structure to obtain a first environment node, where the first environment node is a graph node with a minimum normalized attention value among all graph nodes in the scene adaptive graph structure; a fourth processing unit, configured to perform node causal intervention on the scene adaptive graph structure according to the first environment node to obtain a causal graph structure; The fifth processing unit is used to perform spatiotemporal extraction on the causal graph structure to obtain spatiotemporal data of the task scenario.
9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Patent Citations
Dynamic graph neural network prediction method and product under space-time distribution migration
CN115828987A
Time sequence causal discovery method and device based on intervention data, equipment and medium
CN117648983A
Track prediction method under scene fusion based on space-time structure causal model
CN117933397A
Method and device for converting natural language to SQL (Structured Query Language) query statement based on causal inference
CN118093641A
Traffic network abnormal situation spatio-temporal evolution method fusing causal inference
CN118197047A