Spatio-temporal graph data processing method based on grid graph database

Through the spatiotemporal graph data processing method based on grid graph database, using GeoSOT-3D and GeoSOT-T coding technology, the problem of low expression and calculation efficiency of existing databases in spatiotemporal relationships is solved, and efficient spatiotemporal data management and query are realized.

CN119760160BActive Publication Date: 2025-07-18PEKING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510273597.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-07-18
Estimated Expiration
2045-03-10

AI Technical Summary

Technical Problem

When storing and managing spatiotemporal graph data, existing databases (such as Key-value key-value databases and graph databases) are difficult to effectively express complex spatiotemporal relationships, and the query and calculation efficiency are low, which cannot meet the processing needs of large-scale spatiotemporal graph data.

Method used

Using a method based on grid graph database, the entity is encoded spatially by GeoSOT-3D, and time slices are encoded in combination with GeoSOT-T. The quadruple table of the grid graph database is used to store and query spatiotemporal relationships to achieve efficient spatiotemporal data management.

Benefits of technology

It improves the query and computing efficiency of the database, can effectively express complex spatiotemporal relationships, process large-scale spatiotemporal graph data, and improves query and computing efficiency by 5-10 times.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760160B_ABST
    Figure CN119760160B_ABST
Patent Text Reader

Abstract

This application relates to the technical field of spatio-temporal data processing, and provides a spatio-temporal graph data processing method based on a grid graph database. Grid encoding is performed on the entities in the knowledge graph based on GeoSOT-3D to obtain the spatial grid encoding of the entities; the spatial grid encoding of the entities is stored in sequence in the spatial grid table of the grid graph database according to the Z shape; time encoding is performed on the time slices in the knowledge graph based on GeoSOT-T to obtain the time encoding of the time slices; the time slices are stored in the quadruple table of the grid graph database in the order of the time encoding of the time slices; entities in the knowledge graph are queried based on the spatial grid encoding and time encoding of the quadruple table of the grid graph database, and the spatio-temporal relationship between the entities in the knowledge graph is calculated; the problems of low query and calculation efficiency of existing databases and the inability to effectively express spatio-temporal relationships can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of spatio-temporal data processing, and particularly relates to a spatio-temporal graph data processing method based on a grid graph database. Background Art

[0002] With the advent of the big data era, the spatio-temporal knowledge graph (STKG), as an important tool for entity relationships and spatio-temporal evolution processes, is gradually becoming a core component in the research and application of multiple fields such as urban planning and environmental protection. The spatio-temporal knowledge graph stores the changes of entities and their related attributes and entity relationships over time and space, contains a large amount of spatio-temporal graph data (including three-dimensional information of time, space, and thematic attributes), and has characteristics such as multi-source, massive, and fast update. Therefore, it faces huge challenges in data storage and management.

[0003] Spatio-temporal graph data fusion can fuse multi-source spatio-temporal data, extract information related to a specific application environment, and establish the mapping relationship between entities in the knowledge graph and spatio-temporal graph data.

[0004] When the currently more mature non-relational key-value database (key-value database) performs spatio-temporal graph data fusion expression, it stores data in the form of key-value pairs. The key is used as the longitude and latitude or timestamp to identify a record, and the data value is the data associated with the key. The key-value database can store and manage spatio-temporal data with simple structures and few types. When facing complex spatio-temporal graph data, it is difficult to comprehensively express the complex relationships and spatio-temporal changes between spatio-temporal entities, unable to establish the sub-layers of traditional spatio-temporal data, and then lose the contained spatio-temporal relationships, making it difficult to manage and calculate complex spatio-temporal graph data.

[0005] The nodes of the graph database represent entities, and the edges represent the relationships between entities. It uses a triple (subject-predicate-object) structure to store and query data. The graph database can not only intuitively express complex relationship networks but also provide a graph algorithm library to support complex data analysis, such as recommendation systems, social networks, etc. Although the graph database can manage the longitude and latitude positions or times of spatio-temporal entities through the triple structure, it is difficult to capture the contained complex spatio-temporal relationships; moreover, the triple structure has a high cost for storing data and low query efficiency, is suitable for the storage and management of simple spatio-temporal graph data, and is difficult to process a large amount of complex spatio-temporal graph data.

[0006] Spatio-temporal grids solve the problem of low query and calculation efficiency of the current graph database to a certain extent, but the spatio-temporal recognition method of its point coordinates uses string representation, and its conversion and calculation efficiency levels are low.

[0007] The domain coordinates of the spatio-temporal grid can manage entities based on binary spatio-temporal codes, which conform to the computing and analysis logic of computers. Spatio-temporal grid encoding involves the spatio-temporal relationships of inherent entities, facilitating subsequent spatio-temporal graph data querying and computing to overcome the shortcomings of traditional databases.

[0008] Therefore, there is an urgent need for a grid graph database (GGD) that utilizes spatio-temporal grids to address the problems faced by existing databases (such as key-value databases and graph databases) in storing and associating spatio-temporal graph data. Summary of the Invention

