Data organization and time series prediction method and apparatus based on spatiotemporal knowledge graph
By using a data organization and time series prediction method based on spatiotemporal knowledge graphs, and constructing spatiotemporal correlation edges using large language models and graph neural networks, the problem of insufficient modeling in spatiotemporally sensitive scenarios by traditional methods is solved, and efficient and interpretable time series prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AEROSPACE INFORMATION RES INST CAS
- Filing Date
- 2026-01-15
- Publication Date
- 2026-05-05
AI Technical Summary
Traditional time series forecasting methods struggle to effectively model complex spatial dependencies between entities, the impact of static attributes and sudden dynamic events in spatiotemporally sensitive scenarios, resulting in insufficient model interpretability and real-time response capabilities.
Multi-source heterogeneous data is constructed based on spatiotemporal knowledge graphs. Semantic encoding is performed using a large language model to generate representation vectors for nodes and related edges. Target temporal prediction is performed by combining graph neural networks. The spatiotemporal related edges are constructed considering spatial distance, time decay, and event intensity.
It improves the accuracy and interpretability of time series forecasting, enhances the adaptability to dynamic environments, can capture direct and indirect relationships between entities, adapts to different types of data input, and extends to multiple domain scenarios.
Smart Images

Figure CN121524558B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of knowledge graph and time series prediction technology, and more specifically to a data organization and time series prediction method and apparatus based on spatiotemporal knowledge graph. Background Technology
[0002] With the development of big data and artificial intelligence technologies, time series forecasting has been widely applied in fields such as intelligent traffic management, logistics scheduling optimization, environmental monitoring and analysis, and mobile target trajectory prediction. However, when facing spatiotemporally sensitive application scenarios (such as ship trajectory prediction and store traffic prediction), traditional time series forecasting methods still have certain limitations. These methods often focus on the historical data sequence of a single entity and are difficult to effectively model the complex spatial dependencies between entities (such as the influence between stores in a region), static attributes (such as brand chain relationships and management affiliation structures), and the impact of sudden dynamic events (such as severe weather, marketing activities, or sudden accidents).
[0003] While existing deep learning-based time series prediction models (such as Long Short-Term Memory networks and gated recurrent units) have advantages in processing long-term series data and capturing complex dependencies over time, their complex internal structures and computational mechanisms lead to insufficient interpretability. This makes it difficult to intuitively analyze the specific impact paths and degrees of influence of each input variable on the prediction results. Furthermore, in the face of sudden events or rapidly changing environmental conditions, existing models generally lack efficient real-time response and adaptive adjustment capabilities, failing to promptly reflect the immediate impact of external changes on the prediction target, thus affecting the accuracy and practicality of the predictions. Summary of the Invention
[0004] In view of the above problems, embodiments of this application provide a data organization and time series prediction method and apparatus based on spatiotemporal knowledge graphs, which can at least solve the problems of insufficient modeling of inter-entity relationships, poor model interpretability, and insufficient real-time adaptability of traditional time series prediction methods in spatiotemporally sensitive scenarios.
[0005] According to the first aspect of this application, a data organization and time series prediction method based on spatiotemporal knowledge graphs is provided, comprising: constructing a spatiotemporal knowledge graph based on multi-source heterogeneous data, wherein the node types of the spatiotemporal knowledge graph include at least entity nodes and event nodes; analyzing and representing the nodes, relationships, and spatiotemporal relationships of the spatiotemporal knowledge graph, and dynamically constructing a spatiotemporal graph network; and training a graph neural network model based on the spatiotemporal graph network for target time series prediction; wherein the analysis and representation of the nodes, relationships, and spatiotemporal relationships of the spatiotemporal knowledge graph includes: semantically encoding the static attributes of nodes in the spatiotemporal knowledge graph using a large language model to generate static attribute representation vectors for corresponding nodes, wherein static attributes are used to represent the inherent features of nodes; semantically encoding the static association edges in the spatiotemporal knowledge graph using a large language model to generate representation vectors for corresponding static association edges, wherein static association edges are used to represent the static relationships between entity nodes; and constructing spatiotemporal association edges between corresponding entity nodes and event nodes by analyzing the spatiotemporal relationships between them, wherein the construction dimensions of the spatiotemporal association edges include spatial distance, time decay, and event intensity.
[0006] According to embodiments of this application, constructing spatiotemporal association edges between entity nodes and event nodes by analyzing the spatiotemporal relationship between them includes: determining the spatial influence weight of the association edge connecting entity nodes and event nodes based on the geographic coordinates of entity nodes and event nodes using a preset spatial decay function; determining the temporal influence weight of the association edge connecting event nodes and entity nodes based on the time difference between the occurrence time of the event node and the current time using a preset temporal decay function; generating the event intensity weight of the association edge connecting event nodes and entity nodes through semantic encoding using a large language model based on the descriptive information of the event node; and constructing the spatiotemporal association edges between entity nodes and event nodes based on the spatial influence weight, temporal influence weight, and event intensity weight.
[0007] According to an embodiment of this application, determining the spatial influence weight of the associated edge connecting an entity node and an event node based on the geographic coordinates of an entity node and the geographic coordinates of an event node, using a preset spatial decay function, includes: obtaining the geographic coordinates of the entity node; obtaining the geographic influence area of the event node, and using the center geographic coordinates of the geographic influence area as the geographic coordinates of the event node; calculating the spatial proximity between the entity node and the event node based on the geographic coordinates of the entity node and the event node; and determining the spatial influence weight of the associated edge connecting the entity node and the event node based on the spatial proximity using a preset spatial decay function.
[0008] According to an embodiment of this application, determining the time influence weight of the associated edge connecting the event node and the entity node based on the time difference between the occurrence time of the event node and the current time using a preset time decay function includes: obtaining the occurrence time range corresponding to the event node, wherein the occurrence time range includes the start time and the end time; in response to the current time being less than the start time, determining the time influence weight of the associated edge connecting the event node and the entity node based on the time difference between the current time and the start time using a preset time decay function; in response to the current time being greater than the end time, determining the time influence weight of the associated edge connecting the event node and the entity node based on the time difference between the current time and the end time using a preset time decay function.
[0009] According to embodiments of this application, constructing spatiotemporal association edges between entity nodes and event nodes by analyzing the spatiotemporal relationship between them includes: obtaining the geographic coordinates of the entity node, the geographic influence area of the event node, and the occurrence time range of the event node; in response to the geographic coordinates of the entity node being located within the geographic influence area of the event node, setting the spatial influence weight of the association edge connecting the event node and the entity node to a preset spatial influence weight value; in response to the current time being within the occurrence time range, setting the temporal influence weight of the association edge connecting the event node and the entity node to a preset temporal influence weight value; based on the descriptive information of the event node, generating the event intensity weight of the association edge connecting the event node and the entity node through semantic encoding using a large language model; and constructing the spatiotemporal association edges between the entity node and the event node based on the spatial influence weight, temporal influence weight, and event intensity weight.
[0010] According to embodiments of this application, semantically encoding the static attributes of nodes in a spatiotemporal knowledge graph using a large language model to generate a static attribute representation vector for the corresponding node includes: obtaining the static attributes of nodes in the spatiotemporal knowledge graph, wherein the static attributes include at least the node name, node text description information, and node attribute information; concatenating the static attributes according to a preset format template to generate the complete text content of the corresponding node; and semantically encoding the complete text content using a large language model to generate a static attribute representation vector for the corresponding node.
[0011] According to an embodiment of this application, semantically encoding static association edges in a spatiotemporal knowledge graph using a large language model to generate a representation vector for the corresponding static association edge includes: constructing static association edges between entity nodes based on the static association relationships between entity nodes; and semantically encoding the static association edges using a large language model to generate a representation vector for the corresponding static association edge.
[0012] According to an embodiment of this application, the training steps for training a graph neural network model include: acquiring historical time-series data of the spatiotemporal graph network; training the graph neural network model based on the historical time-series data to obtain a trained graph neural network model, wherein the graph neural network model uses historical time-series data as input features and a target time series within a future period as a supervision signal; performing target time series prediction based on the trained graph neural network model to obtain a prediction result; calculating the prediction error between the prediction result and the actual result; and performing parameter optimization operations with the goal of minimizing the prediction error, wherein the object of the parameter optimization operations is limited to the internal network parameters of the graph neural network model.
[0013] The second aspect of this application provides a data organization and time-series prediction device based on spatiotemporal knowledge graphs, comprising: a spatiotemporal knowledge graph construction module for constructing a spatiotemporal knowledge graph based on multi-source heterogeneous data, wherein the node types of the spatiotemporal knowledge graph include at least entity nodes and event nodes; and a spatiotemporal graph network generation module for analyzing and representing the nodes, relationships, and spatiotemporal relationships of the spatiotemporal knowledge graph, and dynamically constructing a spatiotemporal graph network; wherein the analysis and representation of the nodes, relationships, and spatiotemporal relationships of the spatiotemporal knowledge graph includes: using a large language model to semantically encode the static attributes of nodes in the spatiotemporal knowledge graph, generating a semantic representation of the nodes. The system generates static attribute representation vectors for each node, where static attributes represent the inherent features of the node. It also uses a large language model to semantically encode static association edges in the spatiotemporal knowledge graph, generating representation vectors for these edges. These static association edges represent the static relationships between entity nodes. Furthermore, it constructs spatiotemporal association edges between entity nodes and event nodes by analyzing their spatiotemporal relationships. The dimensions of these spatiotemporal association edges include spatial distance, temporal decay, and event intensity. Finally, it includes a target temporal prediction module, which trains a graph neural network based on the spatiotemporal graph network for target temporal prediction.
[0014] A third aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0015] A fourth aspect of this application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0016] The fifth aspect of this application also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.
[0017] The data organization and time-series prediction method and apparatus based on spatiotemporal knowledge graphs according to the embodiments of this application have at least the following technical effects:
[0018] (1) By organizing multi-source heterogeneous data into a structured knowledge graph with time dimension and spatial semantics, dynamic, verifiable and causal external knowledge support is provided for time series prediction tasks, which effectively improves the timeliness accuracy and reasoning credibility of prediction models in time and space sensitive scenarios, and also improves the interpretability of time series prediction results.
[0019] (2) By constructing spatiotemporal correlation edges from multiple dimensions such as spatial distance, time decay, and event intensity, explicit modeling of the event impact path is realized, which enhances the performance of graph structure in response to dynamic environmental changes and can improve the accuracy of target time series prediction in future periods.
[0020] (3) By encoding entities and relationships, the meaning of the original fields is transformed into semantic vector representations, which can flexibly adapt to different types of data input. Whether it is structured numerical information or unstructured text information, it can be effectively integrated into the prediction framework, further improving the accuracy and reliability of the prediction results.
[0021] (4) It has high versatility and can be extended to domain scenarios that rely on spatiotemporal knowledge graphs for time series prediction, thus solving the limitations of existing solutions in relevant scenarios. Attached Figure Description
[0022] The above-mentioned contents, as well as other objects, features, and advantages of this application, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0023] Figure 1 The illustration shows an application scenario of the spatiotemporal knowledge graph-based data organization and temporal prediction method and apparatus according to embodiments of this application;
[0024] Figure 2 A flowchart illustrating a data organization and temporal prediction method based on spatiotemporal knowledge graphs according to an embodiment of this application is shown.
[0025] Figure 3 A flowchart illustrating the construction of spatiotemporal related edges according to an embodiment of this application is shown schematically;
[0026] Figure 4 A flowchart illustrating the determination of spatial influence weights according to an embodiment of this application is shown schematically;
[0027] Figure 5 A flowchart illustrating the determination of time influence weights according to an embodiment of this application is shown schematically;
[0028] Figure 6 The flowchart illustrates a data organization and time-series prediction method based on spatiotemporal knowledge graphs according to an embodiment of this application.
[0029] Figure 7 This schematically illustrates a structural block diagram of a data organization and temporal prediction apparatus based on a spatiotemporal knowledge graph according to an embodiment of this application; and
[0030] Figure 8 The diagram illustrates a block diagram of an electronic device suitable for implementing a spatiotemporal knowledge graph-based data organization and temporal prediction method according to an embodiment of the present application. Detailed Implementation
[0031] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0032] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0033] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0034] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0035] Traditional time series forecasting methods are mainly divided into two categories: statistical methods and deep learning methods. Statistical methods, such as autoregressive moving average models and exponential smoothing, have theoretical foundations and interpretability, but they are difficult to handle complex nonlinear relationships and the interaction effects between multiple variables. Deep learning methods, such as long short-term memory networks and gated recurrent units, can capture long-term dependencies, but they have significant limitations in the following aspects: (1) Lack of spatiotemporal correlation: Traditional time series forecasting methods only focus on the historical data of a single entity and cannot effectively capture the spatiotemporal dependencies between entities or between entities and events. For example, store traffic is not only affected by its own historical data, but also closely related to surrounding stores, transportation facilities, public events and other related entities or events; the trajectory of a ship is not only affected by its own speed and heading angle, but also by surrounding natural events, social conflicts and other factors; (2) Static knowledge solidification: Traditional methods are difficult to integrate external dynamic knowledge, such as the time evolution path of events like promotional activities and natural disasters. These events are often sudden and time-sensitive, and have an important impact on time series forecasting. (3) Weak causal reasoning: Traditional models struggle to model complex causal relationships, such as the influence of brand effect and street foot traffic on store traffic. They also lack the ability to encode entity attributes and long-term historical relationships.
[0036] To address the above issues, researchers have proposed methods such as graph convolutional networks in recent years to capture spatial dependencies between entities through graph structures, and then combine them with temporal convolutions or recurrent neural networks to capture temporal dependencies. However, existing methods still have shortcomings in the following aspects: (1) Most models only consider simple spatial adjacency relationships and fail to effectively integrate entity knowledge attributes and static association relationships; (2) They lack explicit modeling of dynamic events (such as promotional activities and natural disasters) and the capture of temporal evolution paths.
[0037] The embodiments of this application provide a data organization and time series prediction method based on spatiotemporal knowledge graphs. By constructing spatiotemporal association edges from multiple dimensions such as spatial distance, temporal decay, and event intensity, it achieves explicit modeling of the event influence path, enhancing the performance of graph structures in response to dynamic environmental changes. This not only captures direct connections between entities but also delves into indirect connections, thus providing richer and more accurate information support for prediction. By utilizing large models for semantic representation, it can flexibly adapt to different types of data input. Whether it is structured numerical information or unstructured text information, it can be effectively integrated into the prediction framework, further improving the accuracy and reliability of prediction results. This approach has high versatility and can be extended to domain scenarios that rely on spatiotemporal knowledge graphs for time series prediction, solving the limitations of existing solutions in relevant scenarios.
[0038] Figure 1The illustration shows an application scenario of the spatiotemporal knowledge graph-based data organization and temporal prediction method and apparatus according to embodiments of this application.
[0039] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0040] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0041] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0042] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0043] It should be noted that the data organization and time-series prediction method based on spatiotemporal knowledge graphs provided in the embodiments of this application can generally be executed by server 105. Correspondingly, the data organization and time-series prediction device based on spatiotemporal knowledge graphs provided in the embodiments of this application can generally be located in server 105. The data organization and time-series prediction method based on spatiotemporal knowledge graphs provided in the embodiments of this application can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the data organization and time-series prediction device based on spatiotemporal knowledge graphs provided in the embodiments of this application can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0044] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0045] The following will be based on Figure 1 The described scene, through Figures 2-6 A detailed description is provided of a spatiotemporal knowledge graph-based data organization and temporal prediction method according to embodiments of this application.
[0046] Figure 2 A flowchart illustrating a spatiotemporal knowledge graph-based data organization and temporal prediction method according to an embodiment of this application is shown.
[0047] like Figure 2 As shown, the data organization and time series prediction method 200 based on spatiotemporal knowledge graph in this embodiment includes operations S210 to S230.
[0048] In operation S210, a spatiotemporal knowledge graph is constructed based on multi-source heterogeneous data. The node types of the spatiotemporal knowledge graph include at least entity nodes and event nodes.
[0049] In the embodiments of this application, the construction of the spatiotemporal knowledge graph can be processed through steps 1 to 2.
[0050] Step 1, Data Input and Preprocessing: In the embodiments of this application, data can be obtained from a variety of heterogeneous data sources with different origins and structures. These data sources are extensive, covering various channels such as social media platforms and enterprise databases, and the data structures can include different types such as structured data, semi-structured data, and unstructured data.
[0051] After acquiring multi-source heterogeneous data, this data can be preprocessed to extract information closely related to the target prediction task. Specifically, firstly, the multi-source heterogeneous data undergoes deep cleaning, including noise removal, missing value completion, and correction of format inconsistencies. Then, data format conversion is performed. For time data included in the multi-source heterogeneous data, it can be uniformly converted according to internationally accepted standard time formats to eliminate differences caused by different time representation methods used by different data sources. For geographic location information, it can be uniformly converted into a representation under the same coordinate system to facilitate subsequent analysis and processing of geographic location-related data.
[0052] Step 2, Constructing a spatiotemporal knowledge graph: After completing the data preprocessing, a spatiotemporal knowledge graph can be constructed based on the preprocessed data.
[0053] In the embodiments of this application, a spatiotemporal knowledge graph is used to organize and manage the collected multi-source heterogeneous data, forming structured graph information such as related entities, relationships, and events. The node types of the spatiotemporal knowledge graph include at least entity nodes and event nodes. Each entity node represents a specific object in the real world or a specific domain, typically a static entity such as a person, place, organization, or concept. Each event node represents a process or action that has occurred or is about to occur, usually involving time, place, participants, and result. Each node can have at least one static attribute, which describes the inherent characteristics of the node. These attributes typically include the node's name, textual description information, and a set of structured attribute information (such as category, price, rating, etc.). The data type of the static attributes can be structured or unstructured. Structured data includes numerical, categorical, and temporal types, while unstructured data can include text. Entity nodes are interconnected through static relationships. Static relationships are relatively stable and long-term valid relationships, typically not changing frequently with time or context, such as affiliation or brand. Relationships other than static relationships can be called dynamic relationships. Entity nodes can also act as participants or beneficiaries of event nodes. For example, in the event node "meeting is held", the "meeting organizer" entity node is a participant, responsible for planning and organizing the specific process of the meeting. It can also be a beneficiary of the event node, passively affected by the event node and undergoing corresponding changes. In a spatiotemporal knowledge graph, this relationship can be represented by associated edges.
[0054] In the S220 operation, the nodes, relationships, and spatiotemporal relationships of the spatiotemporal knowledge graph are analyzed and represented, and a spatiotemporal graph network is dynamically constructed.
[0055] The analysis and representation of nodes, associations, and spatiotemporal relationships in the spatiotemporal knowledge graph includes: semantically encoding the static attributes of nodes in the spatiotemporal knowledge graph using a large language model to generate static attribute representation vectors for corresponding nodes, where static attributes represent the inherent features of nodes; semantically encoding the static association edges in the spatiotemporal knowledge graph using a large language model to generate representation vectors for corresponding static association edges, where static association edges represent the static associations between entity nodes; and constructing spatiotemporal association edges between entity nodes and event nodes by analyzing the spatiotemporal relationships between them, where the construction dimensions of the spatiotemporal association edges include spatial distance, time decay, and event intensity.
[0056] Most current mainstream text vector encoding methods are based on static word vectors or shallow context modeling, which struggle to fully capture the dynamic semantic changes of words in different contexts and remain limited in long-distance dependency modeling and deep semantic information fusion. In contrast, large language models based on the Transformer architecture (a neural network architecture based on self-attention mechanisms) can perform global modeling of the input text, dynamically generating vector representations for each word that are closely related to its context through self-attention mechanisms. This allows the same word to obtain highly differentiated semantic encodings in different contexts, thus more accurately reflecting the semantic diversity and complexity in natural language and significantly improving the context adaptability and semantic discriminative power of text representation.
[0057] In the embodiments of this application, the method of semantically encoding the static attributes of nodes in a spatiotemporal knowledge graph using a large language model to generate the static attribute representation vector of the corresponding node includes: obtaining the static attributes of nodes in the spatiotemporal knowledge graph, wherein the static attributes include at least the node name, node text description information, and node attribute information; concatenating the static attributes according to a preset format template to generate the complete text content of the corresponding node; and semantically encoding the complete text content using a large language model to generate the static attribute representation vector of the corresponding node.
[0058] For example, the preset format template can be set as: "{Node Name}\t{Text Description}\t{Attribute Name 1: Attribute Value 1}...{Attribute Name N: Attribute Value N}". Using this preset template, the static attributes (including name, text description, and attribute information) of relevant entity nodes or event nodes in the spatiotemporal knowledge graph can be concatenated into the complete text content of a node. Subsequently, this complete text content, along with relevant prompts, can be input into the large language model. The large language model, based on its powerful semantic understanding capabilities, will deeply analyze the input information, capturing its context, meaning, and related features, and transforming it into a high-dimensional semantic vector. This output semantic vector can then be used as the static attribute representation vector for entity nodes or event nodes.
[0059] In the embodiments of this application, by mapping the static attributes of nodes to a vector, structured and unstructured information can be transformed into a form that can be directly processed by machine learning models. This method can effectively encode the semantic information of attributes of arbitrary lengths of nodes and overcome the differences brought about by numerical or textual fields, unifying the semantic expression of different types of entities and relationships.
[0060] In the embodiments of this application, the method of semantically encoding static association edges in a spatiotemporal knowledge graph using a large language model to generate the corresponding representation vector of the static association edge includes: constructing static association edges between entity nodes based on the static association relationships between entity nodes; and semantically encoding the static association edges using a large language model to generate the corresponding representation vector of the static association edge.
[0061] In the embodiments of this application, static association edges between entity nodes can be constructed based on static association relationships (such as "brand", "type", etc.). Each constructed static association edge corresponds to a relation triple, which consists of three key elements: a head entity, a tail entity, and a relation type that clearly defines the semantic or logical connection between the head and tail entities. Furthermore, by utilizing a large language model, semantic representation vectors of the static association edges can be generated, which can be used to describe the semantic features of the corresponding association edges.
[0062] For example, the format template for the association edge can be preset as: "There is a {relationship type} relationship between {head entity} and {tail entity}". For each static association edge between entity nodes, the corresponding triple (<head entity, relationship type, tail entity>) is generated according to the format template, and the corresponding standardized text is input into the large language model along with the relevant prompt. The large language model can then perform vector encoding on the text to generate the representation vector corresponding to each static association edge.
[0063] In the embodiments of this application, by encoding static relation vectors, the semantic connotations of different types of static relations can be modeled in a unified manner, so that each static associated edge has a semantic annotation, which can enhance the information expression ability of the edges in the graph structure and provide rich topological semantic support for subsequent graph neural networks.
[0064] In the embodiments of this application, entities and relations are encoded using a large language model, and the meaning of the original fields is represented by semantic vectors. Compared with traditional encoding methods such as bucketing, this effectively improves the modeling effect of knowledge graphs in the field of time series prediction.
[0065] The dimensions for constructing associated edges are a variety of key considerations and methods used to define and determine the relationships between nodes. These dimensions reveal the complex connections between nodes from different perspectives, and can transform the implicit complex relationships between nodes into a structured representation that can be formalized, quantified, and traced over time.
[0066] In the embodiments of this application, by analyzing and representing the nodes, relationships, and spatiotemporal relationships of the spatiotemporal knowledge graph, a spatiotemporal graph network is dynamically constructed. Based on the original relationships, spatial distance, time decay, and event intensity dimensions are introduced to further enrich and expand the information carrying capacity of the associated edges, enabling a more comprehensive representation of the complex connections between event nodes and entity nodes. The spatial distance dimension defines and quantifies the association strength between entity nodes and event nodes by measuring their geographical distance. The time decay dimension measures the relative position of the current time and the time range of the event node's occurrence on the timeline, and the resulting attenuation of the event node's influence on entity nodes. The event intensity dimension reflects the degree of influence of event nodes on entity nodes from a semantic perspective. The following will combine the appendix... Figure 3 The construction of spatiotemporal related edges is explained in detail.
[0067] In operation of S230, a graph neural network model is trained based on a spatiotemporal graph network for target time series prediction.
[0068] In embodiments of this application, the training steps for training a graph neural network model include: acquiring historical time-series data of the spatiotemporal graph network; training the graph neural network model based on the historical time-series data to obtain a trained graph neural network model, wherein the graph neural network model uses historical time-series data as input features and a target time series within a future period as a supervision signal; performing target time series prediction based on the trained graph neural network model to obtain a prediction result; calculating the prediction error between the prediction result and the actual result; and performing parameter optimization operations with the goal of minimizing the prediction error, wherein the object of the parameter optimization operations is limited to the internal network parameters of the graph neural network model.
[0069] For example, the aforementioned spatiotemporal graph network (i.e., containing nodes, static associated edges, and spatiotemporal associated edges) can be input into a graph neural network model for end-to-end training. Specifically, time-series data of the spatiotemporal graph network within a preset historical period can be obtained, and the training set data and validation set data can be divided according to a preset ratio (e.g., 8:2). The graph neural network model is trained based on the training set data to obtain the trained graph neural network model; based on the trained graph neural network model, target time-series prediction is performed on the validation set data to obtain the validation set prediction results. The prediction error between the validation set prediction results and the actual results corresponding to the validation set data is calculated; parameter optimization operations are performed with the goal of minimizing the prediction error (e.g., mean squared error or mean absolute error). The graph neural network model uses historical time-series data as input, and the target variable (e.g., store traffic) in the future period as the supervision signal. During training, parameter optimization operations target the internal network parameters of the graph neural network model (such as attention weights, bias terms, etc.), while the parameters of the large language model need to be frozen and fixed. This can reduce the risk of overfitting, improve the model's convergence stability and generalization performance, and ultimately achieve high-precision and interpretable time series prediction results.
[0070] For example, a graph convolutional neural network can be used as a specific implementation of a graph neural network.
[0071] Furthermore, in time series forecasting, graph neural networks can be used for vector representation learning, and the results can be used as input features for other time series forecasting models.
[0072] In the embodiments of this application, by organizing multi-source heterogeneous data into a spatiotemporal graph network with temporal and spatial semantics, dynamic, verifiable, and causally related external knowledge support is provided for time series prediction tasks. This effectively improves the timeliness accuracy and reasoning credibility of the prediction model in spatiotemporally sensitive scenarios, while also enhancing the interpretability of the time series prediction method. By constructing spatiotemporal association edges from multiple dimensions such as spatial distance, time decay, and event intensity, explicit modeling of the event influence path is achieved, enhancing the graph structure's ability to cope with dynamic environmental changes. This not only captures direct connections between entities but also delves into indirect connections, thus providing richer and more accurate information support for prediction. Through semantic representation, different types of data input can be flexibly adapted. Whether it is structured numerical information or unstructured text information, it can be effectively integrated into the prediction framework, further improving the accuracy and reliability of the prediction results. The method has high versatility and can be extended to domain scenarios that rely on spatiotemporal knowledge graphs for time series prediction, solving the limitations of existing solutions in relevant scenarios.
[0073] Figure 3A flowchart illustrating the construction of spatiotemporal related edges according to an embodiment of this application is shown.
[0074] like Figure 3 As shown, the method 300 of this embodiment includes operations S310 to S340.
[0075] In operation S310, based on the geographic coordinates of the entity node and the event node, the spatial influence weight of the associated edge connecting the entity node and the event node is determined by a preset spatial decay function.
[0076] The association edges between entity nodes and event nodes represent the relationship between them. This relationship not only reflects their tight coupling at the structural and semantic levels, but also carries the causal or temporal impact of the event on the entity's state, attributes, or behavior.
[0077] Figure 4 A flowchart illustrating the determination of spatial influence weights according to an embodiment of this application is shown.
[0078] like Figure 4 As shown, this embodiment is one embodiment of operation S310, including operations S311 to S314.
[0079] In operation S311, obtain the geographical coordinates of the entity node.
[0080] In the embodiments of this application, geographic coordinates refer to the spatial location identifier assigned to entity nodes that have a clear geographic location attribute. Geographic coordinates are a static attribute of entity nodes, and they are usually represented by latitude and longitude, and can be extended to three-dimensional coordinates that include altitude when necessary.
[0081] In operation S312, the geographical influence area of the event node is obtained, and the center geographical coordinates of the geographical influence area are used as the geographical coordinates of the event node.
[0082] In the embodiments of this application, the geographical influence area of an event node refers to the range and spatial boundaries of the direct and indirect effects of a specific event on the natural environment, socio-economic system, and human activities in the geographical space. The central geographical coordinates of this geographical influence area can be used as the geographical coordinates of the event node.
[0083] In operation S313, the spatial proximity between entity nodes and event nodes is calculated based on the geographic coordinates of entity nodes and event nodes.
[0084] In the embodiments of this application, spatial proximity is an indicator used to measure the degree of proximity between entity nodes and event nodes in spatial location. It can be quantified by calculating the distance between them. For example, spatial proximity can be represented by Euclidean distance.
[0085] In operation S314, based on spatial proximity, the spatial influence weight of the associated edge between the entity node and the event node is determined by a preset spatial decay function.
[0086] In the embodiments of this application, if the spatial proximity of an entity node and an event node is 0, it indicates that they completely overlap in spatial location. In this case, the entity node is located at the center of the geographical influence area of the event node and is most affected by the event node. As the spatial proximity increases (i.e., the spatial distance between the entity node and the event node increases), the degree of influence on the entity node decreases, exhibiting a clear spatial gradient decay characteristic. This spatial gradient decay characteristic can be modeled using a spatial decay function, that is, the degree of influence of the event node on the entity node can be determined by a preset spatial decay function. For example, a radial basis function kernel (RBF kernel) can be used to construct the decay function.
[0087] In a graph structure, the edges connecting entity nodes and event nodes represent a specific relationship between them, and the weights of these edges are used to measure the strength of this relationship. In the embodiments of this application, the spatial influence weights of the edges connecting entity nodes and event nodes are determined by a preset spatial decay function.
[0088] For example, an event node can represent a typhoon. The geographical impact of the typhoon mainly covers Province A, and the central geographical coordinates of its impact area are (longitude X°, latitude Y°). If the calculated spatial proximity of City B to this central geographical coordinate is 0, it means that City B is exactly located at the center of the typhoon's impact area, implying that it may experience the strongest direct impact of the typhoon. As the distance from the central geographical coordinate increases, the intensity of the typhoon's wind speed, precipitation, and other effects gradually weakens. Therefore, spatial proximity can serve as an important spatial indicator for measuring the degree of typhoon impact.
[0089] In the embodiments of this application, the influence of event nodes on entity nodes is quantified by spatial influence weight, thereby realizing explicit modeling of the event space influence path and enhancing the performance of graph structures in response to dynamic environmental changes.
[0090] In operation S320, based on the time difference between the occurrence time of the event node and the current time, the time influence weight of the associated edge connecting the event node and the entity node is determined by a preset time decay function.
[0091] Figure 5 A flowchart illustrating the determination of time influence weights according to an embodiment of this application is shown.
[0092] like Figure 5 As shown, this embodiment is one embodiment of operation S320, including operations S321 to S323.
[0093] In operation S321, the occurrence time range corresponding to the event node is obtained. The occurrence time range includes the start time and the end time.
[0094] In the embodiments of this application, the occurrence time range of an event node refers to the specific time period covered by the event from the start time to the end time. This range not only represents the time span of the event, but also limits the effective period of the event's effect.
[0095] In operation S322, in response to the current time being less than the start time, the time influence weight of the associated edge connecting the event node and the entity node is determined based on the time difference between the current time and the start time, using a preset time decay function.
[0096] In operation S323, in response to the current time being greater than the end time, the time influence weight of the associated edge connecting the event node and the entity node is determined based on the time difference between the current time and the end time, using a preset time decay function.
[0097] For example, an event node can represent a promotional activity with an occurrence time range of [February 1st, February 28th]. If the current time falls within this time range, it means the entity node is affected by the event node. If the current time is earlier than February 1st (i.e., less than the start time), it indicates the event node has not yet occurred, and the impact of the event node on the entity node gradually weakens as the interval between the current and start times increases. If the current time is later than February 28th (i.e., greater than the end time), it indicates the event node has already occurred, and the impact of the event node on the entity node also gradually weakens as the interval between the current and end times increases. This time-varying impact can be modeled and analyzed using a time decay function. The time decay function quantifies the changing influence of an event over time, typically showing that the intensity of the impact decreases mathematically as the distance between the current time and the event's occurrence time increases.
[0098] In the embodiments of this application, the time influence weight of the associated edge connecting the event node and the entity node is determined by a preset time decay function. For example, the time decay function can be an exponential decay function. When the current time is within the occurrence time range of the event node, the output of the exponential decay function is a preset fixed value (i.e., the time influence weight is a fixed value). When the current time is outside the occurrence time range of the event node, the decay calculation is performed using an exponential decay model. Specifically: if the current time is less than the start time, the time influence weight is determined by the preset time decay function based on the time difference between the current time and the start time; if the current time is greater than the end time, the time influence weight is determined by the preset time decay function based on the time difference between the current time and the end time.
[0099] In the embodiments of this application, a time decay mechanism is used to quantify the timeliness impact based on the time difference between the event occurrence time and the current time, thereby realizing explicit modeling of the event time impact, enhancing the graph structure's ability to cope with dynamic environmental changes, and enabling it to more accurately capture and reflect the evolution law of the structure in the process of temporal evolution.
[0100] In operation S330, based on the description information of the event nodes, the event strength weights of the associated edges connecting the event nodes and entity nodes are generated through semantic encoding using a large language model.
[0101] In the embodiments of this application, by combining the descriptive information of the event node, the event description information can be semantically encoded using a large language model to obtain a representation vector, and this representation vector is used as the event strength weight of the association edge connecting the event node and the entity node. The descriptive information of the event node may include the node's name, textual description information, and attribute information, etc.
[0102] For example, the format template for event intensity can be preset as: "The event information is {description text}, which may have a certain impact on {affected entity name}". After organizing the description information of the event node according to the above format template, it is input into the large language model along with the relevant Prompt. The large language model performs semantic encoding to obtain a representation vector, and this representation vector is used as the event intensity weight of all the edges connecting the event node and the entity node.
[0103] In operating S340, spatiotemporal association edges between entity nodes and event nodes are constructed based on spatial influence weight, temporal influence weight, and event intensity weight.
[0104] In the embodiments of this application, for a certain associated edge connecting an event node and an entity node, firstly, the joint influence weight can be calculated based on the spatial influence weight and the temporal influence weight. The calculation method can be expressed as follows: Then, the joint influence weight and the event intensity weight are simultaneously labeled on this correlation edge, thus obtaining the spatiotemporal correlation edge. By labeling the spatiotemporal correlation edge, the influence intensity of the event on the entity can be clearly quantified, making the causal logic of the time series prediction results more interpretable.
[0105] It should be noted that if an event node has associated edges with multiple entity nodes, then all associated edges need to be constructed as spatiotemporal associated edges.
[0106] In another embodiment of this application, the step of constructing a spatiotemporal association edge may include: obtaining the geographic coordinates of the entity node, the geographic influence area of the event node, and the occurrence time range of the event node; in response to the geographic coordinates of the entity node being located within the geographic influence area of the event node, setting the spatial influence weight of the association edge connecting the event node and the entity node to a preset spatial influence weight value; in response to the current time being within the occurrence time range, setting the temporal influence weight of the association edge connecting the event node and the entity node to a preset temporal influence weight value; generating the event intensity weight of the association edge connecting the event node and the entity node through semantic encoding using a large language model based on the description information of the event node; and constructing the spatiotemporal association edge between the entity node and the event node according to the spatial influence weight, temporal influence weight, and event intensity weight.
[0107] For example, the geographical influence area of an event node can be defined by geographical zoning, based on spatial attributes such as the neighborhood, administrative division, and climate zone where the node is located. If the geographical coordinates of the entity node are within the geographical influence area of the event node, the spatial influence weight of the edge connecting the entity node and the event node is set to a preset spatial influence weight value (i.e., a preset constant value). The time range of the event node's occurrence can be determined using intervals such as hours, days, or seasons. If the current time is within the time range, the time influence weight of the edge connecting the entity node and the event node is set to a preset time influence weight value (i.e., a preset constant value).
[0108] In the embodiments of this application, by constructing spatiotemporal related edges, explicit modeling of the impact path of sudden events (such as typhoons and promotional activities) is realized. By converting the spatial knowledge graph into a spatiotemporal graph network, the ability of the graph structure to model dynamic environmental changes is enhanced.
[0109] Figure 6 The illustration shows a flowchart of a data organization and time-series prediction method based on spatiotemporal knowledge graphs according to an embodiment of the present application.
[0110] like Figure 6 As shown, the process of data organization and time series prediction methods based on spatiotemporal knowledge graphs can be divided into the following four steps.
[0111] Step 1: Static Attribute Encoding. Specifically, the spatiotemporal knowledge graph can contain entity nodes (Company A in the figure) and event nodes (Promotional Activity B in the figure). For the static attributes of entity nodes and event nodes in the spatiotemporal knowledge graph, vector encoding can be performed separately using a large language model to output the static attribute representation vector of the corresponding node. After the static attribute encoding is completed, the spatiotemporal knowledge graph with node vector encoding is transmitted to Step 2 for subsequent processing.
[0112] Step 2: Static Relation Encoding. Specifically, for entity nodes and the static relationships between them in the spatiotemporal knowledge graph (as shown in the figure), vector encoding is performed using a large language model to output the representation vectors of the corresponding static relationships. After the static relationship encoding is completed, the spatiotemporal knowledge graph with the static relationship vector encoding is transmitted to Step 3 for further processing.
[0113] Step 3: Spatiotemporal Relationship Encoding. Specifically, for the spatiotemporal knowledge graph, spatiotemporal relationship edges are constructed from three dimensions: spatial distance, temporal decay, and event intensity, forming a spatiotemporal graph network. This spatiotemporal graph network is then transmitted to Step 4 for subsequent processing.
[0114] Step 4: Model Training and Fine-tuning. Specifically, train the graph neural network model to obtain the trained graph neural network model. Based on the spatiotemporal graph network, use the pre-trained graph neural network model to perform target temporal prediction.
[0115] In the embodiments of this application, multi-source data is organized based on a spatiotemporal knowledge graph, and the spatiotemporal knowledge graph, containing information such as spatiotemporal location and influence range conditions, is constructed into a graph network that reflects the propagation of entities or events. By combining static attribute vector encoding, static relation vector encoding, and spatiotemporal relation encoding, accurate modeling of complex environmental changes (such as sudden events) is achieved, forming a predictive framework that comprehensively captures the changing patterns of time-series data. This method not only enhances the accuracy of the model's prediction of target variables in future periods but also improves the interpretability of time-series prediction methods.
[0116] Based on the aforementioned data organization and time series prediction method based on spatiotemporal knowledge graphs, this application also provides a data organization and time series prediction device based on spatiotemporal knowledge graphs. The following will combine... Figure 7 The device is described in detail.
[0117] Figure 7 The diagram illustrates a structural block diagram of a spatiotemporal knowledge graph-based data organization and time-series prediction apparatus according to an embodiment of the present application.
[0118] like Figure 7As shown, the spatiotemporal knowledge graph-based data organization and time series prediction device 700 of this embodiment includes a spatiotemporal knowledge graph construction module 710, a spatiotemporal graph network generation module 720, and a target time series prediction module 730.
[0119] The spatiotemporal knowledge graph construction module 710 is used to construct a spatiotemporal knowledge graph based on multi-source heterogeneous data. The node types of the spatiotemporal knowledge graph include at least entity nodes and event nodes. In one embodiment, the spatiotemporal knowledge graph construction module 710 can be used to perform the operation S210 described above, which will not be repeated here.
[0120] The spatiotemporal graph network generation module 720 is used to analyze and represent the nodes, relationships, and spatiotemporal connections of the spatiotemporal knowledge graph, and dynamically construct a spatiotemporal graph network. In one embodiment, the spatiotemporal graph network generation module 720 can be used to perform the operation S220 described above, which will not be repeated here.
[0121] The analysis and representation of nodes, associations, and spatiotemporal relationships in the spatiotemporal knowledge graph includes: semantically encoding the static attributes of nodes in the spatiotemporal knowledge graph using a large language model to generate static attribute representation vectors for corresponding nodes, where static attributes represent the inherent features of nodes; semantically encoding the static association edges in the spatiotemporal knowledge graph using a large language model to generate representation vectors for corresponding static association edges, where static association edges represent the static associations between entity nodes; and constructing spatiotemporal association edges between entity nodes and event nodes by analyzing the spatiotemporal relationships between them, where the construction dimensions of the spatiotemporal association edges include spatial distance, time decay, and event intensity.
[0122] The target time series prediction module 730 is used to train a graph neural network model for target time series prediction based on a spatiotemporal graph network. In one embodiment, the target time series prediction module 730 can be used to perform the operation S230 described above, which will not be repeated here.
[0123] In the embodiments of this application, the data organization and time series prediction device 700 based on spatiotemporal knowledge graph may further include a spatiotemporal association edge construction module.
[0124] The spatiotemporal association edge construction module is used to determine the spatial influence weight of the association edge connecting entity nodes and event nodes based on the geographic coordinates of entity nodes and event nodes, using a preset spatial decay function; based on the time difference between the occurrence time of the event node and the current time, it determines the temporal influence weight of the association edge connecting event nodes and entity nodes using a preset temporal decay function; based on the descriptive information of the event node, it generates the event intensity weight of the association edge connecting event nodes and entity nodes through semantic encoding using a large language model; and constructs the spatiotemporal association edge between entity nodes and event nodes based on the spatial influence weight, temporal influence weight, and event intensity weight.
[0125] In embodiments of this application, the spatiotemporal correlation edge construction module may include a spatial influence weight determination module and a temporal influence weight determination module.
[0126] The spatial influence weight determination module is used to obtain the geographic coordinates of entity nodes; obtain the geographic influence area of event nodes, and use the center geographic coordinates of the geographic influence area as the geographic coordinates of event nodes; calculate the spatial proximity between entity nodes and event nodes based on the geographic coordinates of entity nodes and event nodes; and determine the spatial influence weight of the associated edge connecting entity nodes and event nodes based on the spatial proximity through a preset spatial decay function.
[0127] The time influence weight determination module is used to obtain the occurrence time range corresponding to the event node, wherein the occurrence time range includes the start time and the end time; in response to the current time being less than the start time, the time influence weight of the associated edge connecting the event node and the entity node is determined based on the time difference between the current time and the start time and through a preset time decay function; in response to the current time being greater than the end time, the time influence weight of the associated edge connecting the event node and the entity node is determined based on the time difference between the current time and the end time and through a preset time decay function.
[0128] In another embodiment of this application, the spatiotemporal association edge construction module is used to obtain the geographic coordinates of the entity node, the geographic influence area of the event node, and the occurrence time range of the event node; in response to the geographic coordinates of the entity node being located within the geographic influence area of the event node, the spatial influence weight of the association edge connecting the event node and the entity node is set to a preset spatial influence weight value; in response to the current time being within the occurrence time range, the temporal influence weight of the association edge connecting the event node and the entity node is set to a preset temporal influence weight value; based on the description information of the event node, semantic encoding is performed through a large language model to generate the event intensity weight of the association edge connecting the event node and the entity node; and the spatiotemporal association edge between the entity node and the event node is constructed according to the spatial influence weight, temporal influence weight, and event intensity weight.
[0129] In the embodiments of this application, the data organization and time-series prediction device 700 based on spatiotemporal knowledge graph may further include a static attribute semantic representation module, a static association edge semantic representation module, and a graph neural network model training module.
[0130] The static attribute semantic representation module is used to obtain the static attributes of nodes in the spatiotemporal knowledge graph. The static attributes include at least the node name, node text description information, and node attribute information. According to the preset format template, the static attributes are concatenated to generate the complete text content of the corresponding node. The complete text content is semantically encoded using a large language model to generate the static attribute representation vector of the corresponding node.
[0131] The static association edge semantic representation module is used to construct static association edges between entity nodes based on the static association relationships between entity nodes; it uses a large language model to perform semantic encoding on the static association edges and generate the corresponding representation vectors of the static association edges.
[0132] The graph neural network model training module is used to acquire historical time-series data of the spatiotemporal graph network; it trains the graph neural network model based on the historical time-series data to obtain the trained graph neural network model, wherein the graph neural network model uses the historical time-series data as input features and the target time series in the future period as supervision signals; based on the trained graph neural network model, it performs target time series prediction to obtain prediction results; it calculates the prediction error between the prediction results and the actual results; and it performs parameter optimization operations with the goal of minimizing the prediction error, wherein the parameter optimization operations are limited to the internal network parameters of the graph neural network model.
[0133] According to embodiments of this application, by constructing spatiotemporal relationship edges from multiple dimensions such as spatial distance, time decay, and event intensity, explicit modeling of the event influence path is achieved, enhancing the performance of graph structures in response to dynamic environmental changes. This not only captures direct connections between entities but also delves into indirect connections, thereby providing richer and more accurate information support for prediction. By utilizing large models for semantic representation, different types of data inputs can be flexibly adapted. Whether it is structured numerical information or unstructured text information, it can be effectively integrated into the prediction framework, further improving the accuracy and reliability of prediction results. This approach has high versatility and can be extended to domain scenarios that rely on spatiotemporal knowledge graphs for time series prediction, solving the limitations of existing solutions in relevant scenarios.
[0134] According to embodiments of this application, any multiple modules among the spatiotemporal knowledge graph construction module 710, the spatiotemporal graph network generation module 720, and the target timing prediction module 730 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the spatiotemporal knowledge graph construction module 710, the spatiotemporal graph network generation module 720, and the target timing prediction module 730 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any one of the three implementation methods or a suitable combination of any of them. Alternatively, at least one of the spatiotemporal knowledge graph construction module 710, spatiotemporal graph network generation module 720, and target time series prediction module 730 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0135] Figure 8 The diagram illustrates a block diagram of an electronic device suitable for implementing a spatiotemporal knowledge graph-based data organization and temporal prediction method according to an embodiment of the present application.
[0136] like Figure 8 As shown, an electronic device 800 according to an embodiment of this application includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage portion 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.
[0137] RAM 803 stores various programs and data required for the operation of electronic device 800. Processor 801, ROM 802, and RAM 803 are interconnected via bus 804. Processor 801 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 802 and / or RAM 803. It should be noted that the programs may also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0138] According to embodiments of this application, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the input / output (I / O) interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.
[0139] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0140] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 802 and / or RAM 803 and / or one or more memories other than ROM 802 and RAM 803 described above.
[0141] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the spatiotemporal knowledge graph-based data organization and time-series prediction method provided by embodiments of this application.
[0142] When the computer program is executed by the processor 801, it performs the functions defined in the system / apparatus of the embodiments of this application. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0143] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0144] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by processor 801, it performs the functions defined in the system of the embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0145] According to embodiments of this application, program code for executing the computer programs provided in embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0146] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0147] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A data organization and time series prediction method based on spatiotemporal knowledge graphs, characterized in that, The method includes: A spatiotemporal knowledge graph is constructed based on multi-source heterogeneous data. The node types of the spatiotemporal knowledge graph include at least entity nodes and event nodes. The entity nodes are used to represent specific objects in the real world or a specific domain, and the event nodes are used to represent processes or actions that have occurred or are about to occur. The nodes, relationships, and spatiotemporal relationships of the spatiotemporal knowledge graph are analyzed and represented to dynamically construct a spatiotemporal graph network; Based on the spatiotemporal graph network, a graph neural network model is trained for target temporal prediction. The analysis and representation of the nodes, relationships, and spatiotemporal relationships of the spatiotemporal knowledge graph includes: The static attributes of nodes in the spatiotemporal knowledge graph are semantically encoded using a large language model to generate static attribute representation vectors corresponding to the nodes, wherein the static attributes are used to represent the inherent features of the nodes. The static association edges in the spatiotemporal knowledge graph are semantically encoded using a large language model to generate representation vectors corresponding to the static association edges, wherein the static association edges are used to represent the static association relationships between the entity nodes. By analyzing the spatiotemporal relationship between the entity node and the event node, a spatiotemporal association edge is constructed between the entity node and the event node. The construction dimensions of the spatiotemporal association edge include a spatial distance dimension, a time decay dimension, and an event intensity dimension. The spatial distance dimension is used to define and quantify the association strength between the entity node and the event node by measuring their geographical distance. The time decay dimension is used to measure the relative position of the current time and the time range of the event node's occurrence on the time axis and the resulting degree of attenuation of the event node's influence on the entity node. The event intensity dimension is used to reflect the degree of influence of the event node on the entity node from a semantic level.
2. The method according to claim 1, characterized in that, The step of constructing spatiotemporal association edges between entity nodes and event nodes by analyzing the spatiotemporal relationship between them includes: Based on the geographic coordinates of the entity node and the event node, the spatial influence weight of the associated edge connecting the entity node and the event node is determined by a preset spatial decay function. Based on the time difference between the occurrence time of the event node and the current time, the time influence weight of the associated edge connecting the event node and the entity node is determined by a preset time decay function. Based on the description information of the event node, the event strength weight of the associated edge connecting the event node and the entity node is generated by semantic encoding through a large language model. Based on the spatial influence weight, the temporal influence weight, and the event intensity weight, a spatiotemporal association edge is constructed between the entity node and the event node.
3. The method according to claim 2, characterized in that, The determination of the spatial influence weight of the association edge connecting the entity node and the event node based on the geographic coordinates of the entity node and the event node, using a preset spatial decay function, includes: Obtain the geographic coordinates of the entity node; Obtain the geographical influence area of the event node, and use the center geographical coordinates of the geographical influence area as the geographical coordinates of the event node; Based on the geographic coordinates of the entity node and the geographic coordinates of the event node, calculate the spatial proximity between the entity node and the event node; Based on the spatial proximity, the spatial influence weight of the associated edge connecting the entity node and the event node is determined by a preset spatial decay function.
4. The method according to claim 2, characterized in that, The determination of the time influence weight of the associated edge connecting the event node and the entity node based on the time difference between the occurrence time of the event node and the current time, using a preset time decay function, includes: Obtain the occurrence time range corresponding to the event node, wherein the occurrence time range includes the start time and the end time; In response to the current time being less than the start time, based on the time difference between the current time and the start time, the time influence weight of the associated edge connecting the event node and the entity node is determined by a preset time decay function; In response to the current time being greater than the end time, based on the time difference between the current time and the end time, the time influence weight of the associated edge connecting the event node and the entity node is determined by a preset time decay function.
5. The method according to claim 1, characterized in that, The step of constructing spatiotemporal association edges between entity nodes and event nodes by analyzing the spatiotemporal relationship between them includes: Obtain the geographic coordinates of the entity node, the geographic influence area of the event node, and the time range of the event node; In response to the fact that the geographic coordinates of the entity node are located within the geographic influence area of the event node, the spatial influence weight of the associated edge connecting the event node and the entity node is set to a preset spatial influence weight value. In response to the current time being within the occurrence time range, the time influence weight of the associated edge connecting the event node and the entity node is set to a preset time influence weight value; Based on the description information of the event node, the event strength weight of the associated edge connecting the event node and the entity node is generated by semantic encoding through a large language model. Based on the spatial influence weight, the temporal influence weight, and the event intensity weight, a spatiotemporal association edge is constructed between the entity node and the event node.
6. The method according to claim 1, characterized in that, The step of semantically encoding the static attributes of nodes in the spatiotemporal knowledge graph using a large language model to generate static attribute representation vectors corresponding to the nodes includes: Obtain the static attributes of nodes in the spatiotemporal knowledge graph, wherein the static attributes include at least the node name, node text description information, and node attribute information; According to the preset format template, the static attributes are concatenated to generate the complete text content corresponding to the node; The complete text content is semantically encoded using a large language model to generate static attribute representation vectors corresponding to the nodes.
7. The method according to claim 1, characterized in that, The step of semantically encoding the static association edges in the spatiotemporal knowledge graph using a large language model to generate representation vectors corresponding to the static association edges includes: Based on the static association relationships between the entity nodes, construct static association edges between the entity nodes; The static associated edges are semantically encoded using a large language model to generate representation vectors corresponding to the static associated edges.
8. The method according to claim 1, characterized in that, The training steps for the training graph neural network model include: Obtain the historical time series data of the spatiotemporal graph network; The graph neural network model is trained based on the historical time series data to obtain the trained graph neural network model, wherein the graph neural network model uses the historical time series data as input features and the target time series in the future period as supervision signals. Based on the trained graph neural network model, target time series prediction is performed to obtain prediction results; Calculate the prediction error between the predicted result and the actual result; With the goal of minimizing the prediction error, a parameter optimization operation is performed, wherein the object of the parameter optimization operation is limited to the internal network parameters of the graph neural network model.
9. A data organization and time series prediction device based on spatiotemporal knowledge graph, characterized in that, The device includes: A spatiotemporal knowledge graph construction module is used to construct a spatiotemporal knowledge graph based on multi-source heterogeneous data. The node types of the spatiotemporal knowledge graph include at least entity nodes and event nodes. The entity nodes are used to represent specific objects in the real world or a specific domain, and the event nodes are used to represent processes or actions that have occurred or are about to occur. The spatiotemporal graph network generation module is used to analyze and represent the nodes, relationships, and spatiotemporal relationships of the spatiotemporal knowledge graph, and dynamically construct the spatiotemporal graph network. The analysis and representation of the nodes, relationships, and spatiotemporal relationships of the spatiotemporal knowledge graph includes: The static attributes of nodes in the spatiotemporal knowledge graph are semantically encoded using a large language model to generate static attribute representation vectors corresponding to the nodes, wherein the static attributes are used to represent the inherent features of the nodes. The static association edges in the spatiotemporal knowledge graph are semantically encoded using a large language model to generate representation vectors corresponding to the static association edges, wherein the static association edges are used to represent the static association relationships between the entity nodes. By analyzing the spatiotemporal relationship between the entity node and the event node, a spatiotemporal association edge is constructed between the entity node and the event node. The construction dimensions of the spatiotemporal association edge include a spatial distance dimension, a time decay dimension, and an event intensity dimension. The spatial distance dimension is used to define and quantify the association strength between the entity node and the event node by measuring their geographical distance. The time decay dimension is used to measure the relative position of the current time and the time range of the event node's occurrence on the time axis and the resulting degree of attenuation of the event node's influence on the entity node. The event intensity dimension is used to reflect the degree of influence of the event node on the entity node from a semantic level. The target time series prediction module is used to train a graph neural network model for target time series prediction based on the spatiotemporal graph network.
10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
New tea drink sales volume prediction method and system based on graph neural network
CN119273387A
Event entity prediction method based on perceptual contrast learning
CN121030066A