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

By classifying and storing spatiotemporal data according to entity feature information, the problem of slow query speed in existing technologies is solved, and efficient spatiotemporal data query is achieved.

CN110569318BActive Publication Date: 2026-03-31HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-05-16
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing spatiotemporal data storage methods require traversing each data entry during querying, resulting in slow query speeds.

Method used

Spatiotemporal data is categorized and stored according to entity characteristic information. The spatiotemporal data of an entity is saved to the corresponding historical spatiotemporal data set, and the corresponding entity set can be directly searched in the database by query conditions, reducing the number of traversals.

Benefits of technology

It improves the query speed of spatiotemporal data and enables data querying with clear storage logic and high efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110569318B_ABST
    Figure CN110569318B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a kind of storage method of space-time data, query method and storage device, query device, wherein storage method includes: obtaining the space-time data of one or more entities current time period;According to the entity feature information in space-time data, find each entity corresponding historical space-time data set;For each first entity of historical space-time data set, extract current time period space-time data from the space-time data obtained;The extracted space-time data is saved to the historical space-time data set of first entity;For each second entity that corresponding historical space-time data set is not found, new historical space-time data set is built;Extract the space-time data of second entity current time period from the space-time data obtained;The extracted space-time data is saved to the new historical space-time data set.The storage method of space-time data of the embodiment of the present application has the advantage that storage logic is clear;The query method of space-time data has higher query speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data storage technology, and in particular to a method for storing spatiotemporal data, a method for retrieving data, and a storage and retrieval device. Background Technology

[0002] Spatiotemporal data typically refers to data that possesses temporal, spatial, and entity characteristic information, exhibiting characteristics such as time-varying, space-varying, and dynamic. When an entity performs a spatiotemporal action, corresponding spatiotemporal data is usually generated. For example, when a vehicle passes through a checkpoint, the vehicle passage record obtained through the intelligent traffic management system can include the vehicle's spatial location information, time information, and license plate number. Another example is when a mobile phone logs into a network, the mobile phone login information obtained through a wireless access point can include the phone's latitude and longitude information, entry and exit time information, and MAC (Media Access Control) address.

[0003] After generating spatiotemporal data, the server can store it. Current spatiotemporal data storage methods typically generate one spatiotemporal data record for each spatiotemporal action and then store that record in the database; that is, spatiotemporal data is stored record by record.

[0004] Although this spatiotemporal data storage method has the advantage of clear storage logic, when it is necessary to query spatiotemporal data that meets the query conditions in the database, since each spatiotemporal data record contains both time and spatial information, it is necessary to traverse each spatiotemporal data record in the database to find the spatiotemporal data that meets the query conditions, thus resulting in a slow query speed. Summary of the Invention

[0005] The purpose of this invention is to provide a method for storing and querying spatiotemporal data, as well as a storage device and a query device, to achieve clear storage logic while improving the query speed of spatiotemporal data. The specific technical solution is as follows:

[0006] In a first aspect, embodiments of the present invention provide a method for storing spatiotemporal data, the method comprising:

[0007] Acquire spatiotemporal data of one or more entities for the current time period; the spatiotemporal data includes: time information, spatial information, and entity feature information;

[0008] Based on the entity feature information in the spatiotemporal data, the historical spatiotemporal data set corresponding to each entity is searched in the database. The historical spatiotemporal data set includes: the spatiotemporal data of the entity within the historical time period.

[0009] For each first entity whose corresponding historical spatiotemporal data set has been found, extract the spatiotemporal data of the first entity in the current time period from the spatiotemporal data of the current time period obtained;

[0010] Save the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set of the first entity;

[0011] For each second entity for which no corresponding historical spatiotemporal data set was found, a new historical spatiotemporal data set corresponding to that second entity is created.

[0012] Extract the spatiotemporal data of the second entity in the current time period from the spatiotemporal data of the current time period obtained;

[0013] Save the spatiotemporal data of the second entity for the current time period to the newly created historical spatiotemporal data set.

[0014] Optionally, the time period is a period pre-set according to the time period during which entity spatiotemporal data needs to be recorded.

[0015] Optionally, the step of searching the database for the historical spatiotemporal data set corresponding to each entity based on the entity feature information in the spatiotemporal data includes:

[0016] Extract the identification information of each entity from the entity feature information;

[0017] Based on the identification information of each entity, search the database for the historical spatiotemporal data set corresponding to each entity;

[0018] The step of extracting the spatiotemporal data of the first entity for the current time period from the acquired spatiotemporal data for the current time period includes:

[0019] Based on the identification information of the first entity, extract the spatiotemporal data of the first entity in the current time period from the spatiotemporal data of the current time period obtained;

[0020] Saving the spatiotemporal data of the first entity in its current time period to the historical spatiotemporal data set of the first entity includes:

[0021] Save the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set corresponding to the identifier of the first entity in the database;

[0022] The newly created historical spatiotemporal data set corresponding to the second entity includes:

[0023] A historical spatiotemporal data set corresponding to the identification information of the second entity is established in the database;

[0024] The step of extracting the spatiotemporal data of the second entity in the current time period from the acquired spatiotemporal data of the current time period includes:

[0025] Based on the identification information of the second entity, extract the spatiotemporal data of the second entity in the current time period from the spatiotemporal data of the current time period obtained;

[0026] The step of saving the spatiotemporal data of the second entity in its current time period to a newly created historical spatiotemporal data set includes:

[0027] Save the spatiotemporal data of the second entity for the current time period to a newly created historical spatiotemporal data set in the database.

[0028] Optionally, saving the spatiotemporal data of the first entity in its current time period to the historical spatiotemporal data set of the first entity includes:

[0029] For each first entity, a trajectory data unit for the current period corresponding to the current time period is generated; the trajectory data unit for the current period includes: trajectory data within the current time period; the trajectory data includes: spatiotemporal data sorted by acquisition time and containing only time and spatial information;

[0030] The generated trajectory data units for the current period are saved to the historical spatiotemporal data set corresponding to the first entity in chronological order of time periods.

[0031] The step of saving the spatiotemporal data of the second entity in its current time period to a newly created historical spatiotemporal data set includes:

[0032] For each second entity, generate trajectory data units for the current time period corresponding to the current time period;

[0033] The generated trajectory data units for the current period are saved to a newly created historical spatiotemporal data set.

[0034] Secondly, embodiments of the present invention provide a method for querying spatiotemporal data, the method comprising:

[0035] Retrieve query criteria;

[0036] For each entity corresponding to the spatiotemporal data, according to the query conditions, the database is queried for the historical spatiotemporal data set stored for each entity to obtain the spatiotemporal data that meets the query conditions; the historical spatiotemporal data set stored for each entity includes: the spatiotemporal data of the entity within the historical time period.

[0037] Optionally, if the obtained query condition is a time condition, then the step of querying the database for each entity corresponding to the spatiotemporal data according to the query condition, and obtaining the spatiotemporal data that meets the query condition, includes:

[0038] For each entity corresponding to the spatiotemporal data, according to the time conditions, the database is queried for the historical spatiotemporal data set stored for each entity to obtain the spatiotemporal data that meets the time conditions.

[0039] Optionally, if the obtained query conditions are spatial conditions, then the step of querying the database for each entity corresponding to the spatiotemporal data according to the query conditions, and obtaining the spatiotemporal data that meets the query conditions, includes:

[0040] For each entity corresponding to the spatiotemporal data, according to the spatial conditions, the database is queried for the historical spatiotemporal data set stored for each entity to obtain spatiotemporal data that meets the spatial conditions.

[0041] Optionally, the identifier of each entity in the database is stored corresponding to its historical spatiotemporal data set;

[0042] When the obtained query condition is an entity identifier, if the obtained query condition is a time condition, then for each entity corresponding to the spatiotemporal data, according to the query condition, the database is queried for the historical spatiotemporal data set stored for each entity to obtain the spatiotemporal data that meets the query condition, including:

