Data extraction method and device, processor and electronic device

By converting 3D model files to XML or JSON format and parsing the data, the problem of low data extraction efficiency in existing technologies is solved, enabling fast and accurate data acquisition.

CN116011406BActive Publication Date: 2025-11-07CAXA TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211624328.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-15
Publication Date
2025-11-07
Estimated Expiration
2042-12-15

AI Technical Summary

Technical Problem

Existing technologies for extracting data from 3D model files are inefficient, especially due to the large file size and the inability to process them in parallel, resulting in excessively long extraction times.

Method used

Convert 3D model files to XML or JSON format, parse these files to obtain the required data, use an extraction interface to obtain the model's attribute information, determine the existence of the data table, convert and store it, and free up memory to improve efficiency.

Benefits of technology

By converting 3D model files to XML or JSON format and parsing them, data can be obtained quickly and accurately, improving the efficiency of data extraction and reducing processing time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116011406B_ABST
    Figure CN116011406B_ABST
Patent Text Reader

Abstract

The application discloses a data extraction method and device, a processor and an electronic device, and relates to the technical field of 3D model file processing. The method comprises the following steps: obtaining a target 3D model file of data to be extracted, wherein the target 3D model file is a file corresponding to a target model, wherein the target model is a model obtained by adopting target software to perform three-dimensional design on a target object; converting the target 3D model file into a target file in a target format, wherein the target format is one of an XML format and a JSON format; parsing the target file to obtain data in the target file; and determining the data to be extracted in the target 3D model file according to the data in the target file. Through the application, the problem that the efficiency of extracting data is low due to the use of an extraction tool or software to extract data from a 3D model file in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of 3D model file processing, in particular to a data extraction method and device, a processor and an electronic device. BACKGROUND

[0002] Currently, production and manufacturing enterprise informatization needs to ensure the completeness and consistency of collected data, reduce data duplication, and provide basic data for PDM, MES and ERP from CAD. In addition, basic data includes drawing number attributes, product structure information of part assembly, detection attributes, and is saved in a database structure. If a 3D model file is composed of multiple levels of a product, and when part of the files in the 3D model file needs to be modified, the attributes need to be extracted and saved again.

[0003] In related technologies, CAD drawings can be extracted by installing an extraction tool or CAD software. However, since the size of the current 3D model file is several GB, it takes time and memory to open it, and some can only be extracted in series, not in parallel, and it sometimes takes more than a minute to extract a file, resulting in low efficiency of extracting data.

[0004] To address the issue of low efficiency of extracting data from 3D model files using extraction tools or software in related technologies, no effective solution has been proposed so far. SUMMARY

[0005] The main purpose of the present application is to provide a data extraction method and device, a processor and an electronic device to solve the problem of low efficiency of extracting data from 3D model files using extraction tools or software in related technologies.

[0006] To achieve the above purpose, according to one aspect of the present application, a data extraction method is provided. The method comprises: obtaining a target 3D model file of data to be extracted, wherein the target 3D model file is a file corresponding to a target model, wherein the target model is a model obtained by three-dimensional design of a target object using a target software; converting the target 3D model file into a target file in a target format, wherein the target format is one of XML format and JSON format; parsing the target file to obtain data in the target file; and determining the data to be extracted in the target 3D model file according to the data in the target file.

[0007] Further, the converting the target 3D model file into a target file in a target format comprises: obtaining a name of the target 3D model file; determining a target data table corresponding to the target 3D model file according to the name of the target 3D model file; and converting the target data table into the target file in the target format.

[0008] Further, the determining the target data table corresponding to the target 3D model file according to the name of the target 3D model file comprises: determining a type of the target software according to the name of the target 3D model file; obtaining an extraction interface corresponding to the target software according to the type of the target software; and obtaining the target data table corresponding to the target 3D model file through the extraction interface.

[0009] Further, the obtaining the target data table corresponding to the target 3D model file through the extraction interface comprises: extracting attribute information of a target model from the target 3D model file through the extraction interface; extracting attribute information of a sub-model from the target 3D model file through the extraction interface, wherein the sub-model is a sub-model in the target model; and determining the target data table corresponding to the target 3D model file according to the attribute information of the target model and the attribute information of the sub-model.

[0010] Further, the obtaining the extraction interface corresponding to the target software according to the type of the target software comprises: judging whether the target data table corresponding to the target 3D model file exists; converting the target data table into the target file if the target data table corresponding to the target 3D model file exists; and obtaining the extraction interface corresponding to the target software according to the type of the target software if the target data table corresponding to the target 3D model file does not exist.

[0011] Further, the judging whether the target data table corresponding to the target 3D model file exists comprises: obtaining names of a plurality of first data tables, wherein the name of the first data table at least comprises a full path name, a configuration name and a cyclic redundancy check code of a first 3D model file corresponding to the first data table, and the configuration name is used to represent attribute information of a model corresponding to the first 3D model file; judging whether a target name exists in the names of the plurality of first data tables, wherein the target name at least comprises a full path name, a configuration name and a cyclic redundancy check code of the target 3D model file; and indicating that the target data table corresponding to the target 3D model file exists if the target name exists in the names of the plurality of first data tables, and indicating that the target data table corresponding to the target 3D model file does not exist if the target name does not exist in the names of the plurality of first data tables.

[0012] Further, after converting the target 3D model file into a target file in the target format, the method further includes: storing the target file into a database; querying the target file in the database and parsing the target file to obtain data extracted from the target 3D model file.

