Storage and query method and device of spatio-temporal data, storage medium and electronic equipment

CN120973843BActive Publication Date: 2026-08-11JIULING (SHANGHAI) INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-05
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]本申请的主要目的在于提供一种时空数据的存储和查询方法和装置、存储介质及电子设备,以解决相关技术中海量时空数据作为单独的文件存储,导致对时空数据的处理效率比较低的问题

Benefits of technology

[0023] In this embodiment, the following steps are adopted: obtaining the first spatial range information corresponding to the first spatiotemporal data to be queried; determining multiple candidate spatiotemporal data blocks based on the first spatial range information and the root node of the target index tree corresponding to the spatiotemporal data, wherein the multiple spatiotemporal data blocks corresponding to the spatiotemporal data are stored in the target storage space, and the target index tree is obtained based on the storage information corresponding to the spatiotemporal data; and querying the first spatiotemporal data from the multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree. This solves the technical problem in related technologies where massive spatiotemporal data is stored as a separate file, resulting in relatively low processing efficiency of spatiotemporal data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973843B_ABST
    Figure CN120973843B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, storage medium, and electronic device for storing and querying spatiotemporal data. Relating to the field of data processing technology, the method includes: obtaining first spatial range information corresponding to first spatiotemporal data to be queried; determining multiple candidate spatiotemporal data blocks based on the first spatial range information and the root node of a target index tree corresponding to the spatiotemporal data; and querying the first spatiotemporal data from the multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree. This application solves the problem in related technologies where storing massive amounts of spatiotemporal data as separate files results in relatively low processing efficiency for spatiotemporal data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and more specifically, to a method and apparatus for storing and retrieving spatiotemporal data, a storage medium, and an electronic device. Background Technology

[0002] In the intersection of big data and geographic information systems, the efficient management and rapid access to massive amounts of spatiotemporal data has become an increasingly serious challenge. With the widespread application of IoT technology, remote sensing monitoring, and mobile devices, various types of spatiotemporal data, such as sensor readings, map tiles, and trajectory records, are experiencing explosive growth. This data is typically stored in the form of small files, resulting in an extremely large volume. In scenarios such as urban planning, traffic management, and disaster response, the ability to quickly locate and access data within specific spatiotemporal intervals is a key capability of decision support systems. For example, real-time traffic monitoring requires the rapid acquisition of vehicle trajectory data within a specific time and geographical location range to analyze traffic flow and congestion. Although distributed file systems perform well in handling large-scale datasets, they exhibit significant performance bottlenecks when dealing with the massive storage of small spatiotemporal data. Too many independent files complicate metadata management, increase I / O operations, and reduce data access speed.

[0003] There is currently no effective solution to the problem that storing massive amounts of spatiotemporal data as separate files in related technologies results in low processing efficiency. Summary of the Invention

[0004] The main objective of this application is to provide a method, apparatus, storage medium, and electronic device for storing and retrieving spatiotemporal data, in order to solve the problem that storing massive amounts of spatiotemporal data as separate files in related technologies results in relatively low processing efficiency of spatiotemporal data.

[0005] To achieve the above objectives, according to one aspect of this application, a method for storing and querying spatiotemporal data is provided. The method includes: obtaining first spatial range information corresponding to first spatiotemporal data to be queried; determining multiple candidate spatiotemporal data blocks based on the first spatial range information and the root node of a target index tree corresponding to the spatiotemporal data, wherein the multiple spatiotemporal data blocks corresponding to the spatiotemporal data are stored in a target storage space, and the target index tree is obtained based on the storage information corresponding to the spatiotemporal data; and querying the first spatiotemporal data from the multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree.

[0006] Furthermore, before obtaining the first spatial range information corresponding to the first spatiotemporal data to be queried, the method further includes: receiving multiple original spatiotemporal data and obtaining spatial feature information of the multiple original spatiotemporal data; aggregating and splicing the multiple original spatiotemporal data according to the spatial feature information to obtain multiple spatiotemporal data blocks; and constructing the target index tree according to the multiple spatiotemporal data blocks.

[0007] Further, constructing the target index tree based on the multiple spatiotemporal data blocks includes: obtaining the minimum enclosing matrix information and storage path information corresponding to each spatiotemporal data block; constructing multiple root nodes based on the minimum enclosing matrix information and the storage path information; segmenting each spatiotemporal data block and constructing multiple leaf nodes corresponding to each root node based on the multiple segmented spatiotemporal data; and obtaining the target index tree based on the multiple root nodes and the multiple leaf nodes corresponding to each root node.

[0008] Furthermore, constructing multiple leaf nodes corresponding to each root node based on the spatiotemporal data after multiple segments includes: obtaining the data length and sorting information of the spatiotemporal data after each segment; obtaining the offset of the spatiotemporal data after each segment based on the data length and the sorting information; and constructing the multiple leaf nodes based on the offset and the data length of the spatiotemporal data after each segment.

[0009] Further, querying the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree includes: determining the offset corresponding to the first spatiotemporal data based on the first spatial range information; determining the leaf nodes of the target index tree based on the offset corresponding to the first spatiotemporal data; and querying the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree and the offset corresponding to the first spatiotemporal data.

[0010] Furthermore, after retrieving the first spatiotemporal data, the method further includes: obtaining second spatial range information corresponding to the second spatiotemporal data to be processed; obtaining index information corresponding to the second spatiotemporal data based on the second spatial range information and the target index tree corresponding to the spatiotemporal data; and sending the index information to the target node, wherein the target node reads the second spatiotemporal data based on the index information and processes the second spatiotemporal data to obtain processed spatiotemporal data.

[0011] Furthermore, the method further includes: detecting whether an operation request for spatiotemporal data corresponding to the target index tree is received, wherein the operation request is one of the following: a deletion operation and a replacement operation; determining the target spatiotemporal data block corresponding to the operation request based on the target index tree; processing the spatiotemporal data in the target spatiotemporal data block according to the operation request to obtain a processed target spatiotemporal data block; and updating the target index tree based on the processed target spatiotemporal data block to obtain an updated target index tree.

[0012] Furthermore, after obtaining the target index tree based on the plurality of root nodes and the plurality of leaf nodes corresponding to each root node, the method further includes: obtaining the storage path information corresponding to each spatiotemporal data block and the offset of the spatiotemporal data after multiple segments corresponding to each spatiotemporal data block; and storing the spatiotemporal data block into the target storage space based on the storage path information and the offset.