[0009] One of the deficiencies of the prior art is overcome by the present invention, which provides a spatio-temporal graph data processing method based on a grid graph database. The spatio-temporal data is grid encoded based on the GeoSOT-3D rule to effectively represent various types of spatio-temporal nodes and spatio-temporal relationships, and various spatio-temporal computing tasks are completed in combination with spatio-temporal graph data, realizing the processing of complex spatio-temporal relationship networks, storing and encoding querying of large-scale spatio-temporal graph data under limited resources, and being able to solve the problems of low querying and computing efficiency of existing databases and inability to effectively represent spatio-temporal relationships.

[0010] According to one aspect of the present disclosure, a spatio-temporal graph data processing method based on a grid graph database is proposed, and the method includes:

[0011] Grid encoding the entities in the knowledge graph based on GeoSOT-3D to obtain the spatial grid encoding of the entities;

[0012] Storing the spatial grid encoding of the entities in the spatial grid table of the grid graph database in sequence according to the Z-shape;

[0013] Time encoding the time slices in the knowledge graph based on GeoSOT-T to obtain the time encoding of the time slices;

[0014] Storing the time slices in the quadruple table of the grid graph database in the order of the time encoding of the time slices;

[0015] Querying the entities in the knowledge graph and computing the spatio-temporal relationships between the entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table of the grid graph database;

[0016] Wherein, the spatial grid encoding of the entities in the spatial grid table is the subject or object in the quadruple table, the time encoding of the time slices is the adverbial in the quadruple table, and the spatio-temporal relationship between the entities is the predicate in the quadruple table.

[0017] In a possible implementation, storing the spatial grid encoding of the entity in the spatial grid table of the grid graph database in a Z-order includes:

[0018] Determine the spatial grid range and grid hierarchy of the knowledge graph based on the spatial range and unit grid scale set by the knowledge graph;

[0019] Based on the dimension of the spatio-temporal graph data, establish a quadtree or octree encoding index for the spatial grid encoding of the entity at the spatial grid hierarchy where it is located, and store it in the spatial grid table in a Z-order;

[0020] The spatial grid table includes grid encoding, dimension, grid hierarchy, and attribute information.

[0021] In a possible implementation, storing the time slices in the quadruple table of the grid graph database according to the order of the time encoding of the time slices includes:

[0022] Determine the time grid range and time grid hierarchy of the knowledge graph based on the time range set by the knowledge graph and the time interval of the time slices of the knowledge graph;

[0023] Based on the order of the time encoding of the time slices, store the time slices in the quadruple table of the grid graph database. Among them, in the quadruple sub-table of each time slice, store them in the quadruple sub-table in the Z-order of the spatial position of the spatial grid encoding of the entities in the time slice.

[0024] In a possible implementation, querying the entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table of the grid graph database includes:

[0025] Based on the spatio-temporal range of the knowledge graph to be filtered, determine the time encoding range and spatial grid encoding range of the spatio-temporal data of the knowledge graph;

[0026] Perform bitwise operations on the time encoding in the quadruple sub-table of each time slice, and output the quadruple sub-table of the time slices within the time encoding range of the knowledge graph;

[0027] Perform bitwise operations on the spatial grid encoding in the quadruple sub-table of each time slice within the time encoding range, and output the quadruple sub-table of the time slices within the spatial grid encoding range of the knowledge graph;

[0028] Query the entities in the quadruple sub-table of the time slices within the spatial grid encoding range of the knowledge graph, which are the entities in the knowledge graph to be queried.

[0029] In a possible implementation, the query of entities in the knowledge graph by spatial grid encoding and temporal encoding of the quadruple table based on the grid graph database further includes:

[0030] Using the K-nearest neighbor algorithm to query the number of entities close to the spatial grid encoding and temporal encoding of the entity. If the number of entities reaches the K value, output the K nearest entities of the entity;

[0031] If the number of neighboring entities within the spatial grid of the entity does not reach the K value, in the first-order neighborhood of the spatial grid of the entity, sequentially search for the number of entities close to the spatial grid encoding and temporal encoding of the entity in the spatially adjacent, edge-adjacent, and point-adjacent spatial grids. If the number of entities reaches the K value, output the K nearest entities of the entity;

[0032] If the number of neighboring entities within the spatial grid of the first-order neighborhood of the entity does not reach the K value, in the second-order neighborhood of the spatial grid of the entity, sequentially search for the number of entities close to the spatial grid encoding and temporal encoding of the entity in the spatially adjacent, edge-adjacent, and point-adjacent spatial grids. If the number of entities reaches the K value, output the spatial grid encoding and temporal encoding of the K nearest entities of the entity.

[0033] In a possible implementation, the spatio-temporal relationships between entities include: the distance between entities, the topological relationship of entities, the orientation relationship of entities, and the set relationship of entities.

[0034] In a possible implementation, the method further includes: when a new quadruple is added to the grid graph database, determining whether the subject, predicate, and object of the added quadruple have been stored in the node table (Node Table) or edge table (Edge Table) of the grid graph database. If they have been stored, store them in the grid database according to the order of the temporal encoding and spatial grid encoding of the added quadruple.

[0035] In a possible implementation, the method further includes: storing the quadruples of the spatio-temporal relationships between entities of the calculated knowledge graph after the entry of the spatial grid where the subject in the quadruple is located.