[0013] Further, after converting the target data table into a target file in the target format, the method further includes: deleting the target data table to release the memory of a target device, wherein the target device is a device storing the target data table.

[0014] To achieve the above object, according to another aspect of the present application, a data extraction device is provided. The device includes: a first acquisition unit configured to acquire a target 3D model file of data to be extracted, wherein the target 3D model file is a file corresponding to a target model, and wherein the target model is a model obtained by three-dimensional design of a target object using a target software; a first conversion unit configured to convert the target 3D model file into a target file in a target format, wherein the target format is one of an XML format and a JSON format; a first parsing unit configured to parse the target file to obtain data in the target file; and a first determination unit configured to determine the data to be extracted in the target 3D model file according to the data in the target file.

[0015] Further, the first conversion unit includes: a first acquisition sub-unit configured to acquire a name of the target 3D model file; a first determination sub-unit configured to determine a target data table corresponding to the target 3D model file according to the name of the target 3D model file; and a first conversion sub-unit configured to convert the target data table into a target file in the target format.

[0016] Further, the first determination sub-unit includes: a first determination module configured to determine a type of the target software according to the name of the target 3D model file; a first acquisition module configured to acquire an extraction interface corresponding to the target software according to the type of the target software; and a second acquisition module configured to acquire the target data table corresponding to the target 3D model file through the extraction interface.

[0017] Further, the second acquisition module includes: a first extraction sub-module configured to extract attribute information of the target model from the target 3D model file through the extraction interface; a second extraction sub-module configured to extract attribute information of a sub-model from the target 3D model file through the extraction interface, wherein the sub-model is a sub-model in the target model; and a first determination sub-module configured to determine the target data table corresponding to the target 3D model file according to the attribute information of the target model and the attribute information of the sub-model.

[0018] Further, the first obtaining module comprises: a first judging submodule, configured to judge whether there is a target data table corresponding to the target 3D model file; a first converting submodule, configured to convert the target data table into the target file if there is the target data table corresponding to the target 3D model file; and a first obtaining submodule, configured to obtain an extraction interface corresponding to the target software according to a type of the target software if there is no target data table corresponding to the target 3D model file.

[0019] Further, the first judging submodule comprises: an obtaining submodule one, configured to obtain names of a plurality of first data tables, wherein the name of the first data table at least comprises a full path name, a configuration name and a cyclic redundancy check code of a first 3D model file, the first 3D model file is a 3D model file corresponding to the first data table, and the configuration name is used to represent attribute information of a model corresponding to the first 3D model file; a judging submodule one, configured to judge whether there is a target name in the names of the plurality of first data tables, wherein the target name at least comprises a full path name, a configuration name and a cyclic redundancy check code of the target 3D model file; a determining submodule one, configured to represent that there is a target data table corresponding to the target 3D model file if the target name exists in the names of the plurality of first data tables; and a determining submodule two, configured to represent that there is no target data table corresponding to the target 3D model file if the target name does not exist in the names of the plurality of first data tables.

[0020] Further, the device further comprises: a first storage unit, configured to store the target file into a database after the target 3D model file is converted into a target file in a target format; and a first processing unit, configured to query the target file in the database and parse the target file to obtain data extracted from the target 3D model file.

[0021] Further, the device further comprises: a first deleting unit, configured to delete the target data table after the target data table is converted into the target file in the target format, so as to release memory of a target device, wherein the target device is a device storing the target data table.

[0022] In order to achieve the above object, according to another aspect of the present application, a processor is provided, which is used to run a program, wherein the program performs the data extraction method of any one of the above aspects when running.

[0023] To achieve the above object, according to another aspect of the present application, an electronic device is provided, comprising one or more processors and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data extraction method of any one of the above.

[0024] According to the present application, the following steps are adopted: obtaining a target 3D model file of data to be extracted, wherein the target 3D model file is a file corresponding to a target model, wherein the target model is a model obtained by using a target software to perform three-dimensional design on a target object; converting the target 3D model file into a target file in a target format, wherein the target format is one of the following: XML format and JSON format; parsing the target file to obtain data in the target file; and determining the data to be extracted in the target 3D model file according to the data in the target file, thereby solving the problem of low efficiency of extracting data from a 3D model file using an extraction tool or software in the related art. By converting the obtained 3D model file into a file in XML format or JSON format, parsing the file to obtain data in the file, and then determining the data to be extracted in the 3D model file according to the data in the parsed file, the efficiency of extracting data is improved. BRIEF DESCRIPTION OF DRAWINGS

[0025] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and are used to interpret the illustrative embodiments of the present application and their descriptions, and do not constitute improper limitations to the present application. In the drawings:

[0026] Figure 1 is a flowchart of the data extraction method provided according to an embodiment of the present application;

[0027] Figure 2 is a flowchart of the data extraction method provided according to an embodiment of the present application Figure One ;

[0028] Figure 3 is a flowchart of the data extraction method provided according to an embodiment of the present application Figure Two ;

[0029] Figure 4 is a schematic diagram of the data extraction device provided according to an embodiment of the present application;

[0030] Figure 5 is a schematic diagram of the electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0031] It should be noted that the embodiments and features of the present application can be combined with each other in the case of no conflict. The technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings and in combination with the embodiments.

[0032] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.

[0033] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0034] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties. For example, an interface is provided between the system and the relevant user or institution. Before obtaining the relevant information, the interface needs to send a request to the aforementioned user or institution, and after receiving the consent information feedback from the aforementioned user or institution, the relevant information is obtained.

