Space-time diagram data processing method based on grid diagram database

By adopting a grid graph database-based method in spatiotemporal graph data processing and using GeoSOT-3D rules for grid encoding, the existing databases are solved inefficient and difficult to express complex relationships when storing and managing spatiotemporal graph data, and efficient spatiotemporal data processing and query are achieved.

CN119760160AActive Publication Date: 2025-04-04PEKING UNIV

Patent Information

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

AI Technical Summary

Technical Problem

When existing databases store and manage spatiotemporal graph data, it is difficult to effectively express complex relationships between spatiotemporal entities, and the query and calculation efficiency are low.

Method used

The spatiotemporal graph data processing method based on the grid graph database is adopted, and the spatiotemporal data is grid-encoded through the GeoSOT-3D rule, stored in the spatial grid table and quadruple table of the grid graph database, and various spatiotemporal computing tasks are completed in combination with the spatiotemporal graph data.

Benefits of technology

It realizes the processing of complex spatiotemporal relationship networks under limited resources, stores and encodes query large-scale spatiotemporal graph data, improves query and computing efficiency, and can effectively express complex relationships between spatiotemporal entities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760160A_ABST
    Figure CN119760160A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of spatio-temporal data processing, and provides a spatio-temporal diagram data processing method based on a grid diagram database, and the method comprises the steps: carrying out the grid coding of an entity in a knowledge graph based on GeoSOT-3D, and obtaining a spatial grid code of the entity; the space grid codes of the entities are sequentially stored in a space grid table of a grid chart database according to a Z character; performing time coding on the time slices in the knowledge graph based on GeoSOT-T to obtain time codes of the time slices; storing the time slices in a tetrad table of a grid chart database according to the sequence of time codes of the time slices; querying entities in the knowledge graph and calculating a space-time relationship between the entities in the knowledge graph based on a space grid code and a time code of a tetrad table of the grid graph database; the problems that an existing database is low in query and calculation efficiency and cannot effectively express the space-time relation 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 spatiotemporal data processing, and in particular relates to a spatiotemporal graph data processing method based on a grid graph database. Background Art

[0002] With the advent of the big data era, spatio-temporal knowledge map (STKG), as an important tool for entity relationships and spatio-temporal evolution processes, is gradually becoming a core component of research and application in many fields such as urban planning and environmental protection. Spatio-temporal knowledge graphs store entities and their related attributes and entity relationships that change over time and space. They contain a large amount of spatio-temporal graph data (including time, space, and thematic attribute three-dimensional information). They have the characteristics of multi-source, massive, and fast update, so they face huge challenges in data storage and management.

[0003] Spatiotemporal graph data fusion can fuse multi-source spatiotemporal data, extract relevant information related to specific application environments, and establish a mapping relationship between entities and spatiotemporal graph data in knowledge graphs.

[0004] The current more mature non-relational key-value database (KVDB) stores data in the form of key-value pairs when performing spatiotemporal graph data fusion expression. The key is used as latitude and longitude or timestamp to identify a record, and the data value is the data associated with the key. Key-value databases can store and manage spatiotemporal data with simple structures and fewer types. When faced with complex spatiotemporal graph data, it is difficult to fully express the complex relationships and spatiotemporal changes between spatiotemporal entities, and it is impossible to establish a layered layer for traditional spatiotemporal data, which in turn loses the inherent spatiotemporal relationship and makes it difficult to manage and calculate complex spatiotemporal graph data.

[0005] The nodes of a graph database represent entities, and the edges represent the relationships between entities. The graph database uses a triple (subject-predicate-object) structure to store and query data. Graph databases can not only intuitively express complex relationship networks, but also provide graph algorithm libraries to support complex data analysis, such as recommendation systems and social networks. Although graph databases can manage the latitude and longitude positions or time of spatiotemporal entities through a triple structure, it is difficult to capture the complex spatiotemporal relationships involved. In addition, the triple structure has high data storage costs and low query efficiency. It is suitable for the storage and management of simple spatiotemporal graph data, but it is difficult to process large amounts of complex spatiotemporal graph data.

[0006] The space-time grid solves the problem of low query and computing efficiency of current graph databases to a certain extent, but its space-time identification method of point coordinates uses string representation, and its conversion and computing efficiency is low.

[0007] The domain coordinates of the space-time grid can manage entities based on binary space-time codes, which conforms to the calculation and analysis logic of computers. The space-time grid coding involves the space-time relationship of inherent entities, facilitating subsequent space-time graph data query and calculation to overcome the shortcomings of traditional databases.

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