[0036] In a possible implementation, calculating the spatio-temporal relationships between entities in the knowledge graph based on the spatial grid encoding and temporal encoding of the quadruple table based on the grid graph database includes:

[0037] Calculating the distance between entities in the knowledge graph based on the spatial grid encoding of the quadruple table based on the grid graph database;

[0038] Determining the topological relationship and orientation relationship between entities in the knowledge graph based on the distance between entities;

[0039] Calculate the set relationship between entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table in the grid graph database, and generate a new spatial grid table and quadruple table.

[0040] In a possible implementation, the grid graph database includes a node table, an edge table, a spatial grid table, a quadruple table, and a triplet table.

[0041] The spatio-temporal graph data processing method based on the grid graph database of the present disclosure performs grid encoding on the entities in the knowledge graph based on GeoSOT-3D to obtain the spatial grid encoding of the entities; stores the spatial grid encoding of the entities in sequence in the spatial grid table of the grid graph database according to the Z-order; performs spatial encoding on the time slices in the knowledge graph based on GeoSOT-T to obtain the time encoding of the time slices; stores the order of the time encoding of the time slices in the quadruple table of the grid graph database; queries the entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table in the grid graph database and calculates the spatio-temporal relationship between the entities in the knowledge graph; can solve the problems of low query and calculation efficiency of existing databases and inability to effectively express spatio-temporal relationships.

[0042] Some of the other optional features and technical effects of the embodiments of the present invention are described below, and some can be understood by reading this article. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0044] Figure 1 Shows the architecture diagram of the grid graph database according to an embodiment of the present disclosure;

[0045] Figure 2 Shows the flowchart of the spatio-temporal graph data processing method based on the grid graph database according to an embodiment of the present disclosure;

[0046] Figure 3a and Figure 3b Respectively show the schematic diagram of the Z-order storage of the spatial grid according to an embodiment of the present disclosure;

[0047] Figure 4a 、Figure 4b and Figure 4c respectively show a schematic diagram of spatial grid displacement according to an embodiment of the present disclosure. Detailed implementation manners

[0048] To make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with the detailed implementation manners and the accompanying drawings. Herein, the illustrative implementation manners of the present invention and their descriptions are used to explain the present invention, but do not limit the present invention.

[0049] The term "including" and its variations used herein represent open inclusion, that is, "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "at least partially based on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects. There may also be other explicit and implicit definitions hereinafter.

[0050] In addition, the steps shown in the flowchart of the drawings can be executed in a computer such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0051] Figure 1 shows an architecture diagram of a grid graph database according to an embodiment of the present disclosure.

[0052] The grid graph database (GGD) can effectively manage and store the spatio-temporal data in the knowledge graph, and establish a fast and effective spatio-temporal graph data update rule based on this architecture. As Figure 1 shown, the grid graph database consists of five types of sub-tables, namely the node table (Node Table), the edge table (Edge Table), the spatial grid table (Spatial Grid Table), the quadruplet table (Quadruplet Table) and the triplet table (Triplet Table).

[0053] As Figure 1 shown, the node table (Node Table) stores the nodes in the spatio-temporal knowledge graph, and the elements in the table are used as the subject or object in the quadruplet or triplet. The node table (Node Table) can store simple node attributes, and its unit storage structure is:

[0054] {Node ID, Class, Attribute}(1)

[0055] Among them, Node ID is the name of the node, Class is the subclass of the node, and Attribute is an optional item.

[0056] The Edge Table stores the edges in the spatio-temporal knowledge graph. The elements in the Edge Table serve as predicates in quadruples or triples. The unit storage structure of the Edge Table is:

[0057] {Edge ID, Class, Attribute}(2)

[0058] Among them, Edge ID is the name of the edge, similar to the Node Table; Class is the subclass of the edge, and Attribute is the storage of optional attributes of the Edge Table.

[0059] The Spatial Grid Table can store the GeoSOT-3D spatial grid encoding in the order of geographical space and the scale of grid levels. The unit storage structure of the Spatial Grid Table is:

[0060] {Code, Level, Dimension, Attribute}(3)

[0061] Among them, Code is the GeoSOT-3D grid encoding of the spatial grid. The Code in the Spatial Grid Table can form the subject or object in the quadruple table, and can also be used as the query primary key key in other databases to query or interoperate spatio-temporal data with other databases; Level is the level of the grid encoding; Dimension is the dimension of the spatial grid, and three-dimensional or two-dimensional encoding can be stored according to needs; Attribute is the optional attribute of the spatial grid.

[0062] The Quadruplet Table stores quadruples with spatio-temporal relationships and consists of several time sub-tables. The time encoding in the Quadruplet Table serves as an adverbial, and the spatial grid serves as the subject or object. The unit storage structure of the Quadruplet Table is:

[0063] {Subject, Predicate, Object, Time grid}(4)

[0064] Among them, Subject and Object represent the subject and object respectively, which are represented by the spatial grid code Code or the node ID; Predicate represents the spatio-temporal edge between the subject and the object, which is represented by Edge ID; Time grid is the time code, that is, the time encoding (time slice) of the time slice using GeoSOT-T.