[0035] For the convenience of description, the following describes some nouns or terms related to the embodiments of the present application:

[0036] CAD: the abbreviation of Computer Aided Design, which uses computers and their graphic devices to help designers in their design work, simply called CAD, which currently includes two-dimensional design and three-dimensional design, and the geometric model of three-dimensional design is simply called 3D model.

[0037] PDM: Product Data Management, is a technology to manage all product-related information (including parts information, configuration, documents, CAD files, structure, authority information, etc.) and all product-related processes. By implementing PDM, efficient use of documents, drawings, data is enhanced, and workflow is standardized.

[0038] MES: Manufacturing Execution System, is a set of production information management system for manufacturing enterprise workshop execution layer. MES can provide enterprises with management modules including manufacturing data management, planning and scheduling management, production scheduling management, inventory management, quality management, human resource management, work center / device management, tool management, procurement management, cost management, project board management, production process control, bottom layer data integration analysis, upper layer data integration decomposition, etc.

[0039] ERP: Enterprise Resource Planning, in addition to the existing production resource planning, manufacturing, financial, sales, procurement functions of MRP II (Material Requirements Planning), there are quality management, laboratory management, business process management, product data management, inventory, distribution and transportation management, human resource management and periodic reporting system.

[0040] CRC: Cyclic Redundancy Check, is a commonly used, error detection and correction ability of the check code.

[0041] The application will be described below in conjunction with the preferred implementation steps, Figure 1 The flowchart of the data extraction method provided by the embodiment of the application is shown in Figure 1 The method comprises the following steps:

[0042] Step S101, obtaining a target 3D model file of the data to be extracted, wherein the target 3D model file is a file corresponding to a target model, and the target model is a model obtained by three-dimensional design of a target object using a target software.

[0043] For example, the above-mentioned 3D model file can be a file generated by three-dimensional design of a part through CAXA3D entity design (a set of three-dimensional design software for industry) software. And the data about the attribute information of the part needs to be extracted from the 3D model file.

[0044] Step S102, converting the target 3D model file into a target file in a target format, where the target format is one of: an XML format and a JSON format.

[0045] For example, the 3D model file of the data to be extracted is converted into a file in an XML format (eXtensible Markup Language) or a JSON format (JavaScript Object Notation).

[0046] Step S103, parsing the target file to obtain data in the target file.

[0047] For example, the file in the XML format or the JSON format is parsed to obtain data in the file, and the data can be data used to represent attributes of a part.

[0048] Step S104, determining the data to be extracted in the target 3D model file according to the data in the target file.

[0049] For example, data used to represent attribute information of a part that needs to be extracted from the 3D model file is queried from the parsed data.

[0050] Through the above steps S101 to S104, the 3D model file obtained is converted into a file in the XML format or the JSON format, the file is parsed to obtain data in the file, and the data to be extracted in the 3D model file is determined according to the parsed data in the file, thereby achieving the effect of improving the efficiency of extracting data.

[0051] Figure 2 is a flow of a data extraction method provided by an embodiment of the present application Figure One As shown in Figure 2 In the data extraction method provided by the embodiment of the present application, converting the target 3D model file into a target file in a target format includes:

[0052] Step S201, obtaining a name of a target 3D model file;

[0053] Step S202, determining a target data table corresponding to the target 3D model file according to the name of the target 3D model file;

[0054] Step S203, converting the target data table into a target file in a target format.

[0055] For example, the 3D model file of the data to be extracted can be converted into a data table stored in a computer memory, and the data table is converted into a file in the XML format or the JSON format.

[0056] Through the above scheme, the 3D model file of the data to be extracted can be quickly and accurately converted into an XML format or a JSON format file.

[0057] Figure 3 is a flow of a data extraction method provided by an embodiment of the present application Figure Two As shown in Figure 3 In the data extraction method provided by the embodiment of the present application, according to the name of the target 3D model file, the target data table corresponding to the target 3D model file is determined, including:

[0058] Step S301, according to the name of the target 3D model file, the type of the target software is determined;

[0059] Step S302, according to the type of the target software, the extraction interface corresponding to the target software is obtained;

[0060] Step S303, the target data table corresponding to the target 3D model file is obtained through the extraction interface.

[0061] For example, according to the name of the 3D model file, it can be determined which three-dimensional design software is used to design the 3D model file, and then the extraction interface corresponding to the three-dimensional design software for extracting attribute data is determined, and the attribute data of the part model is extracted by using the extraction interface. The extracted attribute data is summarized into a data table saved in the memory.

[0062] Through the above scheme, the data table corresponding to the 3D model file can be quickly and accurately obtained through the extraction interface.

[0063] In order to quickly and accurately obtain the extraction interface corresponding to the target software according to the type of the target software, in the data extraction method provided by the embodiment of the present application, the extraction interface corresponding to the target software can also be obtained according to the type of the target software through the following steps: judging whether the target data table corresponding to the target 3D model file exists; if the target data table corresponding to the target 3D model file exists, the target data table is converted into a target file; if the target data table corresponding to the target 3D model file does not exist, the extraction interface corresponding to the target software is obtained according to the type of the target software.

[0064] For example, it can be judged whether the structure information already exists, if the attribute set is not extracted, the existing structure information is directly used, otherwise the CAD extraction object (the above extraction interface) needs to be determined according to the three-dimensional design software used when the 3D model file is designed.

[0065] Through the above scheme, the extraction interface for extracting attribute data can be quickly and accurately determined.

