Data format conversion method, device, equipment and storage medium

CN116126957BActive Publication Date: 2026-08-21GUANGZHOU BOZHAN HENGTENG INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310041812.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-12
Publication Date
2026-08-21
Estimated Expiration
2043-01-12

AI Technical Summary

Technical Problem

[0004]在现有技术中虽存在部分数据格式之间进行格式转换的手段,但均较为繁琐复杂,不成体系,在对文件进行数据格式转换时,查找格式转换手段费时费力,效率较低,缺乏一种方便快捷的数据格式转换方法

Benefits of technology

[0018] In the data format conversion method provided in this application, after obtaining the geographic data input by the user, the data format conversion device determines the initial data format and the target data format of the geographic data, and determines a conversion relationship sequence based on the initial data format and the target data format. Then, according to the multiple sequential conversion relationships in the conversion relationship sequence, the data format of the geographic data is converted in turn to obtain the geographic data in the target data format. This provides a clear data format conversion link. By using the format conversion methods corresponding to the sequentially arranged conversion relationships in the conversion relationship sequence, the geographic data is converted in turn, so as to make the format conversion of geographic data convenient and fast.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126957B_ABST
    Figure CN116126957B_ABST
Patent Text Reader

Abstract

The application provides a data format conversion method and device, equipment and a storage medium, relates to the technical field of electronic maps, and is used for improving the data format conversion efficiency of geographic information data files. The data format conversion method comprises the following steps: a data format conversion device acquires user-input geographic data, and determines an initial data format and a target data format of the geographic data. Further, the data format conversion device determines a conversion relationship sequence based on the initial data format and the target data format; the conversion relationship sequence comprises at least one conversion relationship, the conversion relationship is used for indicating conversion from a first data format to a second data format; the first data format of the first conversion relationship in the conversion relationship sequence is the initial data format, and the second data format of the last conversion relationship in the conversion relationship sequence is the target data format. The data format conversion device converts the data format of the geographic data from the initial data format to the target data format according to the conversion relationship sequence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic map technology, and in particular to a data format conversion method, apparatus, device and storage medium. Background Technology

[0002] Electronic maps, relying on geographic information data, are an indispensable foundation for modern urban planning, transportation, tourism, and car navigation. However, the numerous cartographic tools used to produce electronic map geographic information data result in a wide variety of data formats.

[0003] Currently, the mainstream tools for creating 2D electronic map data include ArcGIS, MapInfo, and SuperMap. Geographic information data in shapefile and memory initialization file (MIF) formats produced by these tools are crucial foundational data for converting and publishing vector maps. Protocol buffer binary format (PBF), converted from shapefile and MIF formats, is a commonly used data format for vector maps. Furthermore, Web map service standards developed by the Open Geospatial Consortium (OGC), such as Web Map Service (WMS) and Web Map Tile Service (WMTS), have enabled the wider adoption of raster maps composed of stitched raster images. Portable Network Graphics (PNG) format is an image format for the raster tile data that makes up raster maps.

[0004] While some methods exist for converting data formats in the existing technology, they are all cumbersome, complex, and unsystematic. When converting data formats of files, it is time-consuming, laborious, and inefficient to find conversion methods. There is a lack of convenient and fast data format conversion methods. Summary of the Invention

[0005] This application proposes a data format conversion method, apparatus, device, and storage medium to improve the efficiency of data format conversion for geographic information data files.

[0006] To achieve the above objectives, this application adopts the following technical solution:

[0007] Firstly, a data format conversion method is provided, comprising: a data format conversion device acquiring geographic data input by a user, and determining an initial data format and a target data format of the geographic data; the initial data format and the target data format are different. Further, the data format conversion device determines a conversion relationship sequence based on the initial data format and the target data format; the conversion relationship sequence includes at least one conversion relationship, which indicates a conversion from a first data format to a second data format; the first data format of the first conversion relationship in the conversion relationship sequence is the initial data format, and the second data format of the last conversion relationship in the conversion relationship sequence is the target data format. Finally, the data format conversion device converts the geographic data format from the initial data format to the target data format according to the conversion relationship sequence.

[0008] In one possible design, the data format conversion device determines a sequence of conversion relationships based on an initial data format and a target data format. This includes: the data format conversion device determining a first conversion relationship from a conversion relationship topology based on the initial data format; the conversion relationship topology includes multiple data formats and conversion relationships corresponding to two adjacent data formats. Further, if the second data format of the first conversion relationship is not the target data format, the data format conversion device determines a last conversion relationship from the conversion relationship topology based on the target data format. The data conversion device determines a sequence of conversion relationships from the conversion relationship topology based on the first and last conversion relationships.

[0009] In one possible design, the data format conversion device determines a sequence of conversion relationships based on an initial data format and a target data format, including: determining the first conversion relationship from the conversion relationship topology according to the initial data format. Further, if the second data format of the first conversion relationship is the target data format, the data format conversion device determines a sequence of conversion relationships, the sequence including the first conversion relationship.

[0010] In one possible design, the data format conversion device converts the data format of geographic data from an initial data format to a target data format according to a conversion relationship sequence, including: the data format conversion device sequentially switches the data format of geographic data according to the initial data format of the geographic data and the order of at least two conversion relationships included in the conversion relationship sequence, until the data format of the geographic data is the target data format.

[0011] Secondly, a data format conversion apparatus is provided, including an acquisition unit, a determination unit, and a processing unit. The acquisition unit acquires geographic data input by a user. The determination unit determines an initial data format and a target data format of the geographic data, wherein the initial data format and the target data format are different. Based on the initial data format and the target data format, the determination unit determines a conversion relationship sequence; the conversion relationship sequence includes at least one conversion relationship, which indicates a conversion from a first data format to a second data format; the first data format of the first conversion relationship in the conversion relationship sequence is the initial data format, and the second data format of the last conversion relationship in the conversion relationship sequence is the target data format. The processing unit converts the geographic data format from the initial data format to the target data format according to the conversion relationship sequence.

[0012] In one possible design, the determining unit is further configured to determine the first transformation relation from the transformation relation topology based on the initial data format; the transformation relation topology includes multiple data formats and the transformation relations corresponding to two adjacent data formats. The determining unit is further configured to determine the last transformation relation from the transformation relation topology based on the target data format if the second data format of the first transformation relation is not the target data format. The determining unit is further configured to determine a sequence of transformation relations from the transformation relation topology based on the first and last transformation relations.

[0013] In one possible design, the determining unit is further configured to determine the first transformation relation from the transformation relation topology based on the initial data format. The determining unit is also configured to determine a sequence of transformation relations, including the first transformation relation, if the second data format of the first transformation relation is the target data format.

[0014] In one possible design, the processing unit is also used to sequentially switch the data format of the geographic data according to the initial data format of the geographic data and the order of at least two transformation relations included in the transformation relation sequence, until the data format of the geographic data is the target data format.

[0015] Thirdly, a data format conversion apparatus is provided, the data format conversion apparatus including a memory and a processor; the memory and the processor are coupled, the memory being used to store computer program code including computer instructions, and when the processor executes the computer instructions, the data format conversion apparatus performs a data format conversion method as provided in the first aspect or any possible design thereof.