[0065] The Triplet Table stores the semantic triplet relationship without spatio-temporal attributes, that is, the semantic relationship of the scene forms a Triplet Table independently. The unit storage structure of the Triplet Table is:

[0066] {Subject, Predicate, Object}(5)

[0067] Among them, Predicate can be obtained by querying from the Edge Table and is represented by Edge ID; Subject and Object can be obtained by querying from the Node Table and are both represented by Node ID. The triplets in the Triplet Table only contain the semantic structure of the subject, predicate and object, without time adverbials.

[0068] The grid graph database stores semantic and spatio-temporal data into five types of sub-tables, and can extract the elements in the semantic triplets and spatio-temporal quadruplets in the knowledge graph, and perform spatio-temporal association through the grid encoding of space and time; when new spatio-temporal relationships are added, the grid graph database can perform fast update storage and spatio-temporal calculation in the order of space and time, greatly improving the interoperability efficiency between the sub-tables of the grid graph database, and realizing the fusion association and update of spatio-temporal data and semantic data.

[0069] Figure 2 The flowchart of the spatio-temporal graph data processing method based on the grid graph database according to an embodiment of the present disclosure is shown. As Figure 1 shown, the method may include:

[0070] Step S1: Perform grid encoding on the entities in the knowledge graph based on GeoSOT-3D to obtain the spatial grid encoding of the entities.

[0071] Among them, the spatial grid encoding of the entities in the spatial grid table is the subject or object in the quadruplet table, the time encoding of the time slice is the adverbial in the quadruplet table, and the spatio-temporal relationship between the entities is the predicate in the quadruplet table.

[0072] In addition, in the technical solution of this method, in addition to adopting the Global Stereo Subdivision Grid System (GeoSOT-3D), other global grid systems can also be adopted, such as the Global Discrete Grid System (DGGS), the Plane Grid Coding + Height (GeoSOT-2D+Height) system, etc., which are not limited here. Below, taking the adoption of the Global Stereo Subdivision Grid System (GeoSOT-3D) for grid coding as an example for illustration.

[0073] Step S2: Store the spatial grid code of the entity in sequence according to the Z-order in the spatial grid table of the grid graph database.

[0074] The time slices in the Spatial Grid Table and the Quadruplet Table need to encode the time slices in the knowledge graph based on GeoSOT-T to obtain the time code of the time slices, and identify the domain space-time through the time code. Encode the entity grids of the graph data based on the GeoSOT-3D spatial grid and store them in the graph database according to certain rules.

[0075] In an example, storing the spatial grid code of the entity in sequence according to the Z-order in the spatial grid table of the grid graph database may include:

[0076] P1: Based on the spatial range and unit grid scale set by the knowledge graph, determine the spatial grid range and grid level of the knowledge graph. Among them, the spatial grid table may include grid coding, dimension, grid level, and attribute information. The coding rules based on GeoSOT-3D can encode the longitude, latitude, and height of each spatial range to obtain the corresponding binary spatial grid code.

[0077] P2: According to the dimension of the spatio-temporal graph data, establish a quadtree or octree coding index for the spatial grid code of the entity at the spatial grid level where it is located, and store it in the spatial grid table in sequence according to the Z-order. The spatial grid coding and spatial storage scheme generally adopt the Z-order storage (Z-order).

[0078] Figure 3a and Figure 3b respectively show the schematic diagrams of the Z-order storage of the spatial grid according to an embodiment of the present disclosure.

[0079] As Figure 3a shown, the two-dimensional spatial grid coding quadtree is stored in the Spatial Grid Table in the Z-order direction of the northwest, northeast, southwest, and southeast of each larger-scale grid space; as Figure 3bAs shown in the figure, the Z-order space storage principle of the three-dimensional space grid encoded octree space encoding is similar to that of the two-dimensional space grid encoded quadtree Z-order space storage. By storing the Z-order of the space grid encoding in the Spatial Grid Table, two-dimensional space grid data and three-dimensional space grid data can be mapped to a one-dimensional encoded space, which can greatly reduce the amount of data storage and transmission, making the processing of space data simpler and more efficient, and having good scalability.

[0080] Step S3: Perform time encoding on the time slices in the knowledge graph based on GeoSOT-T to obtain the time encoding of the time slices.

[0081] In addition, in the time encoding rule of the technical solution of this method, in addition to using GeoSOT-T, other time grid systems can also be used, which are not limited here.

[0082] Step S4: Store the time slices in the quadruple table of the grid graph database in the order of the time encoding of the time slices. Among them, a sub-table of the quadruple table can be established for each time slice, and in each sub-table of the quadruple table, the quadruples are stored in the spatial Z-order.

[0083] In an example, storing the time slices in the quadruple table of the grid graph database in the order of the time encoding of the time slices may include:

[0084] Based on the time range set by the knowledge graph and the time interval of the time slices of the knowledge graph, determine the time grid range and time grid level of the knowledge graph; based on the encoding rule of GeoSOT-T, the time period corresponding to each time slice can be encoded to obtain the corresponding binary time encoding, and based on the order of the time encoding of the time slices, store the time slices in the quadruple table of the grid graph database; in addition, the time slices can also be sequentially stored in the quadruple table of the grid graph database based on the size of the time encoding of the time slices, which is not limited here.