[0013] To achieve the above objectives, according to another aspect of this application, a device for storing and querying spatiotemporal data is provided. The device includes: a first acquisition unit, configured to acquire first spatial range information corresponding to first spatiotemporal data to be queried; a first determination unit, configured to determine multiple candidate spatiotemporal data blocks based on the first spatial range information and the root node of a target index tree corresponding to the spatiotemporal data, wherein the multiple spatiotemporal data blocks corresponding to the spatiotemporal data are stored in a target storage space, and the target index tree is obtained based on the storage information corresponding to the spatiotemporal data; and a first query unit, configured to query the first spatiotemporal data from the multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree.

[0014] Furthermore, the device further includes: a receiving unit, configured to receive multiple original spatiotemporal data and obtain spatial feature information of the multiple original spatiotemporal data before obtaining the first spatial range information corresponding to the first spatiotemporal data to be queried; an aggregation unit, configured to aggregate and splice the multiple original spatiotemporal data according to the spatial feature information to obtain multiple spatiotemporal data blocks; and a construction unit, configured to construct the target index tree according to the multiple spatiotemporal data blocks.

[0015] Furthermore, the construction unit includes: an acquisition module for acquiring the minimum enclosing matrix information and storage path information corresponding to each spatiotemporal data block; a construction module for constructing multiple root nodes based on the minimum enclosing matrix information and the storage path information; a segmentation module for segmenting each spatiotemporal data block and constructing multiple leaf nodes corresponding to each root node based on the multiple segmented spatiotemporal data; and a first determination module for obtaining the target index tree based on the multiple root nodes and the multiple leaf nodes corresponding to each root node.

[0016] Furthermore, the segmentation module includes: an acquisition submodule, used to acquire the data length and sorting information of the spatiotemporal data after each segment; a determination submodule, used to obtain the offset of the spatiotemporal data after each segment based on the data length and the sorting information; and a construction submodule, used to construct the plurality of leaf nodes based on the offset and the data length of the spatiotemporal data after each segment.

[0017] Furthermore, the first query unit includes: a second determining module, used to determine the offset corresponding to the first spatiotemporal data based on the first spatial range information, and to determine the leaf node of the target index tree based on the offset corresponding to the first spatiotemporal data; and a query module, used to query the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf node of the target index tree and the offset corresponding to the first spatiotemporal data.

[0018] Furthermore, the device further includes: a second acquisition unit, configured to acquire second spatial range information corresponding to the second spatiotemporal data to be processed after querying the first spatiotemporal data; a second query unit, configured to obtain index information corresponding to the second spatiotemporal data based on the second spatial range information and the target index tree corresponding to the spatiotemporal data; and a sending unit, configured to send the index information to a target node, wherein the target node reads the second spatiotemporal data based on the index information and processes the second spatiotemporal data to obtain processed spatiotemporal data.

[0019] Furthermore, the apparatus further includes: a detection unit, configured to detect whether an operation request for spatiotemporal data corresponding to the target index tree is received, wherein the operation request is one of the following: a deletion operation and a replacement operation; a second determination unit, configured to determine the target spatiotemporal data block corresponding to the operation request based on the target index tree; a processing unit, configured to process the spatiotemporal data in the target spatiotemporal data block according to the operation request to obtain a processed target spatiotemporal data block; and an update unit, configured to update the target index tree based on the processed target spatiotemporal data block to obtain an updated target index tree.

[0020] Furthermore, the device further includes: a third acquisition unit, configured to acquire storage path information corresponding to each spatiotemporal data block and offsets of multiple segments of spatiotemporal data corresponding to each spatiotemporal data block before acquiring the first spatial range information corresponding to the first spatiotemporal data to be queried; and a storage unit, configured to store the spatiotemporal data block into the target storage space according to the storage path information and the offsets.

[0021] According to another aspect of the present invention, an electronic device is also provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the spatiotemporal data storage and retrieval method of any of the above-mentioned methods during runtime.

[0022] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein the storage medium stores a program, wherein the program controls the device where the storage medium is located to execute the spatiotemporal data storage and retrieval method described above during program execution.

[0023] In this embodiment, the following steps are adopted: obtaining the first spatial range information corresponding to the first spatiotemporal data to be queried; determining multiple candidate spatiotemporal data blocks based on the first spatial range information and the root node of the target index tree corresponding to the spatiotemporal data, wherein the multiple spatiotemporal data blocks corresponding to the spatiotemporal data are stored in the target storage space, and the target index tree is obtained based on the storage information corresponding to the spatiotemporal data; and querying the first spatiotemporal data from the multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree. This solves the technical problem in related technologies where massive spatiotemporal data is stored as a separate file, resulting in relatively low processing efficiency of spatiotemporal data.

[0024] In this scheme, the root node of the target index tree is used to perform preliminary data filtering based on the first spatial range information corresponding to the first spatiotemporal data to be queried. By comparing the target index tree with the query range, candidate spatiotemporal data blocks that may contain the query data can be quickly filtered out, avoiding scanning the entire dataset. Based on the preliminary filtering, the leaf node information of the target index tree is further used to query each candidate spatiotemporal data block. Through precise matching with the first spatial range information, data segments overlapping with the query range can be directly located in the candidate spatiotemporal data blocks, thereby achieving fine-grained data access. Through the hierarchical index structure, the spatiotemporal data required by the user can be located in a very short time, avoiding blind scanning of massive amounts of data, thus achieving the technical effect of improving the processing efficiency of spatiotemporal data. Attached Figure Description

[0025] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0026] Figure 1 A hardware structure block diagram of a computer terminal for implementing a method for storing and retrieving spatiotemporal data is shown.

[0027] Figure 2 This is a flowchart of a method for storing and querying spatiotemporal data according to an embodiment of this application;

[0028] Figure 3 This is a schematic diagram of spatiotemporal data processing provided in the embodiments of this application. Figure 1 ;

[0029] Figure 4 This is a schematic diagram of spatiotemporal data processing provided in the embodiments of this application. Figure 2 ;

[0030] Figure 5 This is a schematic diagram of spatiotemporal data processing provided in the embodiments of this application. Figure 3 ;