[0016] Fourthly, a computer program product is provided, comprising computer instructions that, when executed on a data format conversion device, enable the data format conversion device to perform a data format conversion method as provided in the first aspect or any possible implementation thereof.

[0017] Fifthly, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a data format conversion device, cause the data format conversion device to perform a data format conversion method as provided in the first aspect or any possible implementation thereof.

[0018] In the data format conversion method provided in this application, after obtaining the geographic data input by the user, the data format conversion device determines the initial data format and the target data format of the geographic data, and determines a conversion relationship sequence based on the initial data format and the target data format. Then, according to the multiple sequential conversion relationships in the conversion relationship sequence, the data format of the geographic data is converted in turn to obtain the geographic data in the target data format. This provides a clear data format conversion link. By using the format conversion methods corresponding to the sequentially arranged conversion relationships in the conversion relationship sequence, the geographic data is converted in turn, so as to make the format conversion of geographic data convenient and fast. Attached Figure Description

[0019] Figure 1 A schematic diagram of a data format conversion system structure provided for an embodiment of this application;

[0020] Figure 2 A schematic diagram of a data format conversion file provided for embodiments of this application. Figure 1 ;

[0021] Figure 3 A schematic diagram of a data format conversion file provided for embodiments of this application. Figure 2 ;

[0022] Figure 4 A data format conversion process is illustrated in the embodiments of this application. Figure 1 ;

[0023] Figure 5 A schematic diagram of a data format conversion file provided for embodiments of this application. Figure 3 ;

[0024] Figure 6 A data format conversion process is illustrated in the embodiments of this application. Figure 2 ;

[0025] Figure 7 A schematic diagram of a data format conversion file provided for embodiments of this application. Figure 4 ;

[0026] Figure 8 A schematic diagram of a data format conversion file provided for embodiments of this application. Figure 5 ;

[0027] Figure 9 A schematic diagram of a data format conversion file provided for embodiments of this application. Figure 6 ;

[0028] Figure 10 A schematic flowchart of a data format conversion method provided for embodiments of this application. Figure 1 ;

[0029] Figure 11 A schematic flowchart of a data format conversion method provided for embodiments of this application. Figure 2 ;

[0030] Figure 12 A schematic diagram of a transformation relationship topology provided for an embodiment of this application;

[0031] Figure 13 A schematic flowchart of a data format conversion method provided for embodiments of this application. Figure 3 ;

[0032] Figure 14 A schematic diagram of a data format conversion device provided for an embodiment of this application;

[0033] Figure 15 A schematic diagram of a data format conversion device structure provided for embodiments of this application. Figure 1 ;

[0034] Figure 16 A schematic diagram of a data format conversion device structure provided for embodiments of this application. Figure 2 . Detailed Implementation

[0035] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0036] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0037] In the description of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. "And / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" and "multiple" refer to two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.

[0038] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0039] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0040] In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0041] The following explanations of the terms used in the embodiments of this application are provided to facilitate the reader's understanding.

[0042] 1. ArcGIS is a geographic information system (GIS) building and application platform that users can use to collect, organize, manage, analyze, communicate and publish geographic information.

[0043] 2. MapInfo (Mapping + Information) is a desktop geographic information system software that provides a desktop solution for data visualization and information mapping.

[0044] 3. MIF, or memory initialization file, is a universal data exchange format for MapInfo and can work on all platforms supported by MapInfo. MapInfo data is stored in two files: graphical data is stored in the .mif file, while text (attribute) data is stored in the .mid file.

[0045] 4. Super Map is a series of basic software for large-scale Geographic Information System (GIS) applications, 2D and 3D mapping and visualization, and decision analysis for various industries. It includes a variety of software products such as cloud GIS server, edge GIS server, terminal GIS and online GIS platform.

[0046] 5. Raster tiles: Raster map tiles are a relatively traditional mode that renders vector data into images of 256×256 or 512×512 pixels. The images are then arranged sequentially in the browser according to a set rule to display the map in full screen.

[0047] 6. Vector tiles organize and define vector data using different description files, parse the data and complete the drawing in real time on the client side, and display the map on the browser side.

[0048] 7. SHP is an open spatial data format that has become an open standard in the geographic information software industry, used to store map feature coordinate data and geometric data.

[0049] 8. CSV (Comma-Separated Values) is a comma-separated value file format, a plain text file format used to store data. A CSV file consists of any number of records, separated by a newline character; each record consists of fields, and the delimiters between fields are other characters or strings.

[0050] 9. PBF is a universal vector tile data standard adopted by many companies and organizations. The organizational model of the tile dataset is similar to the raster tile pyramid model, including a coordinate system, projection method, and tile numbering. It has achieved arbitrary precision, spatial location, and vector tile correspondence, and is compatible with raster tile specifications.

[0051] 10. WebP is an image file format that provides both lossy and lossless (reversible) compression. It is derived from the image encoding format VP8 and is considered a sister project of the WebM multimedia format.

[0052] 11. GDAL (Geospatial Data Abstraction Library) is an open-source raster spatial data transformation library under the X / MIT license. It utilizes an abstract data model to represent various supported file formats. It also includes a suite of command-line tools for data transformation and processing.

[0053] 12. PNG (Portable Network Graphics) is a bitmap format that uses a lossless compression algorithm and supports features such as indexed, grayscale, RGB (red, green, blue) color schemes and alpha channels.

[0054] The above is a brief introduction to some of the concepts involved in the embodiments of this application.

[0055] While there are some methods for converting data formats in existing technologies, they are all cumbersome, complex, and unsystematic, lacking a convenient and quick method for data format conversion.

[0056] To address the aforementioned problems, this application proposes a data format conversion method, apparatus, device, and storage medium. The data format conversion apparatus acquires geographic data input by a user and determines an initial data format and a target data format for the geographic data; the initial data format and the target data format are different. Further, based on the initial data format and the target data format, the data format conversion apparatus determines a conversion relationship sequence; the conversion relationship sequence includes at least one conversion relationship, which indicates a conversion from a first data format to a second data format; the first data format of the first conversion relationship in the conversion relationship sequence is the initial data format, and the second data format of the last conversion relationship in the sequence is the target data format. Finally, the data format conversion apparatus converts the geographic data format from the initial data format to the target data format according to the conversion relationship sequence. In this way, after acquiring the geographic data input by the user, the data format conversion device determines the initial data format and the target data format of the geographic data, and determines the conversion relationship sequence based on the initial data format and the target data format. Then, according to the multiple sequential conversion relationships in the conversion relationship sequence, the geographic data format is converted in turn to obtain the geographic data in the target data format. This provides a clear data format conversion link. By using the format conversion methods corresponding to the sequentially arranged conversion relationships in the conversion relationship sequence, the geographic data is converted in turn, so as to make the format conversion of geographic data convenient and fast.

[0057] Figure 1 This application illustrates a geographic data conversion system, and the geographic data conversion method provided in this embodiment can be applied to, for example, geographic data conversion systems. Figure 1 The geographic data conversion system shown is used to perform convenient and quick format conversion of geographic data. For example... Figure 1 As shown, the geographic data conversion system 10 includes a geographic data conversion device 11, a server 12, and a user device 13.

[0058] The geographic data conversion device 11 is connected to the server 12 and the user equipment 13 respectively. The connection can be wired or wireless, and this application embodiment does not limit the connection.