[0043] The identifiers of entities in the query conditions are compared one by one with the identifiers of each entity in the database to obtain the spatiotemporal data of entities in the database that have the same identifiers as those in the query conditions.

[0044] Optionally, the historical spatiotemporal data set stored for each entity includes the spatiotemporal data of that entity within a historical time period, comprising: trajectory data units of the entity in each historical period; each trajectory data unit includes: trajectory data within the current time period; the trajectory data includes: data sorted by acquisition time and containing only time and spatial information;

[0045] When the obtained query conditions include time and space conditions, the step of querying the spatiotemporal data that meets the query conditions in the spatiotemporal data set corresponding to each entity includes:

[0046] For each entity corresponding to the spatiotemporal data, the database is queried to find trajectory data units in the spatiotemporal data corresponding to each entity that contain the time conditions.

[0047] Within the retrieved trajectory data units, search for spatiotemporal data that meets the time criteria;

[0048] From the spatiotemporal data that meets the time criteria, search for spatiotemporal data that meets the spatial criteria.

[0049] Optionally, when the time condition is a time period, after querying the spatiotemporal data corresponding to each entity in the database and finding trajectory data units containing the time condition, the method further includes:

[0050] In the retrieved trajectory data units that contain the time period corresponding to the time period, trajectory data units belonging to continuous time periods are merged.

[0051] The step of querying spatiotemporal data that meets the time criteria from the retrieved trajectory data units includes:

[0052] Within the merged trajectory data unit, query spatiotemporal data that meets the time criteria.

[0053] Optionally, merging trajectory data units belonging to continuous time periods from the retrieved trajectory data units containing the time period corresponding to the time period includes:

[0054] Determine the start and end time points corresponding to each trajectory data unit;

[0055] If the end time of the first trajectory data unit is the same as the start time of the second trajectory data unit, the first trajectory data unit and the second trajectory data unit are merged; the first trajectory data unit and the second trajectory data unit are any two trajectory data units among the queried trajectory data units containing the time condition.

[0056] Optionally, when the time condition is a point in time, querying the spatiotemporal data that meets the time condition from the retrieved trajectory data units includes:

[0057] For each trajectory data unit retrieved, a binary search is used to find spatiotemporal data that meets the time criteria.

[0058] Optionally, when the time condition is a time period, querying the spatiotemporal data that meets the time condition from the retrieved trajectory data units includes:

[0059] Determine the start and end times of the time conditions;

[0060] The start time, end time, and all intermediate time points between the start and end time points of the time condition are determined as the time points to be queried.

[0061] For each trajectory data unit retrieved, a binary search is used to find spatiotemporal data that meets the time criteria.

[0062] Thirdly, embodiments of the present invention provide a storage device for spatiotemporal data, the device comprising:

[0063] The spatiotemporal data acquisition module is used to acquire spatiotemporal data of one or more entities for the current time period; the spatiotemporal data includes: time information, spatial information and entity feature information;

[0064] The search module is used to search the database for the historical spatiotemporal data set corresponding to each entity based on the entity feature information in the spatiotemporal data. The historical spatiotemporal data set includes the spatiotemporal data of the entity within a historical time period.

[0065] The first extraction module is used to extract the spatiotemporal data of the first entity in the current time period from the spatiotemporal data of the current time period for each first entity in the corresponding historical spatiotemporal data set.

[0066] The first storage module is used to save the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set of the first entity;

[0067] A module is created to create a new historical spatiotemporal data set for each second entity for which no corresponding historical spatiotemporal data set has been found.

[0068] The second extraction module is used to extract the spatiotemporal data of the second entity in the current time period from the spatiotemporal data of the current time period that has been acquired.

[0069] The second storage module is used to save the spatiotemporal data of the second entity in the current time period to a newly created historical spatiotemporal data set.

[0070] Optionally, the time period is a period pre-set according to the time period during which entity spatiotemporal data needs to be recorded.

[0071] Optionally, the search module is specifically used to: extract the identification information of each entity from the entity feature information, and search the database for the historical spatiotemporal data set corresponding to each entity according to the identification information of each entity;

[0072] The first extraction module is specifically used to: extract the spatiotemporal data of the first entity in the current time period from the acquired spatiotemporal data of the current time period according to the identification information of the first entity;

[0073] The first storage module is specifically used to: save the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set in the database corresponding to the identifier of the first entity;

[0074] The establishment module is specifically used to: establish a historical spatiotemporal data set corresponding to the identification information of the second entity in the database;

[0075] The second extraction module is specifically used to: extract the spatiotemporal data of the second entity in the current time period from the acquired spatiotemporal data of the current time period according to the identification information of the second entity;

[0076] The second saving module is specifically used to save the spatiotemporal data of the second entity in the current time period to a newly created historical spatiotemporal data set in the database.

[0077] Optionally, the first storage module is specifically used to: generate a trajectory data unit for the current period corresponding to the current time period for each first entity; the trajectory data unit for the current period includes: trajectory data within the current time period; the trajectory data includes: spatiotemporal data sorted by acquisition time and containing only time and spatial information; and save the generated trajectory data unit for the current period to the historical spatiotemporal data set corresponding to the first entity in chronological order of the time periods.

[0078] The second storage module is specifically used to: generate a trajectory data unit for the current period corresponding to the current time period for each second entity; and save the generated trajectory data unit for the current period to a newly created historical spatiotemporal data set.

[0079] Fourthly, embodiments of the present invention provide a spatiotemporal data query device, the device comprising:

[0080] The query condition retrieval module is used to retrieve query conditions;

[0081] The query module is used to query the database for each entity corresponding to the spatiotemporal data, according to the query conditions, and to obtain the spatiotemporal data that meets the query conditions; the historical spatiotemporal data set corresponding to each entity includes the spatiotemporal data of the entity within the historical time period.

[0082] Optionally, the identifier of each entity in the database is stored corresponding to its historical spatiotemporal data set;

[0083] When the obtained query condition is the entity identifier, if the obtained query condition is a time condition, the query module is specifically used to: compare the entity identifier in the query condition with the identifier of each entity in the database one by one, and obtain the spatiotemporal data of the entities in the database that are the same as the entity identifier in the query condition.

[0084] Optionally, the historical spatiotemporal data set stored for each entity includes the spatiotemporal data of that entity within a historical time period, comprising: trajectory data units of the entity in each historical period; each trajectory data unit includes: trajectory data within the current time period; the trajectory data includes: data sorted by acquisition time and containing only time and spatial information;

[0085] When the obtained query conditions include time conditions and spatial conditions, the query module is specifically used to: for each entity corresponding to the spatiotemporal data, query the database for trajectory data units in the spatiotemporal data corresponding to each entity that contain the time conditions; query the spatiotemporal data that meets the time conditions in the queried trajectory data units; and query the spatiotemporal data that meets the spatial conditions in the queried spatiotemporal data that meets the time conditions.

[0086] Fifthly, embodiments of the present invention provide a server, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the processor being prompted by the machine-executable instructions to implement the method steps of the spatiotemporal data storage method provided in the first aspect of the present invention.

[0087] In a sixth aspect, embodiments of the present invention provide a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor using the method steps of the spatiotemporal data storage method provided in the first aspect of the present invention.

[0088] In a seventh aspect, embodiments of the present invention provide a server, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being prompted by the machine-executable instructions to implement the method steps of the spatiotemporal data query method provided in the second aspect of the present invention.

[0089] Eighthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor using the method steps of the spatiotemporal data query method provided in the second aspect of the present invention.