[0066] In order to quickly and accurately obtain the target data table corresponding to the target 3D model file through the extraction interface, in the data extraction method provided in the embodiment of the application, the target data table corresponding to the target 3D model file can also be obtained through the extraction interface by the following steps: extracting the attribute information of the target model from the target 3D model file through the extraction interface; extracting the attribute information of the sub-model from the target 3D model file through the extraction interface, wherein the sub-model is a sub-model in the target model; determining the target data table corresponding to the target 3D model file according to the attribute information of the target model and the attribute information of the sub-model.

[0067] For example, the attributes can be extracted by CAD extraction objects (the extraction interface described above). Moreover, the CAD extraction attributes need to be extracted after opening the file, and the extracted attributes usually include the name; custom attributes such as the number and the specification; configured attributes such as the configuration name and the number; and process manufacturing attributes such as the size.

[0068] In addition, the CAD extraction attributes can obtain a list of sub-models, loop through the list of sub-models, obtain the file name and the configuration name according to each sub-model, and obtain the sub-model structure information according to the file name and the configuration name of the sub-model. The sub-model structure information is continuously added to the list of sub-items of the parent model, and the sub-model is taken as a new parent model to loop and recursively extract the sub-models.

[0069] Through the above scheme, the attribute information of the model parts can be quickly and accurately extracted through the extraction interface, and the data table is constructed in the memory according to the extracted attribute information of the model parts.

[0070] In order to quickly and accurately obtain the target data table corresponding to the target 3D model file through the extraction interface, in the data extraction method provided in the embodiment of the application, the target data table corresponding to the target 3D model file can also be obtained through the extraction interface by the following steps: obtaining the names of a plurality of first data tables, wherein the name of the first data table at least includes the full path name of the first 3D model file, the configuration name and the cyclic redundancy check code, wherein the first 3D model file is the 3D model file corresponding to the first data table, and the configuration name is used to represent the attribute information of the model corresponding to the first 3D model file; judging whether the target name exists in the names of the plurality of first data tables, wherein the target name at least includes the full path name of the target 3D model file, the configuration name and the cyclic redundancy check code; if the target name exists in the names of the plurality of first data tables, it indicates that the target data table corresponding to the target 3D model file exists; if the target name does not exist in the names of the plurality of first data tables, it indicates that the target data table corresponding to the target 3D model file does not exist.

[0071] For example, the structure information can be retrieved according to the full path name (the name of the path from the root directory, i.e. the name of the absolute path), the configuration name and the CRC check code of the file. If the structure information already exists, the attribute set is not extracted, otherwise the attribute is extracted by the CAD.

[0072] According to the above scheme, the data table corresponding to the 3D model file can be quickly and accurately determined according to the name of the file.

[0073] In order to quickly and accurately query the target file in the database, in the data extraction method provided in the embodiments of the present application, the target file can also be queried in the database by the following steps: storing the target file into the database; querying the target file in the database and parsing the target file to obtain the data extracted from the target 3D model file.

[0074] For example, the structure information file format can be saved to the directory or the document warehouse (the above-mentioned database) along with the 3D model file, and then the structure information file can be directly queried and the data required to be extracted from the 3D model file can be obtained by parsing the file.

[0075] According to the above scheme, the data required to be extracted from the 3D model file can be quickly and accurately obtained.

[0076] In order to release the memory of the target device, in the data extraction method provided in the embodiments of the present application, the memory of the target device can also be released by the following steps: deleting the target data table to release the memory of the target device, wherein the target device is the device storing the target data table.

[0077] For example, the memory of the structure information factory and the CAXA3D entity design attribute extraction can be released by deleting the data table in the memory of the computer (the above-mentioned target device).

[0078] According to the above scheme, the memory of the device can be released, thereby improving the performance of the device.

[0079] According to the method provided in the embodiments of the present application, for example, taking the CAXA3D entity design as an example, the data extraction method can be divided into the following steps:

[0080] (I) Preparation work before data extraction:

[0081] Step 1: Establish the entity extraction class (CIronCADExtractHelper) for the extraction interface (IExtract). Establish the entity structure information factory class (CadFileInfoFactory) for the structure information factory interface (ICadFileInfoFactory), and establish the structure information class (ICadFileInfo) for the structure information interface (ICadFileInfo).

[0082] Step 2: The entity extraction class establishes the "structure information factory class public attribute" with the type "CadFileInfoFactory"; and then establishes the private attribute "CAD extraction object attribute" with the type CAXA3D entity design extraction interface IEyeTreeTopDispPtr. Different CAD extraction interfaces are different, and the types are also different.

[0083] Step 3: The entity extraction class establishes the initialization method, establishes the structure information factory and CAXA3D entity design extraction attribute.

[0084] Step 4: The entity extraction class establishes the extraction method (ExtractCadInfo), which inputs the full path name of the extraction file, the configuration name, and outputs the extraction result structure information (CadFileInfo) class.

[0085] (2) Implementation steps of the extraction method:

[0086] Step 5: According to the file full path name, the configuration name, and the CRC check code of the file, it can be checked whether the structure information already exists. If it already exists, the attribute set is not extracted, otherwise the attribute is extracted through the CAD extraction object. The CAD extraction attribute is extracted after opening the file, and the extracted attribute usually includes the name; the custom attribute such as the number and the specification; the configuration attribute such as the configuration name and the number; and the process manufacturing attribute such as the size.