[0059] It should be noted that the aforementioned geographic data conversion device 11 can also be deployed on server 12 as the same device, or it can be deployed on different devices. The geographic data conversion device and user device 13 can be integrated into the same device, or they can be deployed on different devices. This application embodiment does not specifically limit this.

[0060] The data format conversion device 11 can be used to acquire geographic data input by the user through the user device 13.

[0061] The data format conversion device 11 can also be used to determine the initial data format and target data format of geographic data.

[0062] It should be noted that after acquiring geographic data, the data format conversion device 11 detects the data format of the geographic data file and determines the detected data format as the initial data format.

[0063] In some embodiments, when a user inputs geographic data, they also input the data format they require. The data format conversion device 11 determines the data format required by the user as the target data format. The initial data format is different from the target data format.

[0064] The data format conversion device 11 can also be used to convert relational sequences based on the initial data format and the target data format.

[0065] The conversion relationship sequence includes at least one conversion relationship, which indicates the conversion from a first data format to a second data format; the first data format of the first conversion relationship in the conversion relationship sequence is the initial data format, and the second data format of the last conversion relationship in the conversion relationship sequence is the target data format.

[0066] For example, data formats include .mif, .shp, .csv, .pbf, .png, and Webp. For example, conversion relationships can be: .mif can be converted to .csv, .shp to .csv, .mif to .csv, .csv to .pbf, .png to .csv, pbf-merge (pbf merging), and .csv to .Webp.

[0067] The data format conversion device 11 can also convert the data format of geographic data from the initial data format to the target data format according to the conversion relationship sequence.

[0068] It should be noted that the format conversion methods between adjacent conversion nodes include .mif to .csv, .shpto .csv, .mif to .csv, .csv to .pbf, .png to .csv, pbf-merge (pbf merging), and .csvto .Webp, etc.

[0069] The implementation process of the .mif to .csv conversion method is as follows.

[0070] It should be noted that .mif data is one of the MapInfo data formats, serving as an external data exchange file that stores geometric and location data. A .mif file consists of a header and a data segment. The header defines version information, character set, projection parameters, coordinate types, and table structure. The data segment contains entity data defined by MapInfo, including points, lines, polygons, polylines, regions, arcs, text, rectangles, rounded rectangles, and ellipses.

[0071] An example of the .mif file header format is shown below, with optional information in square brackets.

[0072] Version n

[0073] Charset"characterSetName

[0074] [DELIMITER] <c>"]

[0075] [UNIQUE n,n..]

[0076] [INDEX n,n..]

[0077] [COORDSYS...]

[0078] [TRANSFORM...]

[0079] COLUMNS n

[0080] <name> <type>

[0081] <name> <type>

[0082]

[0083] DATA

[0084] The Version clause specifies whether VERSION 1, VERSION 2, VERSION 300, or VERSION 450 format is used.

[0085] The Charset clause specifies the character set used when creating text in a table.

[0086] The Delimiter specifies the delimiter within the quotation marks. By default, the delimiter is the TAB key; if the default value is used, no DELIMITER line is required.

[0087] Unique specifies a number that indicates a column in the database.

[0088] To indicate that a column in a table has an index, you can include a number (or a series of comma-separated numbers) in the INDEX clause. Each number represents a column in the database; the columns in the INDEX list will have indexes created for them in the appendix.

[0089] The CoordSys clause specifies the COORDSYS clause to indicate that the data is not stored in longitude / latitude format. When the COORDSYS clause is not specified, it is assumed that the data is stored in longitude / latitude format. All coordinates are stored as values ​​relative to the northeast quadrant.

[0090] Columns specifies the number of columns. Then, a row is created for each column, which contains the column name, column type, and, for character and decimal columns, a number indicating the field width.

[0091] The data segment of a .mif file is located after the file header and must be introduced by DATA on a separate line.

[0092] Based on the above description of the .mif file structure, when the data format conversion device 11 determines that the .mif file needs to be converted to a .csv file, it reads the geometric objects and attributes from the .mif file, separates the read geometric information and attributes with English commas, and writes them sequentially into the .csv file to realize the data format conversion between .mif and .csv.

[0093] For example, Figure 2 The file format of the .csv file obtained after the .mif file is converted by the data format conversion device 11 is shown.

[0094] The implementation process of the .shp to .csv conversion method is as follows.

[0095] It should be noted that .shp files include the main file (*.shp), the index file (*.shx), and the database file (*.dbf).

[0096] The main file stores graphic information and records spatial coordinate information, primarily consisting of a file header and file records. The file header includes the version number, file length, data type, and data range, while the file records store the coordinate information of the data, including points, lines, and polygons.

[0097] The index file is primarily used to record offsets in the main file, and includes an index file header and index records. The index file header is organized in the same way as the main file header. The first record in the index file stores the offset of the first record in the main file and its content length. The offset of a record in the main file is represented by 16 bytes, indicating the number of words from the beginning of the main file to the first byte of this record, which allows for quick location of each geometry.

[0098] Database files, also known as attribute files, contain any required feature attributes or attribute keys that can be used to join other tables.

[0099] Based on the above description of the .shp file data structure, when the data format conversion device 11 determines that the .shp file needs to be converted to a .csv file, it reads the geometric figures from the main .shp file (*.shp), reads the attributes of the geometric figures from the database file (*.dbf), separates the read geometric figures and attributes with commas, and writes them sequentially into the .csv file, thereby realizing the data format conversion between .shp and .csv.

[0100] The implementation process of the .mif to .shp conversion method is as follows.

[0101] Based on the above description of the data structures of .mif and .shp files, when the data format conversion device 11 determines that it is necessary to convert the .mif file to a .shp file, it reads the geometric objects and attributes from the .mif file, performs coordinate system transformation based on the read geometric objects and attributes, and writes the geometric objects and attributes after coordinate transformation into the main file (*.shp), the index file (*.shx), and the database file (*.dbf) respectively, according to the data structure of the .shp file, thereby realizing the .mif to .shp data format conversion.

[0102] It should be noted that the following model can be used to perform coordinate transformation between .mif and .shp format data:

[0103] Model 1: Similarity Transformation Model.

[0104] Similarity transformations typically include translation parameters, rotation parameters, and scaling parameters.

[0105]

[0106] Among them, (X) i Y i ) I 、(X i Y i ) Π Let (x0, y0) represent the coordinates of point i in coordinate system I and coordinate system П, respectively. (x0, y0) are two translation parameters, α is a rotation parameter, and m is a scale parameter.

[0107] Model 2: Affine Transformation Model.

[0108]

[0109] Where (s, t) and (x, y) are the coordinates in the two coordinate systems, respectively, and a0, a1, a2, b0, b1, b2 are transformation parameters. When there are more than 3 common points, the least squares method is used for estimation.

[0110] Model 3: Bilinear Transformation Model.

[0111]

[0112] Where (s, t) and (x, y) are the coordinates in the two coordinate systems, respectively, and a0, a1, a2, a3, b0, b1, b2, b3 are transformation parameters. When there are more than 4 common points, the least squares method is used for estimation.

[0113] For example, Figure 3 The file format of the .shp file obtained after the .mif file is converted by the data format conversion device 11 is shown.

