A method and apparatus for data storage

By using a data storage method based on enclosing matrices and spatial indexing technology, the problem of cumbersome and inefficient storage and retrieval of multiple data formats in existing technologies is solved, and efficient data retrieval and management are achieved.

CN116303413BActive Publication Date: 2026-05-19BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
Filing Date
2022-09-13
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing technologies are not applicable to data storage of various data formats, resulting in cumbersome retrieval methods and low retrieval efficiency, which cannot meet the system's frequent call and modification needs.

Method used

By obtaining the format of the data to be stored, using the enclosing matrix for data storage, separating two-dimensional and three-dimensional data management, and establishing a spatial index to achieve a simple retrieval method.

Benefits of technology

It enables efficient storage and management of various data formats, simplifies the retrieval process, improves retrieval efficiency, and meets the system's frequent call and modification needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303413B_ABST
    Figure CN116303413B_ABST
Patent Text Reader

Abstract

The application discloses a data storage method and device, and relates to the technical field of computers. A specific implementation of the method comprises the following steps: acquiring the format of to-be-stored data, the to-be-stored data having a data identifier, and the format comprising a three-dimensional data format; in the case that the format of the to-be-stored data is the three-dimensional data format, saving the to-be-stored data into an object storage container, and acquiring a first bounding matrix according to a configuration file of the to-be-stored data; and storing the data identifier, the first bounding matrix and the storage location of the to-be-stored data in the object storage container into a first database table. The implementation is suitable for multiple data formats, and the retrieval mode is simple and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for data storage. Background Technology

[0002] Currently, the data involved in the construction of smart city models, geological strata models, and cultural relic protection models includes both two-dimensional vector data such as urban planning 2D planar vector maps and road network data, and three-dimensional vector data such as urban building models, underground 3D pipeline models, and subway line models. However, existing technologies cannot be applied to multiple data formats when storing and retrieving data, resulting in cumbersome retrieval methods and low retrieval efficiency, which cannot meet the needs of frequent system calls and modifications. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a data storage method and apparatus that can store data based on the enclosing matrix of the data to be stored, and is applicable to the storage of various data formats. This facilitates data retrieval based on a simple retrieval method, solving the problem that the retrieval method is cumbersome and the retrieval efficiency is low, which cannot meet the frequent calling and modification needs of the system.

[0004] To achieve the above objectives, according to one aspect of the present invention, a data storage method is provided, comprising:

[0005] The format of the data to be stored is obtained, wherein the data to be stored has a data identifier, and the format includes a three-dimensional data format;

[0006] If the format of the data to be stored is a three-dimensional data format, the data to be stored is saved into an object storage container, and the first enclosing matrix is ​​obtained according to the configuration file of the data to be stored.

[0007] The data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container are stored in the first database table.

[0008] Optionally, the format further includes a two-dimensional data format, and the method further includes: when the format of the data to be stored is a two-dimensional data format, converting the format of the data to be stored and extracting a second enclosing matrix from the converted data to be stored; storing the data identifier, the second enclosing matrix, and the data to be stored in a second database table; wherein the second database table is a database table of the same type as the first database table.

[0009] Optionally, after converting the format of the data to be stored, the method further includes: separating the converted data to be stored into vector data and rendering data, so as to store the vector data and the rendering data separately; extracting a second enclosing matrix from the converted data to be stored, including: extracting a second enclosing matrix from the vector data.

[0010] Optionally, the fields of the first database table include: a data identifier field, an enclosing matrix field, and a data storage location field, wherein the field value of the data storage location field is the storage location of the data in the object storage container; the fields of the second database table include: a data identifier field, an enclosing matrix field, and a data field; the method further includes: based on the enclosing matrix of the data to be stored, adding an index path of the data identifier of the data to be stored to a pre-established spatial index, wherein the spatial index is established based on the field values ​​of the enclosing matrix fields of the first database table and the second database table.

[0011] Optionally, the first enclosing matrix includes longitude dimension data, latitude dimension data, and elevation dimension data, and the second enclosing matrix includes longitude dimension data and latitude dimension data; the spatial index is established by: establishing a two-dimensional spatial index based on the longitude dimension data and the latitude dimension data as the first-level index of the spatial index; and establishing a second-level index of the spatial index based on the elevation dimension data.