[0009] The present invention overcomes one of the deficiencies of the prior art and provides a method for processing spatiotemporal graph data based on a grid graph database. The method performs grid encoding on spatiotemporal data based on GeoSOT-3D rules, effectively expresses various types of spatiotemporal nodes and spatiotemporal relationships, and completes various spatiotemporal computing tasks in combination with the spatiotemporal graph data. The method can process complex spatiotemporal relationship networks, store and encode and query large-scale spatiotemporal graph data under limited resources, and can solve the problems of low query and computing efficiency of existing databases and inability to effectively express spatiotemporal relationships.

[0010] According to one aspect of the present disclosure, a method for processing spatiotemporal graph data based on a grid graph database is proposed, the method comprising: Based on GeoSOT-3D, the entities in the knowledge graph are grid-encoded to obtain the spatial grid coding of the entities; The spatial grid codes of the entities are stored in a spatial grid table of a grid map database in a Z-order sequence; Based on GeoSOT-T, time slices in the knowledge graph are time-encoded to obtain time codes of the time slices; The time slices are stored in a four-tuple table of the grid graph database in the order of their time codes; Querying entities in the knowledge graph and calculating spatiotemporal relationships between entities in the knowledge graph based on spatial grid coding and time coding of the quadruple table of the grid graph database; Among them, the spatial grid code of the entity in the spatial grid table is the subject or object in the quadruple table, the time code of the time slice is the adverbial in the quadruple table, and the spatiotemporal relationship between the entities is the predicate in the quadruple table.

[0011] In a possible implementation, storing the spatial grid codes of the entities in a spatial grid table of a grid map database in Z-order includes: Based on the spatial scope and unit grid scale set by the knowledge graph, determine the spatial grid scope and grid level of the knowledge graph; According to the dimension of the spatiotemporal graph data, the spatial grid coding of the entity is used to establish the coding index of the quadtree or octree of the spatial grid level, and is stored in the spatial grid table in Z order; The spatial grid table includes grid code, dimension, grid level and attribute information.

[0012] In a possible implementation, storing the time slices in a quad table of the grid graph database in the order of the time codes of the time slices includes: Determine the time grid range and time grid level of the knowledge graph based on the time range set for the knowledge graph and the time interval of the time slice of the knowledge graph; Based on the order of the time coding of the time slices, the time slices are stored in a quadruple table of the grid graph database, wherein a quadruple sub-table of each time slice is sequentially established in the quadruple table, and in the quadruple sub-table of each time slice, the spatial positions of the spatial grid codings of the entities of the time slices are stored in the quadruple sub-table in a Z-order.

[0013] In a possible implementation, the spatial grid coding and time coding of the quadruple table based on the grid graph database to query the entity in the knowledge graph includes: Based on the spatiotemporal scope of the knowledge graph to be screened, determine the time coding scope and spatial grid coding scope of the spatiotemporal data of the knowledge graph; Perform bitwise operations on the time codes in the quadruple subtable of each time slice, and output the quadruple subtable of the time slice within the time code range of the knowledge graph; Performing bit operations on the spatial grid codes in the quaternary subtable of each time slice within the time code range, and outputting the quaternary subtable of the time slice within the spatial grid code range of the knowledge graph; The entities in the quadruple subtable of the time slice within the spatial grid encoding range of the knowledge graph are queried as the entities in the knowledge graph.

[0014] In a possible implementation, the spatial grid coding and time coding query of the entities in the knowledge graph based on the quadruple table of the grid graph database further includes: Using the K nearest neighbor algorithm to query the number of entities with spatial grid codes and time codes similar to the entity, if the number of entities reaches the K value, output the K neighboring entities of the entity; If the number of adjacent entities in 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 with similar spatial grid codes and time codes to the entity in the spatial grids adjacent to the surface, adjacent to the edge, and adjacent to the point. If the number of entities reaches the K value, output the K adjacent entities of the entity; If the number of adjacent entities in 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, search in sequence for the number of entities in the face-adjacent, edge-adjacent, and point-adjacent spatial grids that are similar to the spatial grid code and time code of the entity. 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.

[0015] In a possible implementation, the spatiotemporal relationship between entities includes: distances between entities, topological relationships between entities, orientation relationships between entities, and set relationships between entities.