[0114] The implementation process of the .csv to .pbf conversion method is as follows.

[0115] It should be noted that the projection of .pbf file data tiles is usually latitude and longitude projection or Mercator projection. The data format conversion from .csv to .pbf involves three parts of data in the .csv file: vector source data (.csv file), table header (schema.csv file), and filtering conditions (filter.json). The vector source data can be vector data converted from .mif / .shpto.csv, and the table header can be the vector data table header generated by .mif / .shp to .csv. filter.json is a custom configuration file used to define the data required for tiling at each scaling level when tiling .pbf.

[0116] When the data format conversion device 11 determines that it is necessary to convert a .csv file to a .pbf file, it can refer to the following: Figure 4 The processing flow shown uses the Spark component to read data from the .csv file, filters the data slices at each level according to the filtering conditions (filter.json), and serializes and stores each level of data slices using protobuf-java-3.5.0 to obtain .pbf files, thus realizing the data format conversion between .csv and .pbf.

[0117] For example, Figure 5 The file format of the .csv file is shown as .pbf file obtained after the data format conversion device 11 converts the .csv file.

[0118] The implementation process of the pbf-merge conversion method is as follows.

[0119] The pbf-merge conversion method is used to merge different pbf data of tile numbers into one. It is suitable for merging pbf data from different layers, such as merging building layers and road network layers, merging POI data from different sources, etc.

[0120] It should be noted that .pbf files are tiled under the same projection, cutting the map data according to a grid. Each cut range is called a tile, and the tile number of the same cut range is the same. The same tile number has different map layers.

[0121] When the data format conversion device 11 determines that pbf-merge processing of .pbf files is required, it can refer to the following: Figure 6 The processing flow shown acquires tile data for each level. Based on the principle of map tile pyramids, the tiles of the 10th map level are taken as the first level of the pyramid. Tiles from other map levels 0-9 within the same tile range of the 10th map level, along with the tiles of the current 10th map level, are placed into the same file, greatly reducing the problem of too many .pbf files. The .pbf data in the same file is read, and the data format conversion device 11 rewrites the tile data of different map levels into a new tile after parsing, thus merging the .pbf files.

[0122] For example, Figure 7 The file format of the .pbf file obtained after the .pbf file has been converted by the data format conversion device 11 is shown.

[0123] The implementation process of the .png to .Webp conversion method is as follows.

[0124] It should be noted that WebP compression is mainly divided into lossy compression, lossless compression, and lossy compression with transparency.

[0125] Among them, lossy compression is based on the predictive coding method in VP8 video coding to compress image data. Its basic steps are similar to JPEG (Joint Photographic Experts Group) compression, mainly including format conversion, sub-block segmentation, predictive coding, forward discrete cosine transform (FDCT), quantization, Z-ordering, and entropy coding.

[0126] Lossless compression is based on transforming image data using different techniques, including: predictive space transformation, color space transformation, using a color palette, packing multiple pixels into one pixel, and alpha value replacement. For entropy coding, an improved LZ77-Huffman coding method is used to compact sparse values; it is a 2D coding technique for distance values.

[0127] Lossy-to-transparency compression differs from both lossy and lossless compression. This encoding method allows for lossy encoding of RGB channels while simultaneously enabling lossless encoding of transparency channels.

[0128] When the data format conversion device 11 determines that it is necessary to convert a .png file to a .Webp file, the data format conversion device 11 performs the following steps in sequence to achieve the data format conversion between .png and .Webp.

[0129] Step 1: The data format conversion device 11 converts the RGB format to YUV format after determining that the image data before compression is in RGB format, where Y represents the luminance component and UV represents the chrominance component.

[0130] Step 2: The data format conversion device 11 divides the data into 8×8 or 16×16 macroblocks.

[0131] Step 3: The data format conversion device 11 performs intra-frame prediction based on the macroblocks obtained in Step 2.

[0132] Intra-frame prediction includes the following four intra-frame prediction modes.

[0133] Firstly, H_PRED (horizontal prediction). Uses the leftmost column L of the block to fill each column in the block.

[0134] Secondly, V_PRED (vertical prediction): Use the top row A of the block to fill each row in the block.

[0135] Thirdly, DC_PRED (DC prediction): fills the block with the average value of all pixels in L and A as the unique value.

[0136] Fourth, TM_PRED (TrueMotion prediction): Uses an asymptotic approach to record the asymptotic difference of the previous row, and expands each row with the same difference as the baseline L.

[0137] Step 4: The data format conversion device 11 performs FDCT on each macroblock, so that the low-frequency part of the transformed data is distributed in the upper left of the data block and the high-frequency part is concentrated in the lower right. The first coefficient in the upper left corner is called the DC coefficient, and the others are AC coefficients.

[0138] Step 5: The data format conversion device 11 divides each value in the macroblock after FDCT transformation by the corresponding coefficient in the quantization table and rounds it down.

[0139] In the quantization table, the coefficients corresponding to the high-frequency part are much larger than those of the low-frequency part. Therefore, after quantization, the frequency coefficients of the high-frequency part are greatly attenuated or even many are cleared to zero, while the frequency coefficients of the low-frequency part are well preserved.

[0140] Step Six: To facilitate subsequent encoding, the data format conversion device 11 rearranges the data blocks before encoding, placing the low-frequency data first and the high-frequency data last, in order to increase the number of consecutive zero values ​​in the array.

[0141] It should be noted that after the data format conversion device 11 rearranges the data blocks, the encoding method can be selected from steps seven to nine below according to the requirements for the .Webp format file.

[0142] Step 7: The data format conversion device 11 encodes the DC coefficient using Differential Pulse Code Modulation (DPCM).

[0143] It should be noted that, since the DC coefficient is relatively large and the DC coefficients of adjacent data blocks are not significantly different, DPCM can be used to encode the difference in DC coefficients between adjacent data blocks after quantization, thereby improving the compression ratio.

[0144] Step 8: The data format conversion device 11 performs run-length encoding on the quantized AC coefficients to effectively compress the data length.

[0145] Step 9: The data format conversion device 11 uses a Boolean algorithm to entropy encode the data.

[0146] For example, Figure 8 The image shows the file format of a .Webp file obtained after a .png file is converted by the data format conversion device 11. The converted .Webp file has a significantly smaller image size compared to the original .png file, which can improve the speed of tile loading and rendering.

[0147] The implementation process of the .png to .csv conversion method is as follows.

[0148] It should be noted that map data is typically stored in tile format. When the area is large and the map resolution is high, the number of tiles can often reach tens of millions or even hundreds of millions. Due to the large data size, data compression is time-consuming and has a high failure rate, making data sharing and transmission impossible. To solve this problem, the data format conversion device 11 converts .png format images into Base64 characters (based on 64 printable characters to represent binary data) and stores them in a small amount of text in CSV format.

[0149] When the data format conversion device 11 determines that it is necessary to convert a .png file to a .csv file, the data format conversion device 11 performs the following steps in sequence to achieve the data format conversion between .png and .csv.

[0150] Step 1: The data format conversion device 11 classifies the RGB values ​​of each pixel in the .png format image between 0 and 255, and converts each level of pixel into ASCII code by referring to the American Standard Code for Information Interchange (ASCII) encoding table.