[0085] Among them, a sub-table of the quadruple for each time slice is sequentially established in the quadruple table, and within the sub-table of the quadruple for each time slice, it is stored in the sub-table of the quadruple in the spatial Z-order of the spatial grid encoding of the entities of the time slice. When both the subject and the object are spatial grids, the spatial grid position of the subject is used as the preferred storage position. Compared with the time identifier in the form of a character segment, this method can reduce the storage amount and achieve the fast sequential arrangement of the time encoding in the quadruple table and the accurate verification of the time neighborhood.

[0086] Step S5: Query the entities in the knowledge graph and calculate the spatio-temporal relationship between the entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table of the grid graph database.

[0087] After completing the storage of semantic knowledge and spatio-temporal graph data, the grid graph database can perform efficient spatio-temporal quadruple queries, spatio-temporal range queries, spatio-temporal proximity relationship queries, and cross-database spatio-temporal queries.

[0088] In one example, querying entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table of the grid graph database includes:

[0089] Based on the spatio-temporal range of the knowledge graph to be filtered, determine the time encoding range and spatial grid encoding range of the spatio-temporal data of the knowledge graph.

[0090] Perform bitwise operations on the time encoding in the quadruple sub-table of each time slice, and output the quadruple sub-table of the time slice within the time encoding range of the knowledge graph;

[0091] Perform bitwise operations on the spatial grid encoding in the quadruple sub-table of each time slice within the time encoding range, and output the quadruple sub-table of the time slice within the spatial grid encoding range of the knowledge graph;

[0092] Querying the entities in the quadruple sub-table of the time slice within the spatial grid encoding range of the knowledge graph is the entity in the knowledge graph to be queried. In special cases, if there are nodes or edges to be filtered, perform a standard semantic query on the quadruples that meet the spatio-temporal range.

[0093] The KNN algorithm (K-Nearest Neighbor algorithm) is a basic classification and regression method. For a spatial entity, the KNN algorithm calculates the distance between this entity and all known class entities, and finds the K entities with the closest distance to it (i.e., "neighbors"). The spatial and time grid encodings of the knowledge graph entities are stored in the Z-order of the quadtree or octree, and the spatial and time grid encodings of adjacent regions are relatively similar. The KNN algorithm can quickly confirm the K nearest entities to the central entity according to the grid neighborhood information, and can query the spatial grid relationships of face adjacency, edge adjacency, and point adjacency of the central entity. The specific process of querying entities using the KNN algorithm is as follows:

[0094] In another example, querying entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table of the grid graph database further includes:

[0095] Use the K-Nearest Neighbor (KNN) algorithm to query the number of entities whose spatial grid encoding and time encoding are close to the entity. If the number of entities reaches the K value, output the K adjacent entities of the entity.

[0096] If the number of adjacent entities within the spatial grid of an entity does not reach the K value, in the first-order neighborhood of the spatial grid of the entity, sequentially search for the number of entities with spatial grid codes and time codes similar to those of the entity in the spatially adjacent (face adjacent), edge adjacent, and point adjacent spatial grids. If the number of entities reaches the K value, output the K adjacent entities of the entity.

[0097] If the number of adjacent entities within the spatial grid of the first-order neighborhood of an entity does not reach the K value, in the second-order neighborhood of the spatial grid of the entity, sequentially search for the number of entities with spatial grid codes and time codes similar to those of the entity in the spatially adjacent (face adjacent), edge adjacent, and point adjacent spatial grids. If the number of entities reaches the K value, output the spatial grid codes and time codes of the K adjacent entities of the entity.

[0098] By virtue of the relationships between the spatial grid codes and time codes of the grid graph database and spatial entities respectively, without changing the number of entries, the storage size of each entry in the Spatial Grid Table and Quadruplet Table can be reduced; range queries are implemented through binary bitwise operations on the time code and spatial grid code in the quadruplet, improving the query efficiency.

[0099] The spatio-temporal graph data processing method based on the grid graph database of the present disclosure performs grid encoding on the entities in the knowledge graph based on GeoSOT-3D, and stores the entity spatial grid codes sequentially in the spatial grid table of the grid graph database in a Z-shaped order; performs time encoding on the time slices in the knowledge graph based on GeoSOT-T, and stores the time slices in the quadruplet table of the grid graph database in the order of the time codes of the time slices; queries the entities in the knowledge graph and calculates the spatio-temporal relationships between the entities in the knowledge graph based on the spatial grid codes and time codes of the quadruplet table of the grid graph database; and can solve the problems of low query and calculation efficiency and inability to effectively express spatio-temporal relationships in existing databases.

[0100] According to another aspect of the present disclosure, the spatio-temporal graph data processing method based on the grid graph database further includes:

[0101] When a new quadruplet is added to the grid graph database, determine whether the subject, predicate, and object of the new quadruplet have been stored in the Node Table or Edge Table of the grid graph database. If so, store them in the grid database according to the order of the time code and spatial grid code of the new quadruplet. In addition, store the quadruplets representing the spatio-temporal relationships between the entities of the calculated knowledge graph after the entries of the spatial grid where the subject is located.

