General spatio-temporal data coding method and device, and storage medium
By generating metadata management tables and binary encoding of urban spatiotemporal data, the problem of inefficient spatiotemporal data processing in the prior art is solved, and rapid indexing and analysis of spatiotemporal data is realized.
Patent Information
- Application Number
- CN202510444968.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-04-10
AI Technical Summary
When judging the encoded slices of data storage, the prior art relies on checking the degree of matching between the data items and the encoded slices one by one, and cannot quickly locate the encoded slices that data should be stored, resulting in inefficient spatiotemporal data processing.
By generating a metadata management table, product information, time information and spatial information of urban spatiotemporal data are extracted, and the information is binary coded, and finally combined to generate general spatiotemporal data encoding.
It realizes rapid indexing, retrieval and analysis of spatiotemporal data, improves data processing efficiency and quality, and solves the problem of inefficient spatiotemporal data retrieval.
Smart Images

Figure CN119961373A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a general spatiotemporal data encoding method, device and storage medium. Background Art
[0002] Under the coding technology system, data is allocated to different coding slice dimensional spaces for storage, so that it can be efficiently retrieved and processed later. However, when judging the coding slices where data is stored, it currently relies on checking the matching degree between data items and coding slices one by one, and it is impossible to quickly locate the coding slice where the data should be stored, resulting in low efficiency in spatiotemporal data processing.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide a universal spatiotemporal data encoding method, device and storage medium, aiming to solve the technical problem of low spatiotemporal data retrieval efficiency.
[0005] To achieve the above objectives, the present application proposes a universal spatiotemporal data encoding method, which includes: Generate metadata management table based on the read urban spatiotemporal data; Extracting product information, time information and space information of each of the city spatiotemporal data according to the metadata management table; Binary-encode the product information, time information, and space information respectively to obtain a product code, a time code, and a space code; The product code, the time code and the space code are integrated to generate a universal spatiotemporal data code for the spatiotemporal data of each city.
[0006] In one embodiment, the step of generating a metadata management table based on the read urban spatiotemporal data includes: Constructing a primary key of the metadata management table according to the product category of the urban spatiotemporal data; Based on the primary key, construct the secondary key of the metadata management table according to the production time of the urban spatiotemporal data; The metadata information of the urban spatiotemporal data is matched to the corresponding secondary key as the value of the metadata management table.
[0007] In one embodiment, the step of respectively performing binary encoding on the product information, time information and space information to obtain a product code, a time code and a space code comprises: Based on the product information of the spatiotemporal data of each city, hierarchical coding is performed according to a preset coding table as a product code; Based on the time information of the spatiotemporal data of each city, Unix time coding is performed to determine the time code; Based on the spatial information of the spatiotemporal data of each city, GeoSOT coding is performed to determine the geographic space coding.
[0008] In one embodiment, the step of performing Unix time coding based on the time information of each of the city spatiotemporal data and determining the time coding comprises: Sorting the time information, and performing Unix time encoding on each time variable in the sorted time information; The result of the Unix time encoding is converted into a binary code as the time code.
[0009] In one embodiment, the step of performing GeoSOT coding based on the spatial information of the spatiotemporal data of each city and determining the geospatial coding comprises: Calculating the directional bounding box range of the urban spatiotemporal data at each time point according to the spatial information; Selecting the maximum value in the oriented bounding box range within the time span as the reference space range, and determining the GeoSOT subdivision level code; The corresponding geographic space code is generated according to the subdivision level corresponding to the subdivision level code and the reference space range.
[0010] In one embodiment, the step of generating the corresponding geographic space code according to the subdivision level corresponding to the subdivision level code and the reference space range includes: According to the subdivision level, determining the level of the urban spatiotemporal data in the GeoSOT code, and calculating the boundary of the GeoSOT slice at the level; Compare the reference spatial range of the urban spatiotemporal data with the boundary of the GeoSOT slice, and determine the GeoSOT slice covered by the reference spatial range of the urban spatiotemporal data as the selected slice; According to the GeoSOT coding rule, the row and column indexes of the selected slice are calculated, and the row and column indexes of the selected slice are converted into binary numbers as the geospatial coding.
[0011] In one embodiment, the step of fusing the product code, the time code and the geographic space code to generate a universal spatiotemporal data code for each of the city spatiotemporal data includes: The segmentation level code, geographic space code, time code and product code are sequentially concatenated to obtain a long binary string as the universal spatiotemporal data code.
[0012] In one embodiment, after the step of fusing the product code, the time code and the geographic space code to generate a universal spatiotemporal data code for each of the city spatiotemporal data, the following steps are included: According to the query instruction of the client, the time parameter, product parameter and space parameter in the query instruction are parsed, the time parameter is converted into the corresponding time parameter code, and the product parameter is converted into the corresponding product parameter code; Compare the time parameter code with the time code portion in the universal spatiotemporal data code to obtain a corresponding time slice array; For the time slice array, further using the product parameter code to compare with the product code portion in the universal spatiotemporal data code to determine the corresponding product slice array; In the product slice array, the spatial range queried in the query instruction is determined according to the spatial parameters, and the intersection range with the spatial range of the universal spatiotemporal data encoding is determined through a spatial intersection algorithm, and the corresponding spatial slice array is determined as a query result and returned to the client.
[0013] In addition, to achieve the above-mentioned objectives, the present application also proposes a universal spatiotemporal data encoding device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the universal spatiotemporal data encoding method as described above.
[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the general spatiotemporal data encoding method described above are implemented.
[0015] The present application provides a universal spatiotemporal data encoding method, which generates a metadata management table based on the read urban spatiotemporal data; extracts the product information, time information and space information of each urban spatiotemporal data according to the metadata management table; performs binary encoding on the product information, time information and space information respectively to obtain product code, time code and geographic space code; integrates the product code, time code and geographic space code to generate universal spatiotemporal data code of each urban spatiotemporal data. The present application first realizes the comprehensive and systematic management of spatiotemporal data by constructing a metadata management system and generating a metadata management table, and performs binary encoding by extracting the product, time and space dimension information of spatiotemporal data from the metadata management table, converting complex data information into binary information that is easy for machines to understand, thereby improving data processing efficiency and quality. The encoded product, time and space dimension information are integrated to generate a universal spatiotemporal data code, realizing rapid indexing, retrieval and analysis of spatiotemporal data. The present application achieves the technical effect of improving the efficiency of spatiotemporal data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0018] Figure 1 A schematic diagram of a flow chart provided for Embodiment 1 of the general spatiotemporal data encoding method of the present application; Figure 2 Logical structure diagram of the metadata management table provided for the general spatiotemporal data encoding method of this application; Figure 3 A general spatiotemporal data encoding structure diagram provided for the general spatiotemporal data encoding method of this application; Figure 4 A schematic diagram of a flow chart provided for Embodiment 2 of the general spatiotemporal data encoding method of the present application; Figure 5 A flowchart diagram of Embodiment 3 of the general spatiotemporal data encoding method of the present application is provided; Figure 6 A flowchart diagram of Embodiment 4 of the general spatiotemporal data encoding method of the present application is provided; Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the general spatiotemporal data encoding method in the embodiment of the present application.
[0019] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0020] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0021] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0022] The main solutions of the embodiments of this application are: At present, under the coding technology system, data is allocated to different coding slice spaces for storage, so as to facilitate efficient retrieval and processing later. However, when judging the coding slices where data is stored, it is currently necessary to check the matching degree between data items and coding slices one by one, and it is impossible to quickly locate the coding slice where the data should be stored, resulting in low efficiency in spatiotemporal data processing.
[0023] This application achieves comprehensive and systematic management of spatiotemporal data by building a metadata management system and generating a metadata management table. By extracting the product, time, and space dimension information of spatiotemporal data from the metadata management table and performing binary encoding, complex data information is converted into binary information that is easy for machines to understand, thereby improving data processing efficiency and quality. The encoded product, time, and space dimension information are integrated to generate a universal spatiotemporal data encoding, which enables rapid indexing, retrieval, and analysis of spatiotemporal data.
[0024] It should be noted that the execution subject of this embodiment may be a universal spatiotemporal data coding system, or a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a control device of a universal spatiotemporal data coding system capable of realizing the above functions, etc., and this embodiment does not specifically limit this. The following takes the universal spatiotemporal data coding system as an example of the execution subject to explain this embodiment and the following embodiments.
[0025] Embodiment 1 Based on this, the present application proposes a general spatiotemporal data encoding method of the first embodiment, please refer to Figure 1 , the general spatiotemporal data encoding method comprises: Step S10: Generate a metadata management table based on the read city spatiotemporal data.
[0026] Build a comprehensive, systematic and efficient metadata management system to manage and describe multi-source heterogeneous urban spatiotemporal data across time domains. By building a metadata management system and generating metadata management tables, we can better understand and utilize multi-source heterogeneous urban spatiotemporal data across time domains and improve the efficiency and quality of data processing.
[0027] In this embodiment, urban spatiotemporal data is multi-source heterogeneous urban spatiotemporal data across time domains. Cross-time domain means that the data spans different time periods, and cross-time domain data means that the time attribute of the data needs to be considered in order to accurately record and manage in the metadata management system. Multi-source heterogeneity means that the data comes from multiple different sources, and the data has differences in structure, format, content, etc. Urban spatiotemporal data is data with timestamps and geographic location information, including various information such as traffic flow, environmental monitoring, and population distribution in the city.
[0028] In this embodiment, metadata is data that describes data, including the source, format, timestamp, spatial range, etc. of the data. The metadata management table is a data structure used to store and manage metadata, which is stored in the form of key-value pairs and uses the Redis memory data structure. A key-value pair is a data structure composed of a key and a value, and is used to quickly retrieve data. Redis is an open source, high-performance key-value storage system used for caching and message queues.
[0029] As an alternative implementation, please refer to Figure 2 The logical structure of the metadata management table shown in the figure reads the urban spatiotemporal data through multi-threaded concurrent reading, obtains and records key information, builds a metadata management system based on the key information, generates a metadata management table including primary keys, secondary keys and values, and uses the Redis hash table data structure to store the metadata management table. Among them, the key information includes file path, file name, coordinate system calibration, spatial range, time information, file format, etc.
[0030] Optionally, when reading data, a file reading method is determined according to the storage mode and medium of the file data. Methods such as single-threaded reading, distributed reading, and cloud reading can be used.
[0031] It should be noted that single-threaded reading is suitable for small-scale data sets or sequentially accessed files. Single-threaded reading is simple to implement and does not require thread synchronization issues. Multi-threaded concurrent reading is suitable for large-scale data sets. When data can be divided into multiple independent blocks for parallel processing, using multi-threaded concurrent reading can fully utilize the parallel processing capabilities of multi-core processors and improve I / O performance. Distributed reading is suitable for large data sets in distributed storage systems. Distributed reading can read data in parallel across multiple nodes, improving the throughput and fault tolerance of the overall system. Cloud reading is suitable for data stored on cloud storage services. It can take advantage of the elasticity and scalability of cloud storage services, as well as the network acceleration and data transmission optimization provided by cloud providers.
[0032] Optionally, the metadata management table can be stored not only in Redis, but also in a file system or a database, and its content format can be JSON, binary, XML, library table, etc.
[0033] Optionally, the primary and secondary keys of the metadata management table are not fixed, and two keys can be selected from the time, product, and space dimensions respectively to form a combination.
[0034] Optionally, step S10 includes: Step S11, constructing a primary key of the metadata management table according to the product category of the urban spatiotemporal data.
[0035] It should be noted that the product category is the category to which the urban spatiotemporal data belongs, including traffic flow, environmental monitoring, population distribution, etc. The primary key is the key used to distinguish data of different product categories in the metadata management table.
[0036] Exemplarily, according to the product categories of the urban spatiotemporal data, the data is preliminarily classified to determine a list of product categories of the urban spatiotemporal data, and a unique identifier is assigned to each product category as a primary key.
[0037] It should be noted that in the metadata management table, the primary key is used as the index to provide a basis for subsequent data storage and retrieval.
[0038] Step S12: Based on the primary key and according to the production time of the urban spatiotemporal data, construct a secondary key of the metadata management table.
[0039] On the basis of the primary key, the urban spatiotemporal data is further classified and managed in the time dimension, and the data with different production times under the same product category are distinguished by constructing a secondary key.
[0040] It should be noted that the production time is the time when the urban spatiotemporal data is generated or recorded. The secondary key is a key in the metadata management table that further subdivides the data based on the primary key and is used to distinguish different production time data under the same product category.
[0041] Exemplarily, based on the primary key, the data is further classified according to the production time of the data, the production time of each city's spatiotemporal data is extracted, and the production time information is converted into a timestamp or date string format as a secondary key and associated with the corresponding primary key.
[0042] Step S13, matching the metadata information of the city spatiotemporal data to the corresponding secondary key as the value of the metadata management table.
[0043] Associate the specific metadata information with the corresponding secondary key to complete the construction of the metadata management table.
[0044] It should be noted that the value is the data associated with the key, that is, the specific metadata information stored in the metadata management table.
[0045] Exemplarily, the metadata information to be stored is determined, including file path, file name, coordinate system calibration, spatial range, time information, file format, etc. This information is paired with the corresponding secondary key, and the paired metadata information is stored as a value under the corresponding secondary key in the metadata management table.
[0046] Step S20: extracting product information, time information and space information of each of the city spatiotemporal data according to the metadata management table.
[0047] In this embodiment, product information refers to the category or type of urban spatiotemporal data, such as traffic data, meteorological data, etc. Time information refers to the time attribute of urban spatiotemporal data, such as the specific time of data collection or generation. Spatial information refers to the spatial location attribute of urban spatiotemporal data, such as latitude and longitude coordinates, geographical area, geographical grid code, etc.
[0048] As an optional implementation, for the metadata management table stored in the database, an SQL query statement is used to extract information related to the metadata management table, and the spatiotemporal data product information, time information and space information of the city are extracted according to the query statement.
[0049] As another optional implementation, for the metadata management table managed by the API (Application Programming Interface), the corresponding API interface is called to pass parameters, and the returned metadata information in JSON format is received, and the product information, time information and space information are parsed from the returned metadata. Among them, JSON (JavaScript Object Notation) is a lightweight data exchange format based on a subset of ECMAScript (JS specification developed by the European Computer Association), which uses a text format that is completely independent of the language to store and represent data.
[0050] Step S30, binary-encoding the product information, time information and space information respectively to obtain a product code, a time code and a geographic space code.
[0051] The key spatiotemporal data information extracted from the metadata management table is converted into binary code to facilitate data storage, retrieval and analysis. Through binary coding, data can be effectively compressed, storage space can be reduced, and the speed of data processing can be increased.
[0052] It should be noted that binary encoding is the process of converting information into binary form. Binary is a digital system that contains only two states, 0 and 1, and is suitable for computer processing and storage.
[0053] As an optional implementation, for product information, binary encoding rules for product information are formulated to ensure that each product category has a unique binary representation. For time information, Unix timestamps are used and converted into binary form. For spatial information, corresponding binary encoding rules are formulated according to specific geographic coding systems.
[0054] Optionally, the encoded information is associated with a record in the original metadata management table.
[0055] Step S40, integrating the product code, the time code and the geographic space code to generate a universal spatiotemporal data code for the spatiotemporal data of each city.
[0056] In this embodiment, the universal spatiotemporal data code is a unique code that integrates product, time, and space dimension information and is used to identify data points or data sets in a spatiotemporal data set.
[0057] As an optional implementation, the encoded product, time, and space dimension information are sequentially combined or concatenated to form a unified encoding string, namely, a universal spatiotemporal data encoding.
[0058] Optionally, a check bit or an error detection code is added to the general spatiotemporal data encoding to improve the accuracy of the encoding.
[0059] As another optional implementation, different weights are assigned to the dimensional information of product, time, and space based on the importance of spatiotemporal data, and the information is merged into a single encoding string according to the weights as a universal spatiotemporal data encoding.
[0060] For example, in time-sensitive applications, time dimension information is given a higher weight.
[0061] Optionally, step S40 includes: Step S41, concatenate the segmentation level code, geographic space code, time code and product code in sequence to obtain a long binary string as the universal spatiotemporal data code.
[0062] Optionally, see Figure 3 , the 5-bit slice level code (i.e., subdivision level code), the dynamic height range GeoSOT code (i.e., space code, 3L bits, L is the slice level), the 32-bit time code, and the 7-bit product code are concatenated in sequence to form a universal spatiotemporal data binary coding structure.
[0063] For example, the slice level is "01011", the GeoSOT code is "110100", the time code is "0001 10000101 1001 1101 0000 0000 0000", and the product code is "0110001", then the spliced code is "01011110100 0001 1000 0101 1001 1101 0000 0000 0000 0110001".
[0064] This embodiment provides a universal spatiotemporal data encoding method. This embodiment firstly realizes comprehensive and systematic management of spatiotemporal data by constructing a metadata management system and generating a metadata management table. By extracting the product, time, and space dimension information of spatiotemporal data from the metadata management table and performing binary encoding, complex data information is converted into binary information that is easy for machines to understand, thereby improving data processing efficiency and quality. The encoded product, time, and space dimension information are integrated to generate a universal spatiotemporal data encoding, thereby realizing rapid indexing, retrieval, and analysis of spatiotemporal data.
[0065] Based on the first embodiment, the second embodiment of the present application proposes a general spatiotemporal data encoding method, referring to Figure 4 , step S20 comprises: Step S21, based on the product information of the spatiotemporal data of each city, hierarchical coding is performed according to a preset coding table as a product code.
[0066] The product information of spatiotemporal data in the metadata management table is converted into a standardized format, namely product code. This code can uniquely identify different data products, facilitating data classification, retrieval and management. Through hierarchical coding, complex product information can be simplified into easy-to-process digital or letter combinations, thereby improving the efficiency and accuracy of data processing.
[0067] It should be noted that hierarchical coding is a coding method that encodes information according to a certain hierarchical structure.
[0068] As an optional implementation method, please refer to the national basic geographic information element classification table to determine the coding rules for each major and medium category of each element, extract the product information of each data item from the metadata management table, and determine the major and medium category of the element to which it belongs. According to the extracted product information, use a seven-bit binary code, where the first three bits represent the code of the major category of the element, and the last four bits represent the code of the medium category of the element, and use the result of the hierarchical coding as the product code.
[0069] Exemplarily, the 7-digit product code for an intercity highway is "0110001", where "011" represents the major category of transportation and "0001" represents the medium category of intercity highway.
[0070] Step S22, performing Unix time coding based on the time information of the spatiotemporal data of each city to determine the time code.
[0071] It should be noted that Unix time code, also known as Unix timestamp or POSIX time, is the number of seconds starting from 00:00:00 UTC on January 1, 1970. It is a standard and widely accepted way of expressing time. Unix time code makes it easier to exchange and process time data between different systems and applications, and also facilitates time-related calculations and analysis.
[0072] Exemplarily, the time information of each data item is extracted from the metadata management table, the date string is converted into a time tuple, and then the time tuple is converted into a Unix time code, and the output Unix time code is used as the time dimension identifier of the data item, that is, the time code.
[0073] Optionally, step S22 includes: Step A10, sorting the time information, and performing Unix time encoding on each time variable in the sorted time information.
[0074] In this embodiment, the sorting is to ensure the order of the time data to facilitate subsequent processing.
[0075] Exemplarily, the extracted time information is sorted in chronological order, and the date and time processing function in the programming language is used to convert each sorted time variable into Unix time code, that is, each time point is converted into the number of seconds since January 1, 1970.
[0076] Step A20, converting the result of the Unix time encoding into binary encoding as the time encoding.
[0077] Exemplarily, the result of the Unix time encoding is converted into a binary number, and it is ensured that the converted binary number is 32 bits. If it is less than 32 bits, the high bits are padded with 0.
[0078] For example, the Unix encoding of the time "October 1, 2021 00:00:00" is: "1633046400", which is converted to 32-bit binary and completed as: "0001, 1000, 0101, 1001, 1101, 0000, 0000, 0000".
[0079] Optionally, the time code may also use 64-bit binary encoding.
[0080] Step S23, performing GeoSOT coding based on the spatial information of the spatiotemporal data of each city to determine the geographic space coding.
[0081] It should be noted that GeoSOT coding is a way of encoding geographic spatial information. Based on multi-level grid division, geospatial data is divided into regular grid cells. Each grid cell has a unique code to identify its spatial location.
[0082] As an optional implementation, SQL query statements are used to extract spatial information of spatiotemporal data from the metadata management table, the GeoSOT encoding library is integrated in the data processing environment, the functions in the GeoSOT encoding library are called, the extracted spatial information is used as input parameters, encoding processing is performed, and the GeoSOT encoding result returned by the encoding function is used as the geographic spatial encoding.
[0083] As another optional implementation, according to the programming language script, spatial information is extracted from the metadata management table through the database connection, the API interface provided by GeoSOT is called, the API response is parsed, and the GeoSOT encoding result is extracted, which is the geographic spatial encoding.
[0084] This embodiment provides a universal spatiotemporal data encoding method. This embodiment implements standardized processing of spatiotemporal data products, time and space dimensions through hierarchical encoding, Unix time encoding and GeoSOT encoding. The encoded data is unique and structured, which is convenient for rapid retrieval and positioning in the database.
[0085] Based on the first and second embodiments, the third embodiment of the present application proposes a general spatiotemporal data encoding method, referring to Figure 5 , step S23 comprises: Step B10, calculating the directional bounding box range of the urban spatiotemporal data at each time point based on the spatial information.
[0086] It should be noted that an Oriented Bounding Box (OBB) is a rectangular area used to surround and contain spatial data objects. It approximately represents the spatial distribution range of the data and can have any direction.
[0087] Exemplarily, for each time point, a directional bounding box is calculated according to the coordinates of all spatial objects at the time point, and the bounding box should contain all relevant spatial objects at the time point.
[0088] Optionally, an axis-aligned bounding box (AABB) can be used to express the spatial extent of the data product, and an axis-aligned bounding box is calculated for each time point as the axis-aligned bounding box.
[0089] Step B20, selecting the maximum value in the range of the oriented bounding box of each time point within the time span as the reference space range, and determining the subdivision level code of GeoSOT.
[0090] As an optional implementation, the directional bounding box ranges of all time points within the time span are traversed, and the range with the largest coverage area is selected as the reference space range. The subdivision level encoding is determined based on the size and shape of the reference space range and the subdivision rules of the GeoSOT coding system. Among them, a larger range may require a lower subdivision level to reduce the number of grids, while a smaller range may require a higher subdivision level to provide higher accuracy.
[0091] For example, the judgment formula " "Determine the GeoSOT segmentation level. Among them, "E" represents the spatial range of the GeoSOT slice, the subscript "n" represents the segmentation level, and "X" represents the reference spatial range of the current data. When the inequality is satisfied, "n" is the segmentation level of the corresponding GeoSOT code of the current data, which is represented by 5-bit binary. The high bits less than 5 bits are padded with 0.
[0092] Step B30, generating the corresponding geographic space code according to the subdivision level corresponding to the subdivision level code and the reference space range.
[0093] Exemplarily, the reference space range is mapped to the GeoSOT grid system, and the index of the grid is determined according to the subdivision level to generate the corresponding spatial code.
[0094] Optionally, the highest and lowest elevations within the administrative divisions of the city where the spatiotemporal data is located are queried as the upper and lower limits of the dynamic elevation range. Based on the determined GeoSOT segmentation level and the dynamic elevation range, a GeoSOT encoding algorithm is used to generate a spatial code.
[0095] Optionally, step B30 includes: Step B31, according to the segmentation level, determine the level of the urban spatiotemporal data in GeoSOT coding, and calculate the boundary of the GeoSOT slice at the level.
[0096] As an optional implementation, the boundary of each slice in the GeoSOT code is calculated according to the determined subdivision level, and the longitude and latitude range of each grid cell is determined according to the GeoSOT coding rules.
[0097] Step B32, comparing the reference spatial range of the urban spatiotemporal data with the boundary of the GeoSOT slice, and determining the GeoSOT slice covered by the reference spatial range of the urban spatiotemporal data as the selected slice.
[0098] Exemplarily, the reference spatial range of the spatiotemporal data is compared with the boundary of the GeoSOT slices to determine which GeoSOT slices are covered by the reference spatial range, and all GeoSOT slices covered by the reference spatial range are selected for subsequent spatial coding generation.
[0099] Step B33, according to the GeoSOT coding rules, calculate the row, column and elevation index of the selected slice, and convert the row, column and elevation index of the selected slice into binary numbers as the geospatial coding.
[0100] It should be noted that the row and column index is used in the GeoSOT coding system to uniquely identify the row, column and elevation position of a slice in the overall spatial structure.
[0101] Exemplarily, according to the GeoSOT encoding rule, the row, column and elevation index of the selected slice are calculated to indicate the position of the slice in the GeoSOT grid system, and the row, column and elevation index are converted into binary numbers as the geospatial encoding.
[0102] This embodiment provides a universal spatiotemporal data encoding method. This embodiment first calculates the directional bounding box range of the urban spatiotemporal data at each time point, so as to capture the spatial distribution changes of the data at different time points. By selecting the maximum range in the directional bounding box range as the reference spatial range, it ensures that the generated geographic spatial code can cover all data points, while reducing unnecessary subdivisions and improving encoding efficiency.
[0103] Based on the first embodiment, the fourth embodiment of the present application proposes a general spatiotemporal data encoding method, referring to Figure 6 , after step S40, comprising: Step S50, according to the query instruction of the client, the time parameter, product parameter and space parameter in the query instruction are parsed, the time parameter is converted into the corresponding time parameter code, and the product parameter is converted into the corresponding product parameter code.
[0104] The time parameters and product requirements in the query instructions sent by the client are converted into a form that the database or system can understand and efficiently process, namely, time parameter coding and product parameter coding, so as to facilitate fast and accurate retrieval in the coding database.
[0105] It should be noted that the query instruction of the client is an instruction containing query conditions sent by the user on the client, including information such as time parameters, product requirements and spatial parameters. The time parameter is the time range or time point specified in the query instruction, which is used to limit the time dimension of data retrieval. The product requirement is the data type or category specified in the query instruction, which is used to limit the product dimension of data retrieval. The spatial parameter is the geographical location or area specified in the query instruction, which is used to limit the spatial dimension of data retrieval. The time parameter code is the standardized code after the time parameter is converted, which is used to retrieve the data of the corresponding time in the database. The product parameter code is the standardized code after the product parameter is converted, which is used to retrieve the data of the corresponding product category in the database.
[0106] As an optional implementation, the query instruction sent by the client is received and analyzed to extract the time, product and space parameters therein. According to the defined encoding rules, the time parameter is converted into a Unix timestamp as the time parameter code, and the product parameter is converted into a product parameter code according to the national basic geographic information element classification table.
[0107] Step S60: Use the time parameter code to compare with the time code part in the general spatiotemporal data code to obtain a corresponding time slice array.
[0108] By comparing the time encoding of the time parameter encoding with the time encoding of the general spatiotemporal data encoding in the encoding database, the data slice array related to the query time is effectively screened out.
[0109] It should be noted that the time slice array is a data set that matches the time parameter encoding, representing data slices within a specified time range.
[0110] Exemplarily, in the coding database, the time parameter code in the received query request is compared with the time code in the universal spatiotemporal data code, and based on the comparison result, all data slices matching the time parameter code are screened out to form a time slice array.
[0111] Step S70: for the time slice array, further use the product parameter code to compare with the product code part in the universal spatiotemporal data code to determine the corresponding product slice array.
[0112] It should be noted that the product slice array is a data set that matches the product parameter code, indicating data slices under the corresponding time and product category.
[0113] Exemplarily, based on the time slice array, the product parameter code in the query instruction is further compared with the product code part in the universal spatiotemporal data code. According to the comparison result, the data slices matching the product parameter code are screened out from the time slice array to form a product slice array.
[0114] Step S80, in the product slice array, determine the spatial range of the query in the query instruction according to the spatial parameters, and determine the intersection range with the spatial range of the universal spatiotemporal data encoding through a spatial intersection algorithm, determine the corresponding spatial slice array as the query result and return it to the client.
[0115] Based on the product slice array, the data slices that meet the spatial range requirements are determined and screened according to the spatial parameters in the query instruction. Through the spatial intersection algorithm, the data slices that intersect or are included in the spatial range specified in the query instruction are accurately identified, and these spatial slice arrays are returned to the client as the final query results.
[0116] It should be noted that the spatial intersection algorithm is an algorithm for determining whether two or more spatial objects intersect or are contained. It is used to determine whether the spatial data in the product slice array intersects with the spatial parameters in the query instruction. The spatial slice array is a data set that matches the spatial parameters, representing the data slices within the specified spatial range under the time and product category.
[0117] As an optional implementation, the spatial range required for the query is determined according to the spatial parameters in the query instruction, and a spatial intersection algorithm is used to calculate the intersection of the query spatial range and the spatial range in the universal spatiotemporal data encoding to form a spatial slice array, and the determined spatial slice array is returned to the client as a query result.
[0118] As another optional implementation, the spatial range specified in the query instruction is determined according to the received spatial parameters, and the query spatial range is compared with the spatial range of each data item in the product slice array using a spatial intersection algorithm. According to the result of the spatial intersection algorithm, the product slice arrays intersecting with the query spatial range are screened out to form a spatial slice array. The spatial slice array is returned to the client as a query result.
[0119] In this embodiment, when querying time, space, and product code, the order is not limited. You can also first perform a preliminary screening based on the product code, then compare the time code, and finally determine the space range specified in the query instruction based on the space parameter.
[0120] As another optional implementation of this embodiment, a query instruction sent by a client is received, and the time parameter, product requirement, and space parameter in the instruction are parsed and converted into corresponding time codes, product codes, and space codes, respectively. According to the converted time codes, product codes, and space codes, they are combined or spliced according to the rules of universal spatiotemporal data coding to form a query code. The constructed query code is compared with the universal spatiotemporal data code, and according to the comparison result, a data set matching the query code is retrieved from the spatiotemporal data set, and returned to the client as a query result.
[0121] This embodiment provides a universal spatiotemporal data encoding method. This embodiment first parses the time parameters, product requirements, and space parameters in the query instruction, converts them into corresponding codes, and quickly finds matching data slices in the coding database, and finally determines and returns the spatial range results of the query, thereby improving query efficiency, reducing data processing time, and ensuring the accuracy of the query results.
[0122] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the general spatiotemporal data encoding method of the present application. More forms of simple transformations based on this technical concept are all within the scope of protection of the present application.
[0123] The present application provides a universal spatiotemporal data encoding device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the universal spatiotemporal data encoding method in the above-mentioned embodiment one.
[0124] Reference below Figure 7, which shows a schematic diagram of the structure of a general spatiotemporal data encoding device suitable for implementing the embodiment of the present application. The general spatiotemporal data encoding device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The general spatiotemporal data encoding device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0125] like Figure 7 As shown, the general spatiotemporal data encoding device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM) 1004. Various programs and data required for the operation of the general spatiotemporal data encoding device are also stored in the random access memory 1004. The processing device 1001, the read-only memory 1002, and the random access memory 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the universal spatiotemporal data encoding device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a universal spatiotemporal data encoding device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0126] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0127] The universal spatiotemporal data encoding device provided by the present application adopts the universal spatiotemporal data encoding method in the above embodiment, which can solve the technical problem of low spatiotemporal data processing efficiency. Compared with the prior art, the beneficial effects of the universal spatiotemporal data encoding device provided by the present application are the same as the beneficial effects of the universal spatiotemporal data encoding method provided by the above embodiment, and other technical features in the universal spatiotemporal data encoding device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0128] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0129] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0130] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the general spatiotemporal data encoding method in the above-mentioned embodiment.
[0131] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM, Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM, CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, radio frequencies (RF, Radio Frequency), etc., or any suitable combination of the above.
[0132] The computer-readable storage medium may be included in the general-purpose spatiotemporal data encoding device; or may exist independently without being assembled into the general-purpose spatiotemporal data encoding device.
[0133] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the universal spatiotemporal data encoding device, the universal spatiotemporal data encoding device can be written in one or more programming languages or a combination thereof to write computer program codes for performing the operations of the present application. The programming languages include object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0134] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0135] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0136] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned general spatiotemporal data encoding method, and can solve the technical problem of low spatiotemporal data processing efficiency. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the general spatiotemporal data encoding method provided in the above-mentioned embodiment, and will not be described in detail here.
[0137] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A general spatiotemporal data encoding method, characterized in that: The general spatiotemporal data encoding method comprises: Generate metadata management table based on the read urban spatiotemporal data; Extracting product information, time information and space information of each of the city spatiotemporal data according to the metadata management table; Binary-encode the product information, time information, and space information respectively to obtain a product code, a time code, and a geographic space code; The product code, the time code and the geographic space code are integrated to generate a universal spatiotemporal data code for the spatiotemporal data of each city.
2. The universal spatiotemporal data encoding method according to claim 1, characterized in that: The step of generating a metadata management table based on the read urban spatiotemporal data includes: Constructing a primary key of the metadata management table according to the product category of the urban spatiotemporal data; Based on the primary key, construct the secondary key of the metadata management table according to the production time of the urban spatiotemporal data; The metadata information of the urban spatiotemporal data is matched to the corresponding secondary key as the value of the metadata management table.
3. The universal spatiotemporal data encoding method according to claim 1, characterized in that: The steps of respectively performing binary coding on the product information, time information and space information to obtain a product code, a time code and a geographic space code include: Based on the product information of the spatiotemporal data of each city, hierarchical coding is performed according to a preset coding table as a product code; Based on the time information of the spatiotemporal data of each city, Unix time coding is performed to determine the time code; Based on the spatial information of the spatiotemporal data of each city, GeoSOT coding is performed to determine the geographic space coding.
4. The universal spatiotemporal data encoding method according to claim 3, characterized in that: The step of performing Unix time coding based on the time information of the spatiotemporal data of each city and determining the time coding comprises: Sorting the time information, and performing Unix time encoding on each time variable in the sorted time information; The result of the Unix time encoding is converted into a binary code as the time code.
5. The universal spatiotemporal data encoding method according to claim 3, characterized in that: The step of performing GeoSOT coding based on the spatial information of the spatiotemporal data of each city and determining the geographic spatial coding comprises: Calculating the directional bounding box range of the urban spatiotemporal data at each time point according to the spatial information; The maximum value in the directional bounding box range of each time point in the time span is selected as the reference space range to determine the GeoSOT subdivision level code; The corresponding geographic space code is generated according to the subdivision level corresponding to the subdivision level code and the reference space range.
6. The universal spatiotemporal data encoding method according to claim 5, characterized in that: The step of generating the corresponding geographic space code according to the subdivision level corresponding to the subdivision level code and the reference space range comprises: According to the subdivision level, determining the level of the urban spatiotemporal data in the GeoSOT code, and calculating the boundary of the GeoSOT slice at the level; Compare the reference spatial range of the urban spatiotemporal data with the boundary of the GeoSOT slice, and determine the GeoSOT slice covered by the reference spatial range of the urban spatiotemporal data as the selected slice; According to the rules of the GeoSOT encoding, the row, column and elevation index of the selected slice are calculated, and the row, column and elevation index of the selected slice are converted into binary numbers as the geospatial encoding.
7. The universal spatiotemporal data encoding method according to claim 1, characterized in that: The step of fusing the product code, the time code and the geographic space code to generate a universal spatiotemporal data code for each of the city spatiotemporal data comprises: The segmentation level code, geographic space code, time code and product code are sequentially concatenated to obtain a long binary string as the universal spatiotemporal data code.
8. The universal spatiotemporal data encoding method according to claim 1, characterized in that: After the step of fusing the product code, the time code and the geographic space code to generate a universal spatiotemporal data code for each of the city spatiotemporal data, the method further comprises: According to the query instruction of the client, the time parameter, product parameter and space parameter in the query instruction are parsed, the time parameter is converted into the corresponding time parameter code, and the product parameter is converted into the corresponding product parameter code; Compare the time parameter code with the time code portion in the universal spatiotemporal data code to obtain a corresponding time slice array; For the time slice array, further using the product parameter code to compare with the product code portion in the universal spatiotemporal data code to determine the corresponding product slice array; In the product slice array, the spatial range queried in the query instruction is determined according to the spatial parameters, and the intersection range with the spatial range of the universal spatiotemporal data encoding is determined through a spatial intersection algorithm, and the corresponding spatial slice array is determined as a query result and returned to the client.
9. A general spatiotemporal data encoding device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the general spatiotemporal data encoding method according to any one of claims 1 to 8.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the general spatiotemporal data encoding method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Space-time data retrieval method based on space grid coding
CN116049521A
Space-time diagram data processing method based on grid diagram database
CN119760160A