Method and device for converting drawing file, electronic equipment and storage medium

By using a preset lightweight service and CAD tool software plug-in mechanism, the problem of high cost and low efficiency in converting various types of drafting files is solved, and efficient and lightweight conversion of various types of CAD drawings is achieved.

CN115713064BActive Publication Date: 2025-11-07CAXA TECH
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, converting various types of drafting files is costly and inefficient, especially since it requires the installation of multiple CAD software tools, resulting in high system resource requirements and instability.

Method used

The system receives conversion requests through a preset lightweight service, determines the converter plugin based on the configuration protocol, converts the files to be converted into preset format files, and utilizes the plugin mechanism of CAD tool software to achieve lightweight conversion of various types of CAD drawings.

Benefits of technology

It reduces system costs, improves system stability and conversion efficiency, and enables the conversion of multiple types of drafting drawings using a single CAD software tool.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115713064B_ABST
    Figure CN115713064B_ABST
Patent Text Reader

Abstract

The application discloses a kind of conversion method of drawing file and its device, electronic equipment and storage medium, wherein the conversion method includes: receiving the conversion request initiated by target client, determining the converter plug-in corresponding to the file to be converted based on the preset configuration protocol, converting the file to be converted into another preset format file using the converter plug-in, and returning the preset format file to the target client.The application solves the technical problems of high cost and low efficiency in converting drawing files when there are multiple types of drawing files in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to a drawing file conversion method and device, electronic equipment and storage medium. BACKGROUND

[0002] At present, the lightweight conversion device often needs to rely on various CAD tool software. If a customer uses multiple CAD tool software, various CAD tool software needs to be installed for conversion. The cost of CAD tool software and the huge demand for system resources of parallel conversion will cause problems such as high system cost and unstable operation.

[0003] At present, the lightweight conversion device of the CAD drawing relies on the CAD software corresponding to the drawing. For example, for an sldprt (soildworks type) drawing, soildworks software must be installed. Therefore, some large customers may use catia drawings, soildworks drawings, creo drawings, etc. at the same time, and catia software, soildworks software, creo software, etc. need to be installed at the same time to build an enterprise lightweight conversion system, which is very costly. In addition, the conversion is unstable and inefficient through inter-process communication to call the tool software interface.

[0004] In related technologies, a CAD model lightweight system is proposed, which includes a CAD model lightweight service device, a client, a collaborative application service platform and a file server. The client is used for reading and browsing the to-be-converted file. The collaborative application service platform is used for saving the to-be-converted file obtained from the client to the file server, sending a conversion instruction to the CAD model lightweight service device, and playing a coordination and scheduling role. The CAD model lightweight service device is used for obtaining the to-be-converted file from the collaborative service platform, realizing conversion and uploading the file to the warehouse.

[0005] However, the CAD model lightweight system in related technologies has the following problems: (1) the CAD model lightweight service device is complex to use and needs to be set up separately; (2) the CAD model lightweight service device does not consider how to handle the scenario of multiple types of CAD drawings coexisting.

[0006] In view of the above problems, no effective solution has been proposed so far. SUMMARY

[0007] The embodiment of the present application provides a drawing file conversion method and device, electronic equipment and storage medium, which at least solve the technical problems of high cost and low efficiency of converting drawing files when multiple types of drawing files exist in related technologies.

[0008] According to an aspect of an embodiment of the present application, a method for converting a drawing file is provided, which is applied to a preset lightweight service, and includes the following steps: receiving a conversion request initiated by a target client, wherein the conversion request at least includes a file to be converted; determining a converter plug-in corresponding to the file to be converted based on a preset configuration protocol; converting the file to be converted into another preset format file by using the converter plug-in; and returning the preset format file to the target client.

[0009] Optionally, before receiving the conversion request initiated by the target client, the method further includes the following steps: obtaining a plurality of file types, and configuring a corresponding plug-in interface for each file type to generate a service configuration, wherein the file type is a type of the file to be converted, and the file type includes at least one of the following: a cat ia type, a solidworks type, and a creo type; the plug-in interface is an interface of the converter plug-in; configuring a corresponding conversion format for each file type to generate a conversion configuration, wherein the conversion format is a format of the preset format file, and each file type corresponds to at least one conversion format; and generating the preset configuration protocol based on the service configuration and the conversion configuration.

[0010] Optionally, the step of determining the converter plug-in corresponding to the file to be converted based on the preset configuration protocol includes the following steps: analyzing the file to be converted to obtain a target file type of the file to be converted; registering the target file type to the preset lightweight service; querying the plug-in interface corresponding to the registered target file type based on the preset configuration protocol; and determining the converter plug-in corresponding to the file to be converted based on the plug-in interface.