[0151] In ASCII encoding, each of the following characters—AZ, az, 0-9, and some other special characters—is represented by a unique number. For example, 'a' is 97, and 'A' is 65.

[0152] Step 2: The data format conversion device 11 divides the obtained ASCII data into groups of three bytes, for a total of 24 bits.

[0153] Step 3: The data format conversion device 11 reassembles the segmented data, dividing the 24 bits into 4 groups of 6 bits each.

[0154] Step 4: The data format conversion device 11 processes the recombined data, adding two "0"s at the beginning of each group to form 8 bits per group, for a total of 32 bits.

[0155] Step 5: The data format conversion device 11 obtains the corresponding encoding value according to the Base64 encoding table. Further, the data format conversion device 11 writes the obtained encoding value into a .csv format file, realizing the data format conversion from .png to .csv.

[0156] For example, take the character "Man".

[0157] S1. The data format conversion device 11 determines the decimal numbers corresponding to the character Man as "77", "97", and "110" based on the ASCII encoding table. Further, the data format conversion device 11 determines the binary values ​​corresponding to the character Man as 01001101, 01100001, and 01101110.

[0158] S2, the data format conversion device 11 combines the three binary numbers obtained in S1 to obtain a 24-bit binary string 010011010110000101101110.

[0159] S3. The data format conversion device 11 divides the 24-bit binary string obtained in S2 into 4 groups of 6 binary bits each, resulting in 010011, 010110, 000101, and 101110.

[0160] S4 and the data format conversion device 11 add "00" to the beginning of each binary string obtained in S3, expanding it to 32 binary bits, resulting in four bytes: 00010011, 00010110, 00000101, and 00101110. The corresponding decimal values ​​are 19, 22, 5, and 46, respectively.

[0161] S5, the data format conversion device 11 determines the corresponding Base64 encoding based on the decimal value obtained in S4 and the Base64 encoding table, and obtains T, W, F, u.

[0162] Furthermore, the data format conversion device 11 writes the obtained TWFu into a .csv format file.

[0163] For example, Figure 9 The image shows the file format of a .csv file obtained after a .png file has been converted by the data format conversion device 11. Compared to the original .png file, the converted .csv file enables faster transmission and storage, improving the rendering efficiency of electronic maps.

[0164] Figure 10 This is a flowchart illustrating a data format conversion method according to some exemplary embodiments. In some embodiments, the above-described data format conversion method can be applied to, for example... Figure 1 The data format conversion system 10 shown includes a data format conversion device 11. Hereinafter, this application will describe the data format conversion method by taking the application of the data format conversion method to the data format conversion device 11 as an example.

[0165] like Figure 10 As shown, the data format conversion method provided in this application embodiment includes the following S201-S204.

[0166] S201, The data format conversion device acquires the geographic data input by the user.

[0167] As one possible implementation, a data format conversion device acquires geographic data input by the user through the user device.

[0168] For example, when the user equipment and the data format conversion device are deployed on different devices, the user selects to send geographic data to the data format conversion device on the user equipment through the connection between the user equipment and the data format conversion device.

[0169] Correspondingly, the data format conversion device receives geographic data sent by the user equipment through a connection with the user equipment.

[0170] When the user device and the data format conversion device are deployed on the same device, the user can drag and drop geographic data to the file input area of ​​the data format conversion device by using a mouse or other input device connected to the user device.

[0171] Correspondingly, when the data format conversion device detects the presence of a file in the file input area, it acquires the geographical data of the file input area.

[0172] S202, The data format conversion device determines the initial data format and the target data format of the geographic data.

[0173] The initial data format and the target data format are different.

[0174] As one possible implementation, after the data format conversion device obtains the geographic data based on the above step S201, it detects the file extension of the geographic data, obtains the data format of the geographic data, and determines the detected and obtained data format as the initial data format.

[0175] Furthermore, if the user inputs a desired data format when entering geographic data, the data format conversion device will determine the user's desired data format as the target data format. If the user does not input a desired data format, the data format conversion device will determine a preset data format as the target data format. Alternatively, the data format conversion device will detect the data formats supported by the software connected to the output interface and determine the data formats supported by that software as the target data format, so that the geographic data in the initial data format can be run by the connected software after being processed by the data format conversion device.

[0176] It should be noted that the preset data format can be set in advance in the data format conversion device by the operation and maintenance personnel of the data format conversion system, and this application embodiment does not specifically limit this.

[0177] For example, the data format of geographic data can be any of the following: .mif, .shp, .csv, .pbf, .png, and Webp.

[0178] S203, The data format conversion device determines the conversion relationship sequence based on the initial data format and the target data format.

[0179] The conversion relationship sequence includes at least one conversion relationship, which indicates the conversion from a first data format to a second data format; the first data format of the first conversion relationship in the conversion relationship sequence is the initial data format, and the second data format of the last conversion relationship in the conversion relationship sequence is the target data format.

[0180] It should be noted that each conversion relationship corresponds to two conversion relationships, indicating that geographic data in the first data format can be converted into geographic data in the second data format.

[0181] As one possible implementation, after determining the initial data format and the target data format, the data format conversion device determines the first conversion relationship from the preset conversion relationships based on the initial data format, and determines the last conversion relationship from the preset conversion relationships based on the target data format. Further, the data format conversion device determines whether the first conversion relationship and the last conversion relationship are the same conversion relationship; if they are the same conversion relationship, it determines that the conversion relationship sequence includes either the first conversion relationship or the last conversion relationship.

[0182] Furthermore, when the first conversion relationship and the last conversion relationship are not the same, the data format conversion device determines the next conversion relationship from the preset conversion relationships based on the second data format of the first quasi-conversion relationship. The first data format of the next conversion relationship is the second data format of the previous conversion relationship, until the second data format of the conversion relationship is the first data format of the last conversion relationship. The data format conversion device generates a conversion relationship sequence based on the first quasi-conversion relationship, the sequentially queried conversion relationships, and the last conversion relationship.

[0183] It should be noted that the preset conversion relationships can be set in advance in the data format conversion device by the operation and maintenance personnel of the data format conversion system. For example, .mif can be converted to .csv, .shp can be converted to .csv, .mif can be converted to .csv, .csv can be converted to .pbf, .png can be converted to .csv, pbf-merge, and .csv can be converted to .Webp. This application embodiment does not specifically limit this.

[0184] For example, if the initial data format of the geographic data is .shp and the target data format is .merge-pbf, the data format conversion device, based on the aforementioned preset conversion relationships, determines that the conversion relationship for the first data format .shp is .shp can be converted to .csv, and identifies this conversion relationship as the first conversion relationship. It also determines that the conversion relationship for the second data format .merge-pbf is pbf-merge, and identifies pbf-merge as the last conversion relationship. Further, if the data format conversion device determines that .shp can be converted to .csv and pbf-merge are not the same conversion relationship, then the data format conversion device determines that the second data format for .shp can be converted to .csv is .csv, and based on the .csv format, queries the next conversion relationship for the first data format .csv, which is .csv can be converted to .pbf. Furthermore, if the data format conversion device determines that .csv can be converted to the second data format .pbf, and the .pbf format is the first data format of the last conversion relationship pbf-merge, then it determines that at least one conversion relationship included in the conversion relationship sequence is .shp can be converted to .csv, .csv can be converted to .pbf, and pbf-merge, then the conversion relationship sequence is [.shp can be converted to .csv, .csv can be converted to .pbf, pbf-merge].

