Multi-track space-time fitting generation method and system

By collecting and cleaning spatio-temporal data, and using Uber H3 and LZ4 algorithms to generate efficient spatial indexes, the problem of insufficient spatio-temporal trajectory data processing speed and accuracy in the existing technology is solved, and the efficiency and accuracy of multi-trajectory spatio-temporal fitting generation are achieved.

CN118747236APending Publication Date: 2024-10-08WUHAN FIBERHOME DIGITAL TECH CO LTD

Patent Information

Application Number
CN202410819138.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

When existing technology processes massive spatiotemporal trajectory data, there are problems such as limited storage and processing speed, insufficient accuracy, different grid shapes at different accuracies, and large differences in unit area of ​​geographical units, resulting in insufficient spatiotemporal trajectory generation accuracy.

Method used

The multi-trajectory spatio-temporal fitting generation method is used to clean the original data through collection and classification. The Uber H3 algorithm is used to generate a spatial index, and the data is saved to the ClickHouse distributed database. The LZ4 algorithm is used to achieve efficient compression and decompression, and is performed according to fence type according to needs. Analyze and generate spatiotemporal trajectory data.

Benefits of technology

It improves the accuracy of generating spatio-temporal trajectory data, solves the problems of different grid shapes and large differences in unit area of ​​geographical units under different accuracies, and ensures the consistency and efficiency of data processing in regions with different dimensions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747236A_ABST
    Figure CN118747236A_ABST
Patent Text Reader

Abstract

A multi-track space-time fitting generation method comprises the following steps: S100, collecting multi-track space-time original data, and carrying out classified cleaning on the original data to obtain space track data; s200, processing the spatial trajectory data to generate spatial index data, and storing the spatial trajectory data and the spatial index data to a ClickHouse distributed database cluster; and S300, according to a demand, analyzing the ClickHouse distributed database cluster according to a fence type to obtain a space-time trajectory of the demand. According to the method, the problems that the shapes of the grids are different under different precisions and the variation amplitude of the precisions is large in time are solved; in regions with different dimensions, the situation that the unit area difference of geographic units is large occurs, the distances from neighborhoods to a central grid are not equal, and the accuracy of generated space-time trajectories is insufficient exists.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data mining, and in particular to a method and system for generating multi-trajectory spatiotemporal fitting. Background Art

[0002] Massive spatiotemporal data records the position changes of objects in time and space on a large scale. Research on spatiotemporal data maximizes the value and utility of spatiotemporal data and applies it to public safety, smart transportation and other fields, which has important practical significance, mainly as follows:

[0003] The first is mobile behavior analysis: by mining spatiotemporal trajectory data, the behavior patterns, laws and trends of moving objects can be analyzed. For example, the movement trajectory of an object can be analyzed to infer information such as the range of activities and permanent locations; the second is trajectory prediction and recommendation: based on historical trajectory data, a prediction model can be established to predict future spatiotemporal location information, for example, predict the next stop location or movement path of an object, thereby realizing personalized recommendations, route planning and other applications; the third is anomaly detection and fault warning: by monitoring the abnormal patterns of spatiotemporal trajectory data, abnormal behaviors or equipment failures can be discovered in a timely manner. For example, in traffic monitoring, the cause of a traffic accident can be detected or traffic congestion can be warned by analyzing the trajectory of the vehicle.

[0004] At present, there are two main ways to generate and analyze spatiotemporal trajectories for data collection objects: one is the spatiotemporal trajectory fitting method based on traditional relational databases. This method mainly filters and cleans the acquired raw data and saves it in traditional databases such as postgresql or Oracle, and then generates spatiotemporal trajectory data according to query conditions. This method stores and processes massive, heterogeneous, and diverse spatiotemporal trajectory data, but the response speed and storage capacity are relatively limited; the second is the improved general spatiotemporal trajectory fitting method based on Geohash, HDFS, etc. This method filters and cleans the acquired raw data and uses the Geohash algorithm to generate a spatiotemporal index and saves it in a big data database, and then returns the spatiotemporal trajectory data according to query conditions. This method can meet the storage of massive data, but it also has the following shortcomings: the shapes of the grids are different under different precisions and the precision changes are sometimes small and sometimes large; there will be large differences in the unit area of ​​geographical units in areas of different dimensions; there are unequal distances from the neighborhood to the central grid, and the accuracy of generating spatiotemporal trajectories is insufficient. Summary of the invention