[0087] Step 6: The CAD extraction attribute obtains the list of sub-models, loops through the list of sub-models, and obtains the file name and configuration name according to each sub-model. The sub-model structure information is obtained according to the file name and configuration name. The sub-model is continuously taken as a new parent model, and the sub-model is recursively extracted. The sub-model structure information is added to the child item list of the parent model.

[0088] Step 7: Implement the structure information solidification, and the structure information recursive loop. Each model establishes a structure information file, and the attribute set in the structure information is given to the node attribute set of the file, and the sub-model structure information is given to the relationship set of the model.

[0089] Step 8: Release the memory of the structure information factory and the CAXA3D entity design extraction attribute, and extract the technology.

[0090] Step 9: The structural information file format saves the file to the directory or the document warehouse.

[0091] Step 10: The structural information file uses the CAD file input to obtain the structural information file name, and then extracts the information according to the common XML or JSON.

[0092] In addition, the method provided by the embodiment of the application can include a 3D model first extraction interface and a 3D model attribute information structured format definition.

[0093] For example, the IExtract interface is implemented for different formats of 3D models. The ExtractCadInfo method of the implementation object of the interface IExtract is called to obtain the attribute saved in the implementation object of ICadFileInfo. The saved data in ICadFileInfo is stored in a file with rules through GetCRCWithStructuralFile in ICadFileInfo.

[0094] Moreover, the design of the data structure is described as follows:

[0095] 1. The 3D model first extraction interface mainly includes three interfaces: an extraction interface (IExtract), a structural information factory interface (ICadFileInfoFactory), and a structural information interface (ICadFileInfo).

[0096] (1) The extraction interface (IExtract): the interface is implemented for different formats of 3D models to obtain the attribute; the method includes: method 1: the extraction method (ExtractCadInfo), the input is the full path name of the extraction file, and the output is the extraction result structural information (ICadFileInfo) class. Method 2: the initialization method: CAD extraction, such as opening the extraction tool. Method 3: exit the corresponding CAD software.

[0097] (2) The structural information factory interface (ICadFileInfoFactory): used to create the object of the structural information interface (ICadFileInfo). The file name and the configuration name determine the obtained different structural information. The main method 1: create the CadFileInfo object: the input is the file name (FileName) and the configuration name (ConfigName), and the output is the object of the structural information file. The file is determined through the file naming rule "source file+configuration name+CRC" whether it is a new extracted model.

[0098] (3) Structure information (ICadFileInfo): The structure information factory interface creates, including a property set (Propertys), a child list (CadFileInfoS), and the CadFileInfo can append the structure information of the lower model CadFileInfo to the child list. Main method 1: Obtain the structure information file name: The file naming rule is source file + configuration name + CRC. For example, if the source file is "UMRW50mb.sldprt", it is "UMRW50mb.sldprt-default94950971.xml".

[0099] 2. 3D model attribute information structured format definition

[0100] (1) The output is a structure information, and the file naming rule is source file + configuration name + CRC. For example, if the source file is "UMRW50mb.sldprt", it is "UMRW50mb.sldprt-default94950971.xml".

[0101] (2) The structured content is composed of multiple nodes, each Node node includes a property set and a relationship node, the property set is the attribute value of the current node, and the relationship is the node related to the current node. Each node attribute field has:

[0102] File: File full path, must specify value.

[0103] Configuration: Different configuration names in each model file correspond to models of different sizes or materials.

[0104] Structure: Structure file path.

[0105] Whether it is a part: TRUE generates a part, and FALSE does not generate a part.

[0106] Through the above scheme, a specific first extraction interface and attribute information structured XML or JSON format can be provided, attribute information structure is stored synchronously, and repeated attribute acquisition does not need to use a specific extraction tool. Moreover, the attribute information structured XML or JSON format is stored as a file, which is stored together with the CAD file. In addition, by providing the attribute information structured format file, the 3D model attribute information of the CAD can be quickly and repeatedly extracted, so as to improve the extraction efficiency and facilitate secondary extraction.

[0107] In summary, the data extraction method provided in the embodiments of the present application comprises the following steps: obtaining a target 3D model file of data to be extracted, wherein the target 3D model file is a file corresponding to a target model, and the target model is a model obtained by using a target software to perform three-dimensional design on a target object; converting the target 3D model file into a target file in a target format, wherein the target format is one of an XML format and a JSON format; parsing the target file to obtain data in the target file; and determining the data to be extracted in the target 3D model file according to the data in the target file. The method solves the problem of low efficiency of extracting data from a 3D model file by using an extraction tool or software in the related art. The 3D model file obtained is converted into a file in an XML format or a JSON format, the file is parsed to obtain data in the file, and then the data to be extracted in the 3D model file is determined according to the data in the parsed file, thereby improving the efficiency of extracting data.

[0108] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.

[0109] The embodiments of the present application also provide a data extraction device. It should be noted that the data extraction device of the embodiments of the present application can be used to execute the data extraction method provided by the embodiments of the present application. The data extraction device provided by the embodiments of the present application is introduced as follows.

[0110] Figure 4 is a schematic diagram of a data extraction device according to the embodiments of the present application. As shown in Figure 4 , the device comprises a first obtaining unit 401, a first converting unit 402, a first parsing unit 403, and a first determining unit 404.

[0111] Specifically, the first obtaining unit 401 is configured to obtain a target 3D model file of data to be extracted, wherein the target 3D model file is a file corresponding to a target model, and the target model is a model obtained by using a target software to perform three-dimensional design on a target object.

[0112] The first converting unit 402 is configured to convert the target 3D model file into a target file in a target format, wherein the target format is one of an XML format and a JSON format.