[0185] If the initial data format of the geographic data is .shp and the target data format is .csv, then the data format conversion device, based on the aforementioned preset conversion relationship, determines that the first data format, .shp, can be converted to .csv, and determines that the second data format, which is the target data format, is the conversion relationship .shp can be converted to .csv. Therefore, the conversion relationship .shp can be converted to .csv is determined to be the last conversion relationship. Furthermore, if the data format conversion device determines that the first and last conversion relationships are the same, then the conversion relationship sequence is [.shp can be converted to .csv].

[0186] S204. The data format conversion device converts the geographic data format from the initial data format to the target data format according to the conversion relationship sequence.

[0187] As one possible implementation, after determining the conversion relationship sequence in step S203, the data format conversion device determines the number of conversion relationships included in the sequence. Further, if the data format conversion device determines that the conversion relationship sequence includes only one conversion relationship, it retrieves a format conversion method from the server based on the identifier of the conversion relationship, performs format conversion on the geographic data, and obtains geographic data in the target data format.

[0188] When the data format conversion device determines that the conversion relationship sequence includes at least two conversion relationships, it retrieves the corresponding format conversion method from the server based on the identifier of the conversion relationship, and sequentially calls the format conversion method to convert the geographic data according to the order of the conversion relationships in the conversion relationship sequence, so as to obtain the geographic data in the target data format.

[0189] It should be noted that the mapping relationship between the identifier of the conversion relationship and the format conversion method can be set in advance by the operation and maintenance personnel of the data format conversion system in the data format conversion device or server. This application embodiment does not specifically limit this.

[0190] For example, the mapping relationship between the identifier of the conversion relationship and the format conversion method is shown in Table 1 below.

[0191] Table 1: Mapping Table of Conversion Relationship Identifiers and Format Conversion Methods

[0192] .mif can be converted to .csv .mif to .csv .shp can be converted to .csv .shp to .csv .mif can be converted to .csv .mif to .csv .csv can be converted to .pbf .csv to .pbf .png can be converted to .csv .png to .csv

[0193] It should be noted that Table 1 above only illustrates the mapping relationship between the identifiers of five conversion relationships and the format conversion methods, and does not constitute a limitation on the number of mapping relationships between the identifiers of conversion relationships and the format conversion methods.

[0194] In some embodiments, as new data formats and conversion methods emerge with the development of electronic maps, a corresponding mapping relationship can be added to the mapping table between the identifier of the conversion relationship and the format conversion method stored in the data format conversion device, and the corresponding format conversion method can be stored in the server to improve the adaptability of the data format conversion method provided in this application.

[0195] Understandably, in the data format conversion method provided in this application embodiment, after obtaining the geographic data input by the user, the data format conversion device determines the initial data format and the target data format of the geographic data, and determines a conversion relationship sequence based on the initial data format and the target data format. Then, according to the multiple sequential conversion relationships in the conversion relationship sequence, the data format of the geographic data is converted in turn to obtain the geographic data in the target data format. This provides a clear data format conversion link. By using the format conversion methods corresponding to the sequentially arranged conversion relationships in the conversion relationship sequence, the geographic data is converted in turn to make the format conversion of the geographic data convenient and fast.

[0196] In a design, such as Figure 11 As shown, this application embodiment also provides a method for determining a transformation relationship sequence based on the initial data format and target data format of geographic data, including S301-S304.

[0197] S301, The data format conversion device determines the first conversion relationship from the conversion relationship topology based on the initial data format.

[0198] The transformation relationship topology includes multiple data formats and the transformation relationship between two adjacent data formats.

[0199] As one possible implementation, the data format conversion device determines an initial topology node corresponding to the initial data format from the conversion relationship topology based on the initial data format of the geographic data determined in step S202 above. Further, the data format conversion device determines the conversion relationship starting from this initial topology node from the conversion relationship topology, and designates the determined conversion relationship as the first conversion relationship.

[0200] It should be noted that the topology nodes in the conversion relationship topology can be pre-set in the data format conversion device by the operation and maintenance personnel of the data format conversion system. The data format conversion device determines each data format as a topology node and connects two topology nodes with a preset conversion relationship among multiple topology nodes to generate the conversion relationship topology.

[0201] For example, Figure 12 A schematic diagram of a conversion relationship topology is shown, where topology nodes include .mif, .shp, .csv, .pbf, and .merge-pbf formats. If the data format conversion device determines that the .csv format is the initial data format, then based on the conversion relationship topology, it determines that .csv can be converted to .pbf as a conversion relationship starting with the .csv format, and determines that .csv can be converted to .pbf as the first conversion relationship.

[0202] If the data format conversion device determines that the .mif format is the initial data format, then based on the conversion relationship topology, it determines that the conversion from .mif to .shp and the conversion from .mif to .csv are both conversion relationships starting with the .mif format. Furthermore, if the data format conversion device determines that the .pbf format is the target data format, then based on the conversion relationship topology, it can be determined that converting from .mif to .csv requires one less format conversion than converting from .mif to .shp, therefore, the conversion from .mif to .csv is determined as the first conversion relationship.

[0203] In some embodiments, when a certain data format is used as the starting point and multiple transformation relationships are included, multiple transformation links are obtained by descending the topology based on each transformation relationship, which can convert geographic data into the target data format. Furthermore, the transformation relationship included in the transformation link with the fewest transformations is selected and written into the transformation relationship sequence.

[0204] S302, The data format conversion device determines whether the second data format of the first conversion relationship is the target data format.

[0205] As one possible implementation, the data format conversion device determines a second data format for the first conversion relationship based on the first conversion relationship determined in step S301. Further, the data format conversion device compares the target data format determined in step S202 with the second data format of the first conversion relationship to determine whether they are consistent.

[0206] S303. If the second data format of the first conversion relationship is not the target data format, the data format conversion device determines the last conversion relationship from the conversion relationship topology according to the target data format.

[0207] As one possible implementation, if the data format conversion device determines in step S302 that the second data format of the first conversion relationship is not the target data format, it determines the terminating topology node corresponding to the target data format from the conversion relationship topology based on the target data format. Further, the data format conversion device determines the conversion relationship ending at this terminating topology node from the conversion relationship topology, and designates the determined conversion relationship as the last conversion relationship.

[0208] For example, based on Figure 12 The diagram shows a topology of the conversion relationship. If the data format conversion device determines that the .pbf format is the initial data format, then based on the topology of the conversion relationship, it determines that the .csv can be converted to .pbf as a conversion relationship ending with the .pbf format, and determines the .csv can be converted to .pbf as the last conversion relationship.

[0209] S304. The data format conversion device determines the sequence of conversion relationships from the conversion relationship topology based on the first and last conversion relationships.

[0210] As one possible implementation, the data format conversion device determines intermediate conversion relationships within the conversion relationship topology based on the first and last conversion relationships determined in steps S301 and S303. Furthermore, the data format conversion device determines that the conversion relationship sequence includes the first conversion relationship, intermediate conversion relationships, and the last conversion relationship.