[0005] In view of the above problems, the present invention is proposed to provide a method and system for generating multi-trajectory spatiotemporal fitting that overcomes the above problems or at least partially solves the above problems.

[0006] In order to solve the above technical problems, the embodiments of the present application disclose the following technical solutions:

[0007] In a first aspect, an embodiment of the present invention discloses a method for generating multi-trajectory spatiotemporal fitting, comprising:

[0008] S100. Collecting multi-trajectory spatiotemporal raw data, classifying and cleaning the raw data, and obtaining spatial trajectory data;

[0009] S200. Process the spatial trajectory data, generate spatial index data, and save the spatial trajectory data and spatial index data to the ClickHouse distributed database cluster;

[0010] S300. According to the demand, the ClickHouse distributed database cluster is analyzed by fence type to obtain the required spatiotemporal trajectory.

[0011] Furthermore, in S100, the multi-track spatiotemporal raw data at least includes: a target unique identifier, a data timestamp, longitude and latitude, a data type of timing point data, and a data storage time.

[0012] Furthermore, in S100, the raw data is classified and cleaned to obtain spatial trajectory data, and the specific method includes:

[0013] Identify the data, including identifying a field representing location information, a field representing a timestamp, and a field that determines the type of the data point;

[0014] Clean the data, remove fields or rows that are not related to the spatial trajectory, process missing values, and correct erroneous data;

[0015] Classify the data and classify the data points into fixed-time points or stable base station points according to business requirements or the value of the data type field.

[0016] Furthermore, in S200, the spatial trajectory data is processed to generate spatial index data, and the specific method includes: using the Uber H3 algorithm H3Indexes.geoToH3(latitude, longitude, resolution) function to generate a spatial index, wherein resolutions of different dimensions represent geographic spaces of different sizes, and Uber H3 has a total of 16 dimensions, ranging from 0 to 15, wherein the higher the dimension, the smaller the area represented and the more accurate the precision.

[0017] Furthermore, in S200, the spatial trajectory data and spatial index data are saved in the ClickHouse distributed database cluster, and the generated long value is used as the primary key in the spatial index library ReplicateReplacingMergeTree storage engine. The loop waiting mechanism is triggered by specifying the time and the specified number and saved in the ClickHouse distributed database cluster, and the LZ4 algorithm is used to achieve efficient compression and decompression operations.

[0018] Furthermore, the specific method of the LZ4 algorithm to achieve efficient compression includes:

[0019] The input data is divided into blocks, and for each block of data, the characters are scanned one by one and inserted into a hash table; the hash table is used to store the previously appeared strings to build a dictionary;

[0020] The longest string that matches the current character is searched in the hash table. The length and relative position of the matching string are encoded and output. For shorter matching strings, the length and relative position are encoded as 1 byte and 2 bytes respectively. For longer matching strings, the length and relative position are encoded as 2 bytes and 4 bytes respectively.

[0021] Furthermore, the specific method of the LZ4 algorithm to achieve efficient decompression includes: reading the header information of the compressed block, including the size metadata of the compressed block; decompressing each data block one by one according to the mark and length information written during the compression process; during the decompression process, judging whether the current value is a literal or a matching string according to the mark; for literals, directly copying to the output; for matching strings, copying the corresponding data from the decompressed data to the output according to the length and offset.

[0022] Furthermore, in S300, according to demand, the ClickHouse distributed database cluster is subjected to collision analysis according to fence type, and the fence type includes at least a circular fence type and a polygonal fence type; when the fence type is a circular fence type, the specific method includes: using the built-in function geoToH3(lon,lat,resolution) in the ClickHouse distributed database to obtain the H3 point index of the specified resolution, the h3EdgeLengthM(resolution) function to calculate the average length of the H3 hexagonal edge, the arrayJoin(h3kRing(h3index,k)) function to obtain the H3 index array, and the greatCircleDistance function to calculate the spherical distance between two longitude and latitude coordinates, so as to quickly obtain the spatial index of the object within the specified circle, and then quickly obtain the spatiotemporal fitting trajectory data of the object corresponding to the spatial index.

[0023] Furthermore, when the fence type is a polygonal fence type, the specific method includes: creating a LinearRing object according to five or more points of the polygon, then creating a Polygon object according to the factory class GeometryFactory, then obtaining all GeoCoord objects in the polygon plane through Geometry and storing them in the List generic array, and then according to H3's polyfill (List <geocoord>points,List<List <geocoord>>holes,intres)api to get the spatial index of the specified latitude in Uber H3 and execute the result in ClickHouse with the built-in function pointInPolygon(x,y,polygon).