[0113] The first parsing unit 403 is configured to parse the target file to obtain data in the target file.

[0114] The first determination unit 404 is configured to determine the to-be-extracted data in the target 3D model file according to the data in the target file.

[0115] In conclusion, the data extraction device provided by the embodiments of the present application obtains the target 3D model file of the to-be-extracted data through the first acquisition unit 401, wherein the target 3D model file is a file corresponding to a target model, and the target model is a model obtained by using a target software to perform three-dimensional design on a target object; the first conversion unit 402 converts the target 3D model file into a target file in a target format, wherein the target format is one of the following: XML format and JSON format; the first analysis unit 403 analyzes the target file to obtain the data in the target file; and the first determination unit 404 determines the to-be-extracted data in the target 3D model file according to the data in the target file, thereby solving the problem of low efficiency of extracting data from a 3D model file by using an extraction tool or software in the related art. The 3D model file obtained is converted into a file in the XML format or the JSON format, the file is analyzed to obtain the data in the file, and then the to-be-extracted data in the 3D model file is determined according to the data in the analyzed file, thereby achieving the effect of improving the efficiency of extracting data.

[0116] Optionally, in the data extraction device provided by the embodiments of the present application, the first conversion unit comprises: a first acquisition subunit, configured to acquire the name of the target 3D model file; a first determination subunit, configured to determine the target data table corresponding to the target 3D model file according to the name of the target 3D model file; and a first conversion subunit, configured to convert the target data table into a target file in a target format.

[0117] Optionally, in the data extraction device provided by the embodiments of the present application, the first determination subunit comprises: a first determination module, configured to determine the type of the target software according to the name of the target 3D model file; a first acquisition module, configured to acquire the extraction interface corresponding to the target software according to the type of the target software; and a second acquisition module, configured to acquire the target data table corresponding to the target 3D model file through the extraction interface.

[0118] Optionally, in the data extraction device provided by the embodiments of the present application, the second acquisition module comprises: a first extraction sub-module, configured to extract the attribute information of the target model from the target 3D model file through the extraction interface; a second extraction sub-module, configured to extract the attribute information of a sub-model from the target 3D model file through the extraction interface, wherein the sub-model is a sub-model in the target model; and a first determination sub-module, configured to determine the target data table corresponding to the target 3D model file according to the attribute information of the target model and the attribute information of the sub-model.

[0119] Optionally, in the data extraction apparatus provided by the embodiment of the present application, the first obtaining module comprises: a first judging submodule, configured to judge whether there is a target data table corresponding to the target 3D model file; a first converting submodule, configured to convert the target data table into a target file if there is a target data table corresponding to the target 3D model file; and a first obtaining submodule, configured to obtain an extraction interface corresponding to the target software according to the type of the target software if there is no target data table corresponding to the target 3D model file.

[0120] Optionally, in the data extraction apparatus provided by the embodiment of the present application, the first judging submodule comprises: a first obtaining submodule, configured to obtain the names of the plurality of first data tables, wherein the name of the first data table at least comprises the full path name, the configuration name and the cyclic redundancy check code of the first 3D model file, wherein the first 3D model file is a 3D model file corresponding to the first data table, and the configuration name is used to represent the attribute information of the model corresponding to the first 3D model file; a first judging submodule, configured to judge whether there is a target name in the names of the plurality of first data tables, wherein the target name at least comprises the full path name, the configuration name and the cyclic redundancy check code of the target 3D model file; a first determining submodule, configured to indicate that there is a target data table corresponding to the target 3D model file if there is the target name in the names of the plurality of first data tables; and a second determining submodule, configured to indicate that there is no target data table corresponding to the target 3D model file if there is no target name in the names of the plurality of first data tables.

[0121] Optionally, in the data extraction apparatus provided by the embodiment of the present application, the apparatus further comprises: a first storage unit, configured to store the target file into the database after converting the target 3D model file into the target file in the target format; and a first processing unit, configured to query the target file in the database and parse the target file to obtain the data extracted from the target 3D model file.

[0122] Optionally, in the data extraction apparatus provided by the embodiment of the present application, the apparatus further comprises: a first deleting unit, configured to delete the target data table after converting the target data table into the target file in the target format, so as to release the memory of the target device, wherein the target device is a device storing the target data table.

[0123] The data extraction apparatus comprises a processor and a memory, and the first obtaining unit 401, the first converting unit 402, the first parsing unit 403 and the first determining unit 404 are all stored in the memory as program units, and the corresponding functions are realized by the processor executing the program units stored in the memory.

[0124] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and the efficiency of data retrieval can be improved by adjusting kernel parameters.

[0125] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0126] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements a method for extracting the data.

[0127] This invention provides a processor for running a program, wherein the program executes a data extraction method during runtime.

[0128] like Figure 5 As shown, this embodiment of the invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: acquiring a target 3D model file from which data to be extracted, wherein the target 3D model file is a file corresponding to a target model, wherein the target model is a model obtained by performing 3D design on a target object using target software; converting the target 3D model file into a target file in a target format, wherein the target format is one of the following: XML format and JSON format; parsing the target file to obtain data in the target file; and determining the data to be extracted from the target 3D model file based on the data in the target file.

[0129] When the processor executes the program, it also performs the following steps: converting the target 3D model file into a target file in the target format includes: obtaining the name of the target 3D model file; determining the target data table corresponding to the target 3D model file based on the name of the target 3D model file; and converting the target data table into a target file in the target format.