[0016] In a possible implementation, the method also includes: when a new quadruple is added to the grid graph database, determining whether the subject, predicate and object of the newly 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, storing them in the grid database according to the order of the time code and spatial grid code of the newly added quadruple.

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

[0018] In a possible implementation, calculating the spatiotemporal relationship between entities in the knowledge graph based on the spatial grid coding and time coding of the quadruple table of the grid graph database includes: Calculate the distance between entities in the knowledge graph based on the spatial grid encoding of the quadruple table of the grid graph database; Determine the topological relationship and orientation relationship between entities in the knowledge graph based on the distance between the entities; The spatial grid coding and temporal coding of the quadruple table of the grid graph database are used to calculate the set relationship between entities in the knowledge graph, and generate new spatial grid tables and quadruple tables.

[0019] In a possible implementation, the grid graph database includes a node table (Node Table), an edge table (Edge Table), a spatial grid table (Spatial Grid Table), a quadruplet table (Quadruplet Table) and a triplet table (Triplet Table).

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

[0021] Other optional features and technical effects of the embodiments of the present invention are partially described below, and partially can be understood by reading this document. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0023] Figure 1 An architectural diagram of a grid graph database according to an embodiment of the present disclosure is shown; Figure 2 A flow chart of a method for processing spatiotemporal graph data based on a grid graph database according to an embodiment of the present disclosure is shown; Figure 3a and Figure 3b A schematic diagram of Z-order storage of a spatial grid according to an embodiment of the present disclosure is shown respectively; Figure 4a , Figure 4b and Figure 4c Schematic diagrams of spatial grid displacement according to an embodiment of the present disclosure are respectively shown. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific implementation methods and drawings. Here, the exemplary implementation methods of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0025] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part 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. Other explicit and implicit definitions may also be included below.

[0026] In addition, the steps shown in the flowchart of the accompanying drawings can be executed in a computer such as a set of computer executable instructions. Also, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in a sequence different from that here.

[0027] Figure 1 An architectural diagram of a grid graph database according to an embodiment of the present disclosure is shown.

[0028] The Grid Graph Database (GGD) can effectively manage and store the spatiotemporal data in the knowledge graph, and establish fast and effective spatiotemporal graph data update rules based on this architecture. Figure 1 As shown in the figure, 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).

[0029] like Figure 1 As shown in the figure, the Node Table stores the nodes in the spatiotemporal knowledge graph, and the elements in the table serve as subjects or objects in quadruples or triples. The Node Table can store simple node attributes, and its unit storage structure is: {Node ID, Class, Attribute}(1) Among them, Node ID is the name of the node, Class is the subclass of the node, and Attribute is optional.

[0030] The edge table stores the edges in the spatiotemporal knowledge graph. The elements in the edge table are used as predicates in quadruples or triples. The unit storage structure of the edge table is: {Edge ID, Class, Attribute}(2) Among them, Edge ID is the name of the edge, which is similar to the Node Table; Class is the subclass of the edge, and Attribute is the optional attribute storage of the Edge Table.

[0031] The Spatial Grid Table can store GeoSOT-3D spatial grid codes according to the geographic spatial order and grid level scale. The unit storage structure of the Spatial Grid Table is: {Code, Level, Dimension, Attribute}(3) Among them, Code is the GeoSOT-3D grid code of the spatial grid. The Code in the spatial grid table can constitute the subject or object in the quadruple table, and can also be used as the query primary key of other databases to query or interoperate with other databases for spatiotemporal data; Level is the level of the grid code; Dimension is the dimension of the spatial grid, which can store three-dimensional or two-dimensional codes as needed; Attribute is the optional attribute of the spatial grid.

[0032] The Quadruplet Table stores quadruplets with time-space relations, and is composed of several time sub-tables. The time code in the Quadruplet Table is used as an adverbial, and the space grid is used as a subject or object. The unit storage structure of the Quadruplet Table is: {Subject, Predicate, Object, Time grid}(4) Among them, Subject and Object represent the subject and object respectively, which are represented by the spatial grid code Code or node ID; Predicate represents the spatiotemporal edge between the subject and the object, which is represented by Edge ID; Time grid is the time code, that is, the time code of the time slice using GeoSOT-T (time slice).

[0033] The triplet table stores semantic triplet relationships without spatiotemporal attributes, that is, the semantic relationship of the scene independently forms a triplet table. The unit storage structure of the triplet table is: {Subject, Predicate, Object}(5) Among them, Predicate can be queried from the Edge Table and represented by Edge ID; Subject and Object can be queried from the Node Table and represented by Node ID. The triples in the Triplet Table only contain the semantic structure of subject, predicate and object, without time adverbial.