[0012] Optionally, establishing a two-dimensional spatial index based on the longitude and latitude data includes: establishing a two-dimensional spatial index based on an R-tree using a rule-based segmentation method based on the longitude and latitude data.

[0013] Optionally, establishing a second-level index of the spatial index based on the elevation dimension data includes: clustering data identifiers according to the elevation dimension data, and establishing a second-level index of the spatial index based on the clustering results.

[0014] Optionally, establishing a second-level index of the spatial index based on the elevation dimension data includes: clustering data identifiers according to the elevation dimension data and dividing them into levels, and establishing a second-level index of the spatial index based on the clustering results and the level division results.

[0015] According to another aspect of the present invention, a data storage apparatus is provided, comprising:

[0016] A data format acquisition module is used to acquire the format of data to be stored, wherein the data to be stored has a data identifier and the format includes a three-dimensional data format.

[0017] The first storage module is used to save the data to be stored into an object storage container when the format of the data to be stored is a three-dimensional data format, and to obtain a first enclosing matrix according to the configuration file of the data to be stored.

[0018] The second storage module is used to store the data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container into the first database table.

[0019] According to another aspect of the present invention, an electronic device for data storage is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data storage method provided in the embodiments of the present invention.

[0020] According to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the data storage method provided in the embodiments of the present invention.

[0021] One embodiment of the above invention has the following advantages or beneficial effects: By obtaining the format of the data to be stored, which has a data identifier and includes a three-dimensional data format; when the format of the data to be stored is a three-dimensional data format, the data to be stored is saved into an object storage container, and a first enclosing matrix is ​​obtained according to the configuration file of the data to be stored. The data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container are stored in a first database table. This technical solution enables data storage based on the enclosing matrix of the data to be stored, is applicable to the storage of various data formats, and achieves separation of storage and management of three-dimensional data. This facilitates data retrieval based on a simple retrieval method, solving the problem that cumbersome retrieval methods and low retrieval efficiency cannot meet the frequent call and modification needs of the system. Furthermore, by establishing a spatial index, a significant improvement in retrieval efficiency is achieved.

[0022] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0023] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0024] Figure 1 This is a schematic diagram of the main steps of a data storage method according to an embodiment of the present invention;

[0025] Figure 2 This is a schematic diagram of the data storage principle of one embodiment of the present invention;

[0026] Figure 3 This is a schematic diagram of a spatial indexing model according to an embodiment of the present invention;

[0027] Figure 4 This is a schematic diagram of the main modules of a data storage device according to an embodiment of the present invention;

[0028] Figure 5 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0029] Figure 6 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0030] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0031] The acquisition, storage, use, and processing of data in the technical solution of this invention all comply with the relevant provisions of national laws and regulations.

[0032] Existing technologies typically store 2D and 3D data separately, with different storage spaces and no connection between them. This prevents the use of a single retrieval method or spatial retrieval approach for data searching. Consequently, existing storage methods for various 2D and 3D data formats result in cumbersome and inefficient data retrieval processes, failing to meet the frequent access and modification requirements of the system.

[0033] To address the technical problems existing in the prior art, the present invention provides a data storage method and apparatus. Based on the data storage method of the present invention, data retrieval can be performed using a simple retrieval method, solving the problems that the retrieval method is cumbersome and inefficient, and cannot meet the frequent calling and modification needs of the system.

[0034] Figure 1 This is a schematic diagram illustrating the main steps of a data storage method according to an embodiment of the present invention. Figure 1 As shown, the data storage method of this embodiment of the invention mainly includes the following steps S101 to S103.

