Data format conversion method and system, storage medium and program product
By extracting data features and establishing mapping relationships, combining data conversion model and version control mechanism, high-precision lossless conversion between DWG and SHP formats is realized, solving the problem of information loss and version incompatibility in data format conversion, and improving data usability and conversion efficiency.
Patent Information
- Application Number
- CN202411578659.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-11-07
AI Technical Summary
In the field of surveying and mapping geographic information, in the data format conversion between DWG format and SHP format, complex graphic elements and professional information are easily lost, resulting in reduced availability of data analysis and application, and traditional conversion methods have problems of information loss and low accuracy.
By extracting data features, establishing mapping relationships, and using the data conversion model to generate supplementary data, the lossless conversion between DWG and SHP formats is realized, and the integrity and reversibility of the conversion is ensured through the loss data storage mechanism, using version information checking and automatic The upgrade prompt mechanism ensures version compatibility.
It realizes high-precision, lossless data conversion between DWG and SHP formats, ensures data integrity and availability, solves the problems of information loss and version incompatibility, and improves the quality and efficiency of data conversion.
Smart Images

Figure CN119088759A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic digital data processing, and in particular to a data format conversion method, system, storage medium and program product. Background Art
[0002] In the field of surveying and mapping geographic information, the diversification of data formats is a common phenomenon. Engineering designers usually use CAD software to draw engineering drawings and generate DWG format data; while in geographic information system applications, the SHP format is widely used for spatial data storage and analysis. With the improvement of the level of informatization, data exchange between CAD mapping and GIS analysis is often required in engineering projects, which puts higher requirements on data format conversion.
[0003] Data format conversion in related technologies usually uses direct mapping to convert graphic elements in DWG into geometric types supported by SHP. For example, line segments and polylines in DWG are converted into line features in SHP, and closed polylines are converted into surface features, while extracting basic attribute information such as layer name and color. When processing annotation information, the text position and content are extracted and converted into the annotation layer of SHP.
[0004] However, in actual engineering applications, the DWG format contains a large number of complex graphic elements, such as spline curves and parametric objects, which are often simplified during the conversion process. It is also difficult to find corresponding expressions in the SHP format for CAD-specific information such as professional symbols and annotation systems in engineering drawings. In projects such as municipal planning and pipeline engineering, this information loss will affect subsequent data analysis and application, reducing data availability. Summary of the invention
[0005] The present application provides a data format conversion method, system, storage medium and program product for realizing lossless conversion between DWG format and SHP format and improving the utilization rate of heterogeneous data.
[0006] In a first aspect, the present application provides a data format conversion method, which is applied to a format conversion system, and the method includes: receiving first format data, and determining the data format of the first format data, and the target format of second format data as the conversion target; the data format is DWG format or SHP format; when the data format is DWG format, the target format is SHP format; when the data format is SHP format, the target format is DWG format; extracting feature data corresponding to the data format in the first format data, and mapping data corresponding to the target format; inputting the mapping data and the target format into a data conversion model to obtain supplementary data; generating second format data based on the mapping data and the supplementary data; extracting data different from the mapping data in the feature data as loss data, and storing the loss data in a conversion database corresponding to the second format data.
[0007] In the above embodiment, the format conversion system realizes the conversion between DWG and SHP formats by identifying and extracting data features, establishing mapping relationships, and using the data conversion model to generate supplementary data during the data conversion process. At the same time, by extracting and storing the lost data during the conversion process, a data recovery mechanism is established, which effectively ensures the integrity and reversibility of data conversion and solves the problem of information loss in traditional format conversion.
[0008] In combination with some embodiments of the first aspect, in some embodiments, the step of extracting feature data corresponding to the data format in the first format data, and mapping data corresponding to the target format, specifically includes: obtaining layer template information corresponding to the first format data and the data format from a preset layer configuration library; classifying the layers in the first format data based on the layer template information to obtain the building element type; dividing the first format data into geometric data and attribute data according to the building element type; classifying the geometric data according to the mathematical function type to determine the geometric feature parameters; parsing the attribute data according to the standardized specifications to determine the attribute feature parameters; determining the feature data corresponding to the data format in the first format data based on the geometric feature parameters and the attribute feature parameters; and extracting data matching the target format from the first format data as mapping data according to the preset data format mapping rules.
[0009] In the above embodiment, the format conversion system classifies and parameterizes the data by introducing a layer configuration library and standardized specifications, thereby realizing the identification and extraction of geometric data and attribute data; matching data is extracted based on preset data format mapping rules, thereby ensuring the standardization and accuracy of the conversion process and improving the quality and efficiency of data conversion.
[0010] In combination with some embodiments of the first aspect, in some embodiments, the geometric data is classified according to the mathematical function type, and the step of determining the geometric feature parameters specifically includes: obtaining a coordinate point sequence in the geometric data, and classifying the geometric data into one or more of a straight line type, an arc type, and a spline curve type according to the distribution characteristics of the coordinate point sequence; determining the corresponding mathematical function type according to the fitting type of the geometric data; and generating geometric feature parameters based on the mathematical function type.
[0011] In the above embodiment, the format conversion system classifies geometric data into different mathematical function types by analyzing the distribution characteristics of the coordinate point sequence, and generates geometric feature parameters accordingly, thereby achieving accurate representation of the expression and features of complex graphic elements.
[0012] In combination with some embodiments of the first aspect, in some embodiments, the step of extracting data different from the mapping data in the feature data as loss data, and storing the loss data in a conversion database corresponding to the second format data specifically includes: extracting data different from the mapping data in the feature data as loss data; generating a unique identification code corresponding to the loss data, and classifying the loss data according to the type of building elements to obtain an associated mapping table between the loss data and the second format data; and storing the loss data, the unique identification code and the associated mapping table in the conversion database corresponding to the second format data.
[0013] In the above embodiment, the format conversion system generates a unique identification code for the lost data and establishes an association mapping table with the target format data. This classification storage and association mapping method ensures the queryability and recoverability of the data and guarantees the possibility of data recovery.
[0014] In combination with some embodiments of the first aspect, in some embodiments, after the step of storing the loss data, the unique identification code and the associated mapping table in the conversion database corresponding to the second format data, the method further includes: upon receiving a data recovery request for converting the second format data into the first format data, determining the corresponding loss data according to the associated mapping table; extracting the inverse mapping data corresponding to the data format of the first format data in the second format data; and generating the first format data according to the loss data and the inverse mapping data.
[0015] In the above embodiment, the format conversion system realizes bidirectional conversion of data formats by establishing a recovery mechanism for lost data and inverse mapping data, thereby ensuring the integrity of data when converting between different formats and avoiding the problem of information loss in traditional conversion methods.
[0016] In combination with some embodiments of the first aspect, in some embodiments, after the steps of receiving data in the first format and determining the data format of the data in the first format and the target format of the data in the second format as a conversion target, the method further includes: determining version information of the data in the first format; matching the version information with a preset version library, and after the match fails, sending a version upgrade prompt to the user terminal; and receiving the updated data in the first format sent back by the user terminal.
[0017] In the above embodiment, the format conversion system ensures the version compatibility of input data through version checking and upgrade prompting mechanism, avoids conversion failure caused by version incompatibility, and improves the availability and stability of the system.
[0018] In combination with some embodiments of the first aspect, in some embodiments, before the step of inputting the mapping data and the target format into the data conversion model to obtain the supplementary data, the method also includes: obtaining coordinate system information of the mapping data; when the coordinate system information is inconsistent with the default coordinate system corresponding to the target format of the second format data, determining the corresponding coordinate conversion algorithm according to the preset accuracy requirements; based on the coordinate conversion algorithm, converting the mapping data into the default coordinate system.
[0019] In the above embodiment, the format conversion system ensures the conversion of spatial data between different coordinate systems through automatic checking and conversion of the coordinate system, thereby ensuring the accuracy and consistency of the spatial data.
[0020] In a second aspect, an embodiment of the present application provides a format conversion system, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the format conversion system to perform the method described in the first aspect and any possible implementation method of the first aspect.
[0021] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions, and when the above-mentioned computer program product runs on a format conversion system, the above-mentioned format conversion system executes the method described in the first aspect and any possible implementation manner of the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions. When the instructions are executed on a format conversion system, the format conversion system executes the method described in the first aspect and any possible implementation manner of the first aspect.
[0023] It can be understood that the format conversion system provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. Due to the adoption of the technical solution of feature data extraction and mapping data conversion, combined with the data conversion model to generate supplementary data, and the establishment of a loss data storage mechanism, it is possible to achieve conversion between different formats while ensuring data integrity, effectively solving the problems of information loss and low conversion accuracy in the data conversion process in the prior art, thereby achieving traceability and recoverability of data format conversion, and ensuring the integrity and availability of the converted data.
[0025] 2. Due to the adoption of a storage solution that uniquely identifies loss data and an associated mapping table, combined with a building element type classification mechanism, and storing this information in a unified manner in a conversion database, it is possible to accurately record and track data changes during the conversion process, effectively solving the problem in the prior art that data conversion is not traceable and information cannot be recovered after loss, thereby achieving traceability and recoverability of the data conversion process.
[0026] 3. Due to the use of version information checking and automatic upgrade prompt mechanism, combined with the matching verification of the preset version library, and the implementation of version update through user terminal interaction, it is possible to ensure the version compatibility of the input data before data conversion, effectively solving the problem of conversion failure or data error caused by version incompatibility in the existing technology, thereby realizing the version adaptability of the data conversion process and ensuring the accuracy and consistency of the data conversion results. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a flowchart of a data format conversion method in an embodiment of the present application; Figure 2 is another flowchart of the data format conversion method in an embodiment of the present application; Figure 3 It is a schematic diagram of a physical device structure of a format conversion system in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more of the listed items.
[0029] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0030] For ease of understanding, the application scenarios of the embodiments of the present application are introduced below.
[0031] A municipal planning department is carrying out a digital transformation project for the city's underground pipe network. The DWG format pipe network drawings drawn by the design institute using AutoCAD contain complex pipeline layouts, connection nodes, elevation information, etc., while the city management department uses the GIS system and requires SHP format data for spatial analysis and management. When processing complex pipe network data, traditional data conversion methods often lose key data such as pipeline connection relationships, elevation information, and pipe diameter parameters, making it impossible to carry out subsequent pipe network analysis and maintenance work. Especially when processing drawings with CAD-specific functions such as dynamic blocks and parametric objects, the converted data is severely distorted and cannot meet actual work needs.
[0032] In the related art, the basic conversion of data formats can be achieved by converting basic graphic elements in the DWG format into point, line, and surface elements supported by the SHP format through direct mapping conversion.
[0033] The following describes a scenario in which the data format conversion method in the related art is used.
[0034] An architectural design institute used traditional conversion tools to convert CAD drawings of residential communities into GIS data. The conversion tools can only process basic geometric elements, converting line segments in CAD into SHP line features and closed polylines into surface features. However, professional information such as door and window symbols, dimensioning, and legend descriptions in the architectural drawings were all lost during the conversion process. What's more serious is that the building layering information in the original drawing was simplified, resulting in confusion in the attribute data of different functional areas. When spatial analysis of the community is required, managers have to manually enter the missing attribute information, which not only increases the workload but also easily introduces errors.
[0035] By adopting the data format conversion method in the embodiment of the present application, a complete data mapping system and a supplementary data generation mechanism are established to achieve high-precision format conversion and ensure data integrity.
[0036] The following describes scenarios in which the data format conversion method in this application is used.
[0037] A city's drainage management department uses the format conversion system of this application to process underground pipe network data. The system first identifies the attribute information such as pipeline type, material, pipe diameter, etc. in the DWG drawings, and saves the complex pipe network node relationship through feature extraction. When converting to SHP format, the system not only retains the basic spatial location information, but also automatically supplements the flow direction, slope and other parameters of the pipe network through the supplementary data model. When pipe network reconstruction is required, engineers can analyze it in the GIS system, and can restore the complete CAD engineering drawings at any time through the loss data recovery mechanism.
[0038] It can be seen that the data format conversion method in the embodiment of the present application can not only realize the conversion of basic data, but also effectively solve the conversion problem of complex professional data, thereby realizing the efficient use of data assets.
[0039] For ease of understanding, the following describes the process of the method provided by this implementation in combination with the above scenario. Figure 1 , which is a flow chart of the data format conversion method in an embodiment of the present application.
[0040] S101, receiving first format data, and determining a data format of the first format data and a target format of second format data as a conversion target.
[0041] Among them, the first format data represents the source data that needs to be format converted, which can be a data file in DWG format or SHP format; the data format refers to the specific file format type of the first format data, including DWG format and SHP format; the target format represents the target data format after conversion, when the source data is in DWG format, the target format is SHP format, and vice versa; the second format data refers to the conversion result data generated according to the target format.
[0042] When the format conversion system receives a data conversion request submitted by a user, it needs to perform this step to determine the input and output requirements of the conversion. Specifically, the system first receives the data file to be converted uploaded or specified by the user, and identifies its format type by parsing the file header information or extension; then, according to the preset conversion rules, it determines the target format corresponding to the current format; finally, the identified format information is stored in the system memory for subsequent conversion processes.
[0043] In some embodiments, the process of identifying and determining the format information can be implemented in a variety of ways: optionally, the system reads the file header feature information and extracts the format identification code; matches against the built-in format feature library; outputs the format identification result and confirms it; optionally, analyzes the file extension and MIME type; scans the file content structure features; and compares and verifies with historical conversion records. It is understandable that other file format identification technologies can also be used to determine the format type, which is not limited here.
[0044] S102: Extract feature data corresponding to the data format and mapping data corresponding to the target format from the data in the first format.
[0045] Among them, feature data represents key information that can reflect the characteristics of the first format data, including geometric features, attribute features, etc.; mapping data refers to data content that has a corresponding expression in the target format.
[0046] After the format conversion system determines the data format as the source format and the target format as the conversion target, it needs to perform this step to prepare the data required for conversion. Specifically, the system first parses and extracts key information reflecting data characteristics according to the data structure specification of the source format; then compares it with the preset format mapping rules to identify the data content that can be directly mapped in the target format; finally, the extracted feature data and mapping data are stored separately to prepare for subsequent conversion processing.
[0047] In some embodiments, the data extraction and mapping process can be implemented in a variety of ways: optionally, loading a preset data structure template; parsing source data according to template rules; extracting feature information and mapping content that meet the requirements; optionally, building a data parsing tree; traversing data nodes to extract features; and establishing a mapping relationship table. It is understandable that other data extraction and mapping methods can also be used to achieve information separation and correspondence, which is not limited here.
[0048] S103: Input the mapping data and the target format into the data conversion model to obtain supplementary data.
[0049] Among them, the data conversion model refers to the algorithm model used to achieve format conversion; supplementary data refers to the data content that needs to be additionally generated to meet the target format requirements.
[0050] After obtaining the mapping data, the format conversion system needs to perform this step to generate complete conversion data. Specifically, the system first packages the extracted mapping data and target format information as model input; then calls the pre-trained data conversion model for processing; and finally obtains the supplementary data output by the model to make up for the data missing in the direct mapping process.
[0051] It should be noted that the data conversion model uses a large number of DWG and SHP format conversion sample pairs that have completed manual verification as training data during the model training stage. The input includes the mapping data of the source format data (such as geometric feature parameters, attribute feature parameters) and the target format requirements, and the output is the corresponding supplementary data. During the training process, the model continuously optimizes the parameter weights by comparing the differences between the conversion results and the manual verification results. The training standards include: geometric accuracy (controlled at the centimeter level), attribute integrity (key field matching rate must reach 99%), spatial topological relationship retention (node connection relationship accuracy must reach 100%), and professional information expression accuracy (professional symbols and annotations semantic understanding accuracy must reach more than 95%). The data conversion model adopts a multi-layer neural network structure, including a feature extraction layer, a rule mapping layer, and a data supplement layer. The feature extraction layer is responsible for identifying key feature patterns in the input data; the rule mapping layer establishes the corresponding relationship between the source format and the target format based on the preset conversion rule library; the data supplement layer generates necessary supplementary data according to the requirements of the target format. The model has built-in parameter configuration modules for different professional fields (such as construction, municipal administration, pipe network, etc.), and can dynamically adjust the processing strategy according to the specific application scenario. In actual application, the data conversion model first receives the pre-processed mapping data (including the mathematical expression of geometric data and the standardized representation of attribute data) and the target format specification. Then, the model analyzes the data characteristics through the feature recognition algorithm, selects the most suitable processing strategy, and generates supplementary data that meets the requirements of the target format. The output supplementary data includes: coordinate system conversion parameters, spatial index information, professional attribute fields, topological relationship descriptions, etc. These supplementary data and the original mapping data together constitute the complete target format data. The model also automatically verifies the output results to ensure that the conversion quality meets the preset standards. In case of special circumstances, the model will give a warning message for the operator to intervene and adjust manually.
[0052] S104: Generate data in a second format based on the mapping data and the supplementary data.
[0053] The second format data refers to final output data that meets the target format requirement.
[0054] After obtaining the mapping data and supplementary data, the format conversion system needs to perform this step to output the final conversion result. Specifically, the system first uses the mapping data as the basic framework; then integrates the supplementary data according to the requirements of the target format; and finally generates a complete second format data file.
[0055] In some embodiments, the data generation process can be implemented in a variety of ways: optionally, constructing a data structure in a target format; filling in mapping data and supplementary data; verifying data integrity; optionally, creating a temporary data container; writing conversion data in sequence; exporting a target format file. It is understandable that other data generation methods can also be used to achieve the output of the final result, which is not limited here.
[0056] S105 , extracting data different from the mapping data in the feature data as loss data, and storing the loss data in a conversion database corresponding to the second format data.
[0057] Among them, loss data refers to data content that cannot be directly mapped during the format conversion process; the conversion database refers to a data storage system used to store conversion-related information; and data differences refer to information that cannot be directly mapped between the two formats.
[0058] After the format conversion system completes the main conversion, it needs to perform this step to save the data information that may be lost. Specifically, the system first compares the feature data and mapping data to identify the content that cannot be directly mapped; then classifies and organizes the lost data; and finally stores it in a special conversion database for possible subsequent data recovery.
[0059] In some embodiments, the loss data can be processed and stored in a variety of ways: optionally, performing data comparison and analysis; extracting unmapped content; establishing a loss data index; optionally, creating a loss data storage structure; categorizing and arranging loss information; and writing to a conversion database. It is understandable that other data processing and storage methods can also be used to save loss information, which is not limited here.
[0060] In actual applications, the system can flexibly configure conversion rules and parameters according to the needs of different industries to adapt to various complex data conversion scenarios.
[0061] The following is a supplement to the scenario of this embodiment.
[0062] A smart city project team integrated this system with the BIM platform to achieve seamless integration between the building information model and the GIS system. When the architect modifies the building design in BIM, the system can automatically detect the changes and update the corresponding CAD drawings, and then synchronize the latest building data to the GIS platform through the format conversion system. The system's version control mechanism ensures data consistency at different stages, while the feature extraction and supplementary data generation functions enable the three-dimensional information of the building to be accurately converted into a format that can be used by GIS. This not only improves the efficiency of collaborative design, but also provides a reliable data foundation for smart city operation and management.
[0063] After combining the above scenarios, the following is a more detailed description of the process of the method provided by this implementation. Figure 2 , is another flow chart of the data format conversion method in an embodiment of the present application.
[0064] S201, receiving first format data, and determining a data format of the first format data and a target format of second format data as a conversion target.
[0065] Referring to step S101 , the format conversion system determines the data format and the target format.
[0066] In some embodiments, the format conversion system obtains layer template information corresponding to the first format data and the data format from a preset layer configuration library; based on the layer template information, classifies the layers in the first format data to obtain the building element type; according to the building element type, divides the first format data into geometric data and attribute data; classifies the geometric data according to the mathematical function type to determine the geometric feature parameters; parses the attribute data according to the standardized specifications to determine the attribute feature parameters; based on the geometric feature parameters and the attribute feature parameters, determines the feature data corresponding to the data format in the first format data; according to the preset data format mapping rules, extracts the data matching the target format from the first format data as mapping data.
[0067] Among them, the layer configuration library represents a standard library for storing layer definitions in different data formats; layer template information refers to the normative data that describes the layer structure and attributes; building element types are used to represent the classification system of building data; geometric data represents data that describes spatial shapes; attribute data refers to non-spatial data that describes object characteristics; feature parameters are used to represent quantitative indicators of data characteristics; and data format mapping rules refer to the corresponding relationship between data conversions in different formats.
[0068] Before the format conversion system processes data, it needs to execute this process to achieve structured analysis and feature extraction of the data. Specifically, the system first obtains the standard layer template from the configuration library to guide data classification; then divides the data into two categories, geometry and attributes, and extracts features for each; then mathematically models the geometry data to generate geometry feature parameters; at the same time, standardizes the attribute data to obtain attribute feature parameters; and finally extracts mappable data content based on these parameters.
[0069] In some embodiments, feature extraction and classification of data can be implemented in a variety of ways: optionally, loading preset classification standards; constructing a hierarchical classification tree; performing automatic classification processing; optionally, establishing a feature recognition model; applying a feature extraction algorithm; and verifying feature data integrity. It is understandable that other feature extraction and classification methods can also be used to implement structured data processing, which is not limited here.
[0070] In some embodiments, the format conversion system obtains a sequence of coordinate points in the geometric data, and classifies the geometric data into one or more of a straight line type, an arc type, and a spline curve type based on the distribution characteristics of the coordinate point sequence; determines the corresponding mathematical function type based on the fitting type of the geometric data; and generates geometric feature parameters based on the mathematical function type.
[0071] Among them, the coordinate point sequence represents an ordered set of points that describe geometric shapes; the distribution feature refers to the spatial distribution law of the point set; the geometric type is used to represent different spatial forms; the fitting type refers to the method of mathematical curve fitting; and the mathematical function type represents the mathematical expression that describes the geometric shape.
[0072] When the format conversion system processes geometric data, it needs to execute this process to realize the recognition of geometric features. Specifically, the system first extracts the coordinate sequence of the geometric object; then analyzes the distribution characteristics of these points to determine which basic geometric type it belongs to; finally, it selects the appropriate mathematical function for fitting according to the geometric type to generate geometric feature parameters.
[0073] In some embodiments, the identification of geometric features and the generation of parameters can be achieved in a variety of ways: optionally, constructing a point set analysis model; executing a shape recognition algorithm; calculating feature parameter values; optionally, establishing a mathematical model library; applying a curve fitting method; optimizing fitting parameters. It is understandable that other geometric analysis methods can also be used to achieve feature identification and parameter generation, which are not limited here.
[0074] In some embodiments, the format conversion system determines the version information of the first format data; matches the version information with a preset version library, and sends a version upgrade prompt to the user terminal after the match fails; and receives the updated first format data sent back by the user terminal.
[0075] The version information indicates the version identifier of the data format; the version library refers to a database that stores various format version definitions.
[0076] Before processing data, the format conversion system needs to execute this process to ensure the compatibility of data versions. Specifically, the system first checks the version information of the input data; then compares it with the version supported by the system; if the version is found to be incompatible, the user is notified to update; finally, the updated data is received and verified.
[0077] In some embodiments, version checking and update processing can be implemented in a variety of ways: optionally, parsing version identifiers; performing version compatibility checks; generating update suggestions; optionally, establishing version mapping relationships; applying automatic upgrade tools; and verifying upgrade results. It is understandable that other version management methods can also be used to implement data version control, which is not limited here.
[0078] S202: Extract feature data corresponding to the data format and mapping data corresponding to the target format from the data in the first format.
[0079] Referring to step S102 , the format conversion system determines feature data and mapping data.
[0080] S203: Acquire coordinate system information of mapping data.
[0081] Among them, the coordinate system information represents the basic information describing the location reference of spatial data, including projection mode, datum surface, measurement unit, etc.; mapping data refers to the spatial data extracted from the source data that can be directly mapped to the target format.
[0082] After acquiring the mapping data, the format conversion system needs to perform this step to ensure the correct conversion of spatial data. Specifically, the system first parses the spatial reference information in the mapping data; then identifies the type and parameters of the coordinate system; and finally saves the acquired coordinate system information in a standard format to prepare for subsequent coordinate conversion.
[0083] In some embodiments, the coordinate system information can be obtained in a variety of ways: optionally, parsing the coordinate system identifier in the data header file; extracting the spatial reference system parameters; verifying the validity of the coordinate system; optionally, reading the coordinate system configuration file; analyzing the coordinate range of the spatial data; determining the detailed parameters of the coordinate system. It is understandable that other coordinate system identification methods can also be used to obtain spatial reference information, which is not limited here.
[0084] S204: When the coordinate system information is inconsistent with a default coordinate system corresponding to the target format of the second format data, a corresponding coordinate conversion algorithm is determined according to a preset accuracy requirement.
[0085] Among them, the default coordinate system represents the standard coordinate system commonly used in the target format; the preset accuracy requirement refers to the error range allowed during the coordinate conversion process; the coordinate conversion algorithm is used to represent the mathematical model for conversion between different coordinate systems.
[0086] After the format conversion system completes the acquisition of coordinate system information, it needs to perform this step to ensure the accuracy of coordinate conversion. Specifically, the system first compares the coordinate system of the source data with the default coordinate system of the target format; then, according to the preset accuracy requirements, selects a suitable coordinate conversion algorithm from the algorithm library; finally, the selected algorithm is parameterized and the accuracy is verified. In some embodiments, the determination of the coordinate conversion algorithm can be achieved in a variety of ways: optionally, performing a coordinate system consistency check; calculating conversion parameters and accuracy indicators; selecting the optimal conversion algorithm; optionally, constructing a conversion parameter matrix; evaluating the accuracy of different algorithms; and optimizing the algorithm parameter configuration. It is understandable that other algorithm selection methods can also be used to achieve the guarantee of coordinate conversion accuracy, which is not limited here.
[0087] S205: Based on a coordinate conversion algorithm, the mapping data is converted into a default coordinate system.
[0088] The coordinate transformation process refers to the operation of transforming spatial data from one coordinate system to another coordinate system.
[0089] After the format conversion system determines the coordinate conversion algorithm, it needs to perform this step to complete the coordinate system conversion of the spatial data. Specifically, the system first loads the configured coordinate conversion algorithm; then performs coordinate transformation on the mapping data according to the conversion parameters; and finally verifies the accuracy of the conversion result to ensure that it meets the preset requirements.
[0090] In some embodiments, the conversion of the coordinate system can be achieved in a variety of ways: optionally, initializing the conversion algorithm parameters; performing coordinate conversion calculations; verifying the accuracy of the conversion results; optionally, establishing coordinate correspondences; batch processing coordinate data; and outputting the converted results. It is understandable that other coordinate transformation methods can also be used to achieve system conversion of spatial data, which is not limited here.
[0091] S206: Input the mapping data and the target format into the data conversion model to obtain supplementary data.
[0092] Referring to step S103, the format conversion system generates supplementary data.
[0093] S207: Generate data in a second format based on the mapping data and the supplementary data.
[0094] Referring to step S104 , the format conversion system generates second format data.
[0095] S208. Extract data in the feature data that is different from the mapped data as loss data.
[0096] After the format conversion system completes the data conversion, it needs to perform this step to identify and save the data information that may be lost. Specifically, the system first compares the feature data and the mapping data item by item; then identifies the differences between the two through the difference analysis algorithm; then classifies and organizes the identified difference data to ensure that all data that cannot be directly mapped is completely extracted; finally, the data is marked as lost data and temporarily stored for subsequent processing.
[0097] In some embodiments, the identification and extraction of loss data can be achieved in a variety of ways: optionally, constructing a comparison table of feature data and mapping data; performing a one-by-one comparison of data items; marking unmatched data; verifying the integrity of loss data; optionally, establishing a data feature index; applying an intelligent matching algorithm; extracting unmatched content; analyzing the features of loss data. It is understandable that other data comparison and extraction methods can also be used to achieve the identification of loss data, which is not limited here.
[0098] S209: Generate a unique identification code corresponding to the loss data, and classify the loss data according to the building element type to obtain an association mapping table between the loss data and the second format data.
[0099] Among them, the unique identification code represents the unique code used to identify the loss data; the building element type refers to the classification system of building data; and the association mapping table is used to represent the correspondence between the loss data and the target format data.
[0100] After the format conversion system identifies the loss data, it needs to perform this step to establish a data tracking mechanism. Specifically, the system first generates a unique identification code for each loss data; then classifies the loss data according to the preset building element classification standard; and finally establishes a corresponding relationship table between the loss data and the target format data.
[0101] In some embodiments, the identification and classification of loss data can be achieved in a variety of ways: optionally, generating an identification that is a combination of a timestamp and a random code; classifying data according to building element specifications; establishing a multi-level index relationship; optionally, creating a hash code identification; building a classification tree structure; generating an association mapping matrix. It is understandable that other identification and classification methods can also be used to achieve the management of loss data, which is not limited here.
[0102] S210: Store the loss data, the unique identification code and the associated mapping table into a conversion database corresponding to the second format data.
[0103] The conversion database refers to a data warehouse for storing information related to format conversion.
[0104] After completing data classification and identification, the format conversion system needs to perform this step to save important information during the conversion process. Specifically, the system first prepares the database storage space; then writes the loss data, identification code and mapping table into the database according to the predetermined structure; finally, establishes the corresponding index and verifies the storage result.
[0105] In some embodiments, data storage can be implemented in a variety of ways: optionally, creating a database table structure; performing batch data insertion; establishing a data retrieval index; optionally, building a data cache layer; writing to persistent storage in batches; and verifying data integrity. It is understandable that other storage methods can also be used to implement persistent storage of data, which is not limited here.
[0106] S211. When receiving a data recovery request for converting second format data into first format data, determine corresponding loss data according to an association mapping table.
[0107] Among them, the data recovery request indicates the user's instruction to convert the data back to the original format; the lost data refers to the data recorded in the previous conversion process that could not be directly mapped; the data matching process is used to indicate the operation of finding the corresponding lost data; and the request verification refers to confirming the validity of the data recovery request.
[0108] After receiving the recovery request, the format conversion system needs to perform this step to prepare the information required for data recovery. Specifically, the system first verifies the validity of the recovery request; then retrieves the corresponding loss data according to the association mapping table; and finally prepares the found loss data for subsequent recovery operations.
[0109] In some embodiments, the loss data can be determined in a variety of ways: optionally, verifying the recovery request parameters; querying the associated mapping table; extracting the corresponding loss data; optionally, establishing a data recovery session; performing a multi-condition matching query; preparing a data recovery environment. It is understandable that other query methods can also be used to determine the loss data, which is not limited here.
[0110] S212: Extract inverse mapping data corresponding to the data format of the first format data from the second format data.
[0111] The inverse mapping data refers to the data extracted from the target format data that can be mapped back to the source format; the data format correspondence relationship refers to the mapping rules between data structures in different formats.
[0112] After determining the lost data, the format conversion system needs to perform this step to prepare the basic data required for data conversion. Specifically, the system first analyzes the structure of the target format data; then extracts the reversible mapped data according to the preset format correspondence; and finally verifies the integrity and correctness of the extracted data.
[0113] In some embodiments, the inverse mapping data can be extracted in a variety of ways: optionally, parsing the target format data structure; identifying the reversible mapping elements; extracting the corresponding data content; optionally, establishing the inverse mapping rules; performing the data structure conversion; and verifying the mapping results. It is understandable that other extraction methods can also be used to obtain the inverse mapping data, which is not limited here.
[0114] S213. Generate first format data according to the loss data and the inverse mapping data.
[0115] After obtaining the required data, the format conversion system needs to perform this step to complete data recovery. Specifically, the system first uses the inverse mapping data as the basic framework; then integrates the lost data according to the source format requirements; and finally generates a complete first format data file and verifies it.
[0116] In some embodiments, the generation of the first format data can be achieved in a variety of ways: optionally, constructing a source format data structure; integrating the inverse mapping and loss data; verifying the generation result; optionally, creating a data generation environment; performing step-by-step data integration; and outputting a final data file. It is understandable that other generation methods can also be used to achieve the recovery of the source format data, which is not limited here.
[0117] In the embodiment of the present application, due to the use of innovative technical means such as feature extraction, mapping data conversion, supplementary data generation and loss data storage, combined with the data processing model, it is possible to achieve two-way conversion between DWG and SHP formats, effectively solving the problems of data loss, insufficient precision and untraceability in traditional conversion methods, and thus achieving complete fidelity, intelligent conversion and reliable storage of heterogeneous data. The system ensures the accuracy and traceability of the conversion process by establishing a complete data mapping system and version control mechanism, while supporting reverse recovery of data, improving data interoperability between engineering design and geographic information systems, and providing a reliable data foundation for the collaborative design of various engineering projects.
[0118] The following describes the format conversion system in the embodiment of the present invention from the perspective of hardware processing. Figure 3 , is a schematic diagram of a physical device structure of a format conversion system in an embodiment of the present application.
[0119] It should be noted that Figure 3 The structure of the format conversion system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0120] like Figure 3As shown, the format conversion system includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method described in the above embodiment. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through bus 304. Input / output (I / O) interface 305 is also connected to bus 304.
[0121] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, a button switch, etc.; an output section 307 including a liquid crystal display (LCD) and an audio output device, an indicator light, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.
[0122] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 309, and / or installed from a removable medium 311. When the computer program is executed by a central processing unit (CPU) 301, various functions defined in the present invention are performed.
[0123] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0124] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings.
[0125] Specifically, the format conversion system of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the data format conversion method provided in the above embodiment is implemented.
[0126] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the format conversion system described in the above embodiment; or may exist independently without being assembled into the format conversion system. The above storage medium carries one or more computer programs, and when the above one or more computer programs are executed by a processor of the format conversion system, the format conversion system implements the data format conversion method provided in the above embodiment.
[0127] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0128] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0129] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A data format conversion method, It is characterized in that Applied to a format conversion system, the method comprises: Receive data in a first format, and determine a data format of the data in the first format and a target format of data in a second format as a conversion target; the data format is a DWG format or a SHP format; when the data format is a DWG format, the target format is a SHP format; when the data format is a SHP format, the target format is a DWG format; Extracting feature data corresponding to the data format and mapping data corresponding to the target format from the first format data; Inputting the mapping data and the target format into a data conversion model to obtain supplementary data; generating the second format data based on the mapping data and the supplementary data; Data different from the mapping data in the feature data is extracted as loss data, and the loss data is stored in a conversion database corresponding to the second format data.
2. The method according to claim 1, It is characterized in that The step of extracting the feature data corresponding to the data format and the mapping data corresponding to the target format from the data in the first format specifically includes: Acquire the first format data and the layer template information corresponding to the data format from a preset layer configuration library; Based on the layer template information, classify the layers in the first format data to obtain the building element type; According to the building element type, dividing the first format data into geometric data and attribute data; Classifying the geometric data according to mathematical function types to determine geometric feature parameters; Parsing the attribute data according to standard specifications to determine attribute characteristic parameters; Determining feature data corresponding to the data format in the first format data based on the geometric feature parameters and the attribute feature parameters; According to a preset data format mapping rule, data matching the target format is extracted from the first format data as the mapping data.
3. The method according to claim 2, It is characterized in that The step of classifying the geometric data according to the mathematical function type and determining the geometric feature parameters specifically includes: Acquire a coordinate point sequence in the geometric data, and classify the geometric data into one or more of a straight line type, an arc type, and a spline curve type according to distribution characteristics of the coordinate point sequence; Determining a corresponding mathematical function type according to the fitting type of the geometric data; Based on the mathematical function type, geometric feature parameters are generated.
4. The method according to claim 1, It is characterized in that The step of extracting data different from the mapping data in the feature data as loss data, and storing the loss data in a conversion database corresponding to the second format data specifically includes: extracting data different from the mapping data in the feature data as loss data; generating a unique identification code corresponding to the loss data, and classifying the loss data according to the building element type, to obtain an association mapping table between the loss data and the second format data; The loss data, the unique identification code and the association mapping table are stored in a conversion database corresponding to the second format data.
5. The method according to claim 4, It is characterized in that After the step of storing the loss data, the unique identification code and the association mapping table in the conversion database corresponding to the second format data, the method further includes: Upon receiving a data recovery request for converting the second format data into the first format data, determining corresponding loss data according to the association mapping table; Extracting inverse mapping data corresponding to the data format of the first format data from the second format data; The first format data is generated according to the loss data and the inverse mapping data.
6. The method according to claim 1, It is characterized in that After the step of receiving the first format data and determining the data format of the first format data and the target format of the second format data as the conversion target, the method further includes: Determining version information of the first format data; Matching the version information with a preset version library, and sending a version upgrade prompt to the user terminal if the match fails; Receive the updated first format data returned by the user terminal.
7. The method according to claim 1, It is characterized in that Before the step of inputting the mapping data and the target format into a data conversion model to obtain supplementary data, the method further includes: Acquiring coordinate system information of the mapping data; When the coordinate system information is inconsistent with a default coordinate system corresponding to the target format of the second format data, determining a corresponding coordinate conversion algorithm according to a preset accuracy requirement; Based on the coordinate conversion algorithm, the mapping data is converted into the default coordinate system.
8. A format conversion system, It is characterized in that The format conversion system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the format conversion system to execute the method described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, It is characterized in that When the instruction is executed on a format conversion system, the format conversion system is caused to execute the method according to any one of claims 1 to 7.
10. A computer program product, It is characterized in that When the computer program product runs on a format conversion system, the format conversion system is enabled to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Urban and rural planning data conversion method and system and computer readable storage medium
CN109977162A
Data processing method and system based on PDM system and readable storage medium
CN116680258A
Construction method of space environment entity data file, electronic equipment and storage medium
CN117251410A
GIS data and CAD data conversion method and device, electronic equipment and storage medium
CN117725255A
Automatic generation of an extract, transform, load (ETL) job
US20150100542A1
Cited By
Model compression method and device, electronic equipment and computer readable medium
CN119832137A
Collaborative design method and system based on CAD platform
CN119848964A
Collaborative Design Method and System Based on CAD Platform
CN119848964B
Cross-format intelligent conversion method and system for engineering drawings
CN120047960A
A method and system for intelligent cross-format conversion of engineering drawings
CN120047960B