[0034] The grid graph database stores semantic and spatiotemporal data in five sub-tables. It can extract elements from semantic triples and spatiotemporal quadruplets in the knowledge graph, and perform spatiotemporal association through grid coding of space and time. When new spatiotemporal relationships are added, the grid graph database can quickly update storage and spatiotemporal calculations in spatial and temporal order, greatly improving the interoperability efficiency between sub-tables of the grid graph database and realizing the fusion association and update of spatiotemporal data and semantic data.

[0035] Figure 2 FIG. 1 shows a flow chart of a method for processing spatiotemporal graph data based on a grid graph database according to an embodiment of the present disclosure. Figure 1 As shown, the method may include: Step S1: Grid encode the entities in the knowledge graph based on GeoSOT-3D to obtain the spatial grid encoding of the entities.

[0036] Among them, the spatial grid encoding of the entity 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 spatiotemporal relationship between entities is the predicate in the quadruple table.

[0037] In addition, in addition to the global stereo grid system (GeoSOT-3D), the grid coding rules in the technical solution of this method can also adopt other global grid systems, such as the discrete global grid system (DGGS), the plane grid coding + height (GeoSOT-2D+Height) system, etc., without any limitation. The following takes the global stereo grid system (GeoSOT-3D) for grid coding as an example for explanation.

[0038] Step S2: The spatial grid codes of the entities are stored in a spatial grid table of the grid map database in Z-order.

[0039] The time slices in the spatial grid table and the quadruplet table need to be encoded based on GeoSOT-T to obtain the time code of the time slice in the knowledge graph, and the time code is used to identify the domain space-time. The entity grid of the graph data is encoded based on the GeoSOT-3D spatial grid and stored in the graph database according to certain rules.

[0040] In one example, storing the spatial grid codes of entities in a spatial grid table of a grid map database in Z-order may include: 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 can include grid code, dimension, grid level and attribute information. Based on the encoding rules of GeoSOT-3D, the longitude, latitude and altitude of each spatial range can be encoded to obtain the corresponding binary spatial grid code.

[0041] P2: According to the dimension of the spatiotemporal graph data, the spatial grid coding of the entity is used to establish the coding index of the quadtree or octree of the spatial grid level, and store it in the spatial grid table in Z-order. The spatial grid coding and spatial storage scheme generally adopts Z-order storage (Z-order).

[0042] Figure 3a and Figure 3b Schematic diagrams of Z-order storage of a spatial grid according to an embodiment of the present disclosure are respectively shown.

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

[0044] Step S3: Time-code the time slices in the knowledge graph based on GeoSOT-T to obtain the time coding of the time slices.

[0045] In addition, in addition to GeoSOT-T, the time coding rules in the technical solution of this method can also adopt other time grid systems, without any limitation here.

[0046] Step S4: store the time slices in the quad table of the grid graph database in the order of their time codes, wherein a quad table sub-table may be established for each time slice, and in each quad table sub-table, quads are stored in a spatial Z-order.

[0047] In one example, storing the time slices in a quad table of a grid graph database in the order of their time codes may include: Based on the time range set by the knowledge graph and the time interval of the knowledge graph time slices, the time grid range and time grid level of the knowledge graph are determined; based on the encoding rules of GeoSOT-T, the time period corresponding to each time slice can be encoded to obtain the corresponding binary time code, and the time slices are stored in the quadruple table of the grid graph database based on the order of the time codes of the time slices; in addition, the time slices can also be stored in the quadruple table of the grid graph database based on the size of the time codes of the time slices, which is not limited here.

[0048] Among them, a quadruple subtable of each time slice is sequentially established in the quadruple table. In each quadruple subtable of each time slice, the spatial position of the spatial grid code of the entity of the time slice is stored in the quadruple subtable in Z order. When the subject and the object are both spatial grids, the spatial grid position of the subject is used as the preferred storage position. Compared with the time mark in the form of character segments, this method can reduce the storage amount and realize the rapid sequential arrangement of time codes in the quadruple table and accurate verification of time neighborhood.

[0049] Step S5: Query entities in the knowledge graph and calculate the spatiotemporal relationships between entities in the knowledge graph based on the spatial grid coding and time coding of the quadruple table of the grid graph database.

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