[0090] This invention provides a method for storing spatiotemporal data. By acquiring spatiotemporal data of multiple entities within the current time period, the spatiotemporal data corresponding to each entity is saved to the entity's historical spatiotemporal data set. This allows the stored spatiotemporal data to be categorized and stored according to different entities, thus offering the advantage of clear storage logic. Building upon this clear storage logic, this invention also provides a method for querying spatiotemporal data. By querying the historical spatiotemporal data set corresponding to each entity in the database according to the acquired query conditions, the method queries the spatiotemporal data set corresponding to each entity, rather than querying each instance of spatiotemporal data in the database. This allows for faster retrieval of the spatiotemporal data corresponding to an entity based on the query conditions, resulting in higher query speed. Of course, implementing any product or method of this invention does not necessarily require simultaneously achieving all the advantages described above. Attached Figure Description

[0091] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0092] Figure 1 A flowchart illustrating a method for storing spatiotemporal data provided in an embodiment of the present invention;

[0093] Figure 2 Another flowchart illustrating the spatiotemporal data storage method provided in this embodiment of the invention;

[0094] Figure 3 A flowchart illustrating a spatiotemporal data query method provided in an embodiment of the present invention;

[0095] Figure 4 This is a schematic diagram of the specific process of S302 in the spatiotemporal data query method provided in the embodiment of the present invention;

[0096] Figure 5 This is a schematic diagram of a specific process in step S3022 of the spatiotemporal data query method provided in an embodiment of the present invention;

[0097] Figure 6 This is another specific flowchart of S3022 in the spatiotemporal data query method provided in the embodiment of the present invention;

[0098] Figure 7 A schematic diagram of a spatiotemporal data storage device provided in an embodiment of the present invention;

[0099] Figure 8 A schematic diagram of a spatiotemporal data query device provided in an embodiment of the present invention;

[0100] Figure 9 Another structural schematic diagram of the spatiotemporal data query device provided in the embodiments of the present invention;

[0101] Figure 10 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention;

[0102] Figure 11 This is a schematic diagram of another server structure provided in an embodiment of the present invention. Detailed Implementation

[0103] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0104] like Figure 1 As shown, this embodiment of the invention provides a method for storing spatiotemporal data, which may include the following steps:

[0105] S101, obtain the spatiotemporal data of one or more entities for the current time period, wherein the spatiotemporal data includes: time information, spatial information and entity feature information.

[0106] In this embodiment of the invention, the entity may not be limited to objects such as vehicles or mobile phones. When these objects move or run, their activities can be captured by information acquisition devices. For example, when a vehicle passes through a checkpoint and is captured by a probe, the server records the vehicle's license plate number, vehicle color, checkpoint location (latitude and longitude), and shooting time, thereby obtaining the corresponding spatiotemporal data of the vehicle. Of course, the obtained spatiotemporal data can be the spatiotemporal data of one or more entities, where the multiple entities can refer to entities with the same attributes, such as all being vehicles. It is easy to understand that each entity can correspond to multiple spatiotemporal data within a time period. For example, multiple vehicle records of vehicle A and vehicle B within the time period from 0:00:00 to 24:00:00. The aforementioned time period can include the current time period and historical time periods. The historical time period is relative to the current time period. For example, if the current time period is from 0:00:00 on the 21st to 24:00:00 on the 21st, then the historical time period can be all time periods prior to the current time period.

[0107] Spatiotemporal data includes time information, spatial information, and entity feature information, specifically including but not limited to vehicle passage records, face capture records, Wi-Fi (Wireless-Fidelity) login records, RFID (Radio-frequency Identification) records, and video recordings. In the example above, the shooting time corresponds to the time information in the spatiotemporal data; the checkpoint location corresponds to the spatial information; and the license plate number and vehicle color correspond to the entity feature information.

[0108] Furthermore, the aforementioned time period can be set according to the time period during which entity spatiotemporal data needs to be recorded. For example, the time period can be set to 00:00:00 to 24:00:00 each day, meaning one time period is 24 hours. Of course, the aforementioned time period can also be set to other time periods during the day, such as 8:00:00 to 8:59:59 during peak traffic hours and 18:00:00 to 18:59:59. The specific time period can be set according to actual recording needs, and this embodiment of the invention does not limit it.

[0109] S102, based on the entity feature information in the spatiotemporal data, search the database for the historical spatiotemporal data set corresponding to each entity, wherein the historical spatiotemporal data set includes: the spatiotemporal data of the entity within the historical time period.

[0110] In this embodiment of the invention, entity feature information records the attributes and characteristics of the entity. For example, when the entity is a vehicle, the entity feature information may include the vehicle's license plate number. When storing spatiotemporal data, the database stores the spatiotemporal data of each entity as a data set according to different entities. For example, when the spatiotemporal data stored in the database is vehicle passage records, multiple vehicle passage records can be searched in the database based on different license plate numbers. That is, based on the entity feature information in the spatiotemporal data, the database can be searched for the spatiotemporal data corresponding to different entities.

[0111] The aforementioned historical spatiotemporal data set can refer to the spatiotemporal data of an entity within a historical time period. For example, if the current time period is from 00:00:00 on March 20th to 24:00:00 on March 21st of a certain year, then the historical data set is the spatiotemporal data of the entity within the time period before 00:00:00 on March 20th to 23:59:59 on March 21st of that year.

[0112] S103, for each first entity in the corresponding historical spatiotemporal data set, extract the spatiotemporal data of the first entity in the current time period from the spatiotemporal data of the current time period obtained.

[0113] It's easy to understand that the acquired spatiotemporal data for the current time period can include spatiotemporal data for multiple entities. Some of these entities already have corresponding spatiotemporal data stored in the database, while others do not. Taking vehicle passage records as an example, some vehicles have passed through checkpoints, so the database stores their historical data; others have not, so the database does not store their historical data. In other words, some entities have corresponding historical spatiotemporal data sets that can be found in the database; these entities are called the first entity. Other entities do not have corresponding historical spatiotemporal data sets that can be found in the database; these entities are called the second entity. Therefore, for the first entity, its spatiotemporal data for the current time period can be extracted from the acquired spatiotemporal data for the current time period for storage.

[0114] S104, save the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set of the first entity.

[0115] After extracting the spatiotemporal data of the first entity in the current time period, this data can be saved to the historical spatiotemporal data set of the first entity. This allows the spatiotemporal data of the first entity in the current time period to be merged with its historical spatiotemporal data to form a new spatiotemporal data set, which will then be used as the historical spatiotemporal data set for the next storage.

[0116] As an optional implementation of this invention, the spatiotemporal data of each entity in the database can be stored in the form of trajectory data units. Each trajectory data unit stores the trajectory data of that entity within a specific time period; that is, the spatiotemporal data of that entity, sorted by acquisition time, contains only time and spatial information. Furthermore, each trajectory data unit can be saved to a historical spatiotemporal data set in chronological order; that is, the trajectory data units in the historical spatiotemporal data set are also stored and arranged in chronological order.

[0117] As an optional implementation of this invention, for each entity's corresponding historical spatiotemporal data set, the entity feature information of each entity remains unchanged. Therefore, the entity feature information of an entity only needs to be saved once, so that when saving the spatiotemporal data of the entity in the future, it is not necessary to repeatedly save the entity feature information. Since the historical spatiotemporal data set corresponds to each entity, in the process of saving the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set of the first entity, the entity feature information of the spatiotemporal data in the current time period can be removed first, and then the spatiotemporal data after removing the entity feature information can be saved to the historical spatiotemporal data set, thereby reducing the storage space occupied by the database due to storing each piece of spatiotemporal data. It is easy to understand that, similar to the process of saving the spatiotemporal data in the current time period, the corresponding entity feature information can also be removed during the process of saving the historical spatiotemporal data to the historical spatiotemporal data set.

[0118] Taking vehicle passage records as an example, the process of removing entity feature information is to remove the features related to the vehicle in the vehicle passage record, such as license plate number, vehicle length, body color, vehicle type and other feature information, and only retain information related to time and space, such as the time of passage, the location of passage (checkpoint location), location features (urban area, suburbs) and so on.