[0102] Since spatio-temporal graph data is represented in the grid graph database in the form of quadruples, when a new quadruple is added, first check whether the subject, predicate, and object in the new quadruple have been stored in the Node Table or Edge Table in the grid graph database. If not, update the subject, predicate, and object in the new quadruple into the sub-table and then update the Quadruplet Table. If all have been stored, place them in the corresponding spatio-temporal storage location in the Quadruplet Table according to the storage order of the corresponding time slice and spatial grid. At the same time, establish a set of indexes or mapping tables corresponding to the grid graph database, such as the mapping from Node ID to quadruple, the mapping from Eode ID to quadruple, etc., and quickly establish an association with the Quadruplet Table through the Node Table and Edge.

[0103] In the grid graph database, since the Spatial Grid Table has been completely established within the spatial range of the application scenario, it will not change when the Quadruplet Table is updated. However, for some special quadruples without spatial grid elements, such as complex spatio-temporal relationships obtained through spatio-temporal calculations (azimuth, distance, etc. between two entities), although there is no spatial grid in the subject and object of the spatio-temporal relationship, the spatial entities associated with the spatio-temporal relationship all have quadruples related to the spatial grid. Therefore, the grid graph database stores this kind of quadruple in the Quadruplet Table after the entry "the spatial grid where the subject in the quadruple is located (subject, located in, spatial grid, time grid)". For example, the azimuth knowledge of ship A relative to plane B is expressed as the quadruple entry: ship A, 175°, plane B, 010. According to the quadruple storage rule, this quadruple will be placed in the Quadruplet Table after the entry "ship A, Located in, 001010, 010".

[0104] In addition, the grid graph database calculates the hierarchical nesting relationship between grids through the stored spatio-temporal data encoded data, that is, obtains the spatio-temporal relationship between entities in the knowledge graph. The spatio-temporal relationship between entities includes: the distance between entities, the topological relationship of entities, the azimuth relationship of entities, and the set relationship of entities. It can map the relationship between grids in the quadruple table to entities and update these entity quadruples to the corresponding storage locations.

[0105] According to another aspect of the present disclosure, calculating the spatio-temporal relationship between entities in a knowledge graph based on the spatial grid encoding and temporal encoding of a quadruple table in a grid graph database may include:

[0106] Calculating the distance between entities in the knowledge graph based on the spatial grid encoding of the quadruple table in the grid graph database;

[0107] Determining the topological relationship and orientation relationship between entities in the knowledge graph based on the distance between entities;

[0108] Calculating the set relationship between entities in the knowledge graph based on the spatial grid encoding and temporal encoding of the quadruple table in the grid graph database, and generating a new spatial grid table and quadruple table.

[0109] Figure 4a 、 Figure 4b and Figure 4c respectively show a schematic diagram of spatial grid displacement according to an embodiment of the present disclosure.

[0110] The distance between entities is calculated as follows. As Figure 4a 、 Figure 4b and Figure 4c shown, spatial entities move bidirectionally in one-dimensional space, octagonally in two-dimensional space, and twenty-six directionally in three-dimensional space. The displacement of the spatial entity on the grid can be calculated by the displacement encoding operator obtained.

[0111] The displacement encoding operator is the distance for the spatial entity grid to translate n grid cells (n < 0 indicates reverse translation) in a certain dimension of longitude, latitude, altitude, and time (represented by encoding c) at the current dissection level. The displacement encoding operator can be extended from one dimension to multiple dimensions. For example, when the encoding c is a four-dimensional encoding, it is necessary to convert the spatial grid unit into 80 domain dimensions, then calculate the displacement of each dimension's encoding, and finally cross-combine the displacements of each calculated dimension to obtain the displacement of encoding c.

[0112] (6)

[0113] Taking the two-dimensional spatial grid as an example, is the distance between entity A and entity B, which can be mapped to the distance calculation between spatial grid A and spatial grid B in the grid graph database.

[0114] The distance calculation between spatial grid A and spatial grid B and the grid span function are respectively expressed as:

[0115]

[0116] (7)

[0117] (8)

[0118] (9)

[0119] Among them, refers to the grid width at the current grid level; g1 and g2 are the first encodings in the corresponding dimensions of the current and respectively. When g1 is equal to g2, it means that entity A and entity B are in the same hemisphere. When g1 is not equal to g2, it indicates that the nodes belong to two different hemispheres. After calculating the distance between entity A and entity B, a quadruple ( , ) is generated and stored in the grid map database.

[0120] The topological relationships between entities are as follows. The topological relationships between entities mainly include overlapped, adjacent, and separate, and can be topologically discriminated through in Equation (7). Taking the topological relationship Topology AB between entity A and entity B as an example, after completing the discrimination of the topological relationship Topology AB between entity A and entity B, a quadruple ( , ) is output and stored in the grid map database.

[0121] The two-dimensional spatial topological relationship Topology AB-2D between entity A and entity B is:

[0122] (10)

[0123] The three-dimensional spatial topological relationship Topology AB-3D between entity A and entity B is:

[0124] (11)