[0011] Optionally, the step of converting the file to be converted into another preset format file by using the converter plug-in includes the following steps: calling a preset tool kit of a preset application by using the converter plug-in; querying the preset configuration protocol to obtain a conversion format corresponding to the target file type; and converting the file to be converted by using the preset tool kit to obtain the preset format file with the conversion format.

[0012] Optionally, before receiving the conversion request initiated by the target client, the method further includes the following step: establishing a preset connection service in a preset application, wherein the preset application is deployed in the target client; and constructing the preset lightweight service based on the preset connection service, wherein the preset connection service is used to establish a communication connection between the preset lightweight service and the target client.

[0013] Optionally, after the preset lightweight service is constructed, the method further comprises: starting the preset application; in a case that the preset application is started successfully, triggering the preset connection service; in a case that the preset connection service is triggered successfully, determining that the preset lightweight service is in a running state and determining that a communication connection between the preset lightweight service and the preset application is in a ready state.

[0014] Optionally, a conversion process of the file to be converted is monitored to obtain a monitoring result; in a case that the monitoring result indicates that the converter plug-in is not queried, query exception information is returned; in a case that the monitoring result indicates that the conversion is not successful, interface exception information is returned; the query exception information or the interface exception information is analyzed to obtain conversion information; and the conversion information is sent to the preset lightweight service, where the preset lightweight service reconverts based on the conversion information.

[0015] According to another aspect of the embodiment of the present application, a drawing file conversion device applied to a preset lightweight service is further provided, comprising: a receiving unit configured to receive a conversion request initiated by a target client, wherein the conversion request at least comprises a file to be converted; a determining unit configured to determine a converter plug-in corresponding to the file to be converted based on a preset configuration protocol; a converting unit configured to convert the file to be converted into another preset format file by using the converter plug-in; and a returning unit configured to return the preset format file to the target client.

[0016] Optionally, the conversion device further comprises: a first obtaining module configured to obtain a plurality of file types and configure a corresponding plug-in interface for each file type to generate a service configuration before receiving a conversion request initiated by a target client, wherein the file type is a type of the file to be converted, and the file type comprises at least one of the following: a cat ia type, a solidworks type, and a creo type, and the plug-in interface is an interface of the converter plug-in; a first generating module configured to configure a corresponding conversion format for each file type to generate a conversion configuration, wherein the conversion format is a format of the preset format file, and each file type corresponds to at least one conversion format; and a second generating module configured to generate the preset configuration protocol based on the service configuration and the conversion configuration.

[0017] Optionally, the determining unit comprises: a first parsing module, configured to parse the to-be-converted file to obtain a target file type of the to-be-converted file; a first registration module, configured to register the target file type to the preset lightweight service; a first query module, configured to query the plug-in interface corresponding to the registered target file type based on the preset configuration protocol; and a first determining module, configured to determine the converter plug-in corresponding to the to-be-converted file based on the plug-in interface.

[0018] Optionally, the converting unit comprises: a first calling module, configured to call a preset tool kit of a preset application by using the converter plug-in; a second query module, configured to query the preset configuration protocol to obtain a conversion format corresponding to the target file type; and a first converting module, configured to convert the to-be-converted file by using the preset tool kit to obtain the preset format file with the conversion format as the file format.

[0019] Optionally, the conversion device further comprises: a first establishing module, configured to establish a preset connection service in a preset application before receiving a conversion request initiated by a target client, wherein the preset application is deployed in the target client; and a first constructing module, configured to construct the preset lightweight service based on the preset connection service, wherein the preset connection service is configured to establish a communication connection between the preset lightweight service and the target client.

[0020] Optionally, the conversion device further comprises: a first starting module, configured to start the preset application after the preset lightweight service is constructed; a first triggering module, configured to trigger the preset connection service in a case where the preset application is started successfully; and a second determining module, configured to determine that the preset lightweight service is in a running state and that a communication connection between the preset lightweight service and the preset application is in a ready state in a case where the preset connection service is triggered successfully.

[0021] Optionally, the conversion device further comprises: a first monitoring module, configured to monitor a conversion process of the to-be-converted file to obtain a monitoring result; a first returning module, configured to return query exception information in a case where the monitoring result indicates that the converter plug-in is not queried; a second returning module, configured to return interface exception information in a case where the monitoring result indicates that the conversion is not successful; a first analyzing module, configured to analyze the query exception information or the interface exception information to obtain conversion information; and a first sending module, configured to send the conversion information to the preset lightweight service, wherein the preset lightweight service reconverts based on the conversion information.

[0022] According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium comprising a stored computer program, wherein the computer-readable storage medium, when the computer program is run, controls a device where the computer-readable storage medium is located to perform the above-mentioned conversion method of a drawing file.