[0031] Figure 6 This is a schematic diagram of spatiotemporal data processing provided in the embodiments of this application. Figure 4 ;

[0032] Figure 7 This is a schematic diagram of spatiotemporal data processing provided in the embodiments of this application. Figure 5 ;

[0033] Figure 8 This is a schematic diagram of a spatiotemporal data storage and retrieval device provided according to an embodiment of this application;

[0034] Figure 9 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0035] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0037] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding access points are provided for users to choose to authorize or refuse. For example, interfaces are set up between this system and relevant users or organizations, providing users with corresponding access points to choose to agree to or refuse automated decision-making results; if the user chooses to refuse, the process proceeds to the expert decision-making stage.

[0038] Example 1

[0039] According to an embodiment of this application, a method embodiment for storing and querying spatiotemporal data is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0040] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a method for storing and retrieving spatiotemporal data is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0041] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0042] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the spatiotemporal data storage and retrieval method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned spatiotemporal data storage and retrieval method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0043] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0044] The display may be a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0045] Under the aforementioned operating environment, this application provides the following: Figure 2 The method for storing and querying spatiotemporal data is shown. Figure 2 This is a flowchart of a method for storing and retrieving spatiotemporal data according to Embodiment 1 of this application. The method for storing and retrieving spatiotemporal data includes:

[0046] Step S201: Obtain the first spatial range information corresponding to the first spatiotemporal data to be queried.

[0047] Optionally, the system can receive the first spatial extent information corresponding to the first spatiotemporal data that the user wishes to query through the front-end interface. The first spatiotemporal data can be weather data over a historical period, GPS tracks of vehicles within a certain time period, or the status of a geographical area recorded by remote sensing images. The first spatial extent information refers to the spatial dimensional constraints of the first spatiotemporal data, such as geographical coordinate ranges, like latitude and longitude intervals (longitude X1-X2, latitude Y1-Y2), or a specific geographical polygonal region, which can be of any shape and defined by a set of vertex coordinates.

[0048] In an optional embodiment, the user specifies "find all weather station records in the xx region," where "xx region" is the first spatial range information. This information is then converted into actionable query parameters, such as the latitude and longitude range or grid code of the xx region, to facilitate subsequent index queries and data retrieval.

[0049] Step S202: Based on the first spatial range information and the root node of the target index tree corresponding to the spatiotemporal data, determine multiple candidate spatiotemporal data blocks. The multiple spatiotemporal data blocks corresponding to the spatiotemporal data are stored in the target storage space, and the target index tree is obtained based on the storage information corresponding to the spatiotemporal data.

[0050] Optionally, the target index tree can be obtained. The target index tree refers to the spatial index structure built for the stored spatiotemporal data, such as an STR-Tree (Spatio-Temporal R Tree). Index trees can organize data in spatial and temporal dimensions, making it faster to query data in a specific spatiotemporal region.

[0051] Then, by comparing the spatial range information of the first spatial range with the spatial range covered by the root node of the target index tree corresponding to the spatiotemporal data, it is possible to quickly determine which lower-level nodes (spatiotemporal data blocks) may contain the data required for the query, thereby obtaining the above-mentioned multiple candidate spatiotemporal data blocks.

[0052] For example, if a user wants to query air quality data for region xx, the system first retrieves the first spatial range information (the geographical coordinates of region xx). Then, by comparing this information with the root node of the target index tree, it can quickly filter out all spatiotemporal data blocks covering region xx.

[0053] It should be noted that multiple spatiotemporal data blocks corresponding to the spatiotemporal data are stored in the target storage space, and the target index tree is derived based on the storage information corresponding to the spatiotemporal data. By building an index based on the storage information corresponding to the spatiotemporal data, data blocks can be located quickly, improving data query efficiency.

[0054] Step S203: Based on the leaf nodes of the target index tree, query the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space.

[0055] Optionally, based on the candidate spatiotemporal data blocks initially selected in step S202, the leaf node information of the target index tree is further utilized to achieve precise searching of data within the query space. In the target index tree, unlike the root node, leaf nodes contain more detailed spatial information. By comparing the first spatial range information provided by the user with the spatial range description of the leaf nodes, it is possible to determine which leaf nodes (i.e., which specific data segments or portions of data within spatiotemporal data blocks) actually intersect or overlap with the query conditions. This fine-grained retrieval allows loading and processing only data directly related to the query conditions, avoiding full block scans or full node traversals, and greatly reducing the waste of computational resources. Once the leaf nodes matching the query conditions are determined, the data segments corresponding to these leaf nodes can be directly read from the target storage space to obtain the aforementioned first spatiotemporal data.

[0056] In summary, based on the first spatial range information corresponding to the first spatiotemporal data to be queried, the root node of the target index tree is used for initial data filtering. By comparing the target index tree with the query range, candidate spatiotemporal data blocks that may contain the query data can be quickly filtered out, avoiding scanning the entire dataset. Based on this initial filtering, the leaf node information of the target index tree is further used to query each candidate spatiotemporal data block. Through precise matching with the first spatial range information, data segments overlapping with the query range can be directly located within the candidate spatiotemporal data blocks, thus achieving fine-grained data access. Through a hierarchical index structure, the spatiotemporal data required by the user can be located in a very short time, avoiding blind scanning of massive amounts of data, thereby achieving the technical effect of improving the efficiency of spatiotemporal data processing.

[0057] Optionally, in the spatiotemporal data storage and query method provided in the embodiments of this application, before obtaining the first spatial range information corresponding to the first spatiotemporal data to be queried, the method further includes: receiving multiple original spatiotemporal data and obtaining spatial feature information of the multiple original spatiotemporal data; aggregating and splicing the multiple original spatiotemporal data according to the spatial feature information to obtain multiple spatiotemporal data blocks; and constructing a target index tree based on the multiple spatiotemporal data blocks.

[0058] In an optional embodiment, raw spatiotemporal data collected from various sources, such as sensors, remote sensing satellites, mobile devices, etc., is received. Spatial features of this data are then extracted, such as the geographic coordinates of each data point, the minimum bounding rectangle (MBR), the spatial centroid, or other geometric properties calculated based on the spatial distribution of the data.