[0119] As an optional implementation of the present invention, in the process of saving the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set of the first entity, the spatiotemporal data of the first entity in the current time period can be merged with the spatiotemporal data in the historical spatiotemporal data set. Specifically, in the form of trajectory data units, spatiotemporal data belonging to different time periods can be saved into different trajectory data units, and then the various trajectory data units can be merged and arranged in the historical spatiotemporal data set of the entity in chronological order.

[0120] S105, for each second entity for which no corresponding historical spatiotemporal data set is found, create a new historical spatiotemporal data set corresponding to that second entity.

[0121] As mentioned earlier, if the entity does not yet have corresponding spatiotemporal data in the database, it is impossible to find the corresponding historical spatiotemporal data set. In this case, a new historical spatiotemporal data set corresponding to the second entity can be created in the database to store the spatiotemporal data of the second entity. Specifically, for example, a folder corresponding to the second entity can be created in the database as the storage path for the newly created historical spatiotemporal data set.

[0122] As an optional implementation of this invention, when creating a new historical spatiotemporal data set corresponding to the second entity, the entity feature information of the entity can be saved once. Therefore, when saving the spatiotemporal data of the entity in the future, it is not necessary to repeatedly save the entity feature information. Since it is only necessary to satisfy that the entity feature information of each entity corresponds to the historical spatiotemporal data set of that entity, the entity feature information does not need to be stored in the database, but rather in other storage paths on the server.

[0123] S106, Extract the spatiotemporal data of the second entity in the current time period from the acquired spatiotemporal data of the current time period.

[0124] In this embodiment of the invention, for the second entity, the spatiotemporal data of the current time period of the second entity can be extracted from the spatiotemporal data of the current time period for storage.

[0125] S107, save the spatiotemporal data of the second entity in the current time period to the newly created historical spatiotemporal data set.

[0126] After extracting the spatiotemporal data of the current time period of the second entity, this data can be saved to the newly created historical spatiotemporal data set of the second entity.

[0127] As an optional implementation of this invention, similar to the storage method of the first entity described above, trajectory data units corresponding to the current time period can be generated for each second entity, and these trajectory data units can be saved to a newly created historical spatiotemporal data set. In the newly created historical spatiotemporal data set, the trajectory data units are also stored in chronological order.

[0128] The present invention provides a method for storing spatiotemporal data. By acquiring spatiotemporal data of multiple entities within the current time period, the spatiotemporal data corresponding to the entity is saved to the historical spatiotemporal data set of that entity. This allows the stored spatiotemporal data to be stored according to different entities, thus having the advantage of clear storage logic.

[0129] This invention also provides a method for storing spatiotemporal data, such as... Figure 2 As shown, the process may include the following steps:

[0130] S201, Obtain spatiotemporal data for the current time period of one or more entities.

[0131] This step and Figure 1 Step S101 in the illustrated embodiment is the same and will not be repeated here.

[0132] S202, extract the identification information of each entity from the entity feature information.

[0133] In this embodiment of the invention, entity feature information records the attributes and characteristics corresponding to the entity. For example, when the entity is a vehicle, the entity feature information can be information used to identify the entity, such as the vehicle's license plate number, vehicle color, and license plate color. When storing spatiotemporal data, the database can typically store the spatiotemporal data of different entities in the form of a data set according to the identification information corresponding to the entity. That is, the identification information of the entity has a unique correspondence with the entity. For example, when the database stores vehicle passage records, the entity's identification information can be the vehicle's license plate number. Therefore, multiple vehicle passage records can be searched in the database based on different license plate numbers.

[0134] S203. Based on the identification information of each entity, search the database for the historical spatiotemporal data set corresponding to each entity.

[0135] This step and Figure 1 Step S102 of the illustrated embodiment is similar. As described above, the entity's identification information has a unique correspondence with the entity. Therefore, the historical spatiotemporal data set corresponding to each entity can be searched in the database according to the identification information of each entity. For example, when the spatiotemporal data stored in the database is vehicle passing records, the vehicle's identification information can be the license plate number. Therefore, the corresponding historical spatiotemporal data set can be searched in the database by the license plate number of different vehicles.

[0136] S204, for each first entity in the corresponding historical spatiotemporal data set, extract the spatiotemporal data of the first entity in the current time period from the spatiotemporal data of the current time period according to the identification information of the first entity.

[0137] This step and Figure 1 Similar to step S103 in the illustrated embodiment, in this embodiment of the invention, spatiotemporal data corresponding to the entity with the identification information can be extracted from the acquired spatiotemporal data according to the entity's identification information. Taking vehicle passage records as an example, when the acquired spatiotemporal data contains spatiotemporal data of three vehicles A, B, and C, where vehicle A's license plate number is aaaa, vehicle B's license plate number is bbbb, and vehicle C's license plate number is cccc, then the empty data with license plate number aaaa, i.e., the spatiotemporal data of vehicle A, can be extracted from it.

[0138] S205, save the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set corresponding to the identifier of the first entity in the database.

[0139] This step and Figure 1Similar to step S104 in the illustrated embodiment, when storing spatiotemporal data, the database can store the spatiotemporal data of different entities in the form of data sets according to the identifiers corresponding to different entities. Therefore, after extracting the spatiotemporal data of the current time period, this spatiotemporal data can be saved to the historical spatiotemporal data set in the database corresponding to the identifier of the first entity. Specifically, for example, when the entity is a vehicle, this spatiotemporal data can be saved to the historical spatiotemporal data set in the database corresponding to the vehicle's license plate number; when the entity is a communication device such as a mobile phone, this spatiotemporal data can be saved to the historical spatiotemporal data set in the database corresponding to the mobile phone's phone number or MAC address.

[0140] S206, For each second entity for which a corresponding historical spatiotemporal data set has been found, establish a historical spatiotemporal data set in the database corresponding to the identification information of the second entity.

[0141] This step and Figure 1 Similar to step S105 in the illustrated embodiment, for each second entity for which no corresponding historical spatiotemporal data set is found, a new historical spatiotemporal data set can be created in the database, and this historical spatiotemporal data set corresponds to the identification information of the second entity. For example, a historical spatiotemporal data set can be created in the database, and this historical spatiotemporal data set corresponds to the license plate number of a vehicle.

[0142] S207, according to the identification information of the second entity, extract the spatiotemporal data of the second entity in the current time period from the spatiotemporal data of the current time period obtained.

[0143] This step and Figure 1 Step S106 of the illustrated embodiment is similar, except that the spatiotemporal data of the second entity is extracted according to the identification information of the second entity. The specific extraction method is performed as described in step S204 of the embodiment of the present invention, and will not be repeated here.

[0144] S208, save the spatiotemporal data of the second entity in the current time period to the newly created historical spatiotemporal data set in the database.

[0145] This step and Figure 1 Step S107 in the illustrated embodiment is the same and will not be described again here.

[0146] The present invention provides a method for storing spatiotemporal data. By acquiring spatiotemporal data of multiple entities within the current time period, the spatiotemporal data corresponding to the entities is saved to a historical spatiotemporal data set in the database corresponding to the entity's identifier. This allows the stored spatiotemporal data to be stored according to the identifiers of different entities, thus having the advantage of clear storage logic.

[0147] This invention also provides a method for querying spatiotemporal data, such as... Figure 3 As shown, the process may include the following steps:

[0148] S301, retrieve query conditions.

[0149] In this embodiment of the invention, when it is necessary to query spatiotemporal data stored in the database, query conditions can be obtained, and then the query can be performed based on the obtained query conditions. For example, an operator can input query conditions into the database server, thereby enabling the database server to obtain the query conditions and search for data in the database based on the query conditions.

[0150] The aforementioned query criteria can specifically include: time conditions, such as a specific point in time or a specific time period; spatial conditions, such as longitude and latitude, and when it is a vehicle passage record, the spatial condition can specifically be the geographical location of the checkpoint; entity feature conditions, such as the identifier of the entity; and combinations of time and spatial conditions.