[0023] According to another aspect of the embodiments of the present application, there is also provided an electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the above-mentioned conversion method of a drawing file.

[0024] In the present disclosure, a conversion request initiated by a target client is received, a converter plug-in corresponding to a file to be converted is determined based on a preset configuration protocol, the file to be converted is converted into another preset format file by using the converter plug-in, and the preset format file is returned to the target client. In the present disclosure, by using a preset lightweight service, a converter plug-in corresponding to a file to be converted can be determined according to a preset configuration protocol configured in advance, and then the file to be converted is converted into another preset format file (i.e., a lightweight file) by using the converter plug-in. By using the preset lightweight service, a plurality of types of drawing papers can be converted by using one drawing tool, the system cost is reduced, the system stability and conversion efficiency are improved, and thus the technical problem of high cost and low efficiency in converting drawing files of multiple types in the related art is solved. BRIEF DESCRIPTION OF DRAWINGS

[0025] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:

[0026] Figure 1 is a flowchart of an optional conversion method of a drawing file according to an embodiment of the present application;

[0027] Figure 2 is a schematic diagram of an optional conversion framework structure of a drawing file according to an embodiment of the present application;

[0028] Figure 3 is a schematic diagram of an optional conversion logic flow of a drawing file according to an embodiment of the present application;

[0029] Figure 4 is a schematic diagram of an optional conversion device of a drawing file according to an embodiment of the present application;

[0030] Figure 5is a hardware structure block diagram of an electronic device (or a mobile device) for a conversion method of a drawing file according to an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to make the persons skilled in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by the persons skilled in the art without creative labor should belong to the protection scope of the present application.

[0032] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological 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 an order other than that illustrated or described herein. 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 that includes a series of steps or units does not necessarily have to be limited 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.

[0033] In order to facilitate the understanding of the present application by the persons skilled in the art, the following explains some terms or nouns involved in the embodiments of the present application:

[0034] CAD plug-in: a plug-in realized based on the secondary development mechanism of various CAD tool software;

[0035] CAD drawing: a three-dimensional drawing generated by CAD software (such as SolidWorks and other tool software);

[0036] Lightweight format: refers to PDF, 3DXML, obj and other formats, which are more convenient for sharing and transmission than original design drawings (i.e. CAD drawings);

[0037] Lightweight conversion service: refers to a web service deployed on a customer server, which is used to convert CAD drawings into lightweight format;

[0038] WebSocket: a protocol for full-duplex communication on a single TCP (Transmission Control Protocol) connection.

[0039] It should be noted that the related 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 related user or institution. Before obtaining the related 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 related information is obtained.

[0040] The CAD tool software usually has the ability to import mainstream CAD drawings, such as a CAD tool software has the ability to import Catia and SolidWorks drawings. The present application proposes a method for constructing lightweight conversion service based on CAD plug-ins, which can encapsulate the ability to support multiple types of CAD drawings and the ability to convert CAD drawings into lightweight files into a preset lightweight service (i.e. lightweight service) based on CAD plug-ins, change the conversion service process communication interface calling mechanism in the related art, realize the function of converting multiple types of CAD drawings with a CAD tool software, greatly reduce the system cost, and improve the system stability.

[0041] The present application only needs to develop a corresponding plug-in service for a kind of CAD tool software, uses CAD model conversion interface, uniformly manages the conversion demand of different CAD drawings, can save cost, optimize efficiency, improves software reliability and stability.

[0042] The present application uses the plug-in mechanism of CAD tool software, can construct lightweight service and lightweight startup logic, and can realize the conversion of multiple CAD drawings into multiple lightweight format files through lightweight service.

[0043] The present application will be described in detail below in conjunction with various embodiments.

[0044] Embodiment one

[0045] According to the embodiment of the present application, an embodiment of a drawing file conversion method is provided. 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 the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0046] Figure 1 is a flowchart of an optional drawing file conversion method according to an embodiment of the present application, as shown in Figure 1 The method comprises the following steps:

[0047] In step S101, a conversion request initiated by a target client is received, wherein the conversion request at least includes a file to be converted.

[0048] In step S102, a converter plug-in corresponding to the file to be converted is determined based on a preset configuration protocol.

[0049] In step S103, the file to be converted is converted into another preset format file by using the converter plug-in.

[0050] In step S104, the preset format file is returned to the target client.

[0051] Through the above steps, the conversion request initiated by the target client can be received, the converter plug-in corresponding to the file to be converted can be determined based on the preset configuration protocol, the file to be converted can be converted into another preset format file by using the converter plug-in, and the preset format file can be returned to the target client. In the embodiment of the present application, the preset lightweight service can be used to determine the converter plug-in corresponding to the file to be converted according to the preset configuration protocol, and then convert the file to be converted into another preset format file (i.e., a lightweight file), so that the use of one drawing tool can convert multiple types of drawing paper, the system cost is reduced, the system stability and conversion efficiency are improved, and the technical problem of high cost and low efficiency in converting drawing files in related technologies is solved.