[0211] It should be noted that the data format conversion device can determine the intermediate conversion relationship by taking the second data format of the previous conversion relationship as the starting point, determining the current conversion relationship, identifying the current conversion relationship as an intermediate conversion relationship, and determining whether the second data format of the current conversion relationship is the first data format of the last conversion relationship.

[0212] Furthermore, if the second data format of the current transformation relation is the first data format of the last transformation relation, then the current transformation relation is determined to be the second-to-last transformation relation in the transformation relation sequence.

[0213] If the second data format of the current conversion relationship is not the first data format of the last conversion relationship, the next conversion relationship is determined based on the second data format of the current conversion relationship, until the second data format of the conversion relationship is determined to be the first data format of the last conversion relationship, and the first data format of the next conversion relationship is the second data format of the current conversion relationship.

[0214] It is understood that in the data format conversion method provided in the embodiments of this application, a conversion relationship topology is generated in advance based on the data format and preset conversion relationship. After the data format conversion device obtains the initial data format and target data format of the geographic data, a conversion relationship sequence including the minimum number of conversion relationships can be determined based on the conversion relationship topology.

[0215] In one design, when the transformation relationship sequence includes multiple transformation relationships, in order to convert the format of geographic data from an initial data format to a target data format, the data format conversion method provided in this application embodiment further includes:

[0216] The data format conversion device sequentially switches the data format of the geographic data according to the initial data format of the geographic data and the order of at least two conversion relationships included in the conversion relationship sequence, until the data format of the geographic data is the target data format.

[0217] The data format conversion device, after determining the conversion relationship sequence, retrieves the corresponding conversion method based on the first conversion relationship in the sequence, converts the geographic data in the initial data format, obtains the geographic data after conversion, and further determines whether the geographic data format is the target data format.

[0218] If the geographic data is in the target data format, output the geographic data in the target data format. If the geographic data is not in the target data format, retrieve the corresponding conversion methods sequentially according to the conversion relationship sequence to convert the geographic data format until the geographic data is in the target data format.

[0219] In a design, such as Figure 13 As shown, this application embodiment also provides a method for determining a transformation relationship sequence based on the initial data format and the target data format of geographic data, including S401-S403.

[0220] S401, The data format conversion device determines the first conversion relationship from the conversion relationship topology based on the initial data format.

[0221] It should be noted that the specific implementation of S401 can be referred to the description of step S301 in the above embodiment of this application, and will not be repeated here.

[0222] S402, The data format conversion device determines whether the second data format of the first conversion relationship is the target data format.

[0223] It should be noted that the specific implementation of S402 can be referred to the description of step S302 in the above embodiment of this application, and will not be repeated here.

[0224] S403. When the second data format of the first conversion relationship is the target data format, the data format conversion device determines the conversion relationship sequence, which includes the first conversion relationship.

[0225] As one possible implementation, if the data format conversion device determines the second data format of the first conversion relationship as the target data format based on the above step S402, that is, it determines that the conversion from the initial data format to the target data format can be achieved through the format conversion method corresponding to the first conversion relationship. The data format conversion device inputs the first conversion relationship sequence determined in step S401 into the conversion relationship sequence to obtain a conversion relationship sequence including the first conversion relationship.

[0226] It is understood that in the data format conversion method provided in the embodiments of this application, a conversion relationship topology is generated in advance based on the data format and the preset conversion relationship. When the data format conversion device determines that the first data format of the first conversion relationship is the initial data format and the second data format is the target data format, the conversion relationship sequence is determined to include only the first conversion relationship, thereby avoiding invalid data relationship determination by the data format conversion device.

[0227] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0228] This application embodiment can divide the user equipment into functional modules according to the above method example. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0229] Figure 14 This is a schematic diagram of a data format conversion apparatus provided in an embodiment of this application. This data format conversion apparatus is used to perform the aforementioned data format conversion method. Figure 14 As shown, the data format conversion device 50 includes an acquisition unit 501, a determination unit 502, and a processing unit 503.

[0230] The acquisition unit 501 is used to acquire geographic data input by the user. For example, such as... Figure 10 As shown, the acquisition unit 501 can be used to execute S201.

[0231] Unit 502 is used to determine the initial data format and the target data format of the geographic data; the initial data format is different from the target data format. For example, ... Figure 10 As shown, the determining unit 502 can be used to execute S202.

[0232] The determining unit 502 is further configured to determine a sequence of conversion relationships based on the initial data format and the target data format; the sequence of conversion relationships includes at least one conversion relationship, which indicates a conversion from a first data format to a second data format; the first data format of the first conversion relationship in the sequence is the initial data format, and the second data format of the last conversion relationship in the sequence is the target data format. For example, such as Figure 10 As shown, the determining unit 502 can be used to execute S203.

[0233] Processing unit 503 is used to convert the data format of geographic data from the initial data format to the target data format according to the transformation relationship sequence. For example, Figure 10 As shown, the processing unit 503 can be used to execute S204.

[0234] Optional, such as Figure 14 As shown, in the data format conversion apparatus 50 provided in this application embodiment, the determining unit 502 is further configured to determine the first conversion relationship from the conversion relationship topology based on the initial data format; the conversion relationship topology includes multiple data formats and the conversion relationships corresponding to two adjacent data formats among the multiple data formats. For example, as Figure 11 As shown, the determining unit 502 can be used to execute S301.

[0235] The determining unit 502 is also used to determine the last transformation relation from the transformation relation topology based on the target data format when the second data format of the first transformation relation is not the target data format. For example, Figure 11 As shown, the determining unit 502 can be used to execute S302-S303.

[0236] Unit 502 is further configured to determine a sequence of transformation relations from the transformation relation topology based on the first and last transformation relations. For example, such as... Figure 11 As shown, the determining unit 502 can be used to execute S304.

[0237] Optional, such as Figure 14 As shown, in the data format conversion apparatus 50 provided in this embodiment, the determining unit 502 is further configured to determine the first conversion relationship from the conversion relationship topology based on the initial data format. For example, as Figure 13 As shown, the determining unit 502 can be used to execute S401.

[0238] The determining unit 502 is further configured to determine a sequence of transformation relations, wherein the second data format of the first transformation relation is the target data format, and the sequence of transformation relations includes the first transformation relation. For example, such as... Figure 13 As shown, the determining unit 502 can be used to execute S402-S403.

[0239] Optional, such as Figure 14 As shown, in the data format conversion device 50 provided in this application embodiment, the processing unit 503 is further configured to sequentially switch the data format of the geographic data according to the geographic data in the initial data format and the order of at least two conversion relationships included in the conversion relationship sequence, until the data format of the geographic data is the target data format.

[0240] In implementing the functions of the integrated modules described above using hardware, this application provides a possible structural diagram of a data format conversion device. This data format conversion device is used to execute the data format conversion method performed by the data format conversion apparatus in the above embodiments. Figure 15 As shown, the data format conversion device 60 includes a processor 601, a memory 602, and a bus 603. The processor 601 and the memory 602 can be connected via the bus 603.

[0241] Processor 601 is the control center of the data format conversion device. It can be a single processor or a collective term for multiple processing elements. For example, processor 601 can be a general-purpose central processing unit (CPU) or other general-purpose processors. The general-purpose processor can be a microprocessor or any conventional processor.