[0151] S302, for each entity corresponding to the spatiotemporal data, according to the query conditions, query the database for the historical spatiotemporal data set stored for each entity to obtain the spatiotemporal data that meets the query conditions.

[0152] In this embodiment of the invention, when storing spatiotemporal data, the database can store the spatiotemporal data of each entity as a data set according to different entities. That is, each entity in the database stores a corresponding historical spatiotemporal data set. The historical spatiotemporal data set stored for each entity includes the spatiotemporal data of that entity within a historical time period. Therefore, during a query, the historical spatiotemporal data set corresponding to each entity can be traversed in the database, thereby obtaining spatiotemporal data that meets the query conditions during the traversal process.

[0153] As an optional implementation of this invention, when the obtained query condition is a time condition, the query can be performed according to that time condition. For example, when the time condition is 15:10:20 on January 1, 2018, the spatiotemporal data that meets the above time condition can be queried in the database from the historical spatiotemporal data set stored for each entity. Specifically, when the entity is a vehicle, if there is a vehicle passing record at 15:10:20 on January 1, 2018 in the historical spatiotemporal data set corresponding to vehicle A, then that vehicle passing record can be used as the spatiotemporal data that meets the query condition.

[0154] As an optional implementation of this invention, the identifier of each entity in the database can be stored corresponding to its historical spatiotemporal data set. When the obtained query condition is the identifier of an entity, if the obtained query condition is a time condition, the identifier of the entity in the query condition can be compared one by one with the identifier of each entity in the database to obtain the spatiotemporal data of the entities in the database that have the same identifier as the entity in the query condition. For example, the license plate number of vehicle A in the query condition can be compared one by one with the license plate numbers of each vehicle in the database to obtain the spatiotemporal data of the vehicles in the database that have the same license plate number as vehicle A.

[0155] As another optional implementation of this invention, when the obtained query condition is a spatial condition, the query can be performed according to that spatial condition. For example, when the spatial condition is specific latitude and longitude information, spatiotemporal data that matches the latitude and longitude information can be queried from the historical spatiotemporal data set stored for each entity in the database. Specifically, when the entity is a vehicle, the spatial condition is the latitude and longitude of checkpoint A. If there is a vehicle passage record in the historical spatiotemporal data set corresponding to vehicle B that matches the latitude and longitude of checkpoint A, then that vehicle passage record can be used as spatiotemporal data that meets the query condition.

[0156] Each entity's identifier in the database can be stored corresponding to its historical spatiotemporal data set. As another optional implementation of this invention, when the obtained query condition is an entity's identifier, the query can be performed according to that entity's identifier. For example, when the query condition is to query spatiotemporal data matching a certain license plate number, the license plate number of the vehicle in the query condition can be compared one by one with the license plate numbers of each vehicle in the database, thereby using the spatiotemporal data corresponding to that license plate number as the spatiotemporal data matching the query condition.

[0157] As another optional implementation of this invention, when the obtained query conditions include both time and space conditions, such as... Figure 4 As shown, the above spatiotemporal data query process can be specifically described as follows:

[0158] S3021, for each entity corresponding to the spatiotemporal data, query the database for trajectory data units containing time conditions in the spatiotemporal data corresponding to each entity.

[0159] The spatiotemporal data of each entity in the database can be stored in the form of trajectory data units. Each trajectory data unit contains the trajectory data of that entity within a specific time period; that is, the spatiotemporal data of that entity, sorted by acquisition time, contains only temporal and spatial information. Furthermore, each trajectory data unit can be saved to a historical spatiotemporal data set in chronological order; that is, the trajectory data units in the historical spatiotemporal data set are also stored in chronological order.

[0160] Since each trajectory data unit stores the trajectory data of the entity within a time period, the trajectory data unit containing the above time conditions can be queried in the database first.

[0161] S3022, in the retrieved trajectory data unit, query spatiotemporal data that meets the time condition.

[0162] After finding the trajectory data unit that contains the above time conditions, you can search for spatiotemporal data that meets the time conditions within it.

[0163] S3023, among the spatiotemporal data that meet the time criteria, query spatiotemporal data that meet the spatial criteria.

[0164] After finding spatiotemporal data that meets the time criteria, you can further search for spatiotemporal data that meets the aforementioned spatial criteria. By narrowing the search scope step by step, you can eventually find spatiotemporal data that meets both the time and spatial criteria.

[0165] Taking vehicle passage records as an example, the above steps S3021-S3023 are explained as follows: if the query conditions are 15:10:20 on January 1, 2018 and checkpoint A, it means that it is necessary to query the vehicles that passed through checkpoint A at that time. During the query, the system first searches the database for trajectory data units corresponding to each vehicle for each historical period. For example, if the time period for trajectory data unit a of vehicle A is from 00:00:00 on January 1, 2018 to 24:00:00 on the same day (24 hours), and the time period for trajectory data unit b of vehicle B is also from 00:00:00 on January 1, 2018 to 24:00:00 on the same day (24 hours), then the system can further search for vehicle passage records that meet the condition of 15:10:20 on January 1, 2018 in trajectory data units a and b. If a vehicle passage record a matching the above time condition is found in trajectory data unit a, and a vehicle passage record b matching the above time condition is also found in trajectory data unit b, then the system can search for vehicle passage records that meet the condition of checkpoint A in vehicle passage records a and b. If vehicle passage record b meets the checkpoint A condition, then the final spatiotemporal data that satisfies the query conditions is vehicle passage record b.

[0166] As an optional implementation of this invention, after retrieving trajectory data units containing time points within a time period, trajectory data units belonging to continuous time periods can be merged. Then, spatiotemporal data matching the time conditions is searched within the merged trajectory data units. This is because sometimes the time period corresponding to the time condition spans the time periods corresponding to trajectory data units of different periods. For example, if the time period is 24 hours, and the query time period is from 15:10:20 on January 1, 2018 to 8:10:20 on January 2, 2018, then the above time period spans two time periods: January 1, 2018 and January 2, 2018. If a query is performed according to the above time conditions, it will be impossible to continue the query because there are no trajectory data units with the corresponding time span in the database. Therefore, for the same entity, trajectory data units with a time period of January 1, 2018 and trajectory data units with a time period of January 2, 2018 can be merged to form a new trajectory data unit with a time span of January 1, 2018 to January 2, 2018.

[0167] As a specific implementation of the present invention, when merging trajectory data units belonging to a continuous time period, the start time point and end time point corresponding to each trajectory data unit can be determined first, and it can be determined whether the end time point of the first trajectory data unit is the same as the start time point of the second trajectory data unit. If they are the same, they are merged.

[0168] As a specific implementation of this invention, when the time condition is a point in time, such as Figure 5 As shown, step S3022 above includes:

[0169] S30221, For each queried trajectory data unit, determine the first spatiotemporal data located at the middle position of the trajectory data unit; S30222, Determine whether the time point corresponding to the first spatiotemporal data is the same as the time point of the time condition; S30223, When the time point corresponding to the first spatiotemporal data is the same as the time point corresponding to the time condition, then the first spatiotemporal data is the queried spatiotemporal data that meets the time condition; When the time point corresponding to the first spatiotemporal data is different from the time point corresponding to the time condition, S30224, Match the time point corresponding to the first spatiotemporal data with the time condition. The time points are compared; when the time point corresponding to the first spatiotemporal data is earlier than the time point corresponding to the time condition, in S30225, the spatiotemporal data located after the first spatiotemporal data is taken as a new trajectory data unit, and the above S30221 is executed; when the time point corresponding to the first spatiotemporal data is not earlier than the time point corresponding to the time condition, in S30226, the spatiotemporal data located before the first spatiotemporal data is taken as a new trajectory data unit, and the above S30221 is executed, until all spatiotemporal data that meet the time condition are found.