[0130] When the processor executes the program, it also performs the following steps: determining the target data table corresponding to the target 3D model file based on the name of the target 3D model file includes: determining the type of the target software based on the name of the target 3D model file; obtaining the extraction interface corresponding to the target software based on the type of the target software; and obtaining the target data table corresponding to the target 3D model file through the extraction interface.

[0131] The processor further implements the following steps when executing the program: obtaining the target data table corresponding to the target 3D model file through the extraction interface includes: extracting attribute information of the target model from the target 3D model file through the extraction interface; extracting attribute information of a sub-model from the target 3D model file through the extraction interface, wherein the sub-model is a sub-model in the target model; and determining the target data table corresponding to the target 3D model file according to the attribute information of the target model and the attribute information of the sub-model.

[0132] The processor further implements the following steps when executing the program: obtaining the extraction interface corresponding to the target software according to the type of the target software includes: determining whether the target data table corresponding to the target 3D model file exists; converting the target data table into the target file if the target data table corresponding to the target 3D model file exists; and obtaining the extraction interface corresponding to the target software according to the type of the target software if the target data table corresponding to the target 3D model file does not exist.

[0133] The processor further implements the following steps when executing the program: determining whether the target data table corresponding to the target 3D model file exists includes: obtaining names of a plurality of first data tables, wherein the name of the first data table at least includes a full path name, a configuration name and a cyclic redundancy check code of a first 3D model file, wherein the first 3D model file is a 3D model file corresponding to the first data table, and the configuration name is used to represent attribute information of a model corresponding to the first 3D model file; determining whether a target name exists in the names of the plurality of first data tables, wherein the target name at least includes a full path name, a configuration name and a cyclic redundancy check code of the target 3D model file; determining that the target data table corresponding to the target 3D model file exists if the target name exists in the names of the plurality of first data tables; and determining that the target data table corresponding to the target 3D model file does not exist if the target name does not exist in the names of the plurality of first data tables.

[0134] The processor further implements the following steps when executing the program: after converting the target 3D model file into the target file in the target format, the method further includes: storing the target file into a database; querying the target file in the database and parsing the target file to obtain data extracted from the target 3D model file.

[0135] The processor further implements the following steps when executing the program: after converting the target data table into the target file in the target format, the method further includes: deleting the target data table to release memory of a target device, wherein the target device is a device storing the target data table.

[0136] The device herein can be a server, a PC, a PAD, a mobile phone, etc.

[0137] The application further provides a computer program product, which, when executed on a data processing device, is adapted to execute a program initialized with the following method steps: obtaining a target 3D model file of data to be extracted, wherein the target 3D model file is a file corresponding to a target model, and wherein the target model is a model obtained by three-dimensional design of a target object using a target software; converting the target 3D model file into a target file in a target format, wherein the target format is one of an XML format and a JSON format; parsing the target file to obtain data in the target file; and determining data to be extracted in the target 3D model file according to the data in the target file.

[0138] When executed on a data processing device, the program is further adapted to be initialized with the following method steps: converting the target 3D model file into a target file in a target format comprises: obtaining a name of the target 3D model file; determining a target data table corresponding to the target 3D model file according to the name of the target 3D model file; and converting the target data table into a target file in the target format.

[0139] When executed on a data processing device, the program is further adapted to be initialized with the following method steps: determining a target data table corresponding to the target 3D model file according to the name of the target 3D model file comprises: determining a type of the target software according to the name of the target 3D model file; obtaining an extraction interface corresponding to the target software according to the type of the target software; and obtaining the target data table corresponding to the target 3D model file through the extraction interface.

[0140] When executed on a data processing device, the program is further adapted to be initialized with the following method steps: obtaining the target data table corresponding to the target 3D model file through the extraction interface comprises: extracting attribute information of the target model from the target 3D model file through the extraction interface; extracting attribute information of a sub-model from the target 3D model file through the extraction interface, wherein the sub-model is a sub-model in the target model; and determining the target data table corresponding to the target 3D model file according to the attribute information of the target model and the attribute information of the sub-model.

[0141] When executed on the data processing device, the program is further adapted to execute the method steps of: obtaining the extraction interface corresponding to the target software according to the type of the target software comprises: judging whether the target data table corresponding to the target 3D model file exists; if the target data table corresponding to the target 3D model file exists, converting the target data table into the target file; and if the target data table corresponding to the target 3D model file does not exist, obtaining the extraction interface corresponding to the target software according to the type of the target software.

[0142] When executed on the data processing device, the program is further adapted to execute the method steps of: judging whether the target data table corresponding to the target 3D model file exists comprises: obtaining the names of a plurality of first data tables, wherein the name of the first data table at least includes the full path name, the configuration name and the cyclic redundancy check code of a first 3D model file, the first 3D model file is a 3D model file corresponding to the first data table, and the configuration name is used to represent the attribute information of the model corresponding to the first 3D model file; judging whether the target name exists in the names of the plurality of first data tables, wherein the target name at least includes the full path name, the configuration name and the cyclic redundancy check code of the target 3D model file; if the target name exists in the names of the plurality of first data tables, it indicates that the target data table corresponding to the target 3D model file exists; and if the target name does not exist in the names of the plurality of first data tables, it indicates that the target data table corresponding to the target 3D model file does not exist.

[0143] When executed on the data processing device, the program is further adapted to execute the method steps of: after converting the target 3D model file into the target file in the target format, the method further comprises: storing the target file into a database; querying the target file in the database and parsing the target file to obtain the data extracted from the target 3D model file.