[0125] The orientation relationship between entities. The orientation calculation of spatio-temporal graph data refers to the direction of entity B relative to entity A, which can be calculated through the spatial grid encoding where the entity is located. According to the orientation calculation result of entity B relative to entity A, a corresponding quadruple implicit relationship structure ( , ) can be generated.

[0126] Calculation result of the orientation of Entity B relative to Entity A is as follows:

[0127] (12)

[0128] Calculation of the set relationship between entities. The set relationship between entities includes intersection, union, and difference set relationships. Among them, the intersection refers to calculating the overlapping part of two or more regions. The union is to combine two or more regions to form a new region that contains all spatio-temporal map data. The difference set is the part that exists in one region but not in another region. After completing the set operation between entities, a new spatial grid table (Spatial Grid Table) can be established in the grid map database based on the new grid set, and the spatio-temporal map data quadruple corresponding to the intersection, union, and difference set regions can be obtained based on the spatio-temporal grid encoding of the grid map database.

[0129] Table 1 shows the representation and definition of each parameter in the spatio-temporal map data set calculation, where A and B represent the sets of any two spatial grid tables (Spatial Grid Table); , respectively represent the spatial grid encodings in the sets of A and B; , respectively represent the spatio-temporal map data corresponding to the two spatial encoding sets. g represents the GeoSOT-3D spatial grid, and c g represents the grid encoding of the GeoSOT-3D spatial grid; ∈, , , ∩, ∪ are common set symbols, representing belongs to, does not belong to, subset, intersection, and union respectively. After the corresponding intersection, union, and difference set calculations, a new grid map database is output, and it contains entities and quadruples that conform to the set operator rules.

[0130] Table 1 Representation and definition of each parameter in the spatio-temporal map data set calculation

[0131]

[0132] By storing and managing spatio-temporal graph data based on GeoSOT-3D grid encoding and the grid graph database GGD, that is, constructing a retrieval system of five types of sub-tables through the grid graph database GGD, encoding with time and space grids based on GeoSOT-T and GeoSOT-3D rules, the storage location of spatio-temporal quadruples in the grid graph database GGD can be accurately identified and located. By using grid encoding algebra, complex spatio-temporal relationships between spatial entities can be calculated, and new quadruples can be generated to answer dynamic spatio-temporal questions. Experimental results show that compared with other databases, the grid graph database GDD of the present disclosure has a significantly improved query and calculation efficiency level for spatio-temporal graph data, with an average increase of 5 - 10 times. In addition, the strategy based on spatial distribution parallel optimization can further improve the speed of large-scale spatio-temporal graph data calculation, confirming the high scalability and practicability of the grid graph data graph GGD.

[0133] All of the above optional technical solutions can be combined arbitrarily to form optional embodiments of the present application, which will not be elaborated one by one here.

[0134] The following is an embodiment of the device of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the device embodiment of the present application, please refer to the method embodiment of the present application.

[0135] According to another aspect of the present disclosure, the present disclosure also proposes a spatio-temporal graph data processing device based on a grid graph database, and the device may include:

[0136] A spatial grid encoding module, configured to perform grid encoding on entities in the knowledge graph based on GeoSOT-3D to obtain the spatial grid encoding of the entities;

[0137] A first storage module, configured to store the spatial grid encoding of the entities in sequence according to the Z shape in the spatial grid table of the grid graph database;

[0138] A time encoding module, configured to perform time encoding on time slices in the knowledge graph based on GeoSOT-T to obtain the time encoding of the time slices;

[0139] A second storage module, configured to store the time slices in the quadruple table of the grid graph database in the order of the time encoding of the time slices;

[0140] A query and calculation module, configured to query entities in the knowledge graph and calculate the spatio-temporal relationships between entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table of the grid graph database;

[0141] Among them, the spatial grid encoding of the entities in the spatial grid table is the subject or object in the quadruple table, the time encoding of the time slice is the adverbial in the quadruple table, and the spatio-temporal relationship between the entities is the predicate in the quadruple table.

[0142] According to another aspect of the present disclosure, the present disclosure provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the above-described method is implemented.

[0143] According to another aspect of the present disclosure, the present disclosure provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-described method is implemented.

[0144] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0145] The exemplary systems and methods of the present invention have been specifically shown and described with reference to the above embodiments, which are only examples of the best mode for implementing the systems and methods. Those skilled in the art can understand that various changes can be made to the embodiments of the systems and methods described herein without departing from the spirit and scope of the present invention defined in the appended claims.

Claims

1. A spatio-temporal graph data processing method based on a grid graph database, characterized in that, The method includes: Performing grid encoding on the entities in the knowledge graph based on GeoSOT-3D to obtain the spatial grid encoding of the entities; Storing the spatial grid encoding of the entities in sequence according to the Z shape in the spatial grid table of the grid graph database; Performing time encoding on the time slices in the knowledge graph based on GeoSOT-T to obtain the time encoding of the time slices; Storing the time slices in the quadruple table of the grid graph database in the order of the time encoding of the time slices; Querying the entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table of the grid graph database and calculating the spatio-temporal relationship between the entities in the knowledge graph; Wherein, the spatial grid encoding of the entities in the spatial grid table is the subject or object in the quadruple table, the time encoding of the time slices is the adverbial in the quadruple table, and the spatio-temporal relationship between the entities is the predicate in the quadruple table.