[0170] Since the spatiotemporal data in the trajectory data unit are arranged in chronological order, they are ordered data. Therefore, the existing binary search method can be used to search for the spatiotemporal data in each trajectory data unit, thereby quickly finding the spatiotemporal data that meets the time conditions.

[0171] As another specific implementation of the present invention, when the time condition is a time period, such as Figure 6 As shown, step S3022 above includes:

[0172] S801, determine the start and end time points of the time conditions; S802, determine the start and end time points of the time conditions, as well as all intermediate time points between the start and end time points, as the time points to be queried; S803, according to the time period of the trajectory data unit, query the trajectory data unit containing each time point to be queried, that is, determine whether the time point to be queried is within the time period of the trajectory data unit.

[0173] Then, for each trajectory data unit retrieved, a binary search is used to obtain precise spatiotemporal data matching the query conditions. The specific binary search process includes:

[0174] S804, for each retrieved trajectory data unit, determine the first spatiotemporal data located in the middle of the trajectory data unit; S805, for each query time point, determine whether the time point corresponding to the first spatiotemporal data is the same as the query time point; when the time point corresponding to the first spatiotemporal data is the same as the query time point, S806, then the first spatiotemporal data is the retrieved spatiotemporal data that meets the time condition; when the time point corresponding to the first spatiotemporal data is different from the query time point, S807, compare the time point corresponding to the first spatiotemporal data with the query time point; when the first time... If the time point corresponding to the empty data is earlier than the time point to be queried, in step S808, the spatiotemporal data located after the first spatiotemporal data is taken as a new trajectory data unit, and step S804 is executed as described above; if the time point corresponding to the first spatiotemporal data is not earlier than the time point to be queried, in step S809, the spatiotemporal data before the first spatiotemporal data is taken as a new trajectory data unit, and step S804 is executed as described above, until all spatiotemporal data that meet the time conditions are queried; in step S8010, all spatiotemporal data queried for each time point to be queried are merged into a query result.

[0175] In this embodiment of the invention, the unit of the above time point can be determined based on the time information in the spatiotemporal data. For example, if the time information in the spatiotemporal data is in seconds, the time point is accurate to the second; if the time information in the spatiotemporal data is in milliseconds, the time point is accurate to the millisecond.

[0176] The spatiotemporal data query method provided in this embodiment of the invention queries the historical spatiotemporal data set stored in the database for each entity corresponding to the spatiotemporal data according to the obtained query conditions. That is, the query is performed according to the spatiotemporal data set corresponding to different entities, rather than querying the spatiotemporal data in the database one by one. Therefore, it can query the spatiotemporal data corresponding to the entity more quickly according to the query conditions, and has a higher query speed.

[0177] This invention also provides a storage device for spatiotemporal data, and... Figure 1 The process shown corresponds to the one described above. Please refer to the relevant documentation. Figure 7 , Figure 7 This is a schematic diagram of a spatiotemporal data storage device according to an embodiment of the present invention, comprising:

[0178] The spatiotemporal data acquisition module 401 is used to acquire spatiotemporal data of one or more entities in the current time period; the spatiotemporal data includes: time information, spatial information and entity feature information.

[0179] The lookup module 402 is used to search the database for the historical spatiotemporal data set corresponding to each entity based on the entity feature information in the spatiotemporal data. The historical spatiotemporal data set includes the spatiotemporal data of the entity within the historical time period.

[0180] The first extraction module 403 is used to extract the spatiotemporal data of the first entity in the current time period from the spatiotemporal data of the current time period obtained for each first entity in the corresponding historical spatiotemporal data set.

[0181] The first storage module 404 is used to save the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set of the first entity.

[0182] Module 405 is used to create a new historical spatiotemporal data set for each second entity for which no corresponding historical spatiotemporal data set has been found.

[0183] The second extraction module 406 is used to extract the spatiotemporal data of the second entity in the current time period from the spatiotemporal data of the current time period that has been acquired.

[0184] The second storage module 407 is used to save the spatiotemporal data of the second entity in the current time period to a newly created historical spatiotemporal data set.

[0185] The aforementioned time period is a period pre-set based on the time period during which entity spatiotemporal data needs to be recorded.

[0186] Optionally, the lookup module 402 is specifically used to: extract the identification information of each entity from the entity feature information, and search for the historical spatiotemporal data set corresponding to each entity in the database according to the identification information of each entity.

[0187] The first extraction module 403 is specifically used to: extract the spatiotemporal data of the first entity in the current time period from the spatiotemporal data of the current time period obtained according to the identification information of the first entity.

[0188] The first storage module 404 is specifically used to: save the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set in the database corresponding to the identifier of the first entity.

[0189] Module 405 is specifically used to: create a historical spatiotemporal data set in the database corresponding to the identification information of the second entity.

[0190] The second extraction module 406 is specifically used to: extract the spatiotemporal data of the second entity in the current time period from the spatiotemporal data of the current time period obtained according to the identification information of the second entity.

[0191] The second storage module 407 is specifically used to: save the spatiotemporal data of the second entity in the current time period to a newly created historical spatiotemporal data set in the database.

[0192] Optionally, the first storage module 404 described above may also be specifically used to: generate a trajectory data unit for the current period corresponding to the current time period for each first entity; the trajectory data unit for the current period includes: trajectory data within the current time period; the trajectory data includes: spatiotemporal data sorted by acquisition time and containing only time and spatial information; and save the generated trajectory data unit for the current period to the historical spatiotemporal data set corresponding to the first entity in chronological order of the time periods.

[0193] The second storage module 407 described above can also be specifically used to: generate a trajectory data unit for the current period corresponding to the current time period for each second entity; and save the generated trajectory data unit for the current period to a newly created historical spatiotemporal data set.

[0194] The present invention provides a spatiotemporal data storage device that acquires spatiotemporal data of multiple entities within the current time period and saves the spatiotemporal data corresponding to the entity to the historical spatiotemporal data set of that entity. This allows the stored spatiotemporal data to be stored according to different entities, thus having the advantage of clear storage logic.

[0195] This invention also provides a spatiotemporal data query device, and... Figure 3 The process shown corresponds to the one described above. Please refer to the relevant documentation. Figure 8 , Figure 8 This is a schematic diagram of a spatiotemporal data query device according to an embodiment of the present invention, comprising:

[0196] The query condition acquisition module 501 is used to acquire query conditions.

[0197] The query module 502 is used to query the database for each entity corresponding to the spatiotemporal data, according to the query conditions, and to obtain the spatiotemporal data that meets the query conditions. The historical spatiotemporal data set corresponding to each entity includes the spatiotemporal data of the entity within the historical time period.

[0198] Optionally, if the obtained query condition is a time condition, then the query module 502 is specifically used to: query the database for each entity corresponding to the spatiotemporal data according to the time condition, and obtain the spatiotemporal data that meets the time condition.

[0199] Optionally, if the obtained query conditions are spatial conditions, then the query module 502 is specifically used to: query the database for each entity corresponding to the spatiotemporal data according to the spatial conditions, and obtain the spatiotemporal data that meets the spatial conditions.

[0200] Optionally, the identifier of each entity in the database is stored in correspondence with its historical spatiotemporal data set; when the obtained query condition is the identifier of the entity, if the obtained query condition is a time condition, then the query module 502 is specifically used to: compare the identifier of the entity in the query condition with the identifier of each entity in the database one by one, and obtain the spatiotemporal data of the entity in the database that is the same as the identifier of the entity in the query condition.

[0201] Optionally, the historical spatiotemporal data set stored for each entity includes the spatiotemporal data of that entity within a historical time period, comprising: trajectory data units of the entity in each historical period; each trajectory data unit contains: trajectory data within the current time period; the trajectory data includes: data sorted by acquisition time and containing only time and spatial information; when the obtained query conditions include time and spatial conditions, the query module 502 is specifically used to: for each entity corresponding to the spatiotemporal data, query the database for trajectory data units in the spatiotemporal data corresponding to each entity that contain time conditions; among the queried trajectory data units, query the spatiotemporal data that meets the time conditions; among the queried spatiotemporal data that meets the time conditions, query the spatiotemporal data that meets the spatial conditions.