[0144] When executed on the data processing device, the program is further adapted to execute the method steps of: after converting the target data table into the target file in the target format, the method further comprises: deleting the target data table to release the memory of the target device, wherein the target device is a device storing the target data table.

[0145] Those skilled in the art will appreciate that embodiments of the application can be readily used as software, hardware, or a combination of software and hardware. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0146] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure One one or more functions specified in the flowchart block or blocks. Figure One means for functionally implementing one or more functions specified in the flowchart block or blocks.

[0147] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure One one or more functions specified in the flowchart block or blocks. Figure One means for functionally implementing one or more functions specified in the flowchart block or blocks.

[0148] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure One one or more functions specified in the flowchart block or blocks. Figure One means for functionally implementing one or more functions specified in the flowchart block or blocks.

[0149] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0150] The memory can include non-persistent memory and / or persistent memory, such as flash memory, read-only memory (ROM), and / or volatile / non-volatile random access memory (RAM), among others. The memory is an example of computer readable media.

[0151] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0152] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not explicitly listed, or other elements inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0153] Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0154] The above merely provides embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of claims of the present application.

Claims

1. A method of extracting data, characterized by, The method comprises the following steps: obtaining a target 3D model file of data to be extracted, wherein the target 3D model file is a file corresponding to a target model, and the target model is a model obtained by using a target software to perform three-dimensional design on a target object; converting the target 3D model file into a target file in a target format, comprising: obtaining the name of the target 3D model file; determining a target data table corresponding to the target 3D model file according to the name of the target 3D model file; and converting the target data table into the target file in the target format, wherein the target format is one of an XML format and a JSON format; wherein, determining the target data table corresponding to the target 3D model file according to the name of the target 3D model file comprises: determining the type of the target software according to the name of the target 3D model file; obtaining an extraction interface corresponding to the target software according to the type of the target software; and obtaining the target data table corresponding to the target 3D model file through the extraction interface; parsing the target file to obtain data in the target file; determining the data to be extracted in the target 3D model file according to the data in the target file.

2. The method of claim 1, wherein, obtaining the target data table corresponding to the target 3D model file through the extraction interface comprises: extracting attribute information of the target model from the target 3D model file through the extraction interface; extracting attribute information of a sub-model from the target 3D model file through the extraction interface, wherein the sub-model is a sub-model in the target model; determining the target data table corresponding to the target 3D model file according to the attribute information of the target model and the attribute information of the sub-model.

3. The method of claim 1, wherein, obtaining the extraction interface corresponding to the target software according to the type of the target software comprises: determining whether the target data table corresponding to the target 3D model file exists; if the target data table corresponding to the target 3D model file exists, converting the target data table into the target file; if the target data table corresponding to the target 3D model file does not exist, obtaining the extraction interface corresponding to the target software according to the type of the target software.

4. The method of claim 3, wherein, determining whether the target data table corresponding to the target 3D model file exists comprises: obtaining the names of a plurality of first data tables, wherein the name of the first data table at least includes the full path name, the configuration name and the cyclic redundancy check code of a first 3D model file, wherein the first 3D model file is a 3D model file corresponding to the first data table, and the configuration name is used to represent the attribute information of the model corresponding to the first 3D model file; determining whether a target name exists in the names of the plurality of first data tables, wherein the target name at least includes the full path name, the configuration name and the cyclic redundancy check code of the target 3D model file; if the target name exists in the names of the plurality of first data tables, it indicates that the target data table corresponding to the target 3D model file exists; If the target name does not exist in the names of the plurality of first data tables, it indicates that the target data table corresponding to the target 3D model file does not exist.

5. The method of claim 1, wherein, After converting the target 3D model file into a target file in a target format, the method further comprises: storing the target file into a database; querying the target file in the database and parsing the target file to obtain data extracted from the target 3D model file.

6. The method of claim 1, wherein, After converting the target data table into a target file in the target format, the method further comprises: deleting the target data table to release the memory of a target device, wherein the target device is a device storing the target data table.

7. An apparatus for extracting data, characterized by comprising: comprises: a first obtaining unit configured to obtain a target 3D model file to be extracted, wherein the target 3D model file is a file corresponding to a target model, and the target model is a model obtained by three-dimensional design of a target object using target software; a first converting unit configured to convert the target 3D model file into a target file in a target format, wherein the target format is one of an XML format and a JSON format; the first converting unit comprises: a first obtaining subunit configured to obtain a name of the target 3D model file; a first determining subunit configured to determine a target data table corresponding to the target 3D model file according to the name of the target 3D model file; and a first converting subunit configured to convert the target data table into a target file in the target format; the first determining subunit comprises: a first determining module configured to determine a type of the target software according to the name of the target 3D model file; a first obtaining module configured to obtain an extraction interface corresponding to the target software according to the type of the target software; and a second obtaining module configured to obtain the target data table corresponding to the target 3D model file through the extraction interface; a first parsing unit configured to parse the target file to obtain data in the target file; a first determining unit configured to determine the data to be extracted in the target 3D model file according to the data in the target file.

8. A processor, comprising: The processor is configured to run a program, wherein the program performs the data extraction method of any one of claims 1 to 6 when the program is run.

9. An electronic device, comprising: comprises one or more processors and a memory, wherein the memory is configured to store one or more programs, and the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data extraction method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for converting CATIA BIM entity model into SuperMap GIS standardized model

    CN108629836A

  • Method for converting max file into glTF file

    CN113961512A