2. The spatio-temporal graph data processing method according to claim 1, characterized in that The storing the spatial grid encoding of the entities in sequence according to the Z shape in the spatial grid table of the grid graph database includes: Determining the spatial grid range and grid hierarchy of the knowledge graph based on the spatial range and unit grid scale set by the knowledge graph; Establishing a quadtree or octree encoding index of the spatial grid hierarchy where the spatial grid encoding of the entities is located according to the dimension of the spatio-temporal graph data, and storing it in the spatial grid table in sequence according to the Z shape; The spatial grid table includes grid encoding, dimension, grid hierarchy and attribute information.

3. The spatio-temporal graph data processing method according to claim 1, wherein The storing the time slices in the quadruple table of the grid graph database in the order of the time encoding of the time slices includes: Determining the time grid range and time grid hierarchy of the knowledge graph based on the time range set by the knowledge graph and the time interval of the time slices of the knowledge graph; Storing the time slices in the quadruple table of the grid graph database based on the order of the time encoding of the time slices, wherein, in the quadruple table, a quadruple sub-table of each time slice is established in sequence, and in the quadruple sub-table of each time slice, it is stored in the quadruple sub-table in the Z shape order of the spatial positions of the spatial grid encoding of the entities of the time slice.

4. The spatio-temporal graph data processing method according to claim 1, wherein The querying the entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table of the grid graph database includes: Determining the time encoding range and spatial grid encoding range of the spatio-temporal data of the knowledge graph based on the spatio-temporal range of the knowledge graph to be filtered; Performing bitwise operations on the time encoding in the quadruple sub-table of each time slice, and outputting the quadruple sub-table of the time slices within the time encoding range of the knowledge graph; Performing bitwise operations on the spatial grid encoding in the quadruple sub-table of each time slice within the time encoding range, and outputting the quadruple sub-table of the time slices within the spatial grid encoding range of the knowledge graph; Querying the entities in the quadruple sub-table of the time slices within the spatial grid encoding range of the knowledge graph is the entity in the knowledge graph to be queried.

5. The spatio-temporal graph data processing method according to claim 1, characterized in that The querying the entities in the knowledge graph based on the spatial grid encoding and time encoding of the quadruple table of the grid graph database further includes: Use the K-nearest neighbor algorithm to query the number of entities that are close to the spatial grid code and time code of the said entity. If the number of said entities reaches the K value, output the K nearest entities of the said entity; If the number of neighboring entities within the spatial grid of the said entity does not reach the K value, in the first-order neighborhood of the spatial grid of the said entity, sequentially search for the number of entities that are close to the spatial grid code and time code of the said entity in the spatially adjacent (face-adjacent), edge-adjacent, and vertex-adjacent spatial grids. If the number of said entities reaches the K value, output the K nearest entities of the said entity; If the number of neighboring entities within the spatial grid of the first-order neighborhood of the said entity does not reach the K value, in the second-order neighborhood of the spatial grid of the said entity, sequentially search for the number of entities that are close to the spatial grid code and time code of the said entity in the spatially adjacent (face-adjacent), edge-adjacent, and vertex-adjacent spatial grids. If the number of said entities reaches the K value, output the spatial grid codes and time codes of the K nearest entities of the said entity.

6. The spatio-temporal graph data processing method according to claim 1, wherein The spatio-temporal relationships between the said entities include: the distance between entities, the topological relationship of entities, the orientation relationship of entities, and the set relationship of entities.

7. The spatio-temporal graph data processing method according to claim 1, characterized in that The said method further includes: When a new quadruple is added to the grid graph database, determine whether the subject, predicate, and object of the newly added quadruple have been stored in the node table or edge table of the grid graph database. If they have been stored, store them in the grid graph database according to the order of the time code and spatial grid code of the newly added quadruple.

8. The spatio-temporal map data processing method according to claim 7, characterized in that The said method further includes: Store the quadruples representing the spatio-temporal relationships between the entities of the calculated knowledge graph after the entry of the spatial grid where the subject of the quadruple is located.

9. The spatio-temporal graph data processing method according to claim 6, wherein Calculate the spatio-temporal relationships between the entities in the knowledge graph based on the spatial grid code and time code of the quadruple table of the grid graph database, including: Calculate the distance between the entities in the knowledge graph based on the spatial grid code of the quadruple table of the grid graph database; Determine the topological relationship and orientation relationship between the entities in the knowledge graph based on the distance between the entities; Calculate the set relationship between the entities in the knowledge graph based on the spatial grid code and time code of the quadruple table of the grid graph database, and generate a new spatial grid table and quadruple table.

10. The spatio-temporal graph data processing method according to claim 1, wherein The grid graph database includes a node table, an edge table, a spatial grid table, a quadruple table, and a triple table.

Citation Information

Patent Citations

  • Chart integrated space-time grid data table structure and transformation method thereof

    CN113886509A

  • Low-altitude airspace earth subdivision grid data organization and query method and device

    CN115329220A