Weather prediction system based on time sequence knowledge graph reasoning and static multivariate space-time attention fusion
By using time sequence knowledge graphs and static multi-time and space attention fusion technology in the weather forecasting system, the problems of limited prediction accuracy and poor generalization capabilities in the existing weather forecasting technology are solved, and higher prediction accuracy and robustness are achieved sex.
Patent Information
- Application Number
- CN202411450064.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-18
AI Technical Summary
The existing weather forecasting technologies have problems such as limited prediction accuracy, high computing resource requirements, poor generalization capabilities of models, lack of spatial and temporal characteristics fusion and poor model interpretability.
Adopt a weather prediction system based on timing knowledge graph inference and static multi-time and space attention fusion. The system includes data acquisition, data processing, timing knowledge graph construction, embedded representation, SMTAFormer model training, data prediction and model evaluation and adjustment, and through multi-head The self-attention mechanism performs feature fusion to improve the accuracy and robustness of predictions.
Effectively capture the timing relationships and multi-dimensional spatiotemporal characteristics in meteorological data, improve the accuracy and robustness of weather forecasts, and enhance the quality of input data of the model and the explanatory nature of the prediction results.
Smart Images

Figure CN119471859A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of weather forecasting, and in particular to a weather forecasting system based on temporal knowledge graph reasoning and static multivariate spatiotemporal attention fusion. Background Art
[0002] With the rapid development of emerging technologies such as big data and artificial intelligence in recent years, meteorological data resources have been fully integrated. Using advanced intelligent algorithms to analyze these data can significantly improve the accuracy of weather forecasts. At present, the mainstream algorithms in the field of weather forecasting include: numerical weather forecast models, statistical weather forecast methods, machine learning and deep learning methods, hybrid models, etc. However, the existing technologies still have the following shortcomings:
[0003] (1) Limited prediction accuracy
[0004] Numerical weather forecast models have deficiencies in dealing with complex terrain and small-scale weather phenomena, resulting in reduced prediction accuracy. Statistical methods perform poorly in dealing with nonlinear and complex weather phenomena, and prediction accuracy depends on the quality and quantity of historical data;
[0005] (2) High computing resource requirements
[0006] Numerical weather forecast models require a lot of computing resources and time for numerical integration, and the prediction cycle is long. Deep learning models require a lot of computing resources during training, and the training time is long, making them difficult to apply in real time;
[0007] (3) Poor model generalization ability
[0008] Machine learning and deep learning models are prone to overfitting, especially when the amount of data is insufficient or the data quality is low. The generalization ability of the model is poor and it is difficult to adapt to the prediction of different regions and different weather phenomena;
[0009] (4) Lack of spatiotemporal feature fusion
[0010] When processing multidimensional spatiotemporal data, existing technologies usually lack effective feature fusion methods and are unable to fully utilize information at different time and spatial scales, resulting in insufficient accuracy and robustness of prediction results.
[0011] (5) Poor model interpretability
[0012] The prediction results of deep learning models often lack interpretability and are difficult to provide meaningful reference information for meteorologists, which affects the credibility and application value of the prediction results. Summary of the invention
[0013] In view of this, the purpose of the present invention is to provide a weather forecasting system based on temporal knowledge graph reasoning and static multi-temporal attention fusion to at least solve the above problems.
[0014] The technical solution adopted by the present invention is as follows:
[0015] A weather forecasting system based on temporal knowledge graph reasoning and static multi-temporal attention fusion, the system includes a data acquisition module, a data processing module, a temporal knowledge graph construction module, an embedding representation module, an SMTAFormer model training module, a data prediction module, and a model evaluation adjustment module. The system is used to execute a weather forecasting method based on temporal knowledge graph reasoning and static multi-temporal attention fusion, the method including the following steps:
[0016] Step 1: Collect regional historical meteorological data through the data acquisition module;
[0017] Step 2: Process the collected historical meteorological data through the data processing module;
[0018] Step 3: Build a time series knowledge graph containing time information based on the processed data through the time series knowledge graph construction module;
[0019] Step 4: Use the embedding method to extract the feature representation of meteorological elements and time series relationships in the time series knowledge graph through the embedding representation module, and generate a high-dimensional feature set;
[0020] Step 5: The SMTAFormer model is trained by extracting static features, extracting multivariate spatiotemporal features, and fusing static feature extraction and multivariate spatiotemporal features from the high-dimensional feature set through the SMTAFormer model training module;
[0021] Step 6: Use the data prediction module to perform link prediction on the time series knowledge graph, and use the SMTAFormer model combined with link prediction to perform meteorological element prediction to generate meteorological element prediction results;
[0022] Step 7: Perform error analysis and accuracy analysis on the meteorological element prediction results through the model evaluation and adjustment module to generate evaluation results, and optimize and adjust the SMTAFormer model based on the evaluation results.
[0023] Furthermore, the historical meteorological data in step 2 includes: temperature, precipitation, humidity, wind speed and air pressure, and the processing of the collected historical meteorological data includes: removing abnormal values, missing values or duplicate values.
[0024] Furthermore, step 3 is specifically as follows: using the ConvE model to map the entities and relations in the processed historical meteorological data into a two-dimensional matrix, using convolution operations to learn the relationships between entities, and vectorizing the entities and complex semantic relations in the temporal knowledge graph.
[0025] Furthermore, step 5 is specifically as follows: extracting static features and multivariate temporal features of the data, using a multi-head self-attention mechanism for feature learning, fusing the outputs of the multi-head self-attention mechanism, and generating a final feature representation through a linear transformation.
[0026] Furthermore, step 5 includes the following formula:
[0027] Static feature extraction formula: S = ReLU (SW S +b S )
[0028] Among them, S is the static feature representation, ReLU is the activation function, and W S is the weight matrix associated with the static features, b S is the bias term;
[0029] Multivariate time feature extraction formula:
[0030] Among them, E i is the result after multivariate time feature extraction, X i is the input feature matrix, W i is the weight feature related to multivariate time features, is the bias term;
[0031] Attention mechanism formula:
[0032] Among them, Attention(Q,K,V) is the calculation process of the attention mechanism, softmax is the activation function, Q is the query matrix, K is the key matrix, V is the value matrix, and d is the dimension of the query and key;
[0033] Fusion feature formula:
[0034] in, is the final feature after fusion, is the output of the attention head, and W is the weight matrix.
[0035] Furthermore, in step 6, link prediction is performed on the time series knowledge graph, specifically: link feature vectors are extracted through the time series knowledge graph. The specific formula is as follows:
[0036] x i =(x i1 ,x i2,...,x in ,)
[0037] Among them, x i is the vector feature of the ith link, representing the meteorological data of the ith link;
[0038] x i1 ,x i2 ,...,x in is the specific characteristic of the link, representing different meteorological indicators;
[0039] The link feature vector and historical link are used as input, and the GRU model is used to predict the link. The specific formula is as follows:
[0040] y i =σ(W h h i-1 +W x x i +b)
[0041] Among them, y i is the predicted probability of the i-th link; σ is the Sigmoid function; W h is the hidden layer weight matrix; h i-1 is the hidden state of the previous time step; W x is the link feature weight matrix; x i is the link feature vector of the current time step; b is the bias term.
[0042] Furthermore, the specific formula for meteorological element prediction is:
[0043]
[0044] Among them, Sigmoid is the activation function, is the forecast result of meteorological elements. is the final feature after fusion, W3 and W4 are weight matrices, and b3 and b4 are bias terms.
[0045] Furthermore, it is characterized in that step 7 specifically comprises:
[0046] Step S1: Use the message passing formula in the graph convolutional network to update the state of the node in the SMTAFormer model prediction process, and use the message aggregation formula to aggregate information from neighboring nodes to generate prediction features;
[0047] Step S2: Evaluate the prediction features and calculate the accuracy and error of the prediction features;
[0048] Step S3: Optimize the model through loss function, cross entropy loss function and multi-class cross entropy loss function.
[0049] Furthermore, the formula used in step S1 is as follows:
[0050] Message passing formula:
[0051] Where M is the message passing function; e s is the embedding vector of the current main node; r is the relationship embedding vector; e o is the embedding vector of the target node; t is the time embedding vector; The current node master node e s The state of the previous layer; is the embedding vector of relation r; h t is the embedding vector at time t;
[0052] Message aggregation formula:
[0053]
[0054] in, is the embedding representation of the target node e0 in the first layer; δ is the activation function; W l is the weight matrix; is the sum operation of neighbor nodes; α l (e s ,r,e0,t) is the attention coefficient, indicating the source node e s , relationship r, similarity or importance of target node e0 and time t; q is a specific variable or operation
[0055] Compared with the prior art, the present invention has the following beneficial effects:
[0056] The present invention constructs a time series knowledge graph containing time information by comprehensively utilizing regional meteorological data resources, which can effectively capture the time series relationship in meteorological data and provide a comprehensive spatiotemporal information foundation; the TASTER embedding method is used to extract the feature representation of nodes and edges in the time series knowledge graph, which can retain complex spatiotemporal relationships and improve the input data quality of the model; the SMTAFormer model combines static feature extraction, multivariate spatiotemporal feature extraction and feature fusion, and uses a multi-head self-attention mechanism for dynamic feature fusion, which can effectively fuse static and spatiotemporal features, accurately capture multidimensional information in meteorological data, and improve the accuracy and robustness of prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only preferred embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0058] Figure 1 It is a schematic diagram of a system flow of an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The enumerated embodiments are only used to explain the present invention and are not used to limit the scope of the present invention.
[0060] Reference Figure 1 The present invention provides a weather forecasting system based on temporal knowledge graph reasoning and static multi-temporal attention fusion, the system includes a data acquisition module, a data processing module, a temporal knowledge graph construction module, an embedding representation module, an SMTAFormer model training module, a data prediction module, and a model evaluation adjustment module. The system is used to perform a weather forecasting method based on temporal knowledge graph reasoning and static multi-temporal attention fusion, the method comprising the following steps:
[0061] Step 1: Collect regional historical meteorological data through the data acquisition module;
[0062] Step 2: Process the collected historical meteorological data through the data processing module;
[0063] Exemplarily, the historical meteorological data include: temperature, precipitation, humidity, wind speed and air pressure, as well as static geographic data such as altitude, geographic location, etc. Processing the collected historical meteorological data includes removing abnormal values, missing values or duplicate values, etc.
[0064] Step 3: Build a time series knowledge graph containing time information based on the processed data through the time series knowledge graph construction module;
[0065] Step 3 is as follows: Use the ConvE model to map the entities and relationships in the processed historical meteorological data into a two-dimensional matrix, use convolution operations to learn the relationships between entities, and vectorize the entities and complex semantic relationships in the time series knowledge graph.
[0066] Exemplarily, the ConvE model architecture is:
[0067] Entity embedding matrix representation:
[0068] E s ∈R d×n
[0069] Among them, R is a set of real numbers; d is the dimension of entity embedding; n is the number of entities.
[0070] Relation embedding matrix representation:
[0071] E r ∈Rd×m
[0072] Among them, R is a set of real numbers; d is the dimension of relation embedding; m is the number of relations.
[0073] The relationship matrix represents:
[0074] R = diag(E r )
[0075] Among them, diag(E r ) means placing each element in the relation embedding matrix on the diagonal to form a diagonal matrix; E r is the relation embedding matrix.
[0076] The entity-relationship composite matrix is represented as follows:
[0077] C=E s *R
[0078] Among them, E s is the entity embedding matrix; * is the convolution operation; R is the diagonal matrix.
[0079] Convolution operation:
[0080] Y=σ(C*W+b)
[0081] Among them, Y is the output result of the model, which represents the predicted value obtained after calculation of all layers; C is the input feature vector, which represents meteorological data or other relevant information, such as temperature, humidity, etc.; W is the weight matrix, which represents the connection strength between each neuron in the model, and is continuously updated through back propagation during the training process; b is the bias term, which represents the constant part in the model and is used to adjust the output value; σ is the activation function. This embodiment uses the Sigmoid function, which is used to map the input to the output range [0,1] to achieve nonlinear transformation.
[0082] Output layer:
[0083] O=sof tmax(YW0)
[0084] Among them, O is the weight matrix of the output layer, which represents the probability distribution of the prediction result; softmax is the activation function; Y is the output result of the intermediate layer, the result after nonlinear activation; W o is the weight matrix of the output layer, which is used to convert the output (Y) of the intermediate layer into the final output (O); softmax is the softmax function, which is used to convert the input into a probability distribution for multi-category classification tasks.
[0085] Step 4: Use the embedding method to extract the feature representation of meteorological elements and time series relationships in the time series knowledge graph through the embedding representation module, and generate a high-dimensional feature set;
[0086] For example, embedding methods including TASTER embedding are used to extract data sequence features of various meteorological elements and convert them into high-dimensional feature sets, and then the high-dimensional feature sets are associated with each other to evaluate the correlation between various meteorological elements, thereby determining the importance of each meteorological element and its contribution to the forecast results. The TASTER embedding method can accurately extract time series features and prepare for the next step of establishing an accurate meteorological forecast model.
[0087] Step 5: The SMTAFormer model is trained by extracting static features, extracting multivariate spatiotemporal features, and fusing static feature extraction and multivariate spatiotemporal features from the high-dimensional feature set through the SMTAFormer model training module;
[0088] Step 5 is as follows: extract the static features and multivariate temporal features of the data, use the multi-head self-attention mechanism for feature learning, fuse the outputs of the multi-head self-attention mechanism, and generate the final feature representation through linear transformation.
[0089] Exemplarily, the static representation of the node is obtained by performing linear transformation and activation function through a static feature extraction formula. The static feature extraction formula is:
[0090] S = ReLU (SW S +b S )
[0091] Among them, S is the static feature representation; ReLU is the activation function; W S is the weight matrix related to the static features, which is used to convert the input static features into a new feature space; b S is the bias term.
[0092] The multivariate time feature extraction formula is used to perform linear transformation and activation function to extract the time series features of the high-dimensional feature set. The details are as follows: multivariate time feature extraction is performed, and the formula is:
[0093]
[0094] Among them, E i is the result after feature extraction, which represents the time series features after linear transformation and ReLU activation; X i is the input feature matrix, which contains the features in the time series data; W i is the weight feature related to multivariate time features; b i is the bias term.
[0095] The feature Ei is added to the initial feature P by the following formula:
[0096] Pi =P+E i
[0097] The above formula indicates that in the process of feature extraction and updating, the newly extracted feature E i is added to the initial feature P to generate the updated feature vector P i Among them, P i is the updated feature vector; P is the initial feature vector; E i It is the time series feature after linear transformation and ReLU activation.
[0098] The concatenation of the attention mechanism output is performed using the following formula:
[0099] M i =Concat(head1,head2,...,head h )W
[0100] The above formula is used to extract multivariate time features, obtain the feature representation of the time series through linear transformation and activation function, and concatenate the outputs of the multi-head attention mechanism. h is the output of different attention heads; W is the concatenated weight matrix; Concat(head1,head2,...,head h ) represents the operation of concatenating the outputs of different attention heads.
[0101] Attention mechanism formula:
[0102]
[0103] The attention mechanism formula describes the calculation process of the attention mechanism. By calculating the similarity between the query Q and the key K, the attention weight is obtained, and then the weighted sum is output as V. Among them, Attention(Q,K,V) is the calculation process of the attention mechanism; softmax is the activation function; Q is the query matrix; K is the key matrix; V is the value matrix; d is the dimension of the query and key.
[0104] Fusion feature formula:
[0105]
[0106] The fusion feature formula is used to fuse the outputs of the multi-head attention mechanism, concatenate the outputs of different heads and obtain the final feature representation through linear transformation. is the final feature after fusion; is the output of the attention head; W is the weight matrix.
[0107] Step 6: Use the data prediction module to perform link prediction on the time series knowledge graph, and use the SMTAFormer model combined with link prediction to perform meteorological element prediction to generate meteorological element prediction results;
[0108] In step 6, link prediction is performed on the time series knowledge graph. Specifically, link feature vectors are extracted through the time series knowledge graph. The specific formula is as follows:
[0109] x i =(x i1 ,x i2 ,...,x in )
[0110] Among them, x i is the vector feature of the ith link, representing the meteorological data of the ith link, such as temperature, humidity, air pressure, etc.; x i1 ,x i2 ,...,x in It is the specific characteristic of the link, representing different meteorological indicators.
[0111] The link feature vector and historical link are used as input, and the GRU model is used to predict the link. The specific formula is as follows:
[0112] y i =σ(W h h i-1 +W x x i +b)
[0113] Among them, y i is the predicted probability of the i-th link, which is used to determine the existence of the link; σ is the Sigmoid function, which maps the output result to the range of [0,1] and is used to represent the probability value; W h is the hidden layer weight matrix, which represents the influence of the hidden state of the previous time step on the output of the current time step; h i-1 is the hidden state of the previous time step, indicating the transmission of historical information; W x is the input feature weight matrix, which represents the weight of the input feature vector at the current time step; i is the input feature vector of the current time step, which contains meteorological data or other relevant link features; b is the bias term, which is used to adjust the output result.
[0114] In the link prediction process, the feature vector and historical link data are used as input to perform time series link prediction through the GRU (Gated Recurrent Unit) model. GRU is a neural network model widely used in time series data. Its advantage is that it can effectively capture long-term dependencies in time series while avoiding the gradient vanishing problem in traditional RNN.
[0115] In the GRU model, the input feature vector of each time step will work together with the hidden state hi_1 of the previous time step to generate a new prediction result. GRU controls the flow of information through the update gate and reset gate, allowing the model to retain or discard the information of the previous time step, thereby improving the prediction accuracy of the model.
[0116] In this way, the GRU model can combine current features and historical information to effectively predict the existence or non-existence of a link.
[0117] Finally, the meteorological elements are predicted, and the final prediction value is obtained through two-layer fully connected neural network and activation function calculation. The meteorological element prediction formula is:
[0118]
[0119] Among them, Sigmoid is the activation function; The forecast results of meteorological elements; is the final feature after fusion; W3 and W4 are weight matrices, which are used to convert input features into outputs in the neural network; b3 and b4 are bias terms, which are used to add a constant offset to each layer of the network.
[0120] Step 7: Perform error analysis and accuracy analysis on the meteorological element prediction results through the model evaluation and adjustment module to generate evaluation results, and optimize and adjust the SMTAFormer model based on the evaluation results.
[0121] Step 7 is as follows:
[0122] Step S1: Use the message passing formula in the graph convolutional network to update the state of the node in the SMTAFormer model prediction process, and use the message aggregation formula to aggregate information from neighboring nodes to generate prediction features;
[0123] Exemplarily, the message passing formula is:
[0124]
[0125] The message passing formula describes the process of message passing in a graph convolutional network, which means summarizing information from neighboring nodes to update the state of the current node. Where M is the message passing function; e s is the embedding vector of the current master node, which represents the node whose state is currently being updated; r is the relationship embedding vector, which represents the node e s and e o The connection relationship between o is the embedding vector of the target node, which represents the embedding vector from the current main node es The node receiving the information; t is the time embedding vector, which indicates the influence of time on the change of node state; The current master node e s The state of the previous layer, that is, the state of the node after the previous round of convolution; is the embedding vector of relation r, which represents the connection relationship between nodes (or the weight of message passing); h t is the embedding vector of time t, which indicates the influence of time on the change of node state.
[0126] Message aggregation formula:
[0127]
[0128] The message aggregation formula fully describes the message transmission and node status update process of the graph convolutional network in the temporal knowledge graph. It combines the information of neighbor nodes (through summation), the attention mechanism (giving weights to different neighbor nodes), and nonlinear transformation (through activation function and weight matrix) to achieve the representation update of the target node at the 111th layer. is the embedding representation of the target node e0 in the first layer; δ is the activation function used to introduce nonlinear transformation; W l is the weight matrix, which represents the learnable parameters in the first layer and is used for linear transformation; is the sum operation of neighbor nodes, indicating that node e o From all neighbor nodes e q Collect information from and sum it up; l (e s ,r,e0,t) is the attention coefficient, indicating the source node e s , relationship r, the similarity or importance of the target node e0 and time t, the attention mechanism determines which neighbor nodes are more important for updating the current node by assigning weights to different neighbor nodes; q is a specific variable or operation.
[0129] Step S2: Evaluate the prediction features and calculate the accuracy and error of the prediction features;
[0130] Exemplary, specifically: Scoring formula:
[0131]
[0132] The scoring formula is used to calculate the score of node pairs and is used to evaluate the relationship between nodes in link prediction tasks. a ,e a is a pair of nodes or entities; W T is the transpose of the weight vector, used to calculate the score; is the entity e at layer 1 aThe vector feature of q ,r q ,t q To query entities, relations, and time.
[0133] Symbolic reasoning path scoring formula:
[0134]
[0135] The symbolic reasoning path scoring formula describes the recursive encoding process in the Bellman-Ford algorithm for computing the shortest path. Where Score(P) is the score of the reasoning path P; α1,α1,...,α L is the attention weight on the path, which measures the importance of different nodes in the path; is the feature matrix of each node, used to evaluate the importance of the path in symbolic reasoning; u and v represent the nodes in the graph; h 1 (u,v) is the state between nodes u and v at layer 1; is the aggregation operation of neighbor node information, E(v) represents the neighbor nodes of node v; w(x,v) is the weight matrix, which represents the weight of the edge from neighbor node x to v; δ represents the activation function, which is used for nonlinear transformation.
[0136] Relative time encoding formula:
[0137]
[0138] The relative time coding formula is used for relative time coding to represent the periodicity and linear changes of time intervals. For periodic time coding, it indicates the periodic change of time step; for frequency and phase, controlling periodicity; The encoding result for the time step combines periodic and linear time information.
[0139] Recursive Encoded Message Passing:
[0140]
[0141] The recursive coding message passing formula describes the message passing process in recursive coding to update node representations. is the state of the tail entity in the first layer; W l is the weight matrix, used for linear changes; a l is the attention weight, which measures the importance of different paths; M(e s ,r,e o ,t) are the feature vectors of nodes and relationships.
[0142] Neural scoring function formula:
[0143]
[0144] The neural scoring function formula is used to calculate the score of the node pair. T is the weight vector; For entity e a The feature representation of .
[0145] Step S3: Optimize the model through loss function, cross entropy loss function and multi-class cross entropy loss function.
[0146] Loss function formula:
[0147]
[0148] in, is the optimal model parameter; f θ is the prediction model; X is the collected data; l is the loss function; p(f θ ) is the regularization term; λ is the regularization parameter; argmin is the minimization function, which is used to find the value of the parameter θ with the minimum loss function.
[0149] Cross entropy loss function:
[0150]
[0151] Among them, y i is the true label of the i-th link; is the predicted probability of the model for the i-th link; N is the number of links.
[0152] Multi-class cross entropy loss function:
[0153]
[0154] Among them, (q,e a ) is an input feature pair in a training sample; q is the query; e a is the actual category; f(q,e a ) is the query q and category e a The score between train is the training data set; E represents the set of all possible categories; is the normalization factor. e is a category in the set of all possible categories.
[0155] The present invention first collects data to collect regional historical meteorological data, including time series data such as temperature, precipitation, humidity, wind speed, air pressure, and static geographic data such as altitude and geographical location; then performs data cleaning to clean the collected data, including removing outliers, missing values or duplicate values; constructs a time series knowledge graph, and constructs a knowledge graph model containing time information for the cleaned data, wherein nodes represent meteorological elements and edges represent the time series relationship between elements; performs embedding representation, and uses embedding methods such as TASTER to extract feature representations of nodes and edges to generate a high-dimensional feature set; uses an SMTAFormer model training module to perform static feature extraction, multivariate spatiotemporal feature extraction, and feature fusion of the static feature extraction and multivariate spatiotemporal features to train the SMTAFormer model to predict future changes in meteorological elements; performs data prediction to predict future changes in meteorological elements such as temperature, precipitation, humidity, wind speed, etc.; performs error analysis and accuracy analysis on the meteorological element prediction results to generate evaluation results, and optimizes and adjusts the SMTAFormer model based on the evaluation results. The present invention can highlight the potential spatiotemporal information and multivariate features between meteorological data, and effectively mine their dependencies using the multi-head self-attention mechanism, thus making up for the limitation of low accuracy of traditional prediction models and improving the accuracy of weather forecasts that combine temporal knowledge graph reasoning with static multivariate spatiotemporal attention fusion.
[0156] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A weather forecasting system based on temporal knowledge graph reasoning and static multi-temporal attention fusion, characterized by: The system includes a data acquisition module, a data processing module, a time series knowledge graph construction module, an embedding representation module, an SMTAFormer model training module, a data prediction module, and a model evaluation adjustment module. The system is used to perform a weather prediction method based on time series knowledge graph reasoning and static multivariate spatiotemporal attention fusion. The method includes the following steps: Step 1: Collect regional historical meteorological data through the data acquisition module; Step 2: Process the collected historical meteorological data through the data processing module; Step 3: Build a time series knowledge graph containing time information based on the processed data through the time series knowledge graph construction module; Step 4: Use the embedding method to extract the feature representation of meteorological elements and time series relationships in the time series knowledge graph through the embedding representation module, and generate a high-dimensional feature set; Step 5: The SMTAFormer model is trained by extracting static features, extracting multivariate spatiotemporal features, and fusing static feature extraction and multivariate spatiotemporal features from the high-dimensional feature set through the SMTAFormer model training module; Step 6: Use the data prediction module to perform link prediction on the time series knowledge graph, and use the SMTAFormer model combined with link prediction to perform meteorological element prediction to generate meteorological element prediction results; Step 7: Perform error analysis and accuracy analysis on the meteorological element prediction results through the model evaluation and adjustment module to generate evaluation results, and optimize and adjust the SMTAFormer model based on the evaluation results.
2. The weather forecasting system based on temporal knowledge graph reasoning and static multivariate spatiotemporal attention fusion according to claim 1 is characterized in that: The historical meteorological data in step 2 include: temperature, precipitation, humidity, wind speed and air pressure, and the processing of the collected historical meteorological data includes: removing abnormal values, missing values or duplicate values.
3. The weather forecasting system based on temporal knowledge graph reasoning and static multivariate spatiotemporal attention fusion according to claim 1 is characterized in that: Step 3 is as follows: Use the ConvE model to map the entities and relationships in the processed historical meteorological data into a two-dimensional matrix, use convolution operations to learn the relationships between entities, and vectorize the entities and complex semantic relationships in the time series knowledge graph.
4. The weather forecasting system based on temporal knowledge graph reasoning and static multivariate spatiotemporal attention fusion according to claim 1 is characterized in that: Step 5 is as follows: extract the static features and multivariate temporal features of the data, use the multi-head self-attention mechanism for feature learning, fuse the outputs of the multi-head self-attention mechanism, and generate the final feature representation through linear transformation.
5. The weather forecasting system based on temporal knowledge graph reasoning and static multivariate spatiotemporal attention fusion according to claim 4 is characterized in that: Step 5 includes the following formula: Static feature extraction formula: S = ReLU (SW S +b S ) Among them, S is the static feature representation; ReLU is the activation function; W S is the weight matrix related to static features; b S is the bias term; Multivariate time feature extraction formula: Among them, E i is the result after multivariate time feature extraction; X i is the input feature matrix; W i is the weight feature related to the multivariate time feature; is the bias term; Attention mechanism formula: Among them, Attention(Q,K,V) is the calculation process of the attention mechanism; softmax is the activation function; Q is the query matrix; K is the key matrix; V is the value matrix; d is the dimension of query and key; Fusion feature formula: in, is the final feature after fusion; is the output of the attention head; W is the weight matrix.
6. The weather forecasting system based on temporal knowledge graph reasoning and static multivariate spatiotemporal attention fusion according to claim 1 is characterized in that: In step 6, link prediction is performed on the time series knowledge graph. Specifically, link feature vectors are extracted through the time series knowledge graph. The specific formula is as follows: x i =(x i1 ,x i2 ,...,x in ,) Among them, x i is the vector feature of the ith link, representing the meteorological data of the ith link; x i1 ,x i2 ,...,x in is the specific characteristic of the link, representing different meteorological indicators; The link feature vector and historical link are used as input, and the GRU model is used to predict the link. The specific formula is as follows: y i =σ(W h h i-1 +W x x i +b) Among them, y i is the predicted probability of the i-th link; σ is the Sigmoid function; W h is the hidden layer weight matrix; h i-1 is the hidden state of the previous time step; W x is the link feature weight matrix; x i is the link feature vector of the current time step; b is the bias term.
7. The weather forecasting system based on temporal knowledge graph reasoning and static multivariate spatiotemporal attention fusion according to claim 4 is characterized in that: The specific formula for meteorological element prediction is: Among them, Sigmoid is the activation function; The forecast results of meteorological elements; is the final feature after fusion; W3 and W4 are weight matrices; b3 and b4 are bias terms.
8. The weather forecasting system based on temporal knowledge graph reasoning and static multivariate spatiotemporal attention fusion according to claim 1 is characterized in that: Step 7 is as follows: Step S1: Use the message passing formula in the graph convolutional network to update the state of the node in the SMTAFormer model prediction process, and use the message aggregation formula to aggregate information from neighboring nodes to generate prediction features; Step S2: Evaluate the prediction features and calculate the accuracy and error of the prediction features; Step S3: Optimize the model through loss function, cross entropy loss function and multi-class cross entropy loss function.
9. The weather forecasting system based on temporal knowledge graph reasoning and static multivariate spatiotemporal attention fusion according to claim 8 is characterized in that: The formula used in step S1 is as follows: Message passing formula: Where M is the message passing function; e s is the embedding vector of the current main node; r is the relationship embedding vector; e o is the embedding vector of the target node; t is the time embedding vector; The current node master node e s The state of the previous layer; is the embedding vector of relation r; h t is the embedding vector at time t; Message aggregation formula: in, is the embedding representation of the target node e0 in the first layer; δ is the activation function; W l is the weight matrix; is the sum operation of neighbor nodes; α l (e s ,r,e0,t) is the attention coefficient, indicating the source node e s , the similarity or importance of relation r, target node e0 and time t; q is a specific variable or operation.
Citation Information
Cited By
Inspection method, device and equipment based on digital airspace system and medium
CN119989283A
Dynamic optimal configuration method for ecological restoration plants in acid mine waste land
CN120046870A
Experiment table bottom cabinet intelligent load prediction and deformation risk early warning system based on AI
CN121093802A