[0202] Optionally, when the time condition is a time period, such as Figure 9 As shown, in Figure 8 Based on the device structure shown, the query device of this embodiment further includes:

[0203] The merging module 503 is used to merge trajectory data units belonging to continuous time periods from the queried trajectory data units containing time periods corresponding to time periods.

[0204] The query module 502 is specifically used to query spatiotemporal data that meet the time conditions in the merged trajectory data unit.

[0205] Specifically, the merging module 503 is used to: determine the start time and end time corresponding to each trajectory data unit; if the end time of the first trajectory data unit is the same as the start time of the second trajectory data unit, merge the first trajectory data unit and the second trajectory data unit; the first trajectory data unit and the second trajectory data unit are any two trajectory data units among the queried trajectory data units containing time conditions.

[0206] Optionally, when the time condition is a time point, the query module 502 is specifically used for: determining the first spatiotemporal data located in the middle of each queried trajectory data unit; determining whether the time point corresponding to the first spatiotemporal data is the same as the time point of the time condition; when the time point corresponding to the first spatiotemporal data is the same as the time point corresponding to the time condition, the first spatiotemporal data is the queried spatiotemporal data that meets the time condition; when the time point corresponding to the first spatiotemporal data is different from the time point corresponding to the time condition, comparing the time point corresponding to the first spatiotemporal data with the time point of the time condition; when the time point corresponding to the first spatiotemporal data is earlier than the time point corresponding to the time condition, in the trajectory data unit, the spatiotemporal data located after the first spatiotemporal data is taken as a new trajectory data unit, and the step of determining the first spatiotemporal data located in the middle of the trajectory data unit is executed; when the time point corresponding to the first spatiotemporal data is greater than the time point corresponding to the time condition, in the trajectory data unit, the spatiotemporal data located before the first spatiotemporal data is taken as a new trajectory data unit, and the step of determining the first spatiotemporal data located in the middle of the trajectory data unit is executed, until all spatiotemporal data that meets the time condition is queried.

[0207] Optionally, when the time condition is a time period, the above query module 502 is specifically used for:

[0208] Determine the start and end times of the time conditions; identify the start and end times, as well as all intermediate times between them, as the query times; based on the time period of the trajectory data units, query the trajectory data units containing each query time point; for each queried trajectory data unit, determine the first spatiotemporal data located in the middle of the trajectory data unit; for each query time point, determine whether the time point corresponding to the first spatiotemporal data is the same as the query time point; if the time point corresponding to the first spatiotemporal data is the same as the query time point, then the first spatiotemporal data is the queried spatiotemporal data that meets the time conditions; if the time point corresponding to the first spatiotemporal data is different from the query time point, then the first spatiotemporal data is the queried spatiotemporal data that meets the time conditions. When the time point corresponding to the first spatiotemporal data is earlier than the time point to be queried, the spatiotemporal data following the first spatiotemporal data is used as a new trajectory data unit, and the step of determining the first spatiotemporal data located in the middle of the trajectory data unit is executed. When the time point corresponding to the first spatiotemporal data is later than the time point to be queried, the spatiotemporal data preceding the first spatiotemporal data is used as a new trajectory data unit, and the step of determining the first spatiotemporal data located in the middle of the trajectory data unit is executed, until all spatiotemporal data that meet the time conditions are found. All spatiotemporal data found for each time point to be queried are merged into the query result.

[0209] The spatiotemporal data query device provided in this embodiment of the invention queries the historical spatiotemporal data set stored in the database for each entity according to the obtained query conditions, one by one, for the entities corresponding to the spatiotemporal data. That is, the query is performed according to the spatiotemporal data set corresponding to different entities, rather than querying the spatiotemporal data in the database one by one. Therefore, it can query the spatiotemporal data corresponding to the entity more quickly according to the query conditions, and has a higher query speed.

[0210] This invention also provides a server, such as... Figure 10 As shown, the server 600 includes a processor 601 and a machine-readable storage medium 602, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the processor being prompted by the machine-executable instructions to perform the following steps:

[0211] Acquire spatiotemporal data for the current time period of one or more entities; the spatiotemporal data includes: time information, spatial information, and entity feature information;

[0212] Based on the entity feature information in the spatiotemporal data, search the database for the historical spatiotemporal data set corresponding to each entity. The historical spatiotemporal data set includes: the spatiotemporal data of the entity within the historical time period.

[0213] For each first entity whose corresponding historical spatiotemporal data set has been found, extract the spatiotemporal data of the first entity in the current time period from the spatiotemporal data of the current time period obtained;

[0214] Save the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set of the first entity;

[0215] For each second entity for which no corresponding historical spatiotemporal data set was found, a new historical spatiotemporal data set corresponding to that second entity is created.

[0216] Extract the spatiotemporal data of the second entity in the current time period from the spatiotemporal data of the current time period obtained;

[0217] Save the spatiotemporal data of the second entity for the current time period to the newly created historical spatiotemporal data set.

[0218] The server provided in this embodiment of the invention acquires spatiotemporal data of multiple entities within the current time period and saves the spatiotemporal data corresponding to the entity to the historical spatiotemporal data set of that entity. This allows the stored spatiotemporal data to be stored according to different entity categories, thus having the advantage of clear storage logic.

[0219] This invention also provides a server, such as... Figure 11 As shown, the server 700 includes a processor 701 and a machine-readable storage medium 702. The machine-readable storage medium stores machine-executable instructions that can be executed by the processor. The processor is prompted by the machine-executable instructions to perform the following steps:

[0220] Retrieve query criteria;

[0221] For each entity corresponding to the spatiotemporal data, according to the query conditions, the database is queried for the historical spatiotemporal data set stored for each entity to obtain the spatiotemporal data that meets the query conditions; the historical spatiotemporal data set stored for each entity includes: the spatiotemporal data of the entity within the historical time period.

[0222] The server provided in this embodiment of the invention queries the historical spatiotemporal data set stored in the database for each entity corresponding to spatiotemporal data according to the obtained query conditions. That is, the query is performed according to the spatiotemporal data set corresponding to different entities, rather than querying the spatiotemporal data in the database one by one. Therefore, it can retrieve the spatiotemporal data corresponding to the entity more quickly according to the query conditions, and has a higher query speed.

[0223] The machine-readable storage medium mentioned in the above-mentioned server may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0224] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0225] This invention also provides a computer-readable storage medium storing a computer program for performing the following steps:

[0226] Acquire spatiotemporal data for the current time period of one or more entities; the spatiotemporal data includes: time information, spatial information, and entity feature information;

[0227] Based on the entity feature information in the spatiotemporal data, search the database for the historical spatiotemporal data set corresponding to each entity. The historical spatiotemporal data set includes: the spatiotemporal data of the entity within the historical time period.

[0228] For each first entity whose corresponding historical spatiotemporal data set has been found, extract the spatiotemporal data of the first entity in the current time period from the spatiotemporal data of the current time period obtained;

[0229] Save the spatiotemporal data of the first entity in the current time period to the historical spatiotemporal data set of the first entity;

[0230] For each second entity for which no corresponding historical spatiotemporal data set was found, a new historical spatiotemporal data set corresponding to that second entity is created.

[0231] Extract the spatiotemporal data of the second entity in the current time period from the spatiotemporal data of the current time period obtained;

[0232] Save the spatiotemporal data of the second entity for the current time period to the newly created historical spatiotemporal data set.

[0233] The present invention provides a computer-readable storage medium that acquires spatiotemporal data of multiple entities within the current time period and saves the spatiotemporal data corresponding to the entities to the historical spatiotemporal data set of the entities. This allows the stored spatiotemporal data to be stored according to different entities, thus having the advantage of clear storage logic.