[0035] Step S101: Obtain the format of the data to be stored. The data to be stored has a data identifier, and the format includes 3D data format. To uniquely identify each piece of data, a unique data identifier is assigned to each piece of data. When storing data, 2D data is generally small in size and can be considered small-volume data, while 3D data is generally large in size and can be considered large-volume data. Their data formats and data storage space requirements are different; therefore, 2D and 3D data need to be processed separately. Small-volume data generally refers to data in the KB level or less than 100MB. shp, JSON, GeoJSON, and KML formats contain small amounts of data and are commonly used formats for storing small-volume data. Large-volume data, compared to small-volume data, for 3D data, 3D data models obtained by oblique photogrammetry or laser scanning can easily reach GB. Even relatively lightweight manually modeled 3D data can reach hundreds of megabytes, showing a significant difference in space occupied compared to small-volume data, and there are dedicated visualization strategies for loading large amounts of data. Among them, shp is short for ESRI Shapefile, an open spatial data format and a vector graphics format. This format file is mainly used to describe geometric objects and can save the position and related attributes of geometric figures. JSON is short for JavaScript Object Notation, a lightweight data exchange format. GeoJSON is a format for encoding various geographic data structures, a geospatial information data exchange format based on JavaScript Object Notation (JSON). KML is short for Keyhole Markup Language, an XML-based markup language that uses XML syntax to describe geospatial data (such as points, lines, polygons, and models), suitable for geographic information collaboration and sharing in a network environment.

[0036] Step S102: If the data to be stored is in a three-dimensional format, save the data to be stored into an object storage container and obtain the first enclosing matrix according to the configuration file of the data to be stored. The enclosing matrix is ​​the matrix formed by the longitude, latitude, and elevation data of the four corners of the smallest cube that can hold the data. Correspondingly, the two-dimensional enclosing matrix is ​​the matrix formed by the longitude and latitude data of the four corners of the smallest rectangle that can hold the two-dimensional data; the three-dimensional enclosing matrix is ​​the matrix formed by the longitude, latitude, and elevation data of the four corners of the smallest cube that can hold the three-dimensional data.

[0037] For large volumes of 3D data, data can be directly saved to an object storage container, which offers ample storage space for large datasets. Common 3D data formats include Obj, Osgb, glTF, and b3dm. Each 3D data set comes with its own XML or JSON configuration file. During storage, the 3D data and its configuration file are stored together. This configuration file contains information such as the loading order of the 3D data, tile levels, the complete coordinate system of the 3D model, the model's center coordinates, and the coordinates of the four corners of the model's bounding cube. When 3D data needs to be loaded, the configuration file is located directly, and the dedicated 3D data loading method retrieves the necessary point data based on this file. Using the complete coordinate system, model center coordinates, and the coordinates of the four corners of the model's bounding cube from the configuration file, the first bounding matrix of the data to be stored can be obtained. Since the data to be stored is 3D, the first bounding matrix is ​​also a 3D bounding matrix that includes the 3D data itself.

[0038] Step S103: Store the data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container into the first database table. Since the three-dimensional data is stored in the object storage container, which has a different structure from the database table storing the two-dimensional data, they are two completely unrelated storage spaces. To facilitate the association or spatial retrieval of two-dimensional and three-dimensional data, this invention separates the storage and management of three-dimensional data. Only the storage location of the data to be stored in the object storage container is saved in the first database table, and the data can be retrieved from the object storage container based on this storage location.

[0039] According to one embodiment of the present invention, the fields of the first database table include, but are not limited to, a data identifier field, an enclosing matrix field, and a data storage location field, wherein the field value of the data storage location field is the storage location of the data in the object storage container. In specific implementations, necessary fields can be added according to business requirements, such as a storage user field, a storage time field, etc. When storing data, the data identifier of the data to be stored is used as the primary key of the database table, which allows for quick data retrieval. Table 1 shows the data storage structure of the first database table in the present invention.

[0040] Table 1

[0041] Fields Data Identifier data Enclosing matrix Storage users Marks and notes Data types String Obj etc. String String Json

[0042] Furthermore, according to another embodiment of the present invention, the format of the data to be stored further includes a two-dimensional data format, and the data storage method of the present invention may further include: when the format of the data to be stored is a two-dimensional data format, performing a format conversion on the data to be stored, extracting a second enclosing matrix from the converted data to be stored, and storing the data identifier, the second enclosing matrix, and the data to be stored in a second database table. The second database table is a database table of the same type as the first database table. Since the first database table and the second database table are database tables of the same type (e.g., a relational database like MySQL), a single retrieval method can be used for data retrieval, thereby achieving data retrieval based on a simple retrieval method. This solves the problem that cumbersome retrieval methods and low retrieval efficiency, which cannot meet the frequent call and modification requirements of the system, are common in data retrieval.