[0059] Based on the extracted spatial feature information, the original spatiotemporal data with geographically adjacent locations are aggregated to form spatiotemporal data blocks. By concatenating geographically adjacent data into the same block, the locality of data access and query efficiency can be significantly improved. Each data block includes multiple original spatiotemporal data, but the data within it is spatially contiguous, which facilitates subsequent index construction and data querying. After aggregation and concatenation, the target index tree is constructed using the spatiotemporal data blocks.

[0060] By aggregating data during the preprocessing stage, small files are concatenated into larger files, reducing the file system's metadata management burden and the number of I / O operations. The constructed index tree further optimizes the data retrieval path, enabling rapid data location during queries without blindly scanning the entire dataset, thus shortening query response time.

[0061] Optionally, in the spatiotemporal data storage and query method provided in this application embodiment, constructing a target index tree based on multiple spatiotemporal data blocks includes: obtaining the minimum enclosing matrix information and storage path information corresponding to each spatiotemporal data block; constructing multiple root nodes based on the minimum enclosing matrix information and storage path information; segmenting each spatiotemporal data block and constructing multiple leaf nodes corresponding to each root node based on the multiple segmented spatiotemporal data; and obtaining the target index tree based on the multiple root nodes and the multiple leaf nodes corresponding to each root node.

[0062] In an optional embodiment, for each spatiotemporal data block, the minimum bounding matrix (MBR) of its spatial extent is first calculated. The MBR is a rectangle that minimizes the bounding space of all data points in the block. Simultaneously, the specific storage path of each spatiotemporal data block in the distributed storage system is recorded for subsequent index construction and data access.

[0063] Based on the MBR information and storage path, a root node of the index tree is constructed for the entire dataset. The root node covers the spatial range of all spatiotemporal data blocks and is the highest level of the index tree, used for initial filtering of the query range and reducing the candidate range. Each spatiotemporal data block is further segmented, i.e., divided into multiple segments according to its spatial range within the spatiotemporal data block. This is done to support finer-grained data queries. Subsequently, based on the spatial range or length information of each segment, multiple leaf nodes are constructed under the corresponding root node. The leaf nodes are directly related to the actual stored data segments and are used to achieve fast location and access.

[0064] Finally, the constructed root nodes and their corresponding leaf nodes are integrated to form a complete target index tree.

[0065] The construction of the target index tree optimizes the data query path. During a query, the MBR information of the root node is first used to quickly narrow down the search scope, identifying data blocks that intersect with or contain the query space. Subsequently, the spatial information and physical storage path of the leaf nodes enable direct location and fine-grained access to the data, avoiding a full dataset scan and significantly improving query speed.

[0066] Optionally, in the spatiotemporal data storage and query method provided in this application embodiment, constructing multiple leaf nodes corresponding to each root node based on multiple segmented spatiotemporal data includes: obtaining the data length and sorting information of each segmented spatiotemporal data; obtaining the offset of each segmented spatiotemporal data based on the data length and sorting information; and constructing multiple leaf nodes based on the offset and data length of each segmented spatiotemporal data.

[0067] In an optional embodiment, for each segment of data within a spatiotemporal data block, two key pieces of information need to be obtained: data length and sorting information. Data length refers to the actual number of bytes in the file for each spatiotemporal data block, which is crucial for calculating the offset. Sorting information refers to the result of sorting the data according to spatial or temporal attributes, ensuring the continuity and order of the data in physical storage.

[0068] The offset is the starting position of each data segment in the storage file, determined by the ending position of the previous segment. Specifically, the offset of each segment is calculated by adding the offset of the previous segment to its length. This calculation method ensures contiguous data storage, facilitating subsequent fast location and access. Based on the calculated offset and data length, a leaf node is constructed for each data segment. The leaf node stores key attributes such as the spatial range, offset, and length of the data segment. The leaf node is directly associated with the physical storage location, enabling precise location of the required data upon receiving a query request.

[0069] In an optional embodiment, a schematic diagram of intra-block segmentation is shown below. Figure 3As shown, the original small files are grouped and aggregated according to their spatial attributes (such as the minimum bounding rectangle of the MBR, center point, centroid, etc.) to form several data blocks. Data blocks reside in the same node of the index tree and are spatially adjacent. Each block corresponds to a physical file (a one-to-one correspondence between blocks and physical files; "block" is a term used for spatial indexing, while "file" is a term used for storage, distinguishing them in different domains and contexts), and compressed using columnar storage formats (such as Parquet or ORC). Blocks are independent of each other, facilitating distributed scheduling and parallel processing. Within each block, it is further divided into multiple data segments based on spatial range. Each segment represents a spatial data set within a certain range. Data within a segment maintains spatial continuity, improving data locality for subsequent computational tasks.

[0070] In an optional embodiment, a schematic diagram of the index structure is shown below. Figure 4 As shown, the root node of the STR-Tree serves as a first-level index for quickly locating block files containing the target spatial region. Within each block, an index structure (i.e., leaf nodes) supporting fast one-dimensional range queries is built to quickly locate specific segment offsets in a one-dimensional linear space. This one-dimensional structure records the starting offset and length of each segment within the block, supporting fine-grained data reading. For example, during initialization, the starting offset of the first segment is set to 0, and its length is its data size. The offsets of subsequent segments are equal to the offset of the previous segment plus its length. In this way, the positional information of each segment can be precisely recorded in the index. During reading, fine-grained reading can be completed by extracting the corresponding byte range from the block file based on the offset and length, without loading the entire block file. Thus, assuming a block contains 5 segments corresponding to spatial ranges A through E, when a user queries spatial ranges B through D, segments 2, 3, and 4 can be quickly found using this one-dimensional structure without traversing all segments, greatly improving query efficiency.

[0071] like Figure 4As shown, spatial and data indexes are used to process spatiotemporal data within a certain spatial range to obtain blocks 1-4. Each data block is then segmented into segments 1-4, 2-4, 3-4, and 4. This application employs a novel method combining STR-Tree and a fast one-dimensional interval query structure to aggregate small original files into large data blocks based on spatial dimensions. Within each block, segments are further divided, achieving efficient fine-grained data access and spatial locality optimization through a two-level index structure. Introducing this index significantly reduces the number of physical files by concatenating small files into large files, thus alleviating the pressure on metadata management in the file system. Furthermore, the unique index design within each block avoids full block scans, allowing for loading of target and data segments, thereby saving disk I / O resources and improving throughput.