[0024] In a second aspect, an embodiment of the present invention discloses a system for generating multi-trajectory spatiotemporal fitting, including: a data collection and sorting module, a spatial index generation module, a data storage module and a spatiotemporal trajectory generation module; wherein:

[0025] The data collection and sorting module is used to collect multi-trajectory spatiotemporal raw data, classify and clean the raw data, and obtain spatial trajectory data;

[0026] A spatial index generation module, used to process the spatial trajectory data to generate spatial index data;

[0027] A data storage module, used to save the spatial trajectory data and spatial index data to a ClickHouse distributed database cluster;

[0028] The spatiotemporal trajectory generation module is used to analyze the ClickHouse distributed database cluster according to the fence type according to the needs, and obtain the required spatiotemporal trajectory.

[0029] The beneficial effects of the above technical solution provided by the embodiment of the present invention include at least:

[0030] The present invention discloses a method for generating multi-trajectory spatiotemporal fitting, including: S100. Collecting multi-trajectory spatiotemporal raw data, classifying and cleaning the raw data, and obtaining spatial trajectory data; S200. Processing the spatial trajectory data, generating spatial index data, and saving the spatial trajectory data and spatial index data to a ClickHouse distributed database cluster; S300. Analyzing the ClickHouse distributed database cluster by fence type according to demand to obtain the required spatiotemporal trajectory. The present invention solves the problem that the shapes of grids under different precisions are different and the amplitude of precision changes from small to large; in areas of different dimensions, there will be large differences in the unit area of ​​geographical units, and there are unequal distances from the neighborhood to the center grid, resulting in insufficient accuracy in generating spatiotemporal trajectories.

[0031] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0033] Figure 1 This is a flow chart of a method for generating multi-trajectory spatiotemporal fitting in Embodiment 1 of the present invention;

[0034] Figure 2 This is a structural diagram of a system for generating multi-trajectory spatiotemporal fitting in Example 2 of the present invention. DETAILED DESCRIPTION

[0035] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0036] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a method and system for generating multi-trajectory spatiotemporal fitting.

[0037] Example 1

[0038] The present invention discloses a method for generating multi-trajectory spatiotemporal fitting. Figure 1 ,include:

[0039] S100. Collect multi-track spatiotemporal raw data, classify and clean the raw data to obtain spatial trajectory data; specifically, collect multi-track spatiotemporal data through sensors, GPS and other equipment, and the multi-track spatiotemporal raw data at least includes: target unique identification, data timestamp, longitude and latitude, data type timing point data and data storage time.

[0040] Specifically, for example, the collected raw data sample is as follows: ["bc5e7eeb-03c9-4a21-b40a-1ce556928a3c","1682959337292","113.994565","22.670532","4","2023-05-02"], where bc5e7eeb-03c9-4a21-b40a-1ce556929a3c represents the target unique identifier, 1682959337292 represents the data timestamp, 113.994565 represents the longitude, 22.670532 represents the latitude, 4 represents the data type of timing point data, and 2023-05-02 represents the storage time.

[0041] In S100 of this embodiment, the original data is classified and cleaned to obtain spatial trajectory data. The specific method includes:

[0042] Identify the data, including identifying a field representing location information, a field representing a timestamp, and a field that determines the type of the data point;

[0043] Clean the data, remove fields or rows that are not related to the spatial trajectory, process missing values, and correct erroneous data;

[0044] Classify the data and classify the data points into fixed-time points or stable base station points according to business requirements or the value of the data type field.

[0045] Specifically, when classifying and cleaning the raw data and obtaining spatial trajectory data, first, you need to understand the structure and content of the raw data, especially the fields related to spatial location and timestamps. Identify which fields represent location information (such as longitude and latitude), which fields represent timestamps, and which fields can help you determine the type of data point (such as timing point or base station stable point).

[0046] Then clean out the fields or rows that are not related to the spatial trajectory. Specifically, it includes: Handling missing values: If the location information or timestamp is missing, you need to decide whether to delete these rows, interpolate and fill them, or use other methods to handle them according to the specific situation. Correcting erroneous data: Check and correct obvious errors, such as unreasonable latitude and longitude values ​​or timestamps.

[0047] The data is then classified: based on business needs or the value of the data type field, the data points are classified as either timing points or base station stable points. This may involve creating a new classification field and using conditional statements or query operations to update the value of the field.