[0051] In one example, querying entities in the knowledge graph based on spatial grid coding and time coding of a quadruple table of a grid graph database includes: Based on the spatiotemporal scope of the knowledge graph that needs to be screened, determine the time coding range and spatial grid coding range of the spatiotemporal data of the knowledge graph.

[0052] Perform bitwise operations on the time codes in the quadruple subtable of each time slice, and output the quadruple subtable of the time slice within the time code range of the knowledge graph; Perform bitwise operations on the spatial grid codes in the quaternary subtable of each time slice within the time code range, and output the quaternary subtable of the time slice within the spatial grid code range of the knowledge graph; The entities in the quad-tuple sub-table of the time slice within the spatial grid encoding range of the query knowledge graph are the entities in the knowledge graph to be queried. In special cases, if there are nodes or edges that need to be filtered, a standard semantic query is performed on the quad-tuples that meet the spatial and temporal range.

[0053] 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 the entity and all known category entities and finds the K entities (i.e., "neighbors") that are closest to it. The spatial and temporal grid encodings of knowledge graph entities are stored in the Z-order of quadtrees or octrees, and the spatial and temporal grid encodings of adjacent areas are similar. The KNN algorithm can be used to quickly identify the K entities closest to the central entity based on the grid neighborhood information, and can query the spatial grid relationships of the central entity's face adjacency, edge adjacency, and point adjacency. The specific process of querying entities using the KNN algorithm is as follows: In another example, querying entities in the knowledge graph based on the spatial grid coding and time coding of the quadruple table of the grid graph database further includes: The K nearest neighbor algorithm (KNN algorithm) is used to query the number of entities that are close to the spatial grid code and time code of the entity. If the number of entities reaches the K value, the K neighboring entities of the entity are output.

[0054] If the number of adjacent entities in 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 with similar spatial grid codes and time codes as the entity in the spatial grids adjacent to the face, adjacent to the edge, and adjacent to the point. If the number of entities reaches the K value, output the K adjacent entities of the entity; If the number of adjacent entities in 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, search in sequence for the number of entities in the face-adjacent, edge-adjacent, and point-adjacent spatial grids that are similar to the spatial grid code and time code of the entity. 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.

[0055] Through the relationship between the spatial grid code and time code of the grid graph database and the spatial entity, the storage size of each entry in the spatial grid table and the quadruplet table can be reduced while the number of entries remains unchanged; range query is realized through binary coding bit operations of the time code in the quadruplet and the spatial grid code, thereby improving query efficiency.

[0056] The spatiotemporal graph data processing method based on the grid graph database disclosed in the present invention performs grid coding on entities in the knowledge graph based on GeoSOT-3D, and stores the entity spatial grid codes in a spatial grid table of the grid graph database in Z-order; performs time coding on time slices in the knowledge graph based on GeoSOT-T, and stores the time slices in a quadruple table of the grid graph database in the order of the time codes of the time slices; queries entities in the knowledge graph based on the spatial grid coding and time coding of the quadruple table of the grid graph database and calculates the spatiotemporal relationships between entities in the knowledge graph; and can solve the problems of low query and calculation efficiency of existing databases and inability to effectively express spatiotemporal relationships.

[0057] According to another aspect of the present disclosure, the spatiotemporal graph data processing method based on the grid graph database further includes: When a new quadruple is added to the grid graph database, it is determined 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, they are stored in the grid database according to the order of the time code and the spatial grid code of the newly added quadruple. In addition, the quadruple of the calculated spatiotemporal relationship between entities of the knowledge graph is stored after the entry of the spatial grid where the subject is located in the quadruple.

[0058] Since the spatiotemporal graph data is represented in the grid graph database by quadruplets, when a new quadruplet is added, first determine whether the subject, predicate, and object in the new quadruplet 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 quadruplet into the subtable and then update the quadruplet table. If they have all been stored, they are placed in the corresponding spatiotemporal storage location in the quadruplet table according to the storage order of the corresponding time slice and space grid. At the same time, establish a set of indexes or mapping tables corresponding to the grid graph database, such as the mapping of Node ID to quadruplet, the mapping of Eode ID to quadruplet, etc., and quickly establish an association with the quadruplet table through the node table and edge.