[0072] By storing the precise offset and length of segmented data in the leaf nodes, direct location from the query range to the specific data can be achieved, avoiding unnecessary full block scans, greatly reducing disk I / O operations, and making data querying extremely efficient.

[0073] Optionally, in the spatiotemporal data storage and query method provided in this application embodiment, querying the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree includes: determining the offset corresponding to the first spatiotemporal data based on the first spatial range information, determining the leaf nodes of the target index tree based on the offset corresponding to the first spatiotemporal data, and querying the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree and the offset corresponding to the first spatiotemporal data.

[0074] In an optional embodiment, based on the first spatial range information provided by the user, the offset of the first spatiotemporal data within the candidate spatiotemporal data blocks is determined. After obtaining the offset information, leaf nodes can be identified. Based on the offset information and the corresponding leaf nodes in multiple candidate spatiotemporal data blocks, the system jumps to the specified location of the corresponding physical file in the target storage space and reads the data segment that matches the offset and data length. In this way, even when processing a large number of spatiotemporal data blocks, rapid location and access to the target data can be achieved, avoiding the loading and processing of irrelevant data and improving query efficiency.

[0075] By using offset information, the data segment in the physical file can be located directly, eliminating the need to traverse the entire file or data block, significantly reducing the number of disk I / O operations, and enabling fast data access.

[0076] Optionally, in the spatiotemporal data storage and query method provided in the embodiments of this application, after querying the first spatiotemporal data, the method further includes: obtaining second spatial range information corresponding to the second spatiotemporal data to be processed; obtaining index information corresponding to the second spatiotemporal data based on the second spatial range information and the target index tree corresponding to the spatiotemporal data; and sending the index information to the target node, wherein the target node reads the second spatiotemporal data based on the index information and processes the second spatiotemporal data to obtain processed spatiotemporal data.

[0077] In an optional embodiment, when performing a distributed computing task, relevant spatiotemporal data blocks can be automatically selected based on the spatial range required by the task. Specifically, the second spatial range information corresponding to the second spatiotemporal data to be processed is obtained. A list of blocks intersecting with the given space is obtained based on the target index tree. Candidate spatiotemporal data blocks containing the second spatiotemporal data are quickly filtered out. Then, the specific segment is located through the fast one-dimensional index structure within the block (i.e., the leaf nodes mentioned above), thereby obtaining the precise offset and length information of the second spatiotemporal data, i.e., the index information mentioned above. The corresponding index information is then distributed to the computing nodes (i.e., the target nodes mentioned above). The target nodes read the second spatiotemporal data based on the index information without performing a full-range file scan. The read data is directly used for computing tasks, such as data analysis, data fusion, or data visualization, ultimately resulting in the processed spatiotemporal data output.

[0078] By directly locating and retrieving data using index information, full block scans are avoided, significantly reducing the number of I / O operations and thus improving the efficiency of data reading and processing.

[0079] Optionally, in the spatiotemporal data storage and query method provided in the embodiments of this application, the method further includes: detecting whether an operation request for spatiotemporal data corresponding to the target index tree is received, wherein the operation request is one of the following: a deletion operation and a replacement operation; determining the target spatiotemporal data block corresponding to the operation request based on the target index tree; processing the spatiotemporal data in the target spatiotemporal data block according to the operation request to obtain the processed target spatiotemporal data block; and updating the target index tree based on the processed target spatiotemporal data block to obtain the updated target index tree.

[0080] In an optional embodiment, operation requests from users can be continuously monitored. These requests include, but are not limited to, deleting specific spatiotemporal data or replacing old data. Once an operation request is detected, the corresponding processing flow is initiated. Based on the spatiotemporal information contained in the operation request, the target index tree is used to quickly locate the spatiotemporal data block to be operated on. The hierarchical structure of the index tree can quickly filter relevant data blocks according to the requested spatial range, reducing the search scope and improving the location speed. The relevant data in the located target spatiotemporal data block is processed. If it is a deletion operation, the specified data is removed, and the data within the block is reorganized; if it is a replacement operation, the old data is replaced with new data, and the data within the block also needs to be appropriately adjusted. After processing, the processed target spatiotemporal data block is obtained. After data processing, the target index tree is updated to reflect the data changes. For example, information of relevant leaf nodes, such as offset, data length, and MBR, is updated.

[0081] The dynamic update mechanism enables rapid updates to the index tree, maintaining data accuracy and validity. Real-time index tree updates ensure that each query is based on the latest data state, avoiding inaccurate queries caused by data changes.

[0082] Optionally, in the spatiotemporal data storage and query method provided in the embodiments of this application, before obtaining the first spatial range information corresponding to the first spatiotemporal data to be queried, the method further includes: obtaining the storage path information corresponding to each spatiotemporal data block and the offset of the multiple segments of spatiotemporal data corresponding to each spatiotemporal data block; and storing the spatiotemporal data block into the target storage space according to the storage path information and the offset.

[0083] In an optional embodiment, upon receiving a spatiotemporal data stream to be processed, the data is first categorized and aggregated into multiple spatiotemporal data blocks based on its spatial attributes. For each spatiotemporal data block, a unique storage path is assigned, which uniquely identifies the location of each data block, ensuring its locatability. Within each spatiotemporal data block, the data can be further divided into multiple segments according to spatial extent. Then, the starting offset and length of each segmented spatiotemporal data within its respective data block are recorded. Finally, based on the storage path information of each spatiotemporal data block and the offsets of the segmented spatiotemporal data, the spatiotemporal data blocks are actually stored at their respective locations in the target storage space.

[0084] By using ordered storage and fine-grained offset recording within segments, the locality of data access is enhanced, which helps to reduce the number of I / O operations and improve the efficiency of data access and processing.

[0085] In an optional embodiment, a schematic diagram of spatiotemporal data processing is shown below. Figure 5 As shown, the system receives the original small file stream and extracts its spatial features (such as MBR, center, centroid); it divides and aggregates regions according to spatial proximity to generate data blocks; it merges the data in the same block into a single physical file and compresses and stores it; it divides the block into multiple segments according to spatial range and records the offset and length of each segment; it constructs an STR-Tree index to record the MBR range of each block and its storage path; it constructs a one-dimensional interval query index structure within each block and records the position information of each segment; and it persistently stores the index information for subsequent queries.