[0043] After extracting the second enclosing matrix, the data to be stored can be saved to the second database table. The fields in the second database table include, but are not limited to, a data identifier field, an enclosing matrix field, and a data field. In practice, additional fields can be added based on business requirements, such as a user field, a time field, etc. When storing data, the data identifier of the data to be stored is used as the primary key of the database table, allowing for quick data retrieval.

[0044] According to one embodiment of the present invention, after format conversion of the data to be stored, the method further includes: separating the converted data to be stored into vector data and rendering data, and storing the vector data and rendering data separately. Furthermore, when extracting the second enclosing matrix from the converted data to be stored, the second enclosing matrix is ​​extracted from the vector data. The two-dimensional data can be divided into two parts: vector data and rendering data. Vector data refers to data with a relatively complex structure, involving topological and geometric relationships; rendering data refers to the visualization element information required for computer rendering, such as color, boundary, and transparency. Since GIS data includes attribute information and spatial geographic location information, while computer rendering includes visualization element information such as color, boundary, and transparency, and attribute information and spatial geographic location information generally have a more complex structure, involving topological and geometric relationships, they can be uniformly classified as vector data. Rendering data mainly contains the elements required for computer rendering, occupies very little space but requires repeated modification. Because the spatial data portion of vector data has a complex structure, is difficult to modify, and has a low user modification frequency, while rendering data is mainly used for front-end visualization and is modified more frequently by users. Therefore, by separating and storing vector data and rendering data separately, the rate of data modification can be improved, database pressure can be alleviated, and rendering efficiency can be increased. Specifically, the vector data and rendering data of the two-dimensional data can be saved to two columns of a database table. As shown in Table 2, this illustrates the data storage structure of the second database table in this invention.

[0045] Table 2

[0046] Fields Data Identifier Vector data Rendering data Enclosing matrix Storage users Marks and notes Data types String GeoJSON Json String String Json

[0047] In embodiments of the present invention, the two-dimensional data and the second enclosing matrix include longitude dimension data and latitude dimension data, and the three-dimensional data and the first enclosing matrix include longitude dimension data, latitude dimension data and elevation dimension data.

[0048] For small-volume two-dimensional data, format conversion is necessary before storage to facilitate data management. For example, common formats like shp, JSON, GeoJSON, and KML can be uniformly converted to GeoJSON format. Then, a second enclosing matrix is ​​extracted from the converted data. Since the data is two-dimensional, this second enclosing matrix is ​​also a two-dimensional enclosing matrix containing only the two-dimensional data. The enclosing matrix is ​​formed by the longitude, latitude, and elevation dimensions of the four corners of the smallest cube that can hold the data. Similarly, a two-dimensional enclosing matrix is ​​formed by the longitude and latitude dimensions of the four corners of the smallest rectangle that can hold the two-dimensional data; a three-dimensional enclosing matrix is ​​formed by the longitude, latitude, and elevation dimensions of the four corners of the smallest cube that can hold the three-dimensional data.

[0049] Following the steps outlined above, the data to be stored can be stored. Regardless of whether it is two-dimensional or three-dimensional data, since the first and second database tables are of the same type, a single retrieval method can be used for data retrieval. This achieves data retrieval based on a simple retrieval method, solving the problem that cumbersome retrieval methods and low retrieval efficiency cannot meet the frequent calling and modification needs of the system.