[0059] In the grid graph database, the Spatial Grid Table has been fully established within the spatial scope of the application scenario, so it will not change when the Quadruplet Table is updated. However, for some special quadruplets without spatial grid elements, such as complex spatiotemporal relationships (direction, distance, etc. between two entities) obtained through spatiotemporal calculations, there are no spatial grids in the subject and object of the spatiotemporal relationship, but the spatial entities associated with the spatiotemporal relationship have quadruplets related to the spatial grid. Therefore, the grid graph database stores this type of quadruplet in the Quadruplet Table after the entry "Spatial grid where the subject in the quadruplet is located (subject, located in, spatialgrid, time gird)". For example, the position knowledge of ship A relative to airplane B is expressed as a four-tuple entry: ship A, 175°, airplane B, 010. According to the four-tuple storage rule, this four-tuple will be placed after the entry "ship A, located in, 001010, 010" in the four-tuple table (QuadrupletTable).

[0060] In addition, the grid graph database calculates the hierarchical nested relationship between grids through the stored spatiotemporal data encoding data, that is, the spatiotemporal relationship between entities in the knowledge graph is obtained. The spatiotemporal relationship between entities includes: the distance between entities, the topological relationship between entities, the orientation relationship between entities, and the collection relationship between entities. It can map the relationship between grids in the quadruple table to entities and update these entity quadruple to the corresponding storage location.

[0061] According to another aspect of the present disclosure, calculating the spatiotemporal relationship between entities in the knowledge graph based on the spatial grid coding and time coding of the quadruple table of the grid graph database may include: The spatial grid encoding of the quadruple table based on the grid graph database calculates the distance between entities in the knowledge graph; Determine the topological relationship and orientation relationship between entities in the knowledge graph based on the distance between entities; The spatial grid coding and temporal coding of the quadruple table of the grid graph database are used to calculate the set relationship between entities in the knowledge graph, and new spatial grid tables and quadruple tables are generated.

[0062] Figure 4a , Figure 4b and Figure 4c Schematic diagrams of spatial grid displacement according to an embodiment of the present disclosure are respectively shown.

[0063] The distance between entities is calculated as follows. Figure 4a , Figure 4b and Figure 4cAs shown in the figure, the spatial entity moves in two directions in one-dimensional space, eight directions in two-dimensional space, and twenty-six directions in three-dimensional space. The displacement of the spatial entity on the grid can be obtained by the displacement coding operator Calculated.

[0064] Shift encoding operator The spatial entity grid is translated by n grid units (n<0 means reverse translation) in one of the dimensions of longitude, latitude, altitude and time (represented by the code c) at the current subdivision level. Displacement coding operator It can be expanded from one dimension to multiple dimensions. For example, when the code c is a four-dimensional code, it is necessary to convert the spatial grid unit into 80 domain dimensions, and then perform displacement calculation on the codes of each dimension. Finally, the calculated displacements of each dimension are cross-merged to obtain the displacement of the code c.

[0065] (6) Taking a two-dimensional space grid as an example, It 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.

[0066] Distance calculation between spatial grid A and spatial grid B and grid span function Respectively expressed as:

[0067] (7) (8) (9) in, Refers to the grid width at the current grid level; g1 and g2 are the current and The first encoding under the corresponding dimension, when g1 and g2 are equal, it means that entity A and entity B are in the same hemisphere, and when g1 and g2 are not equal, it means that the nodes belong to two different hemispheres; after completing the distance calculation between entity A and entity B, a four-tuple is generated and stored in the grid graph database ( , ).

[0068] The topological relationship between entities is as follows. The topological relationship between entities mainly includes overlapped, adjacent, and separate, which can be expressed by Perform topological determination. Based on the topological relationship between entity A and entity B, ABTake this as an example to illustrate that when completing the topological relationship between entity A and entity B, AB After identification, the quadruple is output and stored in the grid graph database ( , ).

[0069] The two-dimensional spatial topological relationship between entity A and entity B AB-2D for: (10) Topology of the three-dimensional space between entity A and entity B AB-3D for: (11) The orientation relationship between entities. The orientation calculation of spatiotemporal graph data refers to the direction of entity B relative to entity A, which can be calculated by the spatial grid code where the entity is located. Based on the orientation calculation result of entity B relative to entity A The corresponding four-tuple implicit relation structure can be generated ( , ).

[0070] Calculation result of the position of entity B relative to entity A for: (12) Calculation of set relationships between entities. Set relationships between entities include intersection, union, and difference set relationships. Among them, intersection refers to calculating the overlapping part of two or more regions. Union is to merge two or more regions to form a new region containing all spatiotemporal graph data. The difference 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 graph database based on the new grid set, and the spatiotemporal graph data quadruple corresponding to the intersection, union, and difference set area can be obtained based on the spatiotemporal grid coding calculation of the grid graph database.

