Spatial-temporal data extrapolation method, device, equipment, medium and product
Through the conditional denoising diffusion probability model and spatio-temporal graph generation module, the problems of high computational complexity and inaccurate data in spatio-temporal data extrapolation are solved, and more accurate prediction of air quality data and the effect of reducing data collection costs are achieved.
Patent Information
- Application Number
- CN202411249716.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-13
AI Technical Summary
Existing data extrapolation methods have high computational complexity when processing spatiotemporal data, making it difficult to process the complexity of meteorological data, resulting in inaccurate air quality data, especially in the case of high deployment costs of meteorological monitoring stations, which cannot be effectively perceived or reasoned. Data covering the area.
The conditional denoising diffusion probability model is adopted, and the spatio-temporal map is constructed through the distribution aggregation module, the spatio-temporal map generation module and the attention mechanism module, and the reverse iterative sampling is performed to obtain the air quality data of the monitoring site to be predicted, and the changes in the spatio-temporal map are considered to improve the Accuracy of data extrapolation.
More accurate prediction of air quality data is achieved, reducing dependence on sensors, reducing data collection costs, and improving the generalization ability of the model and the accuracy of decision-making.
Smart Images

Figure CN119129415A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data extrapolation technology, and in particular to a method, device, equipment, medium and product for spatiotemporal data extrapolation. Background Art
[0002] Due to the limitations of sensor collection range and deployment cost, only spatiotemporal data of part of the entire target area can be obtained. Therefore, these spatiotemporal data are discrete and sparse. The lack of such data may lead to economic losses and waste of decision-making costs. In order to cope with the challenges caused by this sparsity, a method is needed to infer data that cannot be perceived outside the sensor deployment area, which is called data extrapolation.
[0003] Traditional numerical data extrapolation methods have high computational complexity when processing large-scale spatiotemporal data and require a lot of prior knowledge and computing resources. With the development of Internet of Things technology, spatiotemporal data scenarios are increasing, and traditional methods are stretched in the scheduling of human and material resources. Although machine learning and early neural networks have made some progress in simulating traditional numerical physical models, most of these methods are direct inference methods, that is, they are only suitable for data reasoning at fixed locations, not for scenarios where the reasoning location changes dynamically. These models have limited generalization capabilities in cross-domain tasks, especially in scenarios with unknown distributions. The expressiveness of the models is significantly restricted. Although the latest extrapolation methods have begun to pay attention to extracting information from graph structures, these methods often only target a single variable, or simply map the covariates of the target area to assist in the information transmission of air quality data, without fully utilizing the complexity and dynamics of spatiotemporal data.
[0004] In most spatiotemporal data scenarios, such as air quality monitoring, due to the deployment cost of meteorological monitoring stations, meteorological personnel can only obtain meteorological data in a small area. There is a lack of effective perception or reasoning solutions for areas that are not covered by monitoring stations. This causes a lack of information to a certain extent, leading to possible decision-making errors. In addition, traditional spatiotemporal data extrapolation methods often find it difficult to handle the complexity of meteorological data between different regions, resulting in inaccurate air quality data.
[0005] In summary, the air quality data obtained by the existing data extrapolation method is not accurate. Summary of the invention
[0006] The purpose of this application is to provide a spatiotemporal data extrapolation method, device, equipment, medium and product to obtain more accurate air quality data.
[0007] To achieve the above objectives, this application provides the following solutions:
[0008] In a first aspect, the present application provides a method for extrapolating spatiotemporal data, comprising:
[0009] Obtain a prediction set; the prediction set includes: exogenous covariates at the monitoring site to be predicted, exogenous covariates at the preset context node, air quality data at the preset context node, and a static topological relationship between the preset context node and the monitoring site to be predicted; the preset context node is a monitoring site within a set range of the monitoring site to be predicted;
[0010] Constructing a conditional denoising diffusion probability model; the conditional denoising diffusion probability model includes a distribution aggregation module, a spatiotemporal graph generation module and an attention mechanism module; the distribution aggregation module and the spatiotemporal graph generation module are both connected to the attention mechanism module;
[0011] The prediction set is input into a denoising diffusion model, and reverse iterative sampling is performed to obtain the air quality data at the monitoring site to be predicted; the denoising diffusion model is obtained by training a conditional denoising diffusion probability model; the distribution aggregation module is used to obtain the first noise information of the monitoring site to be predicted based on the prediction set; the spatiotemporal graph generation module is used to obtain a spatiotemporal graph based on the exogenous covariates at the monitoring site to be predicted and the air quality data at the preset context nodes, and aggregate the spatiotemporal graph to obtain the second noise information of the monitoring site to be predicted; the attention mechanism module is used to obtain the air quality data at the monitoring site to be predicted based on the first noise information of the monitoring site to be predicted and the second noise information of the monitoring site to be predicted.
[0012] In a second aspect, the present application provides a spatiotemporal data extrapolation device, comprising:
[0013] An acquisition module is used to acquire a prediction set; the prediction set includes: exogenous covariates at the monitoring site to be predicted, exogenous covariates at the preset context node, air quality data at the preset context node, and a static topological relationship between the preset context node and the monitoring site to be predicted; the preset context node is a monitoring site within a set range of the monitoring site to be predicted;
[0014] A construction module is used to construct a conditional denoising diffusion probability model; the conditional denoising diffusion probability model includes a distribution aggregation module, a spatiotemporal graph generation module and an attention mechanism module; the distribution aggregation module and the spatiotemporal graph generation module are both connected to the attention mechanism module;
[0015] The prediction module is used to input the prediction set into the denoising diffusion model, perform reverse iterative sampling, and obtain the air quality data at the monitoring site to be predicted; the denoising diffusion model is obtained by training the conditional denoising diffusion probability model; the distribution aggregation module is used to obtain the first noise information of the monitoring site to be predicted based on the prediction set; the spatiotemporal graph generation module is used to obtain the spatiotemporal graph based on the exogenous covariates at the monitoring site to be predicted and the air quality data at the preset context nodes, and aggregate the spatiotemporal graph to obtain the second noise information of the monitoring site to be predicted; the attention mechanism module is used to obtain the air quality data at the monitoring site to be predicted based on the first noise information of the monitoring site to be predicted and the second noise information of the monitoring site to be predicted.
[0016] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-described spatiotemporal data extrapolation methods.
[0017] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the above-described spatiotemporal data extrapolation methods.
[0018] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any one of the above-mentioned spatiotemporal data extrapolation methods.
[0019] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0020] The present application provides a method, apparatus, device, medium and product for extrapolating spatiotemporal data. A spatiotemporal graph generation module is set in a conditional denoising diffusion probability model, a spatiotemporal graph is obtained based on the exogenous covariates at the monitoring site to be predicted and the air quality data at the preset context nodes, and the spatiotemporal graph is aggregated. The spatiotemporal graph is taken into account in the process of data extrapolation, which can better perceive the changes in external data and make the generated air quality data more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1This is an application environment diagram of a spatiotemporal data extrapolation method in one embodiment of the present application;
[0023] Figure 2 A schematic diagram of a flow chart of a spatiotemporal data extrapolation method provided in one embodiment of the present application;
[0024] Figure 3 A schematic diagram of a spatiotemporal data extrapolation scenario process provided in an embodiment of the present application;
[0025] Figure 4 A flow chart of model training and sampling in a spatiotemporal data extrapolation method provided in one embodiment of the present application;
[0026] Figure 5 A schematic diagram of the structure of a computer device provided in one embodiment of the present application;
[0027] Figure 6 A flow chart of distribution in a distribution aggregation module provided in an embodiment of the present application;
[0028] Figure 7 A workflow diagram of a distribution aggregation module provided in one embodiment of the present application;
[0029] Figure 8 A workflow diagram of a space-time graph generation module provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0032] The spatiotemporal data extrapolation method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, integrated on the server 104, or placed on the cloud or other servers. The terminal 102 can send the prediction set to be processed to the server 104. After the server 104 receives the prediction set to be processed, for the prediction set to be processed, the server 104 inputs the prediction set into the denoising diffusion model, performs reverse iterative sampling, and obtains the air quality data at the monitoring site to be predicted; the denoising diffusion model is obtained by training the conditional denoising diffusion probability model; the distribution aggregation module is used to obtain the first noise information of the monitoring site to be predicted according to the prediction set; the spatiotemporal graph generation module is used to obtain the spatiotemporal graph according to the exogenous covariates at the monitoring site to be predicted and the air quality data at the preset context node, and aggregate the spatiotemporal graph to obtain the second noise information of the monitoring site to be predicted; the attention mechanism module is used to obtain the air quality data at the monitoring site to be predicted according to the first noise information of the monitoring site to be predicted and the second noise information of the monitoring site to be predicted. The server 104 can feed back the obtained air quality data at the monitoring site to be predicted to the terminal 102. In addition, in some embodiments, the spatiotemporal data extrapolation method can also be implemented by the server 104 or the terminal 102 alone, such as the terminal 102 can directly perform spatiotemporal extrapolation on the prediction set, or the server 104 can obtain the prediction set from the data storage system and perform spatiotemporal extrapolation on the prediction set.
[0033] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.
[0034] In an exemplary embodiment, Figure 2 As shown, a method for extrapolating spatiotemporal data is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, Figure 3As shown, the model is trained on extrapolation tasks using historical data to acquire the ability to learn the causal relationship between covariates and target variables that change over time and to perform extrapolation using the above causal relationship and the target variable of the aggregated context node. The trained model is used for extrapolation tasks in the current time period. In the current time period, the trained model learns the causal relationship between the exogenous covariates and the target variable in the current time period, and aggregates the air quality data of the context node to the target node. Finally, these two parts of information are used for joint learning, and the denoising diffusion probability model is used to generate the target variable (air quality information) at the target location. This method is applied to Figure 1 The server 104 in the example is used as an example to illustrate, including the following steps 201 to 203. Among them:
[0035] Step 201: Obtain a prediction set; the prediction set includes: an exogenous covariate X at the monitoring site to be predicted, an exogenous covariate X' at a preset context node, air quality data (PM2.5) Y' at the preset context node, and a static topological relationship Astat between the preset context node and the monitoring site to be predicted; the preset context node is a monitoring site within the set range of the monitoring site to be predicted. The exogenous covariate has a lower collection cost than the air quality data, so it is used as auxiliary information.
[0036] Step 202: construct a conditional denoising diffusion probability model; the conditional denoising diffusion probability model includes a distribution aggregation module, a spatiotemporal graph generation module and an attention mechanism module; the distribution aggregation module and the spatiotemporal graph generation module are both connected to the attention mechanism module.
[0037] Step 203: Input the prediction set into the denoising diffusion model, perform reverse iterative sampling, and obtain the air quality data at the monitoring site to be predicted; the denoising diffusion model is obtained by training the conditional denoising diffusion probability model; the distribution aggregation module is used to obtain the first noise information of the monitoring site to be predicted based on the prediction set; the spatiotemporal graph generation module is used to obtain the spatiotemporal graph based on the exogenous covariates at the monitoring site to be predicted and the air quality data at the preset context nodes, and aggregate the spatiotemporal graph to obtain the second noise information of the monitoring site to be predicted; the attention mechanism module is used to obtain the air quality data at the monitoring site to be predicted based on the first noise information of the monitoring site to be predicted and the second noise information of the monitoring site to be predicted.
[0038] The spatiotemporal graph generation module proposed in this application can capture the complex correlations between spatiotemporal data by generating spatiotemporal graphs to obtain more accurate air quality data, and has a certain generalization ability to help experts make better decisions. For example, before sudden meteorological disasters, it can provide advance numerical estimates and uncertainty considerations for locations that cannot be covered by sensors to optimize decisions.
[0039] In practical applications, the exogenous covariates specifically include: temperature, humidity, wind speed and wind direction.
[0040] In practical applications, the steps of training the conditional denoising diffusion probability model to obtain the denoising diffusion model specifically include:
[0041] The air quality data at the target monitoring site, the exogenous covariates at the target monitoring site, and the static topological relationship Astat' (static adjacency matrix) between the target monitoring site and the monitoring site to be predicted are obtained.
[0042] The denoised diffusion model is obtained by training the conditional denoised diffusion probability model based on the air quality data at the target monitoring station, the exogenous covariates at the target monitoring station, and the static topological relationship between the target monitoring station and the monitoring station to be predicted.
[0043] In practical applications, the conditional denoising diffusion probability model is trained according to the air quality data at the target monitoring site, the exogenous covariates at the target monitoring site, and the static topological relationship between the target monitoring site and the monitoring site to be predicted to obtain the denoising diffusion model, which specifically includes:
[0044] The air quality data at the target monitoring site and the exogenous covariates at the target monitoring site are divided into a context node set in proportion, also known as a validation set Dataset val The target node set is also called the training set Dataset train , two data sets do not intersect, that is, Dataset train ⊥Dataset val , and each data set includes air quality data and exogenous covariates corresponding to the air quality data.
[0045] In the current diffusion step, the noisy target data Y in the previous diffusion step is t'-1 Add the noise corresponding to the current diffusion step to obtain the target data Y with noise in the current diffusion step t' ; The noisy target data in the initial diffusion step is the air quality data Y" in the target node set.
[0046] The static topological relationship between the target monitoring site and the monitoring site to be predicted, the noisy target data of the current diffusion step, the exogenous covariate X'' in the target node set and the context node set (including the air quality data Y''' of the context node and the exogenous covariate X''' of the context node) are input into the distribution aggregation module in the conditional denoising diffusion probability model of the previous diffusion step to obtain the first noise information of the target monitoring site.
[0047] The noisy target data of the current diffusion step, the exogenous covariates in the target node set and the air quality data in the context node set are input into the spatiotemporal graph generation module in the conditional denoising diffusion probability model of the previous diffusion step to obtain the second noise information of the target monitoring site.
[0048] The first noise information of the target monitoring site and the second noise information of the target monitoring site are input into the attention mechanism module in the conditional denoising diffusion probability model of the previous diffusion step to obtain the predicted noise of the current diffusion step.
[0049] According to the predicted noise of the current diffusion step and the noise corresponding to the current diffusion step, the loss function value of the current diffusion step is obtained. The loss function is Loss = ||∈-∈θ(Y t‘ ,X”,C,Astat',t')|| 2 , where ∈ represents the noise corresponding to the current diffusion step, ∈θ(Y t' ,X”,C,Astat',t') is the prediction noise of the current diffusion step, Y t' represents the noisy target data of the current diffusion step t', X'' represents the exogenous covariates in the target node set, C represents the context node set (Y'', X''), including the air quality data and exogenous covariates at the target monitoring site, Astat' represents the static topological relationship between the target monitoring site and the monitoring site to be predicted, and t' represents the degree of noise added by the diffusion model in the entire noise addition / denoising process.
[0050] According to the loss function value of the current diffusion step, the conditional denoising diffusion probability model of the previous diffusion step is trained to obtain the conditional denoising diffusion probability model of the current diffusion step.
[0051] Let the current diffusion step be increased by 1, and then return to the current diffusion step, add the noise corresponding to the current diffusion step to the noisy target data of the previous diffusion step, and obtain the step of the noisy target data of the current diffusion step, until the conditional denoising diffusion probability model of the set diffusion step T (the total number of diffusion steps set in advance) is obtained, and let the conditional denoising diffusion probability model of the set diffusion step be the denoising diffusion model.
[0052] In practical applications, the noisy target data Y in the previous diffusion step t'-1 Add the noise corresponding to the current diffusion step to obtain the target data Y with noise in the current diffusion step t' , specifically: For each diffusion step t'=1,2,...,T, add noise ∈ using the following formula: Among them, βt is the hyperparameter that controls the noise variance of each step, which is the noise corresponding to the current diffusion step and is preset.
[0053] In practical applications, the prediction set is input into the denoising diffusion model, and reverse iterative sampling is performed to obtain the air quality data at the monitoring site to be predicted, which aims to sample from the preset context nodes and the exogenous covariates at the monitoring site to be predicted through the denoising diffusion model to predict the air quality data of the monitoring site to be predicted, specifically including:
[0054] In the t-th reverse diffusion step, the target data with noise at the monitoring site to be predicted in the t-th reverse diffusion step and the prediction set are input into the distribution aggregation module in the denoising diffusion model to obtain the first noise information of the monitoring site to be predicted. The target data with noise at the monitoring site to be predicted in the initial reverse diffusion step is preset and conforms to the standard normal distribution, specifically, the target data initially sampled from the standard normal distribution is pure noise.
[0055] The exogenous covariates at the monitoring site to be predicted, the exogenous covariates at the preset context nodes and the air quality data at the preset context nodes are input into the space-time graph generation module in the denoising diffusion model to obtain the second noise information of the monitoring site to be predicted.
[0056] The first noise information of the monitoring site to be predicted and the second noise information of the monitoring site to be predicted are input into the attention mechanism module in the denoising diffusion model to obtain the predicted noise ∈ t .
[0057] According to the prediction noise in the t-th inverse diffusion step, the target data Y with noise at the monitoring site to be predicted in the t-th diffusion step is t Update to obtain the target data Y with noise at the monitoring site to be predicted under the t-1th reverse diffusion step t-1 .
[0058] Subtract 1 from the value of t, and then return to the step of inputting the noisy target data and the prediction set at the monitoring site to be predicted at the t-th reverse diffusion step into the distribution aggregation module in the denoising diffusion model to obtain the first noise information of the monitoring site to be predicted, until the noisy target data at the monitoring site to be predicted at the first reverse diffusion step is obtained, and determining that the noisy target data at the monitoring site to be predicted at the first reverse diffusion step is the air quality data at the monitoring site to be predicted.
[0059] In practical applications, the distribution aggregation module is a key component of the conditional denoising diffusion probability model, which is responsible for combining the noise information of the target location with the exogenous covariates to generate a more accurate prediction of the air quality data at the target location. t In the process of obtaining the first noise information of the monitoring site to be predicted by the distribution aggregation module in the denoising diffusion model of the prediction set input, the module processes the information of the monitoring site to be predicted and the preset context node through the neural network encoder, and then aggregates the information using the neural process theory to improve the accuracy of the prediction. Figure 7 As shown in the figure, the detailed workflow of the distribution aggregation module is as follows:
[0060] Step 11: Distribution: Figure 6 As shown, two neural network encoders Enc are used, each consisting of two fully connected layers. μ and Enc σ , respectively treat the exogenous covariate X at the prediction monitoring site and the noisy target data Y t And encode the exogenous covariate X' and air quality data Y' of the preset context node to obtain the normal distribution of the target location and context node positions are normally distributed
[0061] Step 12: Neural Process Theory Aggregation: Neural process is a method to improve data generalization. By modeling the data distribution, we can learn the intrinsic relationship R between variables to improve generalization. According to the neural process theory, the learning of R can be expressed by the following formula: Aggregate the exogenous covariates X' to Z of the preset context node to obtain the aggregated information Assume that all monitoring sites to be predicted constitute the set of monitoring sites to be predicted m:
[0062]
[0063] in, It represents the context node corresponding to a certain monitoring site to be predicted obtained from the context node set n corresponding to the monitoring site set m to be predicted, that is, the preset context node. Am,n represents the static topological relationship between the monitoring site set m to be predicted and the corresponding context node set n, that is, the static topological relationship between the preset context node and the monitoring site to be predicted.
[0064] Step 13: The first noise information of the monitoring site to be predicted after sampling the neural process distribution aggregation information is
[0065] In summary, the distribution aggregation module specifically includes: two neural network encoders Enc composed of fully connected layersμ and Enc σ , respectively treat the exogenous covariate X at the prediction monitoring site and the noisy target data Y t And encode the exogenous covariate X' and air quality data Y' of the preset context node to obtain the distribution of the target location and Finally, the first noise information after the neural process distribution aggregation is obtained through the above aggregation formula As one of the inputs of the subsequent attention module waiting to be processed, the attention module here is a well-known module and is not specially designed.
[0066] In practical applications, in the step of inputting the exogenous covariates at the monitoring site to be predicted, the exogenous covariates at the preset context nodes, and the air quality data at the preset context nodes into the spatiotemporal graph generation module in the denoising diffusion model to obtain the second noise information of the monitoring site to be predicted, the spatiotemporal graph generation module aims to learn the time-varying dynamic correlation between the monitoring site to be predicted and the preset context nodes, and aggregate the information of the preset context nodes to the monitoring site to be predicted to achieve the capture and representation of the dynamic topological structure. Different from the traditional static graph-based method, the spatiotemporal graph generation module can adapt to and reflect the complex relationships that change over time in the real world, such as Figure 8 As shown, the specific steps of the spatiotemporal graph generation module include:
[0067] Step 21: Dynamic graph learning: The spatiotemporal graph generation module first captures the dynamic topological structure between the monitoring sites to be predicted and the preset context nodes within the time interval through the dynamic graph learning mechanism of the spatiotemporal graph neural network. This is achieved based on external covariates and the preset context node information within the time period. The specific formula is: Adyn = (X * K1) (X' * K1).
[0068] Step 22: Information aggregation: Using the learned dynamic topological structure, the information aggregation network in the spatiotemporal graph generation module can aggregate information in each time interval, thereby providing the model with richer and more timely contextual information. The aggregation formula is as follows:
[0069] Among them, X and X' represent the exogenous covariates of the monitoring site to be predicted and the air quality data at the preset context node, respectively, Y' represents the air quality data at the preset context node, K1 and K2 are convolution kernels, and ★ represents the convolution operation.
[0070] In summary, the spatiotemporal graph generation module includes a spatiotemporal graph neural network and an information aggregation network; the spatiotemporal graph neural network is used to obtain the spatiotemporal graph, and the information aggregation network is used to aggregate the spatiotemporal graph.
[0071] In practical applications, the exogenous covariates at the monitoring site to be predicted, the exogenous covariates at the preset context nodes, and the air quality data at the preset context nodes are input into the spatiotemporal graph generation module in the denoising diffusion model to obtain the second noise information of the monitoring site to be predicted, specifically including:
[0072] According to the spatiotemporal graph neural network Adyn=(X*K1)(X'*K1), the spatiotemporal graph of the monitoring site to be predicted and the preset context node is obtained, wherein Adyn represents the spatiotemporal graph of the monitoring site to be predicted and the preset context node, X represents the exogenous covariate at the monitoring site to be predicted, K1 represents the convolution kernel of the graph neural network, X' represents the air quality data at the preset context node, and * represents the convolution operation.
[0073] According to the information aggregation network The second noise information of the monitoring site to be predicted is obtained, wherein: represents the second noise information of the monitoring site to be predicted, K2 represents the convolution kernel of the information aggregation network, and Y' represents the air quality data at the preset context node.
[0074] The Diffusion Probabilistic Model for Spatiotemporal Extrapolation (DSTE) proposed in this application aims to restore the true value of air quality data by gradually removing noise. It can use known nodes to infer unknown nodes at the same time, and predict and restore air quality data in unobserved areas in spatiotemporal data through the conditional denoising diffusion probability model.
[0075] The main function of the conditional denoising diffusion probability model is to remove noise inversely and restore clean and accurate spatiotemporal data given a series of noisy target data and related conditional information. The technical details of its implementation are as follows:
[0076] Step 31: Initialization. Obeys standard normal distribution Serves as the initial input to the current inverse diffusion step.
[0077] Step 32: Attention mechanism. Use the attention mechanism to focus on the contextual information related to the air quality data. Query: The query obtained by the distribution aggregation module As the query input, it captures the features related to the target location. Key and Value: The dynamic graph Adyn and context information are learned by the neural network. As the key and value of the attention mechanism, the context features related to the target position are strengthened through the attention mechanism to obtain the next step of the denoising process, the noise Y t-1, perform iterative denoising.
[0078] Step 33: Iterative denoising. Repeat step 32 and add the t-1 step and Denoising to get Y t -2 …. Iteratively remove noise through T inverse diffusion steps t=T,T-1,…1,0. In each step: combine the output of the attention mechanism and the static topological information Astat to guide the denoising process. Use a neural network to predict the noise at each step and remove it. The output of the final step Y 0 The target location prediction after denoising is the air quality data.
[0079] like Figure 4 As shown, the spatiotemporal data extrapolation method provided by the present application first trains the neural network model through the step-by-step noise addition / denoising steps of the diffusion model, so that the model has the ability to denoise according to the degree of noise addition, that is, the diffusion time step t.
[0080] From the target node with noisy target data Y T At the beginning, the node set C(Y',X') containing the target value and the exogenous covariate, the static topology Astat and the inverse diffusion time step T are used as auxiliary information. The first noise information is obtained by aggregating the trained neural process, and the second noise information is obtained by aggregating the dynamic topology. Finally, the next step of the target data Y with noise is obtained through the standard attention neural network. T-1 Repeat the above steps to perform iterative denoising and finally obtain the target data Y 0 .
[0081] The present application also provides an application scenario, which applies the above-mentioned spatiotemporal data extrapolation method. Specifically: The spatiotemporal data extrapolation method provided in this embodiment can be applied in a weather forecast scenario. The weather forecast scenario includes air quality data extrapolation and forecasting based on the extrapolated air quality data. The spatiotemporal data extrapolation method provided in this embodiment can realize air quality data extrapolation. Specifically, in the process of air quality data extrapolation, extrapolated air quality data can be obtained based on the prediction set.
[0082] This application has the following technical effects:
[0083] 1. This application integrates the spatiotemporal task representation of air quality data into the deep generative model by designing a spatiotemporal graph generation module, and combines the potential knowledge relationship between air quality data and exogenous covariates and the graph information transmission mechanism to assist the model in generating more accurate predictions.
[0084] 2. The dynamic graph generation module captures the dynamic topological changes in spatiotemporal data and adapts to the complex situation of inter-regional correlations changing over time in the real world. The distribution aggregation module combines the information of the target location and the context node, and effectively aggregates the spatiotemporal data through the neural network encoder and neural process theory, enhancing the model's generalization ability to new areas. By introducing the gradient-guided attention mechanism, the conditional denoising diffusion probability model can focus on the contextual information closely related to the air quality data, significantly improving the precision of the denoising process and the accuracy of the prediction.
[0085] 3. Only a small number of locations need to be collected to extrapolate data for most locations, rather than collecting data for all locations, which reduces reliance on expensive sensors and reduces the cost of data collection.
[0086] 4. By utilizing graph neural network aggregation and attention mechanism, node information aggregation is performed first and then attention learning is performed. The traditional spatiotemporal diffusion probability model is optimized to directly perform the attention calculation process, which reduces the time and space complexity and improves the operation efficiency of the model.
[0087] Based on the same inventive concept, the embodiment of the present application also provides a spatiotemporal data extrapolation device for implementing the spatiotemporal data extrapolation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more spatiotemporal data extrapolation device embodiments provided below can refer to the limitations of the spatiotemporal data extrapolation method above, and will not be repeated here.
[0088] In an exemplary embodiment, a spatiotemporal data extrapolation device is provided, comprising:
[0089] An acquisition module is used to acquire a prediction set; the prediction set includes: exogenous covariates at the monitoring site to be predicted, exogenous covariates at the preset context node, air quality data at the preset context node, and a static topological relationship between the preset context node and the monitoring site to be predicted; the preset context node is a monitoring site within the set range of the monitoring site to be predicted.
[0090] A construction module is used to construct a conditional denoising diffusion probability model; the conditional denoising diffusion probability model includes a distribution aggregation module, a spatiotemporal graph generation module and an attention mechanism module; the distribution aggregation module and the spatiotemporal graph generation module are both connected to the attention mechanism module.
[0091] The prediction module is used to input the prediction set into the denoising diffusion model, perform reverse iterative sampling, and obtain the air quality data at the monitoring site to be predicted; the denoising diffusion model is obtained by training the conditional denoising diffusion probability model; the distribution aggregation module is used to obtain the first noise information of the monitoring site to be predicted based on the prediction set; the spatiotemporal graph generation module is used to obtain the spatiotemporal graph based on the exogenous covariates at the monitoring site to be predicted and the air quality data at the preset context nodes, and aggregate the spatiotemporal graph to obtain the second noise information of the monitoring site to be predicted; the attention mechanism module is used to obtain the air quality data at the monitoring site to be predicted based on the first noise information of the monitoring site to be predicted and the second noise information of the monitoring site to be predicted.
[0092] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store spatiotemporal data extrapolation data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a spatiotemporal data extrapolation method is implemented.
[0093] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0094] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0095] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0096] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0097] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0098] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0099] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0100] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for extrapolating spatiotemporal data, It is characterized in that The spatiotemporal data extrapolation method comprises: Obtain a prediction set; the prediction set includes: exogenous covariates at the monitoring site to be predicted, exogenous covariates at the preset context node, air quality data at the preset context node, and a static topological relationship between the preset context node and the monitoring site to be predicted; the preset context node is a monitoring site within a set range of the monitoring site to be predicted; Constructing a conditional denoising diffusion probability model; the conditional denoising diffusion probability model includes a distribution aggregation module, a spatiotemporal graph generation module and an attention mechanism module; the distribution aggregation module and the spatiotemporal graph generation module are both connected to the attention mechanism module; The prediction set is input into a denoising diffusion model, and reverse iterative sampling is performed to obtain the air quality data at the monitoring site to be predicted; the denoising diffusion model is obtained by training a conditional denoising diffusion probability model; the distribution aggregation module is used to obtain the first noise information of the monitoring site to be predicted based on the prediction set; the spatiotemporal graph generation module is used to obtain a spatiotemporal graph based on the exogenous covariates at the monitoring site to be predicted and the air quality data at the preset context nodes, and aggregate the spatiotemporal graph to obtain the second noise information of the monitoring site to be predicted; the attention mechanism module is used to obtain the air quality data at the monitoring site to be predicted based on the first noise information of the monitoring site to be predicted and the second noise information of the monitoring site to be predicted.
2. The spatiotemporal data extrapolation method according to claim 1, It is characterized in that The exogenous covariates specifically include: temperature, humidity, wind speed and wind direction.
3. The spatiotemporal data extrapolation method according to claim 1, It is characterized in that The steps of training the conditional denoising diffusion probability model to obtain the denoising diffusion model specifically include: Obtaining air quality data at a target monitoring station, exogenous covariates at the target monitoring station, and static topological relationships between the target monitoring station and the monitoring station to be predicted; The denoised diffusion model is obtained by training the conditional denoised diffusion probability model based on the air quality data at the target monitoring station, the exogenous covariates at the target monitoring station, and the static topological relationship between the target monitoring station and the monitoring station to be predicted.
4. The spatiotemporal data extrapolation method according to claim 3, It is characterized in that The denoising diffusion model is obtained by training the conditional denoising diffusion probability model according to the air quality data at the target monitoring site, the exogenous covariates at the target monitoring site, and the static topological relationship between the target monitoring site and the monitoring site to be predicted, specifically including: Dividing the air quality data at the target monitoring site and the exogenous covariates at the target monitoring site into a context node set and a target node set in proportion; In the current diffusion step, the noise corresponding to the current diffusion step is added to the noisy target data of the previous diffusion step to obtain the noisy target data of the current diffusion step; the noisy target data of the initial diffusion step is the air quality data in the target node set; Input the static topological relationship between the target monitoring site and the monitoring site to be predicted, the target data with noise in the current diffusion step, the exogenous covariates in the target node set, and the context node set into the distribution aggregation module in the conditional denoising diffusion probability model of the previous diffusion step to obtain the first noise information of the target monitoring site; Inputting the target data with noise in the current diffusion step, the exogenous covariates in the target node set and the air quality data in the context node set into the spatiotemporal graph generation module in the conditional denoising diffusion probability model of the previous diffusion step to obtain the second noise information of the target monitoring site; Input the first noise information of the target monitoring site and the second noise information of the target monitoring site into the attention mechanism module in the conditional denoising diffusion probability model of the previous diffusion step to obtain the predicted noise of the current diffusion step; Obtaining a loss function value of the current diffusion step according to the predicted noise of the current diffusion step and the noise corresponding to the current diffusion step; According to the loss function value of the current diffusion step, the conditional denoising diffusion probability model of the previous diffusion step is trained to obtain the conditional denoising diffusion probability model of the current diffusion step; Let the current diffusion step be increased by 1, and then return to the current diffusion step, add the noise corresponding to the current diffusion step to the noisy target data of the previous diffusion step, and obtain the step of the noisy target data of the current diffusion step, until the conditional denoising diffusion probability model of the set diffusion step is obtained, and let the conditional denoising diffusion probability model of the set diffusion step be the denoising diffusion model.
5. The spatiotemporal data extrapolation method according to claim 1, It is characterized in that The step of inputting the prediction set into a denoising diffusion model and performing reverse iterative sampling to obtain the air quality data at the monitoring site to be predicted specifically includes: In the t-th reverse diffusion step, the target data with noise at the monitoring site to be predicted in the t-th reverse diffusion step and the prediction set are input into the distribution aggregation module in the denoising diffusion model to obtain the first noise information of the monitoring site to be predicted; the target data with noise at the monitoring site to be predicted in the initial reverse diffusion step is preset; Inputting the exogenous covariate at the monitoring site to be predicted, the exogenous covariate at the preset context node and the air quality data at the preset context node into the space-time graph generation module in the denoising diffusion model to obtain the second noise information of the monitoring site to be predicted; Input the first noise information of the monitoring site to be predicted and the second noise information of the monitoring site to be predicted into the attention mechanism module in the denoising diffusion model to obtain the predicted noise under the t-th reverse diffusion step; The target data with noise at the monitoring site to be predicted in the t-th diffusion step is updated according to the predicted noise in the t-th reverse diffusion step to obtain the target data with noise at the monitoring site to be predicted in the t-1-th reverse diffusion step; Subtract 1 from the value of t, and then return to the step of inputting the noisy target data and the prediction set at the monitoring site to be predicted at the t-th reverse diffusion step into the distribution aggregation module in the denoising diffusion model to obtain the first noise information of the monitoring site to be predicted, until the noisy target data at the monitoring site to be predicted at the first reverse diffusion step is obtained, and determining that the noisy target data at the monitoring site to be predicted at the first reverse diffusion step is the air quality data at the monitoring site to be predicted.
6. The spatiotemporal data extrapolation method according to claim 5, It is characterized in that Inputting the exogenous covariates at the monitoring site to be predicted, the exogenous covariates at the preset context nodes, and the air quality data at the preset context nodes into the space-time graph generation module in the denoising diffusion model to obtain the second noise information of the monitoring site to be predicted, specifically including: According to the graph neural network Adyn=(X★K1)(X'★K1), a spatiotemporal graph of the monitoring site to be predicted and the preset context node is obtained, wherein Adyn represents the spatiotemporal graph of the monitoring site to be predicted and the preset context node, X represents the exogenous covariate at the monitoring site to be predicted, K1 represents the convolution kernel of the graph neural network, X' represents the air quality data at the preset context node, and ★ represents the convolution operation; According to the information aggregation network The second noise information of the monitoring site to be predicted is obtained, wherein: represents the second noise information of the monitoring site to be predicted, K2 represents the convolution kernel of the information aggregation network, and Y' represents the air quality data at the preset context node.
7. A spatiotemporal data extrapolation device, It is characterized in that The spatiotemporal data extrapolation device comprises: An acquisition module is used to acquire a prediction set; the prediction set includes: exogenous covariates at the monitoring site to be predicted, exogenous covariates at the preset context node, air quality data at the preset context node, and a static topological relationship between the preset context node and the monitoring site to be predicted; the preset context node is a monitoring site within a set range of the monitoring site to be predicted; A construction module is used to construct a conditional denoising diffusion probability model; the conditional denoising diffusion probability model includes a distribution aggregation module, a spatiotemporal graph generation module and an attention mechanism module; the distribution aggregation module and the spatiotemporal graph generation module are both connected to the attention mechanism module; The prediction module is used to input the prediction set into the denoising diffusion model, perform reverse iterative sampling, and obtain the air quality data at the monitoring site to be predicted; the denoising diffusion model is obtained by training the conditional denoising diffusion probability model; the distribution aggregation module is used to obtain the first noise information of the monitoring site to be predicted based on the prediction set; the spatiotemporal graph generation module is used to obtain the spatiotemporal graph based on the exogenous covariates at the monitoring site to be predicted and the air quality data at the preset context nodes, and aggregate the spatiotemporal graph to obtain the second noise information of the monitoring site to be predicted; the attention mechanism module is used to obtain the air quality data at the monitoring site to be predicted based on the first noise information of the monitoring site to be predicted and the second noise information of the monitoring site to be predicted.
8. A computer device, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the spatiotemporal data extrapolation method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the spatiotemporal data extrapolation method according to any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the spatiotemporal data extrapolation method according to any one of claims 1 to 6 is implemented.