[0052] The embodiment of the present application will be described in detail below in combination with the above steps. The following steps can be applied to the preset lightweight service.

[0053] Figure 2 is a schematic diagram of an optional conversion framework structure of a drawing file according to the embodiment of the present application, as Figure 2As shown, it includes: a client / browser, a lightweight service, wherein the lightweight service includes: a CAD plug-in service (built based on websocket), a configuration (including: service configuration, conversion configuration, etc.), various conversion plug-ins (such as SolidWorks conversion plug-in, Catia conversion plug-in, creo conversion plug-in, etc.), and a CAD SDK (i.e. software development kit (Software Development Kit) of CAD tool software). The client / browser can call the lightweight service, transmit the file to be converted to the lightweight service, and then wait for the lightweight file returned by the lightweight service. In the lightweight service, the service configuration and the conversion configuration can be performed through the configuration module first to generate a configuration protocol, then the conversion plug-in (SolidWorks conversion plug-in, Catia conversion plug-in, creo conversion plug-in, etc.) corresponding to the file to be converted is called through the CAD plug-in service, the file to be converted is registered to the lightweight service, and then the CAD SDK is called through the corresponding conversion plug-in to realize the lightweight conversion of the file to be converted.

[0054] In the embodiment, the websocket service: needs to communicate with the client, is used for listening to the conversion request and transmitting the lightweight file processed back.

[0055] The conversion plug-in: by implementing conversion plug-ins of different types of drawing files, and registering the drawing files to the lightweight service, wherein the conversion plug-in supports the extension of new CAD type conversion support, and is not limited to Figure 2 several CAD types (such as SolidWorks, Catia, creo, etc.) in the embodiment; the model conversion capability of the CAD tool software can be fully utilized, for example, the entity design three-dimensional design software itself supports the mutual conversion of various three-dimensional models, and as long as the SDK of an entity design three-dimensional design software can meet the needs of the customer for conversion of different types of CAD models.

[0056] The configuration protocol: which types of CAD conversion plug-ins and conversion types are configured to support, etc.

[0057] Optionally, before receiving the conversion request initiated by the target client, it further includes: establishing a preset connection service in a preset application, wherein the preset application is deployed in the target client; based on the preset connection service, a preset lightweight service is constructed, wherein the preset connection service is used to establish a communication connection between the preset lightweight service and the target client.

[0058] In the embodiment of the present application, the preset connection service (i.e., the websocket service) can be established in a preset application (i.e., a certain CAD tool software, which is not limited to the type of CAD tool software, and can be any type of CAD tool software), the preset application is deployed on the target client, and then the preset connection service is used to build the preset lightweight service (i.e., the lightweight service), which is used to establish a communication connection between the preset lightweight service and the target client, to listen to the conversion request and to return the processed lightweight file.

[0059] Optionally, after the preset lightweight service is built, the preset application is started, the preset connection service is triggered if the preset application is started successfully, and it is determined that the preset lightweight service is in a running state and the communication connection between the preset lightweight service and the preset application is in a ready state if the preset connection service is triggered successfully.

[0060] In the embodiment of the present application, before the conversion request is processed, the preset lightweight service needs to be started, specifically, when the CAD tool software is started, the websocket service can be triggered by using the mechanism that the CAD tool software automatically loads the plug-in, at this time, the lightweight service runs in the background and the communication connection with the CAD tool software is ready, which can access the SDK of the CAD tool software (i.e., the preset application is started, the preset connection service is triggered if the preset application is started successfully, and it is determined that the preset lightweight service is in a running state and the communication connection between the preset lightweight service and the preset application is in a ready state if the preset connection service is triggered successfully).

[0061] Optionally, before the conversion request initiated by the target client is received, the following steps are further included: obtaining a plurality of file types, and configuring a corresponding plug-in interface for each file type to generate a service configuration, wherein the file type is the type of the file to be converted, and the file type includes at least one of the following: cat ia type, solidworks type, creo type, and the plug-in interface is the interface of the converter plug-in; configuring a corresponding conversion format for each file type to generate a conversion configuration, wherein the conversion format is the format of the preset format file, and each file type corresponds to at least one conversion format; and generating a preset configuration protocol based on the service configuration and the conversion configuration.