[0071] Table 1 shows the representation and definition of various parameters in the calculation of spatiotemporal graph data set, where A and B represent the set of any two spatial grid tables; , Represent the spatial grid codes in sets A and B respectively; , They represent the spatiotemporal graph data corresponding to the two spatial coding sets. g represents the GeoSOT-3D spatial grid, c gRepresents the grid code of GeoSOT-3D spatial grid; ∈, , , ∩, ∪ are universal set symbols, representing belonging, not belonging, subset, intersection and union respectively. After the corresponding intersection, union and difference calculations, a new grid graph database is output, which contains entities and quadruples that conform to the rules of set operators.

[0072] Table 1 Representation and definition of various parameters in the calculation of spatiotemporal graph data set

[0073] By storing and managing spatiotemporal graph data based on GeoSOT-3D grid coding and grid graph database GGD, that is, building a retrieval system of five sub-tables through the grid graph database GGD, encoding the time and space grids based on GeoSOT-T and GeoSOT-3D rules, it is possible to accurately identify and locate the storage location of the spatiotemporal quadruple in the grid graph database GGD. By using grid coding algebra, complex spatiotemporal relationships between spatial entities can be calculated, and new quadruple groups can be generated to answer dynamic spatiotemporal questions. Experimental results show that compared with other databases, the grid graph database GDD disclosed in the present invention has significantly improved the query and calculation efficiency level of spatiotemporal graph data, which is an average of 5-10 times. In addition, the strategy based on spatially distributed parallel optimization can further improve the speed of large-scale spatiotemporal graph data calculation, confirming the high scalability and practicality of the grid graph data map GGD.

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

[0075] The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0076] According to another aspect of the present disclosure, the present disclosure further proposes a spatiotemporal graph data processing device based on a grid graph database, which may include: The spatial grid coding module is used to perform grid coding on entities in the knowledge graph based on GeoSOT-3D to obtain the spatial grid coding of the entities; A first storage module is used to store the spatial grid codes of the entities in a spatial grid table of a grid map database in Z-order; The time coding module is used to perform time coding on the time slices in the knowledge graph based on GeoSOT-T to obtain the time coding of the time slices; A second storage module is used to store the time slices in a four-tuple table of the grid graph database in the order of the time codes of the time slices; A query and calculation module, used for querying entities in the knowledge graph and calculating the spatiotemporal relationship between entities in the knowledge graph based on the spatial grid coding and time coding of the quadruple table of the grid graph database; Among them, the spatial grid code of the entity in the spatial grid table is the subject or object in the quadruple table, the time code of the time slice is the adverbial in the quadruple table, and the spatiotemporal relationship between the entities is the predicate in the quadruple table.

[0077] 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 in the memory and executable on the processor, and the processor implements the method described above when executing the program.

[0078] According to another aspect of the present disclosure, the present disclosure proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described above is implemented.

[0079] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0080] The exemplary systems and methods of the present invention have been specifically shown and described with reference to the above embodiments, which are merely examples of the best modes for implementing the present systems and methods. It will be appreciated by those skilled in the art that various changes may be made to the embodiments of the systems and methods described herein when implementing the present systems and / or methods without departing from the spirit and scope of the present invention as defined in the appended claims.

Claims

1. A method for processing spatiotemporal graph data based on a grid graph database, characterized in that: The method comprises: Based on GeoSOT-3D, the entities in the knowledge graph are grid-encoded to obtain the spatial grid coding of the entities; The spatial grid codes of the entities are stored in a spatial grid table of a grid map database in a Z-order sequence; Based on GeoSOT-T, time slices in the knowledge graph are time-encoded to obtain time codes of the time slices; The time slices are stored in a four-tuple table of the grid graph database in the order of their time codes; Querying entities in the knowledge graph and calculating spatiotemporal relationships between entities in the knowledge graph based on spatial grid coding and time coding of the quadruple table of the grid graph database; Among them, the spatial grid code of the entity in the spatial grid table is the subject or object in the quadruple table, the time code of the time slice is the adverbial in the quadruple table, and the spatiotemporal relationship between the entities is the predicate in the quadruple table.