[0242] As one embodiment, processor 601 may include one or more CPUs, for example Figure 15 CPU 0 and CPU 1 are shown in the diagram.

[0243] The memory 602 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.

[0244] As one possible implementation, the memory 602 can exist independently of the processor 601. The memory 602 can be connected to the processor 601 via a bus 603 and is used to store instructions or program code. When the processor 601 calls and executes the instructions or program code stored in the memory 602, it can implement the data format conversion method provided in the embodiments of this application.

[0245] In another possible implementation, the memory 602 can also be integrated with the processor 601.

[0246] Bus 603 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 15 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0247] It should be pointed out that, Figure 15 The structure shown does not constitute a limitation on the data format conversion device 60. Except... Figure 15 In addition to the components shown, the data format conversion device 60 may include components such as... Figure 15 It can show more or fewer parts, or combine certain parts, or arrange different parts.

[0248] As an example, combined Figure 14 The functions implemented by the acquisition unit 501, the determination unit 502, and the processing unit 503 in the data format conversion device 50 are the same as those of the data format conversion device 50. Figure 15 The processor 601 in it has the same function.

[0249] Optional, such as Figure 15 As shown, the data format conversion device provided in this application embodiment may further include a communication interface 604.

[0250] Communication interface 604 is used to connect with other devices via a communication network. This communication network can be Ethernet, a wireless access network, a wireless local area network (WLAN), etc. Communication interface 604 may include an acquisition unit for receiving data and a transmission unit for sending data.

[0251] In one design, the communication interface in the data format conversion device provided in this application embodiment can also be integrated into the processor.

[0252] Figure 16 This illustration shows another hardware structure of the data format conversion device in an embodiment of this application. For example... Figure 16 As shown, the data format conversion device 70 may include a processor 701 and a communication interface 702. The processor 701 is coupled to the communication interface 702.

[0253] The functions of processor 701 can be referred to in the description of processor 601 above. In addition, processor 701 also has storage functions, which can be referred to in the description of memory 602 above.

[0254] The communication interface 702 is used to provide data to the processor 701. The communication interface 702 can be an internal interface of the data format conversion device, or it can be an external interface of the data format conversion device (equivalent to the communication interface 604).

[0255] It should be pointed out that, Figure 16 The structure shown does not constitute a limitation on the data format conversion device, except Figure 16 In addition to the components shown, the data format conversion device 70 may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0256] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional units is used as an example. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0257] This application also provides a computer-readable storage medium storing instructions. When a computer executes these instructions, the computer performs each step of the method flow shown in the above-described method embodiments.

[0258] Embodiments of this application provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform the data format conversion method described in the above method embodiments.

[0259] The computer-readable storage medium may 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 computer-readable storage media (a non-exhaustive list) include: 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), registers, hard disks, optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing, or any other form of computer-readable storage medium in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0260] Since the apparatus, device, computer-readable storage medium, and computer program product in the embodiments of this application can be applied to the above methods, the technical effects that can be obtained can also be referred to the above method embodiments. The embodiments of this application will not be repeated here.

[0261] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.< / type> < / name> < / type> < / name> < / c>

Claims

1. A data format conversion method, characterized in that, The method includes: Obtain geographic data input by the user, and determine the initial data format and the target data format of the geographic data; the initial data format and the target data format are different. Based on the initial data format, the target data format, and the conversion relationship topology, a conversion relationship sequence from the initial data format to the target data format is determined; the conversion relationship topology includes multiple data formats and conversion relationships corresponding to two adjacent data formats among the multiple data formats; the conversion relationship sequence includes at least one conversion relationship, which is used to indicate conversion from a first data format to a second data format; the first data format of the first conversion relationship in the conversion relationship sequence is the initial data format, and the second data format of the last conversion relationship in the conversion relationship sequence is the target data format; According to the transformation relationship sequence, the data format of the geographic data is transformed from the initial data format to the target data format.

2. The data format conversion method according to claim 1, characterized in that, The step of determining the conversion relationship sequence from the initial data format to the target data format based on the initial data format, the target data format, and a preset conversion relationship topology includes: Based on the initial data format, the first transformation relationship is determined from the transformation relationship topology; If the second data format of the first transformation relationship is not the target data format, the last transformation relationship is determined from the transformation relationship topology according to the target data format; The transformation relationship sequence is determined from the transformation relationship topology based on the first transformation relationship and the last transformation relationship.

3. The data format conversion method according to claim 1, characterized in that, The step of determining the transformation relationship sequence based on the initial data format and the target data format includes: Based on the initial data format, determine the first transformation relationship from the transformation relationship topology; If the second data format of the first transformation relationship is the target data format, the transformation relationship sequence is determined, and the transformation relationship sequence includes the first transformation relationship.

4. The data format conversion method according to claim 2, characterized in that, The step of converting the data format of the geographic data from the initial data format to the target data format according to the conversion relationship sequence includes: Based on the geographic data in the initial data format and the order of the at least two transformation relationships included in the transformation relationship sequence, the data format of the geographic data is switched sequentially until the data format of the geographic data is the target data format.

5. A data format conversion device, characterized in that, It includes an acquisition unit, a determination unit, and a processing unit; The acquisition unit is used to acquire the geographic data input by the user; The determining unit is used to determine the initial data format and the target data format of the geographic data; the initial data format is different from the target data format. The determining unit is further configured to determine a sequence of conversion relationships from the initial data format to the target data format based on the initial data format, the target data format, and the conversion relationship topology; the conversion relationship topology includes multiple data formats and conversion relationships corresponding to two adjacent data formats among the multiple data formats; the conversion relationship sequence includes at least one conversion relationship, which is used to indicate a conversion from a first data format to a second data format; the first data format of the first conversion relationship in the conversion relationship sequence is the initial data format, and the second data format of the last conversion relationship in the conversion relationship sequence is the target data format; The processing unit is configured to convert the data format of the geographic data from the initial data format to the target data format according to the conversion relationship sequence.

6. The data format conversion device according to claim 5, characterized in that, The determining unit is further configured to determine the first transformation relationship from the transformation relationship topology based on the initial data format; The determining unit is further configured to, when the second data format of the first conversion relationship is not the target data format, determine the last conversion relationship from the conversion relationship topology according to the target data format; The determining unit is further configured to determine the transformation relationship sequence from the transformation relationship topology based on the first transformation relationship and the last transformation relationship.

7. The data format conversion device according to claim 5, characterized in that, The determining unit is further configured to determine the first transformation relationship from the transformation relationship topology based on the initial data format; The determining unit is further configured to determine the transformation relationship sequence, wherein the transformation relationship sequence includes the first transformation relationship, when the second data format of the first transformation relationship is the target data format.

8. A data format conversion device, characterized in that, Including memory and processor; The memory and the processor are coupled; The memory is used to store computer program code, which includes computer instructions; When the processor executes the computer instructions, the data format conversion device performs the data format conversion method as described in any one of claims 1-4.

9. A computer program product, characterized in that, The computer program product includes computer instructions, which, when executed on a data format conversion device, perform the data format conversion method as described in any one of claims 1-4.

10. A computer-readable storage medium storing instructions, characterized in that, When the instruction is executed on the data format conversion device, the data format conversion device performs the data format conversion method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Data format conversion method and device for use in network application

    CN103559171A