[0062] In the embodiment of the present application, a plurality of file types (the file types are types of the files to be converted, and the file types include but are not limited to cat ia type, solidworks type, creo type, etc.) can be obtained first, and a corresponding plug-in interface (for example, the plug-in interface corresponding to the SolidWorks type is the SolidWorks plug-in interface, and the plug-in interface is an interface of the converter plug-in) is configured for each file type to generate a service configuration (that is, each file type corresponds to a plug-in interface of the same type). Then, a corresponding conversion format (that is, each file type corresponds to one or more conversion formats after conversion, and the conversion format is a format of a preset format file, and each file type corresponds to at least one conversion format) is configured for each file type to generate a conversion configuration (that is, each file type corresponds to one or more conversion formats after conversion). Then, a preset configuration protocol (that is, the corresponding conversion plug-in and the corresponding conversion format after conversion are configured for each file type) can be generated based on the service configuration and the conversion configuration.

[0063] In step S101, a conversion request initiated by a target client is received, wherein the conversion request at least includes a file to be converted.

[0064] In the embodiment of the present application, when the preset connection service listens to the conversion request initiated by the target client (the conversion request carries the file to be converted (that is, a drawing file of a certain type)), the preset lightweight service can receive the conversion request and obtain the file to be converted from the conversion request.

[0065] In step S102, a converter plug-in corresponding to the file to be converted is determined based on a preset configuration protocol.

[0066] Optionally, the step of determining the converter plug-in corresponding to the file to be converted based on the preset configuration protocol includes: analyzing the file to be converted to obtain a target file type of the file to be converted; registering the target file type to the preset lightweight service; querying a plug-in interface corresponding to the registered target file type based on the preset configuration protocol; and determining the converter plug-in corresponding to the file to be converted based on the plug-in interface.

[0067] In the embodiment of the present application, the converter plug-in (that is, the CAD conversion plug-in) corresponding to the file to be converted can be determined according to the preset configuration protocol, specifically: the file to be converted can be analyzed first to obtain a target file type of the file to be converted, then the target file type is registered to the preset lightweight service, and then the plug-in interface corresponding to the registered target file type is queried according to the preset configuration protocol, and the converter plug-in corresponding to the file to be converted is determined based on the plug-in interface.

[0068] In step S103, the file to be converted is converted into another preset format file by using the converter plug-in.

[0069] Optionally, the step of converting the to-be-converted file into another preset format file by using the converter plug-in comprises: calling a preset toolkit of a preset application by using the converter plug-in; querying a preset configuration protocol to obtain a conversion format corresponding to the target file type; and converting the to-be-converted file by using the preset toolkit to obtain a preset format file with the conversion format.

[0070] In the embodiment of the present application, after the converter plug-in corresponding to the to-be-converted file is queried, the preset toolkit (i.e., the SDK of the CAD tool software) of the preset application can be called through the converter plug-in, and then the conversion format (which can be multiple conversion formats such as pdf, cle, etc.) corresponding to the target file type can be obtained by querying the preset configuration protocol. Then, the preset format file (i.e., the lightweight file) with the conversion format can be obtained by converting the to-be-converted file by using the preset toolkit.

[0071] In the embodiment of the present application, after the converter plug-in corresponding to the to-be-converted file is queried, the preset toolkit (i.e., the SDK of the CAD tool software) of the preset application can be called through the converter plug-in, and then the conversion format (which can be multiple conversion formats such as pdf, cle, etc.) corresponding to the target file type can be obtained by querying the preset configuration protocol. Then, the preset format file (i.e., the lightweight file) with the conversion format can be obtained by converting the to-be-converted file by using the preset toolkit.

[0072] In the embodiment of the present application, after the converter plug-in corresponding to the to-be-converted file is queried, the preset toolkit (i.e., the SDK of the CAD tool software) of the preset application can be called through the converter plug-in, and then the conversion format (which can be multiple conversion formats such as pdf, cle, etc.) corresponding to the target file type can be obtained by querying the preset configuration protocol. Then, the preset format file (i.e., the lightweight file) with the conversion format can be obtained by converting the to-be-converted file by using the preset toolkit.

[0073] Optionally, the conversion process of the to-be-converted file is monitored to obtain a monitoring result; in a case where the monitoring result indicates that the converter plug-in is not queried, query exception information is returned; in a case where the monitoring result indicates that the conversion is not successful, interface exception information is returned; the query exception information or the interface exception information is analyzed to obtain conversion information; and the conversion information is sent to a preset lightweight service, wherein the preset lightweight service reconverts based on the conversion information.