2. The method for processing spatiotemporal graph data according to claim 1, characterized in that: The step of storing the spatial grid codes of the entities in a spatial grid table of the grid map database in a Z-order manner includes: Based on the spatial scope and unit grid scale set by the knowledge graph, determine the spatial grid scope and grid level of the knowledge graph; According to the dimension of the spatiotemporal graph data, the spatial grid coding of the entity is used to establish the coding index of the quadtree or octree of the spatial grid level, and is stored in the spatial grid table in Z order; The spatial grid table includes grid code, dimension, grid level and attribute information.

3. The method for processing spatiotemporal graph data according to claim 1, characterized in that: The time slices are stored in a four-tuple table of the grid graph database in the order of the time codes of the time slices, including: Determine the time grid range and time grid level of the knowledge graph based on the time range set for the knowledge graph and the time interval of the time slice of the knowledge graph; Based on the order of the time coding of the time slices, the time slices are stored in a quadruple table of the grid graph database, wherein a quadruple sub-table of each time slice is sequentially established in the quadruple table, and in the quadruple sub-table of each time slice, the spatial positions of the spatial grid codings of the entities of the time slices are stored in the quadruple sub-table in a Z-order.

4. The method for processing spatiotemporal graph data according to claim 1, characterized in that: The spatial grid coding and time coding of the quadruple table based on the grid graph database to query the entities in the knowledge graph includes: Based on the spatiotemporal scope of the knowledge graph to be screened, determine the time coding scope and spatial grid coding scope of the spatiotemporal data of the knowledge graph; Perform bitwise operations on the time codes in the quadruple subtable of each time slice, and output the quadruple subtable of the time slice within the time code range of the knowledge graph; Performing bit operations on the spatial grid codes in the quaternary subtable of each time slice within the time code range, and outputting the quaternary subtable of the time slice within the spatial grid code range of the knowledge graph; The entities in the quadruple subtable of the time slice within the spatial grid encoding range of the knowledge graph are queried as the entities in the knowledge graph.

5. The method for processing spatiotemporal graph data according to claim 1, characterized in that: The spatial grid coding and time coding of the quadruple table based on the grid graph database to query the entities in the knowledge graph also includes: Using the K nearest neighbor algorithm to query the number of entities with spatial grid codes and time codes similar to the entity, if the number of entities reaches the K value, output the K neighboring entities of the entity; If the number of adjacent entities in 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 with similar spatial grid codes and time codes to the entity in the spatial grids adjacent to the surface, adjacent to the edge, and adjacent to the point. If the number of entities reaches the K value, output the K adjacent entities of the entity; If the number of adjacent entities in 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, search in sequence for the number of entities in the face-adjacent, edge-adjacent, and point-adjacent spatial grids that are similar to the spatial grid code and time code of the entity. 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.

6. The method for processing spatiotemporal graph data according to claim 1, characterized in that: The spatiotemporal relationship between entities includes: the distance between entities, the topological relationship between entities, the orientation relationship between entities and the collection relationship between entities.

7. The method for processing spatiotemporal graph data according to claim 1, characterized in that: The method further comprises: When a new quadruple is added to the grid graph database, it is determined 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 so, they are stored in the grid database according to the order of the time code and spatial grid code of the newly added quadruple.

8. The method for processing spatiotemporal graph data according to claim 7, characterized in that: The method further comprises: The calculated quadruple of spatiotemporal relations between entities in the knowledge graph is stored after the entry of the spatial grid where the subject is located in the quadruple.

9. The method for processing spatiotemporal graph data according to claim 6, characterized in that: The spatial grid coding and time coding of the quadruple table of the grid graph database are used to calculate the spatiotemporal relationship between entities in the knowledge graph, including: Calculate the distance between entities in the knowledge graph based on the spatial grid encoding of the quadruple table of the grid graph database; Determine the topological relationship and orientation relationship between entities in the knowledge graph based on the distance between the entities; The spatial grid coding and temporal coding of the quadruple table of the grid graph database are used to calculate the set relationship between entities in the knowledge graph, and generate new spatial grid tables and quadruple tables.

10. The method for processing spatiotemporal graph data according to claim 1, characterized in that: 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

  • Space-time grid-based block data generation and display method and device

    CN114896255A

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

    CN115329220A

  • Airspace grid chart generation method

    CN116069882A

  • Spatial relation knowledge graph data model construction method and device and query method

    CN116108205A

Cited By

  • General spatio-temporal data coding method and device, and storage medium

    CN119961373A

  • General spatio-temporal data encoding method, device and storage medium

    CN119961373B

  • Space-time data query method based on knowledge graph, electronic equipment and program product

    CN122019845A