[0048] Finally, the spatial trajectory is constructed: connect the data points with continuous timestamps and location information to form a spatial trajectory. This may require sorting the data (by timestamp) and ensuring that the location information is continuous. If there is noise or error in the data, it may be necessary to use spatial interpolation or smoothing techniques to optimize the trajectory.

[0049] S200. Process the spatial trajectory data, generate spatial index data, and save the spatial trajectory data and spatial index data to the ClickHouse distributed database cluster;

[0050] In S200 of this embodiment, the spatial trajectory data is processed to generate spatial index data. The specific method includes: using the Uber H3 algorithm H3Indexes.geoToH3(latitude, longitude, resolution) function to generate a spatial index, where resolutions of different dimensions represent geographic spaces of different sizes. Uber H3 has a total of 16 dimensions, ranging from 0 to 15, where the higher the dimension, the smaller the area represented and the more accurate it is.

[0051] In this embodiment, the spatial trajectory data and spatial index data are saved in the ClickHouse distributed database cluster, and the generated long value is used as the primary key in the spatial index library ReplicateReplacingMergeTree storage engine. The loop waiting mechanism is triggered by specifying the time and the specified number and saved in the ClickHouse distributed database cluster, and the LZ4 algorithm is used to achieve efficient compression and decompression operations.

[0052] The ReplicateReplacingMergeTree storage engine is used in the spatiotemporal fitting trajectory database. The LZ4 algorithm is used in the engine. LZ4 is a fast and lossless compression algorithm that supports multiple compression levels. It is based on the LZ77 algorithm and dictionary compression technology. It uses hash tables and pointers to find and replace repeated patterns in data, thereby achieving efficient compression and decompression operations. The LZ4 algorithm does not need to know the size of the input data in advance during the compression process. It can compress data while reading it, which is very suitable for processing large-scale data streams and real-time data compression scenarios;

[0053] The specific method of implementing efficient compression using the LZ4 algorithm includes:

[0054] The input data is divided into blocks, and for each block of data, the characters are scanned one by one and inserted into a hash table; the hash table is used to store the previously appeared strings to build a dictionary;

[0055] The longest string that matches the current character is searched in the hash table. The length and relative position of the matching string are encoded and output. For shorter matching strings, the length and relative position are encoded as 1 byte and 2 bytes respectively. For longer matching strings, the length and relative position are encoded as 2 bytes and 4 bytes respectively.

[0056] In this embodiment, the specific method of the LZ4 algorithm to achieve efficient decompression includes: reading the header information of the compressed block, including the size metadata of the compressed block; decompressing each data block one by one according to the mark and length information written during the compression process; during the decompression process, judging whether the current value is a literal or a matching string according to the mark; for literals, directly copying to the output; for matching strings, copying the corresponding data from the decompressed data to the output according to the length and offset.

[0057] S300. According to the demand, the ClickHouse distributed database cluster is analyzed by fence type to obtain the required spatiotemporal trajectory.

[0058] In S300 of this embodiment, according to the needs, the ClickHouse distributed database cluster is subjected to collision analysis according to the fence type, and the fence type includes at least a circular fence type and a polygonal fence type; when the fence type is a circular fence type, the specific method includes: using the built-in function geoToH3(lon,lat,resolution) in the ClickHouse distributed database to obtain the H3 point index of the specified resolution, the h3EdgeLengthM(resolution) function to calculate the average length of the H3 hexagonal edge, the arrayJoin(h3kRing(h3index,k)) function to obtain the H3 index array, and the greatCircleDistance function to calculate the spherical distance between two longitude and latitude coordinates, so as to quickly obtain the spatial index of the object within the specified circle, and then quickly obtain the spatiotemporal fitting trajectory data of the object corresponding to the spatial index.

[0059] In some preferred embodiments, when the fence type is a polygon fence type, the specific method includes: creating a LinearRing object according to the five points (or more) of the polygon, then creating a Polygon object according to the factory class GeometryFactory, and then obtaining all GeoCoord objects in the polygon plane through Geometry and storing them in the List generic array, and then according to the H3 polyfill (List <geocoord>points,List<List <geocoord>>holes,int res)api to get the spatial index of the specified latitude in Uber H3, and execute the result in ClickHouse with the built-in function pointInPolygon(x,y,polygon).