[0074] In the embodiment of the present application, the conversion process of the to-be-converted file can be monitored to view the conversion progress of the file in real time to obtain a monitoring result. If the monitoring result indicates that the converter plug-in (i.e., the converter plug-in corresponding to the to-be-converted file does not exist) is not queried, query exception information can be returned, and failure logs can be recorded. If the monitoring result indicates that the conversion is not successful, interface exception information can be returned, and conversion exception records can be made for tracing and re-conversion. Then, the query exception information or the interface exception information can be analyzed to obtain conversion information, and the conversion information can be sent to a preset lightweight service, so that the preset lightweight service reconverts based on the conversion information.

[0075] Figure 3 is a schematic diagram of an optional drawing file conversion logic flow according to the embodiment of the present application, as shown in Figure 3 has the following flow:

[0076] (1) Lightweight service startup: when starting the CAD software silently, the websocket service is triggered to start by using the mechanism of automatically loading the plug-in of the CAD software, at this time the lightweight service runs in the background, and the communication connection with the CAD software is ready, and the SDK of the CAD software can be accessed.

[0077] (2) After the websocket service listens to the conversion request of the client, the file to be converted is obtained from the client.

[0078] (3) The file type is obtained by analyzing the file to be converted, and the corresponding CAD conversion plug-in is found according to the configuration protocol.

[0079] (4) Determine whether the corresponding CAD conversion plug-in exists.

[0080] (5) If not, return an exception, record a failure log, and perform lightweight monitoring to real-time view the conversion progress of the file, especially the failed file. After analysis, it is determined whether to continue processing the conversion request. If processing, the request is resent, and if not processing, it is directly ended.

[0081] (6) If it exists, the SDK of the currently used CAD is called through the conversion plug-in, and the corresponding lightweight format file is converted according to the configuration protocol.

[0082] (7) Determine whether the conversion is successful.

[0083] (8) If it fails, determine that the interface is abnormal, record the exception, and perform lightweight monitoring to real-time view the conversion progress of the file, especially the failed file. After analysis, it is determined whether to continue processing the conversion request. If processing, the request is resent, and if not processing, it is directly ended.

[0084] (9) If it succeeds, the lightweight file is uploaded to the file warehouse, and the result is returned to the client.

[0085] (10) The client uses the lightweight file, and the process is ended.

[0086] In the embodiment of the application, a method for constructing a service based on a CAD plug-in to support file lightweight conversion of multiple types of CAD drawings is proposed, and the method is encapsulated into a service to provide an interface to the outside. Compared with the related art in which inter-process communication is performed by calling an SDK, the embodiment can improve stability by taking the CAD software as a service, and can support multiple types of CAD lightweight services by using the capabilities of the CAD software, thereby reducing costs. In addition, the lightweight service can be implemented as a background service, and direct calling of the SDK cannot implement the background service, thereby improving conversion efficiency.

[0087] The following is a detailed description with reference to another embodiment.

[0088] Example 2

[0089] The drawing file conversion device provided in this embodiment includes multiple implementation units, each of which corresponds to a specific implementation step in Embodiment 1 above.

[0090] Figure 4 This is a schematic diagram of an optional drawing file conversion device according to an embodiment of the present invention, such as... Figure 4 As shown, the conversion device may include: a receiving unit 40, a determining unit 41, a conversion unit 42, and a returning unit 43, wherein...

[0091] The receiving unit 40 is used to receive a conversion request initiated by the target client, wherein the conversion request includes at least: the file to be converted;

[0092] The determining unit 41 is used to determine the converter plug-in corresponding to the file to be converted based on a preset configuration protocol;

[0093] Conversion unit 42 is used to convert the file to be converted into another preset format file using a converter plugin;

[0094] Return unit 43 is used to return a preset format file to the target client.

[0095] The aforementioned conversion device can receive conversion requests initiated by the target client through the receiving unit 40, determine the converter plugin corresponding to the file to be converted based on a preset configuration protocol through the determining unit 41, convert the file to be converted into another preset format file through the conversion unit 42 using the converter plugin, and return the preset format file to the target client through the returning unit 43. In this embodiment of the invention, by using a preset lightweight service, the converter plugin corresponding to the file to be converted can be determined according to a pre-configured preset configuration protocol, and then the converter plugin can be used to convert the file to be converted into another preset format file (i.e., a lightweight file). By using a preset lightweight service, it is possible to convert multiple types of drafting drawings using a single drafting tool, reducing system costs, improving system stability and conversion efficiency, and thus solving the technical problems of high cost and low efficiency in converting drafting files when multiple types of drafting files exist in related technologies.

[0096] Optionally, the conversion device further comprises: a first acquisition module, configured to acquire a plurality of file types and configure a corresponding plug-in interface for each file type to generate a service configuration before receiving a conversion request initiated by the target client, wherein the file type is a type of the file to be converted, the file type comprises at least one of the following: cat ia type, solidworks type, creo type, and the plug-in interface is an interface of the converter plug-in; a first generation module, configured to configure a corresponding conversion format for each file type to generate a conversion configuration, wherein the conversion format is a format of a preset format file, and each file type corresponds to at least one conversion format; and a second generation module, configured to generate a preset configuration protocol based on the service configuration and the conversion configuration.