[0050] Figure 2 This is a schematic diagram illustrating the data storage principle of one embodiment of the present invention. Figure 2As shown, in the embodiments of the present invention, the data can be divided into two-dimensional small-volume data and three-dimensional large-volume data, and processed separately. For two-dimensional small-volume data, the main storage formats are such as shapefile, JSON, GeoJSON, KML, etc., and these two-dimensional data in these formats are uniformly converted into GeoJSON format two-dimensional data. Then, the GeoJSON format two-dimensional data is separated to obtain rendering data and vector data, and the bounding matrix of the two-dimensional data is extracted from the vector data; then, the data identifier, bounding matrix, rendering data, and vector data are all saved to a database table. For three-dimensional large-volume data, the main storage formats are such as obj, osgb, glTF, b3dm, etc., and these three-dimensional data in these formats are stored in an object storage container, and the bounding matrix of the three-dimensional data is extracted according to the configuration file of the three-dimensional data; then, the data identifier, bounding matrix, and storage location of the three-dimensional data in the object storage container are saved to a database table. Finally, both database tables are stored in a database, such as a MySQL database. When data needs to be retrieved, it can be retrieved from the database tables of the MySQL database. Therefore, a single database retrieval method can be used to retrieve data.

[0051] However, a single database retrieval method cannot meet the spatial retrieval needs of data. For example, when searching for "shops around a certain community in a certain region", the retrieval efficiency is still very low because a single database retrieval method can only traverse the data one by one. Therefore, it is necessary to establish a spatial indexing mechanism, and to establish a multi-level three-dimensional spatial index based on combined indexing technology for two-dimensional and three-dimensional vector data.

[0052] According to one embodiment of the present invention, after storing the data to be stored, an index path for the data identifier of the data to be stored can be added to a pre-established spatial index based on the enclosing matrix of the data to be stored, for data retrieval based on the spatial index. According to the technical solution of the present invention, if the data to be stored is two-dimensional data, its enclosing matrix is ​​the second enclosing matrix; if the data to be stored is three-dimensional data, its enclosing matrix is ​​the first enclosing matrix.

[0053] In embodiments of the present invention, the spatial index is established based on the field values ​​of the enclosing matrix fields of the first and second database tables. The field values ​​of the enclosing matrix fields of the second database table include data in two dimensions: longitude and latitude. The field values ​​of the enclosing matrix fields of the first database table include data in three dimensions: longitude, latitude, and elevation.

[0054] According to one embodiment of the present invention, a spatial index is established as follows: a two-dimensional spatial index is established based on longitude and latitude data as the first-level index; a second-level index is established based on elevation data. Specifically, when establishing the two-dimensional spatial index based on longitude and latitude data, a rule-based segmentation method can be used to establish the two-dimensional spatial index based on an R-tree. Two-dimensional spatial indexes are established according to administrative division rules, such as provinces, cities, counties, and districts, serving as the first-level index of the three-dimensional spatial index. Specifically, the elevation data in the enclosing matrix can be extracted separately, and two-dimensional longitude and latitude indexes are established first based solely on the longitude and latitude data to reduce index complexity. R-tree spatial index: The R-tree spatial index combines the idea of ​​bounding rectangles to classify and store data. When data is entered, it matches the specific bounding rectangle that exists according to the latitude and longitude range of the data. The latitude and longitude range of the bounding rectangle is used as the leaf node, and the data is stored in the leaf node. The data is represented by a unique identifier field "id". The vector data and rendering data information of the data can be retrieved in the database table by using "id".

[0055] According to an embodiment of the present invention, after the first-level index is established, elevation dimension data is introduced to establish the second-level index. Specifically, the second-level spatial index is established based on the elevation dimension data. This can be achieved by extracting the elevation dimension data from the bounding matrix of the three-dimensional data, clustering the data identifiers based on the elevation dimension data, and establishing the second-level spatial index based on the clustering results.

[0056] After obtaining elevation dimension data, there are various clustering methods that can be used to cluster data reasonably based on its distribution. One such method is the intersection method. If the application scenario results in significant differences in the distribution of elevation dimension data in the 3D data, the intersection method can be used. For example, to establish the distribution of geological rock strata. Rock strata at different elevations are generally different, so a method of clustering and merging strata with overlapping elevation ranges is adopted. Suppose there are 4 rock strata models: A [3.525 m, 5.255 m], B [2.21 m, 4.25 m], C [5.25 m, 9.57 m], and D [102.25 m, 107.58 m]. A and B have overlapping elevations, and A and C also have overlapping elevations. Based on the characteristics of rock strata, A, B, and C are likely to have similar properties. Therefore, A, B, and C are clustered together, with the elevation index being [2.21 m, 9.57 m]. D is stored separately.