[0060] The present embodiment discloses a method for generating multi-trajectory spatiotemporal fitting, including: S100. Collecting multi-trajectory spatiotemporal raw data, classifying and cleaning the raw data, and obtaining spatial trajectory data; S200. Processing the spatial trajectory data, generating spatial index data, and saving the spatial trajectory data and spatial index data to the ClickHouse distributed database cluster; S300. Analyzing the ClickHouse distributed database cluster by fence type according to demand to obtain the required spatiotemporal trajectory. The present invention solves the problem that the shapes of grids under different precisions are different and the amplitude of precision changes from small to large; in areas of different dimensions, there will be large differences in the unit area of ​​geographical units, and there are unequal distances from the neighborhood to the central grid, resulting in insufficient accuracy in generating spatiotemporal trajectories.

[0061] Example 2

[0062] Based on the method for generating multi-trajectory spatiotemporal fitting in Example 1, this embodiment discloses a system for generating multi-trajectory spatiotemporal fitting, such as Figure 2 , including: data collection and sorting module, spatial index generation module, data storage module and spatiotemporal trajectory generation module; among which:

[0063] The data collection and sorting module is used to collect multi-trajectory spatiotemporal raw data, classify and clean the raw data, and obtain spatial trajectory data;

[0064] A spatial index generation module, used to process the spatial trajectory data to generate spatial index data;

[0065] A data storage module, used to save the spatial trajectory data and spatial index data to a ClickHouse distributed database cluster;

[0066] The spatiotemporal trajectory generation module is used to analyze the ClickHouse distributed database cluster according to the fence type according to the needs, and obtain the required spatiotemporal trajectory.

[0067] The specific working principles of the data collection and sorting module, the spatial index generation module, the data storage module and the spatiotemporal trajectory generation module have been described in detail in Example 1, and will not be repeated in this embodiment.

[0068] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.

[0069] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.

[0070] Those skilled in the art will also appreciate that the various illustrative logic blocks, modules, circuits, and algorithmic steps described in conjunction with the embodiments herein can all be implemented as electronic hardware, computer software, or a combination thereof. In order to clearly illustrate the interchangeability between hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above around their functions. Whether such functions are implemented as hardware or software depends on specific applications and the design constraints imposed on the entire system. A skilled person can implement the described functions in an alternative manner for each specific application, but such implementation decisions should not be interpreted as departing from the scope of protection of the present disclosure.

[0071] The steps of the method or algorithm described in conjunction with the embodiments herein may be directly embodied as hardware, a software module executed by a processor, or a combination thereof. The software module may be located in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a mobile disk, a CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may be located in an ASIC. The ASIC may be located in a terminal. Of course, the processor and the storage medium may also be present in a terminal as discrete components.

[0072] For software implementation, the techniques described in this application can be implemented with modules (e.g., procedures, functions, etc.) that perform the functions described in this application. These software codes can be stored in a memory unit and executed by a processor. The memory unit can be implemented within the processor or outside the processor. In the latter case, it is coupled to the processor in a communication manner via various means, which are well known in the art.

[0073] The above description includes examples of one or more embodiments. Of course, it is not possible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the term is covered in a manner similar to the term "including", as explained by "including" used as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".< / geocoord> < / geocoord> < / geocoord> < / geocoord>

Claims

1. A method for generating multi-trajectory spatiotemporal fitting, characterized in that: include: S100. Collecting multi-trajectory spatiotemporal raw data, classifying and cleaning the raw data, and obtaining spatial trajectory data; S200. Process the spatial trajectory data, generate spatial index data, and save the spatial trajectory data and spatial index data to the ClickHouse distributed database cluster; S300. According to the demand, the ClickHouse distributed database cluster is analyzed by fence type to obtain the required spatiotemporal trajectory.

2. A method for generating multi-trajectory spatiotemporal fitting according to claim 1, characterized in that: In S100, the multi-track spatiotemporal raw data at least includes: a target unique identifier, a data timestamp, longitude and latitude, a data type of timing point data, and a data storage time.

3. The method for generating multi-trajectory spatiotemporal fitting according to claim 1, characterized in that: In S100, the raw data is classified and cleaned to obtain spatial trajectory data. The specific method includes: Identify the data, including identifying a field representing location information, a field representing a timestamp, and a field that determines the type of the data point; Clean the data, remove fields or rows that are not related to the spatial trajectory, process missing values, and correct erroneous data; Classify the data and classify the data points into fixed-time points or stable base station points according to business requirements or the value of the data type field.