[0097] Optionally, the determination unit comprises: a first analysis module, configured to analyze the file to be converted to obtain a target file type of the file to be converted; a first registration module, configured to register the target file type to a preset lightweight service; a first query module, configured to query a plug-in interface corresponding to the registered target file type based on the preset configuration protocol; and a first determination module, configured to determine a converter plug-in corresponding to the file to be converted based on the plug-in interface.

[0098] Optionally, the conversion unit comprises: a first calling module, configured to call a preset tool kit of a preset application by using the converter plug-in; a second query module, configured to query the preset configuration protocol to obtain a conversion format corresponding to the target file type; and a first conversion module, configured to convert the file to be converted by using the preset tool kit to obtain a preset format file with the conversion format as the file format.

[0099] Optionally, the conversion device further comprises: a first establishment module, configured to establish a preset connection service in the preset application before receiving the conversion request initiated by the target client, wherein the preset application is deployed in the target client; and a first construction module, configured to construct the preset lightweight service based on the preset connection service, wherein the preset connection service is used to establish a communication connection between the preset lightweight service and the target client.

[0100] Optionally, the conversion device further comprises: a first starting module, configured to start the preset application after the preset lightweight service is constructed; a first triggering module, configured to trigger the preset connection service in a case where the preset application is started successfully; and a second determination module, configured to determine that the preset lightweight service is in a running state and that a communication connection between the preset lightweight service and the preset application is in a ready state in a case where the preset connection service is triggered successfully.

[0101] Optionally, the conversion device further comprises: a first monitoring module, configured to monitor a conversion process of the file to be converted, and obtain a monitoring result; a first returning module, configured to return query exception information in a case where the monitoring result indicates that the converter plug-in is not queried; a second returning module, configured to return interface exception information in a case where the monitoring result indicates that the conversion is not successful; a first analysis module, configured to analyze the query exception information or the interface exception information, and obtain conversion information; and a first sending module, configured to send the conversion information to a preset lightweight service, where the preset lightweight service re-performs the conversion based on the conversion information.

[0102] The conversion device described above can further comprise a processor and a memory, and the receiving unit 40, the determining unit 41, the converting unit 42, the returning unit 43, and the like are stored in the memory as program units, and the corresponding functions are realized by the processor executing the program units stored in the memory.

[0103] The processor described above comprises a kernel, and the kernel calls the corresponding program units in the memory. The kernel can be one or more, and the preset format file is returned to the target client by adjusting the kernel parameters.

[0104] The memory described above can include a non-permanent memory in a computer readable medium, a random access memory (RAM), and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory comprises at least one memory chip.

[0105] The application further provides a computer program product adapted to execute the program of the following method steps when executed on a data processing device: receiving a conversion request initiated by a target client, determining a converter plug-in corresponding to a file to be converted based on a preset configuration protocol, converting the file to be converted into another preset format file by using the converter plug-in, and returning the preset format file to the target client.

[0106] According to another aspect of the embodiments of the application, a computer readable storage medium is also provided, which comprises a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the above-mentioned conversion method of the drawing file when the computer program is running.

[0107] According to another aspect of the embodiments of the application, an electronic device is also provided, which comprises one or more processors and a memory, and the memory is configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the above-mentioned conversion method of the drawing file.

[0108] Figure 5is a hardware structural block diagram of an electronic device (or a mobile device) for a conversion method of a drawing file according to an embodiment of the present application. As shown in Figure 5 the electronic device can include one or more (shown as 502a, 502b, …, 502n in the figure) processors 502 (the processor 502 can include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 504 for storing data. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. Those skilled in the art can understand that Figure 5 the structure shown is only schematic, and does not limit the structure of the above-mentioned electronic device. For example, the electronic device can include more or fewer components than Figure 5 shown, or have a different configuration from Figure 5 shown.

[0109] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0110] In the above-mentioned embodiments of the present application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0111] In several embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented by other ways. Among them, the above-mentioned device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division way, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the coupling or direct coupling or communication connection between the units or modules shown or discussed can be through some interface, indirect coupling or communication connection between units or modules, which can be electrical or other forms.

[0112] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed to multiple units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.

[0113] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0114] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various program code storage media.

[0115] The above is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.

Claims