[0234] This invention also provides a computer-readable storage medium storing a computer program for performing the following steps:

[0235] Retrieve query criteria;

[0236] For each entity corresponding to the spatiotemporal data, according to the query conditions, the database is queried for the historical spatiotemporal data set stored for each entity to obtain the spatiotemporal data that meets the query conditions; the historical spatiotemporal data set stored for each entity includes: the spatiotemporal data of the entity within the historical time period.

[0237] The present invention provides a computer-readable storage medium that, by querying the historical spatiotemporal data set corresponding to each entity in the database according to the obtained query conditions, queries are performed on the spatiotemporal data set corresponding to different entities, rather than querying the spatiotemporal data in the database one by one. Therefore, the spatiotemporal data corresponding to the entity can be retrieved more quickly according to the query conditions, resulting in a higher query speed.

[0238] For the device / server / storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments.

[0239] It should be noted that the apparatus, server, and storage medium in the embodiments of the present invention are respectively the apparatus, server, and storage medium for applying the above-mentioned spatiotemporal data storage method and query method. Therefore, all embodiments of the above-mentioned spatiotemporal data storage method and query method are applicable to the apparatus, server, and storage medium, and can achieve the same or similar beneficial effects.

[0240] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0241] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0242] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A method of storing spatio-temporal data, characterized by, The method comprises: acquiring spatio-temporal data of one or more entities in a current time period; the spatio-temporal data comprises time information, space information and entity feature information; finding a historical spatio-temporal data set corresponding to each entity in a database according to the entity feature information in the spatio-temporal data, the historical spatio-temporal data set comprising spatio-temporal data of the entity in a historical time period, wherein the database stores spatio-temporal data of different entities in the form of data sets; extracting spatio-temporal data of a first entity in the current time period from the acquired spatio-temporal data of the current time period for each first entity for which a corresponding historical spatio-temporal data set is found; saving the spatio-temporal data of the first entity in the current time period to the historical spatio-temporal data set of the first entity; for each second entity for which no corresponding historical spatio-temporal data set is found, newly creating a historical spatio-temporal data set corresponding to the second entity and saving the entity feature information of the second entity once; extracting spatio-temporal data of the second entity in the current time period from the acquired spatio-temporal data of the current time period; saving the spatio-temporal data of the second entity in the current time period to the newly created historical spatio-temporal data set; wherein the saving of the spatio-temporal data of the first entity in the current time period to the historical spatio-temporal data set of the first entity comprises: generating a current-period trajectory data unit corresponding to the current time period for each first entity, the current-period trajectory data unit containing trajectory data in the current time period, the trajectory data comprising spatio-temporal data sorted by collection time and containing only time information and space information without entity feature information; saving the generated current-period trajectory data unit to the historical spatio-temporal data set corresponding to the first entity in the order of time periods, wherein each trajectory data unit in the historical spatio-temporal data set corresponding to the first entity is saved in the order of time and each trajectory data unit contains trajectory data of the first entity in one time period; the saving of the spatio-temporal data of the second entity in the current time period to the newly created historical spatio-temporal data set comprises, for each second entity, generating a current-period trajectory data unit corresponding to the current time period and saving the generated current-period trajectory data unit to the newly created historical spatio-temporal data set.

2. The storage method according to claim 1, wherein, The time period is a period set in advance according to a time segment in a day during which spatio-temporal data of entities needs to be recorded.

3. The storage method of claim 1, wherein, The finding of a historical spatio-temporal data set corresponding to each entity in a database according to the entity feature information in the spatio-temporal data comprises: extracting identification information of each entity from the entity feature information; finding a historical spatio-temporal data set corresponding to each entity in a database according to the identification information of each entity; the extraction of spatio-temporal data of a first entity in the current time period from the acquired spatio-temporal data of the current time period comprises: extracting, according to the identification information of the first entity, current time period spatio-temporal data of the first entity from the obtained current time period spatio-temporal data; the saving of the current time period spatio-temporal data of the first entity into the historical spatio-temporal data set of the first entity comprises: saving the current time period spatio-temporal data of the first entity into a historical spatio-temporal data set corresponding to the identification of the first entity in the database; the newly establishing of the historical spatio-temporal data set corresponding to the second entity comprises: establishing, in the database, a historical spatio-temporal data set corresponding to the identification information of the second entity; the extracting of the current time period spatio-temporal data of the second entity from the obtained current time period spatio-temporal data comprises: extracting, according to the identification information of the second entity, current time period spatio-temporal data of the second entity from the obtained current time period spatio-temporal data; the saving of the current time period spatio-temporal data of the second entity into the newly established historical spatio-temporal data set comprises: saving the current time period spatio-temporal data of the second entity into the newly established historical spatio-temporal data set in the database.

4. A storage device for spatio-temporal data, characterized by The device comprises: a spatio-temporal data acquisition module, configured to acquire current time period spatio-temporal data of one or more entities; the spatio-temporal data comprises time information, space information and entity feature information; a searching module, configured to search, according to the entity feature information in the spatio-temporal data, a historical spatio-temporal data set corresponding to each entity in a database, the historical spatio-temporal data set comprising spatio-temporal data of the entity in a historical time period, wherein the database stores spatio-temporal data in the form of data sets according to different entities; a first extracting module, configured to extract, for each first entity for which a corresponding historical spatio-temporal data set is searched, current time period spatio-temporal data of the first entity from the acquired current time period spatio-temporal data; a first saving module, configured to save the current time period spatio-temporal data of the first entity into the historical spatio-temporal data set of the first entity; an establishing module, configured to, for each second entity for which no corresponding historical spatio-temporal data set is searched, newly establish a historical spatio-temporal data set corresponding to the second entity and save entity feature information of the second entity once; a second extracting module, configured to extract, from the acquired current time period spatio-temporal data, current time period spatio-temporal data of the second entity; a second saving module, configured to save the current time period spatio-temporal data of the second entity into the newly established historical spatio-temporal data set. The first saving module is specifically configured to: for each first entity, generate a current-period trajectory data unit corresponding to a current time period; the current-period trajectory data unit contains trajectory data in the current time period; the trajectory data includes time-space data sorted by collection time, which only contains time information and space information without entity feature information; and save the generated current-period trajectory data unit to a historical time-space data set corresponding to the first entity in a time-period order. The second saving module is specifically configured to: for each second entity, generate a current-period trajectory data unit corresponding to a current time period; and save the generated current-period trajectory data unit to a newly created historical time-space data set.

5. The memory device of claim 4, wherein, The time period is a period set in advance according to a time segment in a day during which entity time-space data needs to be recorded.

6. The memory device of claim 4, wherein, The finding module is specifically configured to: extract identification information of each entity from the entity feature information; and find the historical time-space data set corresponding to each entity in the database according to the identification information of each entity. The first extracting module is specifically configured to: extract the current-period time-space data of the first entity from the obtained current-period time-space data according to the identification information of the first entity. The first saving module is specifically configured to: save the current-period time-space data of the first entity to the historical time-space data set corresponding to the identification of the first entity in the database. The establishing module is specifically configured to: establish the historical time-space data set corresponding to the identification information of the second entity in the database. The second extracting module is specifically configured to: extract the current-period time-space data of the second entity from the obtained current-period time-space data according to the identification information of the second entity. The second saving module is specifically configured to: save the current-period time-space data of the second entity to the newly created historical time-space data set in the database.

7. A server, characterized by The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-3.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-3.

Citation Information

Patent Citations

  • Real-time database based meteorological element data organization type-in and querying method

    CN101984421A

  • Method and device for updating data

    CN106033452A

  • Security threat data integration method, device and system

    CN106372504A

  • Data processing method and device

    CN106649341A

  • Vehicle driving rule analysis method and system, computer device and storage medium

    CN109766821A