4. The method for generating multi-trajectory spatiotemporal fitting according to claim 1, characterized in that: In S200, the spatial trajectory data is processed to generate spatial index data. The specific method includes: using the Uber H3 algorithm H3Indexes.geoToH3(latitude, longitude, resolution) function to generate a spatial index, wherein resolutions of different dimensions represent geographic spaces of different sizes. Uber H3 has a total of 16 dimensions, ranging from 0 to 15, wherein the higher the UberH3 dimension, the smaller the area represented and the more accurate it is.

5. The method for generating multi-trajectory spatiotemporal fitting according to claim 1, characterized in that: In S200, the spatial trajectory data and spatial index data are saved in the ClickHouse distributed database cluster, and the generated long value is used as the primary key in the spatial index library ReplicateReplacingMergeTree storage engine. The loop waiting mechanism is triggered by specifying the time and the specified number and saved in the ClickHouse distributed database cluster, and the LZ4 algorithm is used to achieve efficient compression and decompression operations.

6. The method for generating multi-trajectory spatiotemporal fitting according to claim 1, characterized in that: The specific method of the LZ4 algorithm to achieve efficient compression includes: The input data is divided into blocks, and for each block of data, the characters are scanned one by one and inserted into a hash table; the hash table is used to store the previously appeared strings to build a dictionary; The longest string that matches the current character is searched in the hash table. The length and relative position of the matching string are encoded and output. For shorter matching strings, the length and relative position are encoded as 1 byte and 2 bytes respectively. For longer matching strings, the length and relative position are encoded as 2 bytes and 4 bytes respectively.

7. The method for generating multi-trajectory spatiotemporal fitting according to claim 1, characterized in that: The specific method of implementing efficient decompression by the LZ4 algorithm includes: reading the header information of the compressed block, including the size metadata of the compressed block; decompressing each data block one by one according to the mark and length information written during the compression process; during the decompression process, judging whether the current value is a literal value or a matching string according to the mark; for literals, directly copying to the output; for matching strings, copying the corresponding data from the decompressed data to the output according to the length and offset.

8. The method for generating multi-trajectory spatiotemporal fitting according to claim 1, characterized in that: In S300, according to the requirements, the ClickHouse distributed database cluster is subjected to collision analysis according to the fence type, and the fence type includes at least a circular fence type and a polygonal fence type; When the fence type is a circular fence type, the specific method includes: using the built-in function geoToH3(lon,lat,resolution) in the ClickHouse distributed database to obtain the H3 point index of the specified resolution, the h3EdgeLengthM(resolution) function to calculate the average length of the H3 hexagonal edge, the arrayJoin(h3kRing(h3index,k)) function to obtain the H3 index array, and the greatCircleDistance function to calculate the spherical distance between two longitude and latitude coordinates, quickly obtain the spatial index of the object within the specified circle, and then quickly obtain the space-time fitting trajectory data of the object corresponding to the spatial index.

9. The method for generating multi-trajectory spatiotemporal fitting according to claim 1, characterized in that: When the fence type is a polygonal fence type, the specific method includes: creating a LinearRing object according to five or more points of the polygon, then creating a Polygon object according to the factory class GeometryFactory, and then obtaining all GeoCoord objects in the polygon plane through Geometry and storing them in the List generic array, and then according to H3's polyfill (List <geocoord>points,List<List <geocoord> >holes,int res)api to get the spatial index of the specified latitude in Uber H3, and execute the result in ClickHouse with the built-in function pointInPolygon(x,y,polygon).< / geocoord> < / geocoord> 10. A system for generating multi-trajectory spatiotemporal fitting, characterized in that: include: Data collection and sorting module, spatial index generation module, data storage module and spatiotemporal trajectory generation module; among which: The data collection and sorting module is used to collect multi-trajectory spatiotemporal raw data, classify and clean the raw data, and obtain spatial trajectory data; A spatial index generation module, used to process the spatial trajectory data to generate spatial index data; A data storage module, used to save the spatial trajectory data and spatial index data to a ClickHouse distributed database cluster; The spatiotemporal trajectory generation module is used to analyze the ClickHouse distributed database cluster according to the fence type according to the needs, and obtain the required spatiotemporal trajectory.

Citation Information

Patent Citations

  • Trajectory data processing method and device and electronic equipment

    CN111143497A

  • Space-time trajectory data processing method and device, electronic equipment and storage medium

    CN113946575A

  • Space-time target description character generation method based on open source space-time data

    CN114707511A

  • Regional analysis method based on spatial grid index

    CN115543998A

  • Storage and retrieval method and system based on spatio-temporal data density perception

    CN117370347A

Cited By

  • Multi-source marine environment data storage method and system based on HDF5

    CN120336278A