1. A method of converting a drawing file, characterized by, The application is applied to a preset lightweight service, and includes the following steps: receiving a conversion request initiated by a target client, wherein the conversion request at least includes a file to be converted; determining a converter plug-in corresponding to the file to be converted based on a preset configuration protocol; converting the file to be converted into another preset format file by using the converter plug-in; returning the preset format file to the target client; wherein, before receiving the conversion request initiated by the target client, the following steps are further included: obtaining multiple file types and configuring a corresponding plug-in interface for each file type to generate a service configuration, wherein the file type is the type of the file to be converted, and the file type includes at least one of the following: catia type, soildworks type, and creo type, and the plug-in interface is the interface of the converter plug-in; configuring a corresponding conversion format for each file type to generate a conversion configuration, wherein the conversion format is the format of the preset format file, and each file type corresponds to at least one conversion format; generating the preset configuration protocol based on the service configuration and the conversion configuration; wherein, the method further includes monitoring the conversion process of the file to be converted to obtain a monitoring result; returning abnormal information according to the monitoring result; analyzing the abnormal information to obtain conversion information; and sending the conversion information to the preset lightweight service for re-conversion; parsing the file to be converted to obtain a target file type of the file to be converted; the step of converting the file to be converted into another preset format file by using the converter plug-in includes: calling a preset tool package of a preset application by using the converter plug-in; querying the preset configuration protocol to obtain a conversion format corresponding to the target file type; converting the file to be converted by using the preset tool package to obtain the preset format file with the conversion format.

2. The conversion method of claim 1, wherein, the step of determining the converter plug-in corresponding to the file to be converted based on the preset configuration protocol includes: registering the target file type to the preset lightweight service; querying the plug-in interface corresponding to the registered target file type based on the preset configuration protocol; determining the converter plug-in corresponding to the file to be converted based on the plug-in interface.

3. The conversion method of claim 1, wherein, before receiving the conversion request initiated by the target client, the following steps are further included: establishing a preset connection service in a preset application, wherein the preset application is deployed in the target client; constructing the preset lightweight service based on the preset connection service, wherein the preset connection service is used to establish a communication connection between the preset lightweight service and the target client.

4. The conversion method of claim 3, wherein, after constructing the preset lightweight service, the following steps are further included: starting the preset application; triggering the preset connection service in the case that the preset application is successfully started; determining that the preset lightweight service is in a running state and determining that the communication connection between the preset lightweight service and the preset application is in a ready state in the case that the preset connection service is successfully triggered.

5. The conversion method of claim 1, wherein, further including: monitoring the conversion process of the file to be converted to obtain a monitoring result; In a case where the monitoring result indicates that the converter plug-in is not queried, return query exception information; In a case where the monitoring result indicates that the conversion is not successful, return interface exception information; Analyze the query exception information or the interface exception information to obtain conversion information; Send the conversion information to the preset lightweight service, wherein the preset lightweight service reconverts based on the conversion information.

6. A conversion apparatus for a drawing file, characterized by comprising: Applied to a preset lightweight service, comprising: A receiving unit configured to receive a conversion request initiated by a target client, wherein the conversion request at least includes a file to be converted; A determining unit configured to determine a converter plug-in corresponding to the file to be converted based on a preset configuration protocol; A converting unit configured to convert the file to be converted into another preset format file by using the converter plug-in; A returning unit configured to return the preset format file to the target client; The device is further configured to obtain a plurality of file types, configure a corresponding plug-in interface for each file type, generate a service configuration, wherein the file type is the type of the file to be converted, and the file type includes at least one of the following: catia type, soildworks type, and creo type, and the plug-in interface is the interface of the converter plug-in; configure a corresponding conversion format for each file type to generate a conversion configuration, wherein the conversion format is the format of the preset format file, and each file type corresponds to at least one conversion format; generate the preset configuration protocol based on the service configuration and the conversion configuration; The device is further configured to monitor the conversion process of the file to be converted to obtain a monitoring result, return exception information according to the monitoring result, analyze the exception information to obtain conversion information, and send the conversion information to the preset lightweight service for re-conversion; The device is further configured to parse the file to be converted to obtain a target file type of the file to be converted; and the step of converting the file to be converted into another preset format file by using the converter plug-in includes: calling a preset tool kit of a preset application by using the converter plug-in; querying the preset configuration protocol to obtain a conversion format corresponding to the target file type; and converting the file to be converted by using the preset tool kit to obtain the preset format file with the conversion format.

7. A computer readable storage medium characterized in that, The computer-readable storage medium includes a stored computer program, wherein the computer program controls the device where the computer-readable storage medium is located to perform the conversion method of the drawing file in any one of claims 1 to 5 when the computer program is running.

8. An electronic device, comprising: The device includes one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the conversion method of the drawing file in any one of claims 1 to 5.

Citation Information

Patent Citations

  • configuration and application method of Revit model interface plug-in and interface plug-in

    CN111596957A