[0057] Another example is the equal division method: If the data elevation distribution is uniform, the space can be directly divided equally. For instance, the space can be divided into [negative infinity, 0 meters], [0 meters, 10 meters], [10 meters, 20 meters]...[100 meters, positive infinity], and the data can be directly placed into the corresponding interval. For data spanning two groups, both can exist. For example, a 3D data model E may exist in both the [0 meters, 10 meters] and [10 meters, 20 meters] groups. The appropriate interval for classifying 3D data model E can be determined proportionally. For example, if the elevation dimension data range of 3D data model E is [8 meters, 11 meters], and 2 / 3 of the elevation dimension data is in the [0 meters, 10 meters] interval, then 3D data model E can be classified into the [0 meters, 10 meters] interval.

[0058] According to another embodiment of the present invention, when establishing the second-level index of the spatial index based on elevation dimension data, it can also be as follows: clustering the data identifiers according to the elevation dimension data and dividing them into levels, and establishing the second-level index of the spatial index based on the clustering results and the level division results. Specifically, depending on the number of category intervals in the clustering results and the retrieval accuracy requirements, when the number of category intervals obtained after clustering is too large or the retrieval accuracy requirement is high, the clustered intervals can be further divided into levels. Finally, the second-level index of the spatial index is established based on the clustering results and the level division results.

[0059] Figure 3 This is a schematic diagram of a spatial indexing model according to an embodiment of the present invention. Figure 3 As shown, R8 is the smallest bounding cube of a certain data set (obtainable from the enclosing matrix). After clustering, it is contained within the bounding cube of R4, and R4 and R5 are further clustered to form the bounding rectangle of R1. Similarly, other data can be gradually expanded and classified into R1, R2, and R3 through clustering, thus obtaining a spatial object index relationship graph. Figure 3 The tree-like portion (indicated by the dashed box) is the spatial index in this invention. The spatial index does not store specific data; it only stores the unique data identifier "id" corresponding to the data and its corresponding smallest bounding cube (obtainable from the enclosing matrix). This spatial index is stored in a database table. When performing data retrieval, the system checks whether the data is stored in R1, R2, R3 according to the search criteria, and then searches level by level until the unique data identifier "id" that meets the criteria is determined. The coordinate information, attribute information, and rendering information of the data corresponding to this "id" are then directly read. This eliminates the need to check the search criteria for each piece of data, greatly accelerating the retrieval efficiency.

[0060] Figure 4 This is a schematic diagram of the main modules of a data storage device according to an embodiment of the present invention. Figure 4As shown, the data storage device 400 according to an embodiment of the present invention mainly includes a data format acquisition module 401, a first storage module 402, and a second storage module 403.

[0061] The data format determination module 401 is used to obtain the format of the data to be stored, wherein the data to be stored has a data identifier and the format includes a three-dimensional data format.

[0062] The first storage module 402 is used to save the data to be stored into an object storage container when the format of the data to be stored is a three-dimensional data format, and to obtain a first enclosing matrix according to the configuration file of the data to be stored.

[0063] The second storage module 403 is used to store the data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container into the first database table.

[0064] According to an embodiment of the present invention, the format further includes a two-dimensional data format, and the data storage device 400 further includes a two-dimensional data storage module (not shown in the figure), which is used to: when the format of the data to be stored is a two-dimensional data format, perform format conversion on the data to be stored, and extract a second enclosing matrix from the converted data to be stored; store the data identifier, the second enclosing matrix and the data to be stored in a second database table; wherein the second database table is a database table of the same type as the first database table.

[0065] According to another embodiment of the present invention, the two-dimensional data storage module (not shown in the figure) can also be used to: after converting the format of the data to be stored, separate the converted data to be stored into vector data and rendering data, so as to store the vector data and the rendering data separately; and, when extracting the second enclosing matrix from the converted data to be stored, extract the second enclosing matrix from the vector data.

