A method, apparatus, device and storage medium for spatiotemporal query
By constructing a spatiotemporal index set in an existing time-series database and using the indexing method of the time-series model for spatiotemporal queries, the problem that open-source time-series databases cannot efficiently support spatiotemporal queries is solved, achieving low-cost and high-efficiency spatiotemporal query results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2026-03-31
AI Technical Summary
Existing open-source time-series databases cannot efficiently support spatiotemporal queries, cannot meet users' query needs within a specified space and time range, and developing spatiotemporal indexes independently is costly.
By reusing the time series model of the existing time series database, a spatiotemporal index set is constructed, and spatiotemporal queries are performed using the indexing method of the time series model, including obtaining query conditions, constructing the spatiotemporal index set, and obtaining the identifier of the target device from the spatiotemporal index set. Dimensionality reduction and compression techniques are used to optimize data storage.
It enables low-cost and efficient spatiotemporal queries, meets users' spatiotemporal query needs, reduces development costs, and improves query accuracy and efficiency.
Smart Images

Figure CN115510339B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a method, apparatus, device and storage medium for spatiotemporal query. Background Technology
[0002] As a product of the new generation of information technology, the Internet of Things (IoT) is conducive to promoting the transformation of production, daily life, and social management towards intelligence, precision, and networking. With the development of IoT technology, the amount of time-series data is growing explosively, and traditional databases cannot meet the storage and retrieval needs of large amounts of time-series data.
[0003] Time-series databases are specifically designed for storing and querying time-series data. In the positioning field, spatiotemporal querying is a key performance indicator (TPI) for time-series databases. Spatiotemporal querying refers to retrieving time-series data that meets specific spatial and temporal constraints. It is commonly used in high-frequency global positioning system (GPS) data query scenarios and is currently a type of query that users are paying close attention to. However, currently available open-source time-series databases do not possess spatiotemporal query functionality, nor are there efficient spatiotemporal query solutions that can meet users' spatiotemporal query needs. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for spatiotemporal querying, which can efficiently query time-series data under fixed space and time, and meet users' spatiotemporal querying needs.
[0005] In a first aspect, this application provides a spatiotemporal query method, which includes: obtaining query conditions; the query conditions include a query area identifier and a first query time period; obtaining an identifier of a target device from a spatiotemporal index set according to the query conditions; wherein the spatiotemporal index set includes at least one spatiotemporal index; the spatiotemporal index includes: an area identifier, first time information, and a first device identifier, the first device identifier being used to indicate a device in the area indicated by the area identifier at the time indicated by the first time information; the spatiotemporal index set is stored in a time-series database and reused according to the fields indicated by the time-series model of the time-series database, and the target device is a device in the query area within the first query time period.
[0006] In one possible implementation, the time series model includes a device identifier field, a time field, and a device metric field. The device identifier field stores a second device identifier, the time field stores second time information, and the device metric field stores the metric value of the device indicated by the second device identifier at the time point indicated by the second time information. The spatiotemporal index set is reused according to the fields indicated by the time series model of the time series database, which means that the region identifier is located in the device identifier field, the first time information is located in the time field, and the first device identifier is located in the device metric field.
[0007] In another possible implementation, before retrieving the identifier of the target device from the spatiotemporal index set based on the query conditions, the method further includes: constructing a spatiotemporal index set based on the time-series data in the time-series database; wherein the time-series data is stored using a time-series model.
[0008] In another possible implementation, the device measurement values include latitude and longitude data; based on the time series data in the time series database, a spatiotemporal index set is constructed, including: obtaining latitude and longitude data from the time series data; reducing the dimensionality of the latitude and longitude data to obtain the region identifier; and constructing a spatiotemporal index set based on the region identifier.
[0009] Another possible implementation involves reducing the dimensionality of latitude and longitude data to obtain a region identifier, including using a space-filling curve to reduce the dimensionality of latitude and longitude data to obtain a string, which serves as the region identifier.
[0010] In another possible implementation, the spatiotemporal index set includes one or more spatiotemporal index files, each corresponding to a time slice. Based on the query conditions, the identifier of the target device is obtained from the spatiotemporal index set, including: obtaining a subset of spatiotemporal indexes from the spatiotemporal index set based on a first query time period; wherein the subset of spatiotemporal indexes includes one or more spatiotemporal index files whose time slices satisfy the first query time period; obtaining a target spatiotemporal index file containing the identifier of the region to be queried from the subset of spatiotemporal indexes based on the identifier of the region to be queried; and obtaining the identifier of the target device from the target spatiotemporal index file based on the query conditions.
[0011] In another possible implementation, the time series model also includes an index of time series indexes, which records the positions of time series indexes in order of region identifiers; the time series index records the position and time statistics of a data block index for a region identifier; the data block index records the position of a data block; and, based on the query conditions, the identifier of the target device is obtained from the target spatiotemporal index file, including: querying the target time series index from the index of time series indexes based on the region identifier to be queried; wherein the target time series index contains the region identifier to be queried; determining the target data block index based on the time statistics of the target time series index and the first query time period; the time statistics of the target data block index include the first query time period; querying the target data block based on the target data block index; and filtering the identifiers of target devices that meet the first query time period from the target data blocks.
[0012] In another possible implementation, the first-time information and / or the first device identifier is data compressed using a cursor algorithm or a block compression algorithm.
[0013] In another possible implementation, the above method further includes: querying the time series data of the target device from the time series database based on the identifier of the target device and the second time period to be queried.
[0014] The spatiotemporal query method provided in this application obtains the target device identifier from a spatiotemporal index set built using the time-series model of a reused time-series database by acquiring query conditions, thereby satisfying the user's spatiotemporal query needs and filling the gap in current open-source time-series databases that cannot support spatiotemporal queries. Moreover, the spatiotemporal index set constructed in this solution reuses the time-series model of existing time-series databases, resulting in lower development costs and meeting the usage requirements in various scenarios.
[0015] Secondly, this application provides a spatiotemporal query device, which includes an acquisition module. The acquisition module is used to acquire query conditions; the query conditions include a query area identifier and a first query time period; the acquisition module is also used to acquire an identifier of a target device from a spatiotemporal index set according to the query conditions; wherein, the spatiotemporal index set includes at least one spatiotemporal index; the spatiotemporal index includes: an area identifier, first time information, and a first device identifier, the first device identifier being used to indicate a device in the area indicated by the area identifier at the time indicated by the first time information; the spatiotemporal index set is stored in a time-series database and reused according to the fields indicated by the time-series model of the time-series database, and the target device is a device in the query area within the first query time period.
[0016] In one possible implementation, the time series model includes a device identifier field, a time field, and a device metric field. The device identifier field stores a second device identifier, the time field stores second time information, and the device metric field stores the metric value of the device indicated by the second device identifier at the time point indicated by the second time information. The spatiotemporal index set is reused according to the fields indicated by the time series model of the time series database, which means that the region identifier is located in the device identifier field, the first time information is located in the time field, and the first device identifier is located in the device metric field.
[0017] In another possible implementation, the above apparatus further includes a construction module. The construction module is used to construct a spatiotemporal index set based on time-series data in the time-series database; wherein the time-series data is stored using a time-series model.
[0018] In another possible implementation, the device metric includes latitude and longitude data; the construction module is specifically used to obtain latitude and longitude data from time series data; reduce the dimensionality of the latitude and longitude data to obtain the region identifier; and construct a spatiotemporal index set based on the region identifier.
[0019] In another possible implementation, the above device further includes a processing module. Specifically, the processing module is used to reduce the dimensionality of the latitude and longitude data to obtain a string, which serves as a region identifier, by employing a space-filling curve.
[0020] In another possible implementation, the spatiotemporal index set includes one or more spatiotemporal index files, each spatiotemporal index file corresponding to a time slice; the acquisition module is specifically used to: acquire a subset of spatiotemporal indexes from the spatiotemporal index set according to a first query time period; wherein, the subset of spatiotemporal indexes includes one or more spatiotemporal index files whose time slices satisfy the first query time period; acquire a target spatiotemporal index file including the query region identifier from the subset of spatiotemporal indexes according to the query region identifier; and acquire the identifier of the target device from the target spatiotemporal index file according to the query conditions.
[0021] In another possible implementation, the time series model also includes an index of time series indexes, which records the positions of time series indexes in order of region identifiers; the time series index records the position and time statistics of a data block index for a region identifier; the data block index records the position of a data block; the acquisition module is specifically used to: query the target time series index from the index of time series indexes based on the region identifier to be queried; wherein the target time series index contains the region identifier to be queried; determine the target data block index based on the time statistics of the target time series index and the first time period to be queried; the time statistics of the target data block index includes the first time period to be queried; query the target data block based on the target data block index; and filter the identifiers of target devices that meet the first time period to be queried from the target data block.
[0022] In another possible implementation, the first-time information and / or the first device identifier is data compressed using a cursor algorithm or a block compression algorithm.
[0023] In another possible implementation, the acquisition module is also used to query the time series data of the target device from the time series database based on the identifier of the target device and the second time period to be queried.
[0024] Thirdly, this application provides an electronic device comprising: a processor and a memory; the memory storing processor-executable instructions; when the processor is configured to execute the instructions, causing the electronic device to implement the method of the first aspect described above.
[0025] Fourthly, this application provides a computer-readable storage medium comprising: computer software instructions; which, when executed in an electronic device, cause the electronic device to implement the method described in the first aspect.
[0026] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform the steps of the relevant method described in the first aspect above, so as to implement the method of the first aspect above.
[0027] The beneficial effects of the second to fifth aspects mentioned above can be referred to the corresponding description of the first aspect, and will not be repeated here. Attached Figure Description
[0028] Figure 1 A schematic diagram of the structure of a timing model provided in this application;
[0029] Figure 2 A schematic diagram of the structure of a data block provided in this application;
[0030] Figure 3 A schematic diagram of the structure of a time-series index area provided in this application;
[0031] Figure 4 A flowchart illustrating a spatiotemporal query method provided in this application;
[0032] Figure 5 A flowchart illustrating another spatiotemporal query method provided in this application;
[0033] Figure 6 A schematic diagram of a z-ordering curve provided in this application;
[0034] Figure 7 A schematic diagram of a region identifier provided for this application;
[0035] Figure 8 A schematic diagram illustrating the process of another spatiotemporal query method provided in this application;
[0036] Figure 9 A schematic diagram of the composition of a spatiotemporal query device provided in this application;
[0037] Figure 10 This is a schematic diagram of the composition of an electronic device provided in this application. Detailed Implementation
[0038] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0039] It should be noted that in the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0040] To facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art can understand that the terms "first" and "second" are not intended to limit the quantity or execution order.
[0041] To facilitate understanding of the solutions in this application, the technical terms used in this application are explained herein.
[0042] 1. IoT: Internet of Things. This refers to a vast network formed by combining various information sensing devices, such as RFID devices, infrared sensors, GPS, and laser scanners, with the internet. Its purpose is to connect all objects to the network for easy identification and management.
[0043] 2. Tag: A tag consists of a tag key and a corresponding tag value. For example, "City (TagKey) = Hangzhou (TagValue)" is a tag.
[0044] 3. Tag set: A collection of multiple tags.
[0045] 4. Measurement value: A value that changes over time.
[0046] 5. Space-filling curve: A function curve in which a one-dimensional curve encompasses the entire two-dimensional or even multi-dimensional space. Depending on the arrangement rules, there are different types of space-filling curves.
[0047] As described in the background section, time-series data is abundant in IoT scenarios. In the field of positioning, devices such as vehicles have built-in sensors that can report their location information at regular intervals (e.g., every 10 seconds). Examples of this reported location information are shown in Table 1.
[0048] Table 1
[0049]
[0050] In Table 1, license plate number, vehicle color, and brand are three labels. These three labels form a label set, which can be used to describe the static attributes of a device; that is, the label set can serve as a unique identifier for the device. Longitude and latitude are values that change with the reporting time and are measures in time-series data.
[0051] Therefore, time-series databases primarily store two-dimensional measurement data such as latitude and longitude. In this scenario, the following requirement exists: users need to search for vehicle travel records within a specified spatial range (e.g., 1 km × 1 km) and a defined time range, i.e., a spatiotemporal query requirement. However, existing open-source time-series databases do not possess efficient spatiotemporal query capabilities. Furthermore, the industry standard YDT 3772-2020 for time-series databases uses spatiotemporal query as an indicator of a time-series database's capabilities, and spatiotemporal query is a query type that users are particularly interested in.
[0052] Among related technologies, a method for developing spatiotemporal indexes that is completely independent of existing databases is provided, but the development cost is relatively high.
[0053] In conclusion, how to achieve low-cost and efficient spatiotemporal queries is an urgent problem to be solved.
[0054] Based on this, this application provides a spatiotemporal query method. This method reuses the time series model of an existing time series database and performs spatiotemporal queries based on the indexing method of the time series model, so as to achieve low-cost and efficient spatiotemporal queries and meet the user's needs.
[0055] To facilitate the description of this solution, the time series model of the time series database is introduced here. The time series model is the format for storing time series data in disks or persistent media. Currently, time series databases usually adopt the following time series model grouped by identity document (ID). Here, ID is the serialized value of the tag set. For example, in Table 1 above, the tag set "license plate number = Zhe AXXXX, vehicle color = red, brand = BaoMa" can indicate a unique device. Serializing this tag set generates a number, such as getting the number 1 as the ID of this device. Other devices can be implemented in the way of ID auto-increment.
[0056] Figure 1 This is a schematic structural diagram of a time series model provided by an embodiment of this application. Table 2 describes each part of the Figure 1 shown time series model.
[0057] Table 2
[0058]
[0059] Combined with Table 2, Figure 1 the shown time series model is described. The two most important parts of the time series model are the time series data area and the time series index area. Among them, the time series data area includes multiple data blocks, and each data block represents multiple time lines generated by a device. In Figure 1 there are two data block IDs 1, which means that each data block stores the time series data generated by the device with ID 1 in two different time periods. The time series index area is used to index the time series data in the time series data area, including data block index, time series index, and index of the time series index. In addition, the descriptions of the time series file header, Bloom filter, and time series file tail are shown in Table 2 and will not be repeated here.
[0060] Next, Figure 2 the time series data area in the time series model is described in detail. As Figure 2 shown, a data block includes a chunk header (chunkHeader) and chunk data (chunkData). The chunk header records the size (chunkSize) of the data block and the number of pages (numOfPages). The chunk data includes multiple pages, and each page includes a page header (PageHeader) and page data (PageData).
[0061] Among them, the page data stores a list of times (List <timestamp>This involves both time and field values. For example, a time list = [10, 20, 30…100], field value 1 = [116.389550, 116.389550, 116.389550…116.389550], and field value 2 = [39.928167, 39.928167, 39.928167…39.928167], which represents the latitude and longitude data of the device with ID 1 over a period of time. Typically, time and field values with the same ID tend to have relatively small changes between adjacent values over a period of time. For example, time, every 10 seconds, can be encoded using the RLE cursor algorithm, for example, marked as (start time, increment, quantity), and the data could be encoded as (10, 10, 9). For field values, XOR-based Gorilla encoding can be used to save storage space and improve read / write performance by reducing I / O.
[0062] The header includes a list of statistics. <statistics>This section records statistical values for a specific ID metric and a time list, such as the maximum and minimum values of the time list, and the average, maximum, and minimum values of the metric. These statistical values for the time list are helpful for indexing based on time during queries.
[0063] The following is combined with Figure 3 Table 3 provides a detailed explanation of the timing index area in the timing model. Table 3 describes each part of the timing index area.
[0064] Table 3
[0065]
[0066]
[0067] As shown in Table 3, each data block index records the location of a data block and its statistical values, such as the average value of a metric, the maximum and minimum values over time. There is a one-to-one correspondence between the data block index and the data block. For example... Figure 3 If two data block indices ID1 are shown, then there are two data blocks with ID1. Time series indexes are recorded in the time series file, containing metadata (e.g., time statistics) for all data block indices with a given ID. Figure 3 In the middle, time series index 1 corresponds to two data block indexes with ID 1. The index records for time series indexes are stored in the time series file, and the position information of all time series indexes is sorted alphabetically by ID. Figure 3 The index of the time series index corresponds to all time series indexes.
[0068] A time-series database contains multiple time-series files, each storing time-series data according to a time-series model. Due to the large volume of time-series data, it is stored across different time-series files based on time and statistical values. On the disk storage of the time-series model, time-series files are partitioned based on time shards (e.g., by week) and ID hashes to determine which IDs and time periods each file contains. As mentioned earlier, the time statistics of data blocks are stored in the time-series index of the time-series files for convenient time-based indexing during queries.
[0069] Based on the above introduction to the time series model, the following provides a detailed explanation of the process of querying data from a time series database using an index. Using the query `Select * From tableName where ID = 1 And TimeStamp > 10 And TimeStamp < 20` (meaning to search the time series database for all data with ID 1 between times 10 and 20), we can illustrate how to find the relevant data blocks based on the time series model index to retrieve the data. The process is divided into the following steps:
[0070] 1. Use binary search to find the index of the time series index and locate the position of the time series index of ID1.
[0071] As mentioned earlier, the index of the time series contains all the location information of all time series in a sequential manner. Therefore, a binary search can be used to quickly locate the position of the time series index of ID1.
[0072] 2. Locate the time series index and select the data block index that matches the time range.
[0073] The time series index records the time statistics of all data block indexes with a given ID. Therefore, data block indexes that meet the time statistics criteria can be filtered according to a time limit of 10-20.
[0074] 3. Locate the data block based on the data block index and retrieve the data from the data block.
[0075] As mentioned earlier, there is a one-to-one correspondence between the data block index and the data block, and the data block index records the location information of the data block. Therefore, determining the data block index allows you to find the corresponding data block. Then, the target data is filtered from the data block based on the time constraint of 10-20. For example, data block ID1 stores the measurement data of device ID1 within the time range of 10-100. After finding data block ID1, the data within it is further filtered to obtain the measurement data of device ID1 within the time range of 10-20, thus completing the query operation.
[0076] Based on the above description, it can be seen that current time-series databases can only meet the need to query metric data based on device identifier and time. For example, querying the movement route (changes in latitude and longitude) of a vehicle over a period of time. In some scenarios, such as when a traffic accident occurs in a certain area, relevant personnel need to query which vehicles passed through that area within a certain time period, i.e., the need for spatiotemporal queries. However, current time-series databases cannot support spatiotemporal query requirements. Therefore, the following describes a spatiotemporal query method provided by an embodiment of this application.
[0077] Figure 4 This is a flowchart illustrating a spatiotemporal query method provided in an embodiment of this application. Figure 4 As shown, the spatiotemporal query method provided in this application may specifically include the following steps:
[0078] S401, The spatiotemporal query device obtains query conditions.
[0079] The query criteria include the identifier of the region to be queried and the first time period to be queried.
[0080] As mentioned earlier, spatiotemporal querying involves retrieving device information within a specific spatial range and time period. Therefore, in some embodiments, when a user needs to perform a spatiotemporal query, the spatiotemporal query device can receive query conditions input by the user. These query conditions include an identifier of the area to be queried and a first time period to be queried. This input can be done by the user directly entering the information on the spatiotemporal query device, or by the user sending a request to the spatiotemporal query device through a user-side device (e.g., a mobile terminal, computer, etc.) so that the spatiotemporal query device can obtain the query conditions from the request. This application embodiment does not limit the specific input method.
[0081] S402. The spatiotemporal query device obtains the identifier of the target device from the spatiotemporal index set according to the query conditions.
[0082] The spatiotemporal index set includes at least one spatiotemporal index; the spatiotemporal index includes: a region identifier, first time information, and a first device identifier, wherein the first device identifier indicates a device in the region indicated by the region identifier at the time indicated by the first time information; the spatiotemporal index set is stored in a time-series database and reused according to the fields indicated by the time-series model of the time-series database. The target device is a device in the query region within the first query time period.
[0083] In some embodiments, after obtaining the query conditions, the spatiotemporal query device can retrieve the identifiers of devices within the query area, i.e., the target devices, from a pre-established spatiotemporal index set according to the query conditions to complete the spatiotemporal query. This spatiotemporal index set is stored in a time-series database, reusing the time-series model of the time-series database. The specific steps for constructing the spatiotemporal index are described in S501 below, and the specific steps for obtaining the identifiers of the target devices from the spatiotemporal index set are described in S502-S503 below, and will not be elaborated upon here.
[0084] The technical solutions provided by the above embodiments offer at least the following beneficial effects: The spatiotemporal query method provided in this application, by obtaining query conditions, retrieves the identifier of the target device from the spatiotemporal index set built from the time series model of a reused time series database, thereby satisfying the user's spatiotemporal query needs and filling the gap that currently open-source time series databases cannot support spatiotemporal queries. Moreover, the spatiotemporal index set constructed by this solution reuses the time series model of an existing time series database, resulting in lower development costs and meeting the usage needs in various scenarios.
[0085] The spatiotemporal query method provided in this application will be described in detail below with reference to specific embodiments. This method can be applied to a spatiotemporal query device. The spatiotemporal query method may include two processes: a "spatiotemporal index set construction process" and a "spatiotemporal query process." The "spatiotemporal index set construction process" can be completed before the "spatiotemporal query process."
[0086] like Figure 5 As shown, the "Spatiotemporal Index Set Construction Process" may include the following S501. The "Spatiotemporal Query Process" may include the following S502-S504.
[0087] S501, the spatiotemporal query device constructs a spatiotemporal index set based on the time series data in the time series database.
[0088] The time-series data is stored using a time-series model.
[0089] This solution constructs a spatiotemporal index based on existing time-series data. Both the spatiotemporal index and the original time-series data are stored in a time-series database. For ease of distinction, in this embodiment, the time-series file storing the time-series data is called a time-series data file, and a collection of multiple time-series data files is called a time-series data set. The time-series file storing the spatiotemporal index is called a spatiotemporal index file, and a collection of multiple spatiotemporal index files is called a spatiotemporal index set. Therefore, in some embodiments, the spatiotemporal query device can obtain time-series data from the time-series database to construct a spatiotemporal index set based on the time-series data. Specifically, time-series data is obtained from the time-series data set in the time-series database.
[0090] The spatiotemporal index set includes at least one spatiotemporal index; the spatiotemporal index includes: a region identifier, first time information, and a first device identifier, the first device identifier being used to indicate a device in the region indicated by the region identifier at the time indicated by the first time information; the spatiotemporal index set is stored in the time series database and reused according to the fields indicated by the time series model of the time series database.
[0091] The time series model includes a device identifier field, a time field, and a device metric field. For the original time series data, the device identifier field is used to store the second device identifier, the time field is used to store the second time information, and the device metric field is used to store the metric value of the device indicated by the second device identifier at the time point indicated by the second time information.
[0092] For spatiotemporal indexes, the region identifier is located in the device identifier field, the first time information is located in the time field, and the first device identifier is located in the device metric field.
[0093] The specific steps for constructing the spatiotemporal index set include the following S501a-S501c.
[0094] S501a, the spatiotemporal query device obtains latitude and longitude data from the time series data.
[0095] Implementing spatiotemporal queries requires spatial data as an index condition. The latitude and longitude data included in the device measurement values of time-series data constitutes spatial data. Therefore, in some embodiments, the spatiotemporal query device can obtain latitude and longitude data from the measurement value field of the time-series data.
[0096] Latitude and longitude data are high-dimensional data, which are difficult to index directly. Therefore, this embodiment of the application reduces the dimensionality of the high-dimensional data to generate one-dimensional data that can be easily indexed, i.e., by executing the following S501b.
[0097] The S501b spatiotemporal query device reduces the dimensionality of latitude and longitude data to obtain regional identifiers.
[0098] In some embodiments, after obtaining latitude and longitude data, the spatiotemporal query device can reduce the dimensionality of the latitude and longitude data to obtain the region identifier.
[0099] Specifically, in this embodiment, the spatiotemporal query device can use a space-filling curve to reduce the dimensionality of latitude and longitude data into a string, which serves as a region identifier. The space-filling curve is an important approximate representation method, dividing space into grids of equal size and encoding the grids according to certain rules. There are many types of space-filling curves, commonly including z-ordering curves and Hilbert curves. For example, this embodiment uses a z-ordering curve for illustration, but this does not constitute a limitation. Figure 6 This provides a schematic diagram of a z-sorting curve. Using a z-sorting curve, latitude and longitude data can be converted into a one-dimensional string, such as... Figure 7 As shown, each string (e.g., WX4ER, WX4G2) represents a geographically defined area. The longer the string, the more precise the area identified. A 5-bit code can represent a rectangular area of 10 square kilometers, while a 6-bit code can represent a rectangular area of approximately 0.34 square kilometers. For details on how the dimensionality reduction is used to obtain the area identifier, please refer to the relevant technical documentation on the Geohash algorithm; it will not be elaborated upon here.
[0100] The S501c spatiotemporal query device constructs a spatiotemporal index set based on the regional identifier.
[0101] In some embodiments, after obtaining the region identifier, the spatiotemporal query device can construct a spatiotemporal index set based on the region identifier.
[0102] As mentioned earlier, the spatiotemporal index set is reused according to the fields indicated by the time series model. Specifically, the spatiotemporal query device stores the region identifier in the original device identifier field of the time series model, stores the first device identifier in the original device metric value field of the time series model, and stores the first time information in the time field. Simply put, the dimensionality of the metric values in the original time series data is reduced, and the fields are swapped with the device identifier for storage.
[0103] It should be noted that, to reduce data storage space and improve read / write performance, data can be compressed before storage. In the spatiotemporal index set, the first time information and / or the first device identifier are data compressed using a cursor algorithm or a block compression algorithm.
[0104] For example, Table 4 provides a logical structure for a partial spatiotemporal index.
[0105] Table 4
[0106]
[0107] As shown in Table 4, in area WX4ER, devices 1, 2, and 3 always move or remain in this area within the time range of 10-100. In area WX4G, devices 2, 4, 5, and 6 always move or remain in this area within the time range of 10-100.
[0108] It is understandable that the spatiotemporal index shown in Table 4 has a characteristic similar to cyclic segments in its metric field and time field. Therefore, the data in these two fields can be compressed (e.g., using run-length encoding). In the worst case, where the metric field has no duplicates, a general block compression algorithm (e.g., snappy compression) can still be used for compression, effectively saving storage space for the spatiotemporal index.
[0109] It should be noted that the spatiotemporal index data shown in Table 4 is stored in the time series data area of the time series model, just like the time series data. Due to the inherent characteristics of the time series model, after the spatiotemporal index is stored in the time series data area, the time series index area automatically establishes the relevant modules (such as the aforementioned data block index and time series index) to facilitate spatiotemporal queries using the original indexing method of the time series model.
[0110] Furthermore, due to the large volume of data in the spatiotemporal index, it is stored in multiple spatiotemporal index files. The spatiotemporal index can be stored using the same time sharding and statistical values as the original time-series model. Time sharding (e.g., by week) and hash partitioning by region identifiers determine which time periods and regions are included in a spatiotemporal index file. Statistical values are calculated to determine the maximum and minimum times of data blocks within the spatiotemporal index file and stored in the time-series index of the spatiotemporal index file for convenient subsequent index queries. All spatiotemporal index files storing spatiotemporal indexes constitute the spatiotemporal index set.
[0111] See also Figure 5 As shown below, the "spatiotemporal query process" will be described in conjunction with specific embodiments. The "spatiotemporal query process" may include the following S502-S504.
[0112] S502, The spatiotemporal query device obtains the query conditions.
[0113] The query criteria include the identifier of the region to be queried and the first time period to be queried.
[0114] For a detailed description of this step, please refer to the description of S401 above, which will not be repeated here.
[0115] For example, in the aforementioned scenario, the spatiotemporal query device obtains the user's query conditions, the query area is WX4ER, and the query time is 10-150.
[0116] S503. The spatiotemporal query device obtains the identifier of the target device from the spatiotemporal index set according to the query conditions.
[0117] The target device is the device within the query area during the first query time period; the spatiotemporal index set is stored in the time series database, reusing the time series model of the time series database.
[0118] In some embodiments, the spatiotemporal query device can obtain the identifier of the target device from the spatiotemporal index set based on the obtained query conditions. The specific acquisition steps are as follows: Figure 5 As shown, it includes the following S503a-S503c.
[0119] S503a, The spatiotemporal query device obtains a subset of spatiotemporal indexes from the spatiotemporal index set according to the first time period to be queried.
[0120] The spatiotemporal index subset consists of one or more spatiotemporal index files whose time shards satisfy the first query time period.
[0121] Because the spatiotemporal index files store data in time slices, in some embodiments, the spatiotemporal query device retrieves a subset of spatiotemporal indexes from the spatiotemporal index set whose time slices satisfy the first query time period. The number of spatiotemporal index files included in the subset varies depending on the first query time period. This query step can be referred to as the first-level time index.
[0122] Based on the examples in the above embodiments, if the time slices (time statistics in the time series index) of the spatiotemporal index file 1 and the spatiotemporal index file 2 contain the time to be queried 10-150, then the spatiotemporal index file 1 and the spatiotemporal index file 2 are the spatiotemporal index subsets obtained by the query.
[0123] S503b: The spatiotemporal query device obtains the target spatiotemporal index file, which includes the identifier of the region to be queried, from the spatiotemporal index subset based on the identifier of the region to be queried.
[0124] As mentioned earlier, the spatiotemporal index file is also divided according to the hash partition of the region identifier. Therefore, in some embodiments, after obtaining a subset of the spatiotemporal index, the spatiotemporal query device can further filter from the subset of the spatiotemporal index based on the region identifier to be queried, in order to obtain the target spatiotemporal index file that includes the region identifier to be queried. Specifically, the spatiotemporal query device can filter out the target spatiotemporal index file that includes the region identifier to be queried through hash positioning and a Bloom filter of the time series model. This query step can be referred to as the first-level spatial index.
[0125] It should be noted that, depending on the actual query conditions, the target spatiotemporal index file may be one or more spatiotemporal index files. This application embodiment does not impose a specific limit on the number of files in the target spatiotemporal index file.
[0126] For example, in conjunction with the above embodiments, if the spatiotemporal index file 1 stores the identifier WX4ER of the region to be queried, the spatiotemporal query device obtains the spatiotemporal index file 1 as the target spatiotemporal index file.
[0127] S503c, the spatiotemporal query device obtains the identifier of the target device from the target spatiotemporal index file according to the query conditions.
[0128] In some embodiments, the spatiotemporal query device can obtain the identifier of the target device from the target spatiotemporal index file according to the query conditions and the indexing method of the time series model. The specific index acquisition method includes the following steps:
[0129] 1. The spatiotemporal query device queries the target time series index from the index of the time series index based on the identifier of the region to be queried.
[0130] The target time series index contains the identifier of the region to be queried.
[0131] In the spatiotemporal index file, the time series index stores the location information of all time series in sequential order. Therefore, a binary search can be used to quickly locate the position of the time series index of the region to be queried. This step of the query can be called the second-level spatial index.
[0132] 2. The spatiotemporal query device determines the target data block index based on the time statistics of the target time series index and the first time period to be queried, and then determines the target data block.
[0133] The time statistics of the target data block index include the first time period to be queried.
[0134] In the spatiotemporal index file, the time series index records the time statistics of all data block indexes with a region identifier. Therefore, data block indexes that meet the time statistics criteria can be filtered according to the first query time period. This step of the query can be called the second-level time index.
[0135] 3. The spatiotemporal query device filters the identifiers of target devices that meet the first query time period from the target data block.
[0136] There is a one-to-one correspondence between the data block index and the data block, and the data block index records the location information of the data block. Therefore, determining the data block index is sufficient to find the corresponding data block. Multiple spatiotemporal indexes are recorded in the data block. The target spatiotemporal index is obtained by filtering based on the first query time period, and then the identifier of the target device is retrieved from the device metric field of the target spatiotemporal index.
[0137] For example, data block 1, identified by region identifier WX4ER, stores time information from 10 to 100, while data block 2, identified by region identifier WX4ER, stores time information from 110 to 200. Since the first time period to be queried is 10 to 150, all spatiotemporal indices of data block 1 are extracted, the spatiotemporal indices of data block 2 with time information from 110 to 150 are obtained by slicing, and the results are merged and displayed.
[0138] In light of the aforementioned scenario, after identifying which vehicles passed through the accident area during the first query time period, relevant personnel may want to further understand where these vehicles subsequently went, i.e., their movement routes. This can be done by using the target device's identifier to query the target device's time-series data from the time-series database. For example... Figure 5 As shown, the instantaneous query device can also execute the following S504.
[0139] S504. The spatiotemporal query device queries the time series data of the target device from the time series database based on the identifier of the target device and the second time period to be queried.
[0140] In some embodiments, the spatiotemporal query device can query the time-series data of a target device from a time-series data set based on a target identifier and a second query time period to determine the metric value of the target device in the second query time period. The second query time period may be the same as or different from the first query time period; this embodiment does not specifically limit this. The specific process of querying time-series data from the time-series data set is described above in the process of querying data from a time-series database by index, and will not be repeated here.
[0141] Figure 8 The spatiotemporal query process provided in this application embodiment first decomposes the query conditions to obtain one or more interval identifiers plus time periods. Then, iterates through each query condition, and for each query condition, first finds the device identifier that meets the condition through the spatiotemporal index set (i.e., S502-S503 above). Further, based on the device identifier + time + query box (e.g., SQL statement), the result is obtained from the time series data set (i.e., S504 above), and finally the result set is merged and returned.
[0142] The technical solutions provided by the above embodiments offer at least the following beneficial effects: The spatiotemporal query method provided in this application, by obtaining query conditions, retrieves the identifier of the target device from the spatiotemporal index set built from the time series model of a reused time series database, thereby satisfying the user's spatiotemporal query needs and filling the gap that currently open-source time series databases cannot support spatiotemporal queries. Moreover, the spatiotemporal index set constructed by this solution reuses the time series model of an existing time series database, resulting in lower development costs and meeting the usage needs in various scenarios.
[0143] Furthermore, the spatiotemporal index set constructed in this embodiment can be compressed according to the characteristics of the timeline (cyclic segments), reducing the storage cost of the index. In addition, this solution employs the original time-series model's dual temporal and spatial indexes, significantly reducing development costs while retaining the original time-series model's coarse-to-fine granularity and high index accuracy, thus improving the accuracy of spatiotemporal queries. This solution, based on a time-series database, efficiently implements spatiotemporal queries and can be applied to high-frequency GPS spatiotemporal query scenarios, expanding the capabilities of time-series databases in the IoT field.
[0144] In an exemplary embodiment, this application also provides a spatiotemporal query device. This spatiotemporal query device may include one or more functional modules for implementing the spatiotemporal query method of the above method embodiments.
[0145] For example, Figure 9 This is a schematic diagram illustrating the composition of a spatiotemporal query device provided in an embodiment of this application. Figure 9 As shown, the spatiotemporal query device includes: an acquisition module 901.
[0146] The acquisition module 901 is used to acquire query conditions; the query conditions include the identifier of the area to be queried and the first time period to be queried.
[0147] The acquisition module 901 is further configured to acquire the identifier of the target device from the spatiotemporal index set according to the query conditions; wherein, the spatiotemporal index set includes at least one spatiotemporal index; the spatiotemporal index includes: a region identifier, first time information and a first device identifier, the first device identifier is used to indicate the device in the region indicated by the region identifier at the time indicated by the first time information; the spatiotemporal index set is stored in a time series database and reused according to the fields indicated by the time series model of the time series database, and the target device is the device in the query region within the first query time period.
[0148] In some embodiments, the time series model includes a device identifier field, a time field, and a device metric field; wherein, the device identifier field is used to store a second device identifier, the time field is used to store second time information, and the device metric field is used to store the metric value of the device indicated by the second device identifier at the time point indicated by the second time information; the spatiotemporal index set is reused according to the fields indicated by the time series model of the time series database, which means that: the region identifier is located in the device identifier field, the first time information is located in the time field, and the first device identifier is located in the device metric field.
[0149] In some embodiments, the above-described apparatus further includes a construction module 902.
[0150] The construction module 902 is used to construct a spatiotemporal index set based on the time series data in the time series database; wherein the time series data is stored using a time series model.
[0151] In some embodiments, the device metric includes latitude and longitude data. The construction module 902 is specifically used to: obtain latitude and longitude data from time series data; reduce the dimensionality of the latitude and longitude data to obtain a region identifier; and construct a spatiotemporal index set based on the region identifier.
[0152] In some embodiments, the above-described apparatus further includes a processing module 903. Specifically, the processing module 903 is used to reduce the dimensionality of latitude and longitude data to obtain a string using a space-filling curve, which serves as a region identifier.
[0153] In some embodiments, the spatiotemporal index set includes one or more spatiotemporal index files, each spatiotemporal index file corresponding to a time slice. The acquisition module 901 is specifically configured to: acquire a subset of spatiotemporal indexes from the spatiotemporal index set according to a first query time period; wherein the subset of spatiotemporal indexes includes one or more spatiotemporal index files whose time slices satisfy the first query time period; acquire a target spatiotemporal index file including the query region identifier from the subset of spatiotemporal indexes according to the query region identifier; and acquire the identifier of the target device from the target spatiotemporal index file according to the query conditions.
[0154] In some embodiments, the first time information and / or the first device identifier are data compressed using a cursor algorithm or a block compression algorithm.
[0155] In some embodiments, the acquisition module 901 is further configured to query time series data of the target device from the time series database based on the identifier of the target device and the second time period to be queried.
[0156] When the functions of the integrated modules described above are implemented in hardware, this application provides a possible structural diagram of an electronic device. This electronic device can be the aforementioned spatiotemporal query module. For example... Figure 10 As shown, the electronic device 1000 includes: a processor 1002, a communication interface 1003, and a bus 1004. Optionally, the electronic device may also include a memory 1001.
[0157] Processor 1002 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 1002 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 1002 may also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0158] Communication interface 1003 is used to connect with other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0159] The memory 1001 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0160] As one possible implementation, the memory 1001 can exist independently of the processor 1002. The memory 1001 can be connected to the processor 1002 via the bus 1004 and is used to store instructions or program code. When the processor 1002 calls and executes the instructions or program code stored in the memory 1001, it can implement the spatiotemporal query method provided in the embodiments of this application.
[0161] In another possible implementation, the memory 1001 can also be integrated with the processor 1002.
[0162] Bus 1004 can be an extended industry standard architecture (EISA) bus, etc. Bus 1004 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0163] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the spatiotemporal query device can be divided into different functional modules to complete all or part of the functions described above.
[0164] This application also provides a computer-readable storage medium. All or part of the processes in the above method embodiments can be executed by computer instructions instructing related hardware. The program can be stored in the computer-readable storage medium, and when executed, it can include the processes of the above method embodiments. The computer-readable storage medium can be any of the foregoing embodiments or memory. The computer-readable storage medium can also be an external storage device of the above-mentioned spatiotemporal query device, such as a pluggable hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the spatiotemporal query device. Further, the computer-readable storage medium can include both internal storage units of the spatiotemporal query device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the spatiotemporal query device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0165] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to execute any of the spatiotemporal query methods provided in the above embodiments.
[0166] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, the disclosure, and the appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple components. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0167] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.
[0168] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.< / statistics> < / timestamp>
Claims
1. A spatio-temporal query method characterized in that, The method comprises: obtaining a query condition; the query condition comprises a to-be-queried region identifier and a first to-be-queried time period; obtaining an identifier of a target device from a spatio-temporal index set according to the query condition; wherein the spatio-temporal index set comprises at least one spatio-temporal index; the spatio-temporal index comprises a region identifier, first time information and a first device identifier, the first device identifier being used to indicate a device in a region indicated by the region identifier at a time indicated by the first time information; the spatio-temporal index set is stored in a time series database, and is multiplexed according to fields indicated by a time series model of the time series database; the target device is a device in the to-be-queried region within the first to-be-queried time period; the time series model comprises a device identifier field, a time field and a device metric value field; the spatio-temporal index set is multiplexed according to the fields indicated by the time series model of the time series database, which means that: the region identifier is located in the device identifier field, the first time information is located in the time field, and the first device identifier is located in the device metric value field; the time series model comprises a plurality of data blocks, each data block comprising a plurality of timelines generated by a device; the method further comprises: when spatio-temporal index data is stored in the time series model, establishing an index of a time series index corresponding to the spatio-temporal index data, the time series index and a data block index.
2. The method of claim 1, wherein: wherein the device identifier field is used to store a second device identifier, the time field is used to store second time information, and the device metric value field is used to store a metric value of a device indicated by the second device identifier at a time point indicated by the second time information.
3. The method of claim 2, wherein, Before obtaining the identifier of the target device from the spatio-temporal index set according to the query condition, the method further comprises: constructing the spatio-temporal index set according to time series data in the time series database; wherein the time series data is stored in the time series model.
4. The method of claim 3, wherein, The device metric value comprises latitude and longitude data; The constructing the spatio-temporal index set according to the time series data in the time series database comprises: obtaining the latitude and longitude data from the time series data; dimensionally reducing the latitude and longitude data to obtain the region identifier; constructing the spatio-temporal index set based on the region identifier.
5. The method of claim 4, wherein, The dimensionally reducing the latitude and longitude data to obtain the region identifier comprises: dimensionally reducing the latitude and longitude data to obtain a string as the region identifier by using a space-filling curve.
6. The method of claim 2, wherein, The spatio-temporal index set comprises one or more spatio-temporal index files, each spatio-temporal index file corresponding to a time slice; The obtaining the identifier of the target device from the spatio-temporal index set according to the query condition comprises: obtaining a spatio-temporal index subset from the spatio-temporal index set according to the first to-be-queried time period; wherein the spatio-temporal index subset comprises one or more spatio-temporal index files whose time slices satisfy the first to-be-queried time period; obtaining a target spatio-temporal index file comprising the to-be-queried region identifier from the spatio-temporal index subset according to the to-be-queried region identifier; According to the query condition, the identifier of the target device is obtained from the target spatio-temporal index file.
7. The method of claim 6, wherein, The time sequence index further comprises an index of a time sequence index, which records positions of the time sequence index in sequence of region identifiers; the time sequence index records positions of a data block index of a region identifier and time statistics values; The data block index records a position of a data block; The method further comprises: According to the target time sequence index and the first to-be-queried time period, a target data block index is determined; the time statistics values of the target data block index comprise the first to-be-queried time period; Based on the target data block index, a target data block is queried; From the target data block, the identifier of the target device satisfying the first to-be-queried time period is filtered. The first time information and / or the first device identifier are data compressed by using a cursor algorithm or a block compression algorithm.
8. The method according to any one of claims 1 to 7, characterized in that, The method further comprises:
9. The method according to any one of claims 1 to 7, characterized in that, According to the identifier of the target device and a second to-be-queried time period, time sequence data of the target device is queried from the time sequence database. The apparatus comprises an obtaining module and a constructing module; 10. A spatio-temporal query apparatus characterized in that, The obtaining module is configured to obtain a query condition; the query condition comprises a to-be-queried region identifier and a first to-be-queried time period; The obtaining module is further configured to obtain, according to the query condition, an identifier of a target device from a spatio-temporal index set; the spatio-temporal index set comprises at least one spatio-temporal index; the spatio-temporal index comprises a region identifier, first time information and a first device identifier, the first device identifier being used to indicate a device in a region indicated by the region identifier at a time indicated by the first time information; the spatio-temporal index set is stored in a time sequence database, and is multiplexed according to fields indicated by a time sequence model of the time sequence database; the target device is a device in the to-be-queried region in the first to-be-queried time period; The time sequence model comprises a device identifier field, a time field and a device metric value field; the spatio-temporal index set is multiplexed according to fields indicated by the time sequence model of the time sequence database, which means that: The region identifier is located in the device identifier field, the first time information is located in the time field, and the first device identifier is located in the device metric value field; The time sequence model comprises a plurality of data blocks, and each data block comprises a plurality of timelines generated by a device; The constructing module is configured to, when spatio-temporal index data is stored in the time sequence model, establish an index of a time sequence index corresponding to the spatio-temporal index data, the time sequence index and a data block index. The apparatus further comprises a processing module; 11. The apparatus of claim 10, wherein, The time sequence model comprises a device identifier field, a time field and a device metric value field; the device identifier field is configured to store a second device identifier, the time field is configured to store second time information, and the device metric value field is configured to store a metric value of a device indicated by the second device identifier at a time point indicated by the second time information; The construction module is configured to construct the spatio-temporal index set according to time sequence data in the time sequence database; the time sequence data is stored in the time sequence model; The device metric value comprises latitude and longitude data; the construction module is specifically configured to obtain the latitude and longitude data from the time sequence data, reduce the dimension of the latitude and longitude data to obtain the region identifier, and construct the spatio-temporal index set based on the region identifier; The processing module is specifically configured to reduce the dimension of the latitude and longitude data to obtain a string as the region identifier by using a space-filling curve; The spatio-temporal index set comprises one or more spatio-temporal index files, and each spatio-temporal index file corresponds to a time slice; The obtaining module is specifically configured to obtain a spatio-temporal index subset from the spatio-temporal index set according to the first to-be-queried time period; the spatio-temporal index subset comprises one or more spatio-temporal index files whose time slices satisfy the first to-be-queried time period; obtain a target spatio-temporal index file comprising the to-be-queried region identifier from the spatio-temporal index subset according to the to-be-queried region identifier; and obtain the identifier of the target device from the target spatio-temporal index file according to the query condition; The time sequence model further comprises an index of a time sequence index, the index of the time sequence index records positions of the time sequence index in sequence of region identifiers; the time sequence index records a position of a data block index of a region identifier and a time statistical value; and the data block index records a position of a data block; The obtaining module is specifically configured to query a target time sequence index from the index of the time sequence index according to the to-be-queried region identifier; the target time sequence index contains the to-be-queried region identifier; determine a target data block index according to a time statistical value of the target time sequence index and the first to-be-queried time period; the time statistical value of the target data block index comprises the first to-be-queried time period; query a target data block based on the target data block index; and filter the identifier of the target device that satisfies the first to-be-queried time period from the target data block; The first time information and / or the first device identifier are data compressed by using a cursor algorithm or a block compression algorithm; The obtaining module is further configured to query time sequence data of the target device from the time sequence database according to the identifier of the target device and a second to-be-queried time period.
12. An electronic device, comprising: The electronic device comprises a processor and a memory; The memory stores instructions executable by the processor; The processor is configured to execute the instructions, so that the electronic device implements the method in any one of claims 1-9.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium comprises computer software instructions. When the computer software instructions are run in an electronic device, they cause the electronic device to implement the method of any one of claims 1-9.
Citation Information
Patent Citations
Method for storing IOT time series data related to geographical location information
CN104008212A