[0086] In an optional embodiment, a schematic diagram of spatiotemporal data processing is shown below. Figure 6 As shown, the user inputs a spatial range (e.g., a rectangular area); the index tree is used to quickly filter out candidate blocks that may contain the target data, read the index within the block to locate the target segment, and return the data within the segment. For example, the root node (block) and leaf nodes (segments) of a polygon can be directly found using the index tree to obtain the file and offset. Within this segment, the corresponding data can be obtained through linear search; for each candidate block, a one-dimensional index structure is used to locate the specific offset position of the required segment; only the target segment data is read, avoiding a full block scan; the result set is returned, completing the query.

[0087] In an optional embodiment, a schematic diagram of spatiotemporal data processing is shown below. Figure 7 As shown, a user request is detected, containing a specific identifier for the spatiotemporal data to be updated or deleted, such as a data ID, timestamp, or spatial coordinates. The target index tree is used to quickly locate the spatiotemporal data block containing the target data based on the spatial range in the request. Then, a fast one-dimensional interval lookup index within the block is used to further determine the specific location of the target data within the block (i.e., which segment). Once the target spatiotemporal data is located, the operation in the request is executed. If it is a deletion operation, the target data is removed from its segment, and the data within the segment may need to be reorganized to maintain data continuity and index integrity. If it is a replacement operation, the old data is replaced with the new spatiotemporal data. The target index tree is updated to reflect the data changes, including updating information about the affected leaf nodes, such as offsets, data lengths, and MBRs.

[0088] The spatiotemporal data storage and query method provided in this application significantly reduces the number of physical files, metadata burden, and number of file openings by aggregating massive small files into large block files; it also reduces the pressure on metadata management in the file system; it enhances the data locality of computing tasks and improves execution efficiency by spatially segmenting within blocks; and it achieves rapid positioning from spatial range to specific segments by fusing STR-Tree and one-dimensional interval query structures into an index structure.

[0089] The spatiotemporal data storage and query method provided in this application embodiment obtains the first spatial range information corresponding to the first spatiotemporal data to be queried; determines multiple candidate spatiotemporal data blocks based on the first spatial range information and the root node of the target index tree corresponding to the spatiotemporal data; and queries the first spatiotemporal data from the multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree. This solves the technical problem in related technologies where storing massive amounts of spatiotemporal data as separate files results in relatively low efficiency in storing and querying spatiotemporal data.

[0090] In this scheme, the root node of the target index tree is used to perform preliminary data filtering based on the first spatial range information corresponding to the first spatiotemporal data to be queried. By comparing the target index tree with the query range, candidate spatiotemporal data blocks that may contain the query data can be quickly filtered out, avoiding scanning the entire dataset. Based on the preliminary filtering, the leaf node information of the target index tree is further used to query each candidate spatiotemporal data block. Through precise matching with the first spatial range information, data segments overlapping with the query range can be directly located in the candidate spatiotemporal data blocks, thereby achieving fine-grained data access. Through the hierarchical index structure, the spatiotemporal data required by the user can be located in a very short time, avoiding blind scanning of massive amounts of data, thus achieving the technical effect of improving the storage and query efficiency of spatiotemporal data.

[0091] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0092] Example 2

[0093] This application also provides a spatiotemporal data storage and retrieval apparatus. It should be noted that this spatiotemporal data storage and retrieval apparatus can be used to execute the spatiotemporal data storage and retrieval method provided in this application. The spatiotemporal data storage and retrieval apparatus provided in this application will be described below.

[0094] According to embodiments of this application, an apparatus for implementing the above-described method for storing and querying spatiotemporal data is also provided, such as... Figure 8 As shown, the device includes: a first acquisition unit 801, a first determination unit 802, and a first query unit 803.

[0095] The first acquisition unit 801 is used to acquire the first spatial range information corresponding to the first spatiotemporal data to be queried.

[0096] The first determining unit 802 is used to determine multiple candidate spatiotemporal data blocks based on the first spatial range information and the root node of the target index tree corresponding to the spatiotemporal data. The multiple spatiotemporal data blocks corresponding to the spatiotemporal data are stored in the target storage space, and the target index tree is obtained based on the storage information corresponding to the spatiotemporal data.

[0097] The first query unit 803 is used to query the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree.

[0098] The spatiotemporal data storage and query apparatus provided in this application embodiment obtains first spatial range information corresponding to the first spatiotemporal data to be queried through a first acquisition unit 801; a first determination unit 802 determines multiple candidate spatiotemporal data blocks based on the first spatial range information and the root node of the target index tree corresponding to the spatiotemporal data; and a first query unit 803 queries the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree. This solves the technical problem in related technologies where storing massive amounts of spatiotemporal data as separate files results in relatively low processing efficiency of spatiotemporal data.

[0099] In this scheme, the root node of the target index tree is used to perform preliminary data filtering based on the first spatial range information corresponding to the first spatiotemporal data to be queried. By comparing the target index tree with the query range, candidate spatiotemporal data blocks that may contain the query data can be quickly filtered out, avoiding scanning the entire dataset. Based on the preliminary filtering, the leaf node information of the target index tree is further used to query each candidate spatiotemporal data block. Through precise matching with the first spatial range information, data segments overlapping with the query range can be directly located in the candidate spatiotemporal data blocks, thereby achieving fine-grained data access. Through the hierarchical index structure, the spatiotemporal data required by the user can be located in a very short time, avoiding blind scanning of massive amounts of data, thus achieving the technical effect of improving the processing efficiency of spatiotemporal data.

[0100] Optionally, in the spatiotemporal data storage and query apparatus provided in the embodiments of this application, the apparatus further includes: a receiving unit, configured to receive multiple original spatiotemporal data and obtain spatial feature information of the multiple original spatiotemporal data before obtaining the first spatial range information corresponding to the first spatiotemporal data to be queried; an aggregation unit, configured to aggregate and splice the multiple original spatiotemporal data according to the spatial feature information to obtain multiple spatiotemporal data blocks; and a construction unit, configured to construct a target index tree according to the multiple spatiotemporal data blocks.

[0101] Optionally, in the spatiotemporal data storage and query apparatus provided in this application embodiment, the construction unit includes: an acquisition module, used to acquire the minimum enclosing matrix information and storage path information corresponding to each spatiotemporal data block; a construction module, used to construct multiple root nodes based on the minimum enclosing matrix information and storage path information; a segmentation module, used to segment each spatiotemporal data block and construct multiple leaf nodes corresponding to each root node based on the multiple segmented spatiotemporal data; and a first determination module, used to obtain a target index tree based on the multiple root nodes and the multiple leaf nodes corresponding to each root node.

[0102] Optionally, in the spatiotemporal data storage and query device provided in this application embodiment, the segmentation module includes: an acquisition submodule, used to acquire the data length corresponding to each segment of spatiotemporal data and the sorting information of each segment of spatiotemporal data; a determination submodule, used to obtain the offset corresponding to each segment of spatiotemporal data based on the data length and sorting information; and a construction submodule, used to construct multiple leaf nodes based on the offset corresponding to each segment of spatiotemporal data and the data length corresponding to each segment of spatiotemporal data.

[0103] Optionally, in the spatiotemporal data storage and query device provided in the embodiments of this application, the first query unit includes: a second determining module, used to determine the offset corresponding to the first spatiotemporal data based on the first spatial range information, and to determine the leaf node of the target index tree based on the offset corresponding to the first spatiotemporal data; and a query module, used to query the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf node of the target index tree and the offset corresponding to the first spatiotemporal data.

[0104] Optionally, in the spatiotemporal data storage and query apparatus provided in this application embodiment, the apparatus further includes: a second acquisition unit, configured to acquire second spatial range information corresponding to the second spatiotemporal data to be processed after querying the first spatiotemporal data; a second query unit, configured to obtain index information corresponding to the second spatiotemporal data based on the second spatial range information and the target index tree corresponding to the spatiotemporal data; and a sending unit, configured to send the index information to a target node, wherein the target node reads the second spatiotemporal data based on the index information and processes the second spatiotemporal data to obtain processed spatiotemporal data.

[0105] Optionally, in the spatiotemporal data storage and query apparatus provided in this application embodiment, the apparatus further includes: a detection unit, configured to detect whether an operation request for spatiotemporal data corresponding to a target index tree is received, wherein the operation request is one of the following: a deletion operation and a replacement operation; a second determination unit, configured to determine the target spatiotemporal data block corresponding to the operation request based on the target index tree; a processing unit, configured to process the spatiotemporal data in the target spatiotemporal data block according to the operation request to obtain a processed target spatiotemporal data block; and an update unit, configured to update the target index tree based on the processed target spatiotemporal data block to obtain an updated target index tree.

[0106] Optionally, in the spatiotemporal data storage and query apparatus provided in the embodiments of this application, the apparatus further includes: a third acquisition unit, used to acquire storage path information corresponding to each spatiotemporal data block and offset of multiple segments of spatiotemporal data corresponding to each spatiotemporal data block before acquiring the first spatial range information corresponding to the first spatiotemporal data to be queried; and a storage unit, used to store the spatiotemporal data blocks to the target storage space according to the storage path information and the offset.

[0107] It should be noted that the first acquisition unit 801, the first determination unit 802, and the first query unit 803 mentioned above correspond to steps S201 to S203 in Embodiment 1. The three units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above units can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.

[0108] Example 3

[0109] Embodiments of this application may provide an electronic device. Figure 9 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 9 As shown, the electronic device may include: one or more ( Figure 9 Only one of the components is shown: processor 902, memory 904, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module, and display.

[0110] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0111] The processor can invoke information and application programs stored in the memory through the transmission device to perform the following steps: obtain the first spatial range information corresponding to the first spatiotemporal data to be queried; determine multiple candidate spatiotemporal data blocks based on the first spatial range information and the root node of the target index tree corresponding to the spatiotemporal data, wherein the multiple spatiotemporal data blocks corresponding to the spatiotemporal data are stored in the target storage space, and the target index tree is obtained based on the storage information corresponding to the spatiotemporal data; and query the first spatiotemporal data from the multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree.

[0112] The processor can invoke information and applications stored in the memory through the transmission device to perform the following steps: before obtaining the first spatial range information corresponding to the first spatiotemporal data to be queried, the method further includes: receiving multiple raw spatiotemporal data and obtaining spatial feature information of the multiple raw spatiotemporal data; aggregating and splicing the multiple raw spatiotemporal data according to the spatial feature information to obtain multiple spatiotemporal data blocks; and constructing a target index tree based on the multiple spatiotemporal data blocks.

[0113] The processor can invoke information and applications stored in memory through a transmission device to perform the following steps: Constructing a target index tree based on multiple spatiotemporal data blocks includes: obtaining the minimum enclosing matrix information and storage path information corresponding to each spatiotemporal data block; constructing multiple root nodes based on the minimum enclosing matrix information and storage path information; segmenting each spatiotemporal data block and constructing multiple leaf nodes corresponding to each root node based on the multiple segmented spatiotemporal data; and obtaining the target index tree based on the multiple root nodes and the multiple leaf nodes corresponding to each root node.

[0114] The processor can invoke information and applications stored in the memory through the transmission device to perform the following steps: constructing multiple leaf nodes corresponding to each root node based on multiple segmented spatiotemporal data, including: obtaining the data length and sorting information of each segmented spatiotemporal data; obtaining the offset of each segmented spatiotemporal data based on the data length and sorting information; and constructing multiple leaf nodes based on the offset and data length of each segmented spatiotemporal data.

[0115] The processor can invoke information and application programs stored in the memory through the transmission device to perform the following steps: querying the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree, including: determining the offset corresponding to the first spatiotemporal data according to the first spatial range information, determining the leaf node of the target index tree according to the offset corresponding to the first spatiotemporal data; and querying the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree and the offset corresponding to the first spatiotemporal data.

[0116] The processor can invoke information and applications stored in the memory through the transmission device to perform the following steps: After retrieving the first spatiotemporal data, the method further includes: obtaining the second spatial range information corresponding to the second spatiotemporal data to be processed; obtaining the index information corresponding to the second spatiotemporal data based on the second spatial range information and the target index tree corresponding to the spatiotemporal data; and sending the index information to the target node, wherein the target node reads the second spatiotemporal data based on the index information and processes the second spatiotemporal data to obtain the processed spatiotemporal data.

[0117] The processor can invoke information and application programs stored in memory through the transmission device to perform the following steps: detect whether an operation request for spatiotemporal data corresponding to the target index tree has been received, wherein the operation request is one of the following: deletion operation and replacement operation; determine the target spatiotemporal data block corresponding to the operation request based on the target index tree; process the spatiotemporal data in the target spatiotemporal data block according to the operation request to obtain the processed target spatiotemporal data block; update the target index tree based on the processed target spatiotemporal data block to obtain the updated target index tree.

[0118] The processor can access the information and application programs stored in the memory via the transmission device to perform the following steps: obtain the storage path information corresponding to each spatiotemporal data block and the offset of the spatiotemporal data after multiple segments corresponding to each spatiotemporal data block; and store the spatiotemporal data block to the target storage space according to the storage path information and the offset.

[0119] Those skilled in the art will understand that Figure 9The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 9 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 9 Showing more or fewer components (such as network interfaces, display devices, etc.), or having the same Figure 9 The different configurations shown.

[0120] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0121] Example 4

[0122] Embodiments of this application also provide a computer-readable storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the spatiotemporal data storage and retrieval method provided in Embodiment 1.

[0123] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0124] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing methods and steps for storing and retrieving spatiotemporal data.

[0125] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0126] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0127] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0128] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0129] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0130] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0131] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for storing and retrieving spatiotemporal data, characterized in that, include: Obtain the first spatial range information corresponding to the first spatiotemporal data to be queried; Based on the first spatial range information and the root node of the target index tree corresponding to the spatiotemporal data, multiple candidate spatiotemporal data blocks are determined, wherein the multiple spatiotemporal data blocks corresponding to the spatiotemporal data are stored in the target storage space, and the target index tree is obtained based on the storage information corresponding to the spatiotemporal data; Based on the leaf nodes of the target index tree, the first spatiotemporal data is queried from multiple candidate spatiotemporal data blocks in the target storage space; Before obtaining the first spatial range information corresponding to the first spatiotemporal data to be queried, the method further includes: Receive multiple raw spatiotemporal data and acquire spatial feature information of the multiple raw spatiotemporal data; Based on the spatial feature information, the multiple original spatiotemporal data are aggregated and spliced ​​to obtain multiple spatiotemporal data blocks; Obtain the minimum enclosing matrix information and storage path information corresponding to each spatiotemporal data block; Based on the minimum enclosing matrix information and the storage path information, multiple root nodes are constructed; Each spatiotemporal data block is segmented, and multiple leaf nodes corresponding to each root node are constructed based on the spatiotemporal data after multiple segments. The target index tree is obtained based on the multiple root nodes and the multiple leaf nodes corresponding to each root node.

2. The method according to claim 1, characterized in that, Based on the spatiotemporal data after multiple segments, multiple leaf nodes corresponding to each root node are constructed, including: Obtain the data length and sorting information of the spatiotemporal data after each segment; Based on the data length and the sorting information, the offset corresponding to each segment of spatiotemporal data is obtained; Based on the offset and data length of the spatiotemporal data after each segment, the multiple leaf nodes are constructed.

3. The method according to claim 1, characterized in that, Based on the leaf nodes of the target index tree, retrieving the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space includes: Based on the first spatial range information, the offset corresponding to the first spatiotemporal data is determined, and the leaf node of the target index tree is determined based on the offset corresponding to the first spatiotemporal data. Based on the leaf nodes of the target index tree and the offsets corresponding to the first spatiotemporal data, the first spatiotemporal data is queried from multiple candidate spatiotemporal data blocks in the target storage space.

4. The method according to claim 1, characterized in that, After retrieving the first spatiotemporal data, the method further includes: Obtain the second spatial range information corresponding to the second spatiotemporal data to be processed; Based on the target index tree corresponding to the second spatial range information and the spatiotemporal data, the index information corresponding to the second spatiotemporal data is obtained; The index information is sent to the target node, whereby the target node reads the second spatiotemporal data based on the index information and processes the second spatiotemporal data to obtain processed spatiotemporal data.

5. The method according to claim 1, characterized in that, The method further includes: Detect whether an operation request for the spatiotemporal data corresponding to the target index tree has been received, wherein the operation request is one of the following: deletion operation and replacement operation; Based on the target index tree, determine the target spatiotemporal data block corresponding to the operation request; Based on the operation request, the spatiotemporal data in the target spatiotemporal data block is processed to obtain the processed target spatiotemporal data block; The target index tree is updated based on the processed target spatiotemporal data block to obtain the updated target index tree.

6. The method according to claim 2, characterized in that, Before obtaining the first spatial range information corresponding to the first spatiotemporal data to be queried, the method further includes: Obtain the storage path information corresponding to each spatiotemporal data block and the offset of the spatiotemporal data after multiple segments corresponding to each spatiotemporal data block; The spatiotemporal data block is stored in the target storage space based on the storage path information and the offset.

7. A device for storing and retrieving spatiotemporal data, characterized in that, include: The first acquisition unit is used to acquire the first spatial range information corresponding to the first spatiotemporal data to be queried. The first determining unit is used to determine multiple candidate spatiotemporal data blocks based on the first spatial range information and the root node of the target index tree corresponding to the spatiotemporal data, wherein the multiple spatiotemporal data blocks corresponding to the spatiotemporal data are stored in the target storage space, and the target index tree is obtained based on the storage information corresponding to the spatiotemporal data. The first query unit is used to query the first spatiotemporal data from multiple candidate spatiotemporal data blocks in the target storage space based on the leaf nodes of the target index tree; The device is further configured to: receive multiple raw spatiotemporal data and acquire spatial feature information of the multiple raw spatiotemporal data; aggregate and splice the multiple raw spatiotemporal data according to the spatial feature information to obtain multiple spatiotemporal data blocks; acquire minimum enclosing matrix information and storage path information corresponding to each spatiotemporal data block; construct multiple root nodes according to the minimum enclosing matrix information and the storage path information; segment each spatiotemporal data block and construct multiple leaf nodes corresponding to each root node according to the multiple segmented spatiotemporal data; and obtain the target index tree according to the multiple root nodes and the multiple leaf nodes corresponding to each root node.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device containing the computer-readable storage medium to perform the spatiotemporal data storage and retrieval method according to any one of claims 1 to 6.

9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, executes the method for storing and retrieving spatiotemporal data according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Spatio-temporal data index building and searching methods, a spatio-temporal data index building and searching device and spatio-temporal data index building and searching equipment

    CN104750708A

  • Information processing method and computer readable storage medium

    CN110347925A