[0066] According to another embodiment of the present invention, the fields of the second database table include: a data identifier field, an enclosing matrix field, and a data field; the fields of the first database table include: a data identifier field, an enclosing matrix field, and a data storage location field, wherein the field value of the data storage location field is the storage location of the data in the object storage container. The data storage apparatus 400 of this embodiment may further include an index path adding module (not shown in the figure), used to: add an index path of the data identifier of the data to be stored to a pre-established spatial index based on the enclosing matrix of the data to be stored, wherein the spatial index is established based on the field values ​​of the enclosing matrix fields of the first and second database tables.

[0067] According to another embodiment of the present invention, the second enclosing matrix includes longitude dimension data and latitude dimension data, and the first enclosing matrix includes longitude dimension data, latitude dimension data and elevation dimension data; the spatial index is established by: establishing a two-dimensional spatial index based on the longitude dimension data and the latitude dimension data as the first layer index of the spatial index; and establishing a second layer index of the spatial index based on the elevation dimension data.

[0068] According to another embodiment of the present invention, establishing a two-dimensional spatial index based on the longitude dimension data and the latitude dimension data includes: establishing a two-dimensional spatial index based on an R-tree using a rule-based segmentation method based on the longitude dimension data and the latitude dimension data.

[0069] According to another embodiment of the present invention, establishing a second-level index of the spatial index based on the elevation dimension data includes: clustering data identifiers according to the elevation dimension data, and establishing a second-level index of the spatial index based on the clustering results.

[0070] According to another embodiment of the present invention, establishing a second-level index of the spatial index based on the elevation dimension data includes: clustering data identifiers according to the elevation dimension data and dividing them into levels, and establishing a second-level index of the spatial index based on the clustering results and the level division results.

[0071] According to the technical solution of this invention, by obtaining the format of the data to be stored, which has a data identifier and includes a three-dimensional data format; when the format of the data to be stored is a three-dimensional data format, the data to be stored is saved into an object storage container, and a first enclosing matrix is ​​obtained according to the configuration file of the data to be stored. The data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container are stored in a first database table. This technical solution enables data storage based on the enclosing matrix of the data to be stored, is applicable to the storage of various data formats, and achieves separation of storage and management of three-dimensional data. This facilitates data retrieval based on a simple retrieval method, solving the problem that cumbersome retrieval methods and low retrieval efficiency cannot meet the frequent call and modification needs of the system. Furthermore, by establishing a spatial index, retrieval efficiency is significantly improved.

[0072] Figure 5 An exemplary system architecture 500 is shown, in which a data storage method or data storage apparatus for which embodiments of the present invention can be applied is illustrated.

[0073] like Figure 5As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0074] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, and 503, such as data storage applications, data browser applications, search applications, database applications, email clients, etc. (for example only).

[0075] Terminal devices 501, 502, and 503 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0076] Server 505 can be a server providing various services, such as a backend management server supporting data retrieval requests sent by users using terminal devices 501, 502, and 503 (for example only). The backend management server can process received data storage requests and other data to obtain the format of the data to be stored, where the data to be stored has a data identifier, and the format includes a three-dimensional data format. If the format of the data to be stored is a three-dimensional data format, the server saves the data to be stored into an object storage container and obtains a first enclosing matrix according to the configuration file of the data to be stored. The server then processes the data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container into a first database table, and feeds back the processing result (e.g., data storage result – for example only) to the terminal device.

[0077] It should be noted that the data storage method provided in the embodiments of the present invention is generally executed by server 505, and correspondingly, the data storage device is generally located in server 505.

[0078] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0079] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing terminal devices or servers of the present invention. Figure 6 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0080] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0081] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0082] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this invention.

[0083] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0084] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0085] The units or modules described in the embodiments of the present invention can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor can be described as including a data format acquisition module, a first storage module, and a second storage module. The names of these units or modules do not necessarily limit the specific unit or module itself; for example, a data format acquisition module can also be described as "a module for acquiring the format of data to be stored."

[0086] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: acquiring a format of data to be stored, the data to be stored having a data identifier, the format including a three-dimensional data format; if the format of the data to be stored is a three-dimensional data format, saving the data to be stored into an object storage container, and acquiring a first enclosing matrix according to a configuration file of the data to be stored; and storing the data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container into a first database table.

[0087] According to the technical solution of this invention, by obtaining the format of the data to be stored, which has a data identifier and includes a three-dimensional data format; when the format of the data to be stored is a three-dimensional data format, the data to be stored is saved into an object storage container, and a first enclosing matrix is ​​obtained according to the configuration file of the data to be stored. The data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container are stored in a first database table. This technical solution enables data storage based on the enclosing matrix of the data to be stored, is applicable to the storage of various data formats, and achieves separation of storage and management of three-dimensional data. This facilitates data retrieval based on a simple retrieval method, solving the problem that cumbersome retrieval methods and low retrieval efficiency cannot meet the frequent call and modification needs of the system. Furthermore, by establishing a spatial index, retrieval efficiency is significantly improved.

[0088] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for data storage, characterized in that, include: The format of the data to be stored is obtained, wherein the data to be stored has a data identifier, and the format includes a three-dimensional data format and a two-dimensional data format; If the format of the data to be stored is a three-dimensional data format, the data to be stored is saved into an object storage container, and the first enclosing matrix is ​​obtained according to the configuration file of the data to be stored. The data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container are stored in the first database table; When the format of the data to be stored is a two-dimensional data format, the format of the data to be stored is converted, and the converted data to be stored is separated into vector data and rendering data, so that the vector data and the rendering data are stored separately, and the second enclosing matrix is ​​extracted from the vector data; The data identifier, the second enclosing matrix, and the data to be stored are stored in a second database table; wherein the second database table is a database table of the same type as the first database table.

2. The method according to claim 1, characterized in that, The fields of the first database table include: a data identifier field, an enclosing matrix field, and a data storage location field, wherein the field value of the data storage location field is the storage location of the data in the object storage container; the fields of the second database table include: a data identifier field, an enclosing matrix field, and a data field; The method further includes: Based on the enclosing matrix of the data to be stored, an index path for the data identifier of the data to be stored is added to a pre-established spatial index. The spatial index is established based on the field values ​​of the enclosing matrix fields of the first database table and the second database table.

3. The method according to claim 2, characterized in that, The first enclosing matrix includes longitude dimension data, latitude dimension data, and elevation dimension data; the second enclosing matrix includes longitude dimension data and latitude dimension data. The spatial index is established in the following way: A two-dimensional spatial index is established based on the longitude and latitude data as the first-level index of the spatial index; A second-level index of the spatial index is established based on the elevation dimension data.

4. The method according to claim 3, characterized in that, A two-dimensional spatial index is established based on the longitude and latitude data, including: Based on the longitude and latitude data, a two-dimensional spatial index is established using a rule-based segmentation method and an R-tree.

5. The method according to claim 3, characterized in that, The second-level index of the spatial index is established based on the elevation dimension data, including: The data identifiers are clustered based on the elevation dimension data, and a second-level index of the spatial index is established based on the clustering results.

6. The method according to claim 3, characterized in that, The second-level index of the spatial index is established based on the elevation dimension data, including: The data identifiers are clustered and hierarchically divided based on the elevation dimension data. A second-level index of the spatial index is then established based on the clustering results and hierarchical division results.

7. A data storage device, characterized in that, include: A data format acquisition module is used to acquire the format of the data to be stored, wherein the data to be stored has a data identifier, and the format includes a three-dimensional data format and a two-dimensional data format. The first storage module is used to save the data to be stored into an object storage container when the format of the data to be stored is a three-dimensional data format, and to obtain a first enclosing matrix according to the configuration file of the data to be stored. The second storage module is used to store the data identifier, the first enclosing matrix, and the storage location of the data to be stored in the object storage container into the first database table; A two-dimensional data storage module is used to: when the format of the data to be stored is a two-dimensional data format, perform format conversion on the data to be stored, separate the converted data to be stored into vector data and rendering data, store the vector data and the rendering data separately, and extract a second enclosing matrix from the vector data; store the data identifier, the second enclosing matrix and the data to be stored into a second database table; wherein the second database table is a database table of the same type as the first database table.

8. An electronic device for data storage, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

9. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.