CN113688098A - File conversion system, method and device - Google Patents

File conversion system, method and device Download PDF

Info

Publication number
CN113688098A
CN113688098A CN202110963726.5A CN202110963726A CN113688098A CN 113688098 A CN113688098 A CN 113688098A CN 202110963726 A CN202110963726 A CN 202110963726A CN 113688098 A CN113688098 A CN 113688098A
Authority
CN
China
Prior art keywords
file
converted
conversion
type
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110963726.5A
Other languages
Chinese (zh)
Inventor
崔晨
刘开飞
汤永浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Caxa Technology Co Ltd
Original Assignee
Caxa Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Caxa Technology Co Ltd filed Critical Caxa Technology Co Ltd
Priority to CN202110963726.5A priority Critical patent/CN113688098A/en
Publication of CN113688098A publication Critical patent/CN113688098A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/116Details of conversion of file system types or formats
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a file conversion system, a file conversion method and a file conversion device. The system comprises: the message processing server is used for receiving the file conversion request, generating an event message according to the file conversion request and sending the event message to the message queue; the file conversion server runs with a plurality of file converters, wherein each file converter acquires the event message from the message queue and executes file conversion on the file to be converted when the file type indicated by the event message is matched with a preset file type, and the preset file type is the file type which is supported by the file converter for conversion; and the file warehouse is used for storing the files to be converted and the converted files. By the method and the device, the problems that the conversion efficiency of the file conversion mode in the related technology is low and the conversion process is easy to generate abnormity are solved.

Description

File conversion system, method and device
Technical Field
The present application relates to the field of file conversion, and in particular, to a file conversion system, method and apparatus.
Background
In the field of file conversion, lightweight conversion is required to be performed on files, so that the files can be conveniently transferred and read, most of the existing lightweight conversion is completed by manually performing lightweight conversion operation on the files in a lightweight system by a user, and the problems of low efficiency and large labor consumption exist.
In order to solve the problem, a lightweight system which completes a series of processing of downloading, lightweight conversion and uploading of the model in combination with a collaborative management system also appears in the related art, but because each module depends on the management platform system to perform coordinated processing, the problems of system jamming, data loss and difficulty in fault location and repair are easily caused.
Aiming at the problems that the conversion efficiency of a file conversion mode in the related technology is low and the conversion process is easy to generate abnormity, an effective solution is not provided at present.
Disclosure of Invention
The application provides a file conversion system, method and device, which aim to solve the problems that the conversion efficiency of a file conversion mode in the related technology is low and the conversion process is easy to generate abnormity.
According to one aspect of the present application, a file conversion system is provided. The system comprises: the message processing server is used for receiving the file conversion request, generating an event message according to the file conversion request and sending the event message to the message queue; the file conversion server runs with a plurality of file converters, wherein each file converter acquires the event message from the message queue and executes file conversion on the file to be converted when the file type indicated by the event message is matched with a preset file type, and the preset file type is the file type which is supported by the file converter for conversion; and the file warehouse is used for storing the files to be converted and the converted files.
Optionally, the file converter comprises: the downloading module is used for downloading the file to be converted from the file warehouse and storing the file to be converted to the first storage address when the file type indicated by the event message corresponds to the preset file type; the first data channel is connected with the downloading module and used for caching the associated information of the file to be converted, wherein the associated information of the file to be converted at least comprises a first storage address; the conversion module is connected with the first data channel and used for acquiring a first storage address, acquiring a file to be converted according to the first storage address, executing file conversion on the file to be converted to obtain a converted file, and storing the converted file to a second storage address; the second data channel is connected with the conversion module and used for caching the associated information of the converted file, wherein the associated information of the converted file at least comprises a second storage address; and the uploading module is connected with the second data channel and used for acquiring a second storage address, acquiring the converted file according to the second storage address and uploading the converted file to the file warehouse.
According to another aspect of the present application, a file conversion method is provided. The method comprises the following steps: acquiring a current event message from the message queue, wherein the current event message is a message corresponding to the target file conversion request; identifying the current event message through a target file converter to obtain the type of a file to be converted, wherein the file to be converted is a file requested to be converted by a target file conversion request; judging whether the type of the file to be converted is matched with a preset file type, wherein the preset file type is a file type which is supported by the target file converter for conversion; and when the type of the file to be converted is matched with the preset file type, converting the file to be converted through the target file converter.
Optionally, before obtaining the current event message from the message queue, the method further includes: receiving a file conversion request sent by a target application program; generating a corresponding event message according to the file conversion request, wherein the event message at least comprises the type information of the file to be converted and the address information of the file to be converted; and sending the event message to a message queue.
Optionally, when the type of the file to be converted matches a preset file type, performing, by the target file converter, conversion on the file to be converted includes: downloading a file to be converted from a file warehouse; executing file conversion on the downloaded file to be converted to obtain a converted file; and uploading the converted file to a file warehouse.
Optionally, after determining whether the type of the file to be converted matches the preset file type, the method further includes: and when the type of the file to be converted is not matched with the preset file type, acquiring a next event message from the message queue, wherein the next event message is the next event message of the current event message.
Optionally, when the type of the file to be converted matches a preset file type, after the file to be converted is converted by the target file converter, the method further includes: and sending a first message to a message queue, wherein the first message is used for indicating that the conversion of the file to be converted is completed.
Optionally, the method further comprises: and in the process of executing conversion on the file to be converted through the target file converter, sending a second message to the target application program under the condition of abnormal conversion, wherein the second message is used for indicating that the conversion process of the file to be converted is abnormal.
Optionally, the file to be converted is a CAD file, and the file converter is a CAD file converter.
According to another aspect of the present application, there is provided a file conversion apparatus. The device includes: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a current event message from a message queue, and the current event message is a message corresponding to a target file conversion request; the identification unit is used for identifying the current event message through the target file converter to obtain the type of the file to be converted, wherein the file to be converted is the file requested to be converted by the target file conversion request; the judging unit is used for judging whether the type of the file to be converted is matched with a preset file type, wherein the preset file type is a file type which is supported by the target file converter to be converted; and the conversion unit is used for executing conversion on the file to be converted through the target file converter when the type of the file to be converted is matched with the preset file type.
According to another aspect of the embodiments of the present invention, there is also provided a non-volatile storage medium, which includes a stored program, wherein the program controls a device in which the non-volatile storage medium is located to execute a file conversion method when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a processor and a memory; the memory has stored therein computer readable instructions, and the processor is configured to execute the computer readable instructions, wherein the computer readable instructions when executed perform a file conversion method.
According to the application, the message processing server is used for receiving the file conversion request, generating the event message according to the file conversion request and sending the event message to the message queue; the file conversion server runs with a plurality of file converters, wherein each file converter acquires the event message from the message queue and executes file conversion on the file to be converted when the file type indicated by the event message is matched with a preset file type, and the preset file type is the file type which is supported by the file converter for conversion; the file warehouse is used for storing the files to be converted and the converted files, and solves the problems that the conversion efficiency of a file conversion mode in the related technology is low and the conversion process is easy to generate abnormity. A mode that a plurality of file converters acquire event messages from the message queue and execute file conversion is adopted, and therefore the effects of improving the file conversion efficiency and reducing abnormal file conversion conditions are achieved.
Drawings
The accompanying drawings, which 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 and are not intended to limit the application. In the drawings:
FIG. 1 is a schematic diagram of a file conversion system according to the related art;
FIG. 2 is a schematic diagram of a file conversion system provided according to an embodiment of the present application;
FIG. 3 is a flowchart of a file conversion method provided according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative file conversion method provided in accordance with an embodiment of the present application;
FIG. 5 is a schematic diagram of an alternative file conversion method provided in accordance with an embodiment of the present application;
fig. 6 is a schematic diagram of a file conversion device provided according to an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In order to solve the problems of low efficiency and large labor consumption in the related art that the lightweight conversion operation is manually executed on the file in the lightweight system by a user, the following methods appear in the related art:
as shown in fig. 1, the CAD model lightweight system in the related art includes a CAD model lightweight service device 10, a client 11, a collaborative application service platform 13, and a file server 15.
The browser end 11 is used for reading and browsing lightweight files; the collaborative application service platform 13 is used for storing the file to be transferred, which is acquired from the client, in the file server and sending a file transfer instruction to the lightweight conversion service module 10, so as to play a role in coordination and scheduling; and the CAD model lightweight service device 10 acquires the file transfer task from the collaborative service platform, realizes conversion and uploads a file warehouse.
However, in the related art, depending on the collaboration service platform, the uploading of the file to be converted and the distribution of the file transferring task are all completed by the collaboration service platform, and as a "core" of the system, the collaboration service platform directly interacts with the browser, the file repository and the converter, and when the collaboration platform goes down, the data (the file to be converted, the converting task and the converter state information) is easily lost. On the other hand, in the CAD model lightweight service device 10, the parallel scheduling module 105 relies on the operation of a plurality of converters. If the module is in fault and crashes, the converter can not work, and the efficiency and the stability can not be guaranteed.
Based on this, the present application intends to provide a solution to the above technical problem, the details of which will be explained in the following embodiments.
According to an embodiment of the present application, a file conversion system is provided.
FIG. 2 is a schematic diagram of a file conversion system according to an embodiment of the present application. As shown in fig. 2, the system includes:
and the message processing server 21 is configured to receive the file conversion request, generate an event message according to the file conversion request, and send the event message to the message queue.
The file conversion request may be a file conversion request sent by a user through a client or a browser, and the file conversion request is used for requesting to convert a file of one version into another version, for example, a CAD original file may be requested to be converted into a lightweight file.
Specifically, after receiving the file conversion request, the message processing server 21 extracts the request information in the file conversion request, converts the request information into the event message in the set format, and sends the event message to the message queue in sequence, where the set format at least includes the type information of the file to be converted and the address information of the file, and the message queue may be a Kafka message queue.
The file conversion server 22 runs with a plurality of file converters, wherein each file converter acquires the event message from the message queue and performs file conversion on the file to be converted when the file type indicated by the event message matches with a preset file type, wherein the preset file type is the file type supported by the file converter for conversion.
Specifically, the file converters are respectively used for converting files of different types, each file converter acquires a current event message from the message queue, and identifies whether the type information of the file to be converted in the current event message is a type that the file converter supports conversion, if so, the conversion is executed, otherwise, the current event message is skipped, and a next event message is acquired from the message queue.
And the file warehouse 23 is used for storing the files to be converted and the converted files.
Specifically, on one hand, the file repository 23 stores the file to be converted, and the file converter may obtain the file to be converted from the file repository 23 according to the address of the file; on the other hand, the file repository 23 also stores the converted file, and the file converter may upload the converted file to the file repository 23 according to the address of the file.
Optionally, in the file conversion system provided in the embodiment of the present application, the file converter includes: the downloading module is used for downloading the file to be converted from the file warehouse 23 when the file type indicated by the event message corresponds to the preset file type, and storing the file to be converted to the first storage address; the first data channel is connected with the downloading module and used for caching the associated information of the file to be converted, wherein the associated information of the file to be converted at least comprises a first storage address; the conversion module is connected with the first data channel and used for acquiring a first storage address, acquiring a file to be converted according to the first storage address, executing file conversion on the file to be converted to obtain a converted file, and storing the converted file to a second storage address; the second data channel is connected with the conversion module and used for caching the associated information of the converted file, wherein the associated information of the converted file at least comprises a second storage address; and the uploading module is connected with the second data channel and is used for acquiring the second storage address, acquiring the converted file according to the second storage address and uploading the converted file to the file warehouse 23.
Specifically, the downloading module in the file converter may download the file to be converted from the file repository 23 according to the address of the file to be converted, store the file to be converted in the storage medium of the file converter, and cache the storage information of the downloaded file to be converted in the first data channel; under the condition that the conversion module is idle, acquiring storage information of a file to be converted from the first data channel, reading the file to be converted according to the storage information, performing conversion on the file to be converted, storing the converted file into a storage medium of the file converter, and caching the storage information of the converted file in the second data channel; and under the condition that the uploading module is idle, acquiring the storage information of the converted file from the second data channel, reading the converted file according to the storage information, and uploading the converted file to a corresponding address in the file warehouse 23.
The file conversion system provided by the embodiment of the application receives a file conversion request through the message processing server 21, generates an event message according to the file conversion request, and sends the event message to the message queue; the file conversion server 22 runs with a plurality of file converters, wherein each file converter acquires the event message from the message queue and executes file conversion on the file to be converted when the file type indicated by the event message is matched with a preset file type, wherein the preset file type is the file type supported by the file converter for conversion; the file warehouse 23 stores the files to be converted and the converted files, and solves the problems that the conversion efficiency of the file conversion mode in the related technology is low and the conversion process is easy to generate abnormity. A mode that a plurality of file converters acquire event messages from the message queue and execute file conversion is adopted, and therefore the effects of improving the file conversion efficiency and reducing abnormal file conversion conditions are achieved.
FIG. 3 is a flow chart of a file conversion method according to an embodiment of the present application. As shown in fig. 3, the method comprises the steps of:
step S302, obtaining the current event message from the message queue, wherein the current event message is a message corresponding to the target file conversion request.
Specifically, the current event message may be an event message currently acquired by the file converter from the message queue, the current event message is generated according to a target file conversion request, and the target file conversion request may be a file conversion request sent by a user through a client or a browser, where the file conversion request is used to request to convert a file of one version into another version.
Optionally, in the file conversion method provided in this embodiment of the present application, before obtaining the current event message from the message queue, the method further includes: receiving a file conversion request sent by a target application program; generating a corresponding event message according to the file conversion request, wherein the event message at least comprises the type information of the file to be converted and the address information of the file to be converted; and sending the event message to a message queue.
Specifically, after receiving a file conversion request sent by a browser or a client, the message processing server extracts request information in the file conversion request, converts the request information into event messages in a set format, and sends the event messages to a message queue according to the sequence of the file conversion request, wherein the set format at least includes type information of a file to be converted and address information of the file, and the message queue may be a Kafka message queue.
Step S304, identifying the current event message through the target file converter to obtain the type of the file to be converted, wherein the file to be converted is the file requested to be converted by the target file conversion request.
The file to be converted is of various types, and optionally, the file to be converted is a CAD file, and the file converter is a CAD file converter.
In an alternative embodiment, the file to be converted may be an original CAD file, the target file conversion request may be a file lightweight conversion request, and the target file converter user converts the original CAD file into a lightweight CAD file.
Step S306, determining whether the type of the file to be converted matches a preset file type, where the preset file type is a file type supported by the target file converter for conversion.
Specifically, the target file converter is one of a plurality of file converters operating in the file conversion server, each file converter is used for converting different types of files, the target file converter acquires the current event message from the message queue, identifies the type information of the file to be converted in the current event message, and judges whether the type information of the file to be converted in the current event message is the type of self-supported conversion.
Step S308, when the type of the file to be converted is matched with the preset file type, the file to be converted is converted through the target file converter.
Specifically, the target file converter determines that the type information of the file to be converted in the current event message is a type that the target file converter supports conversion, and then performs conversion, thereby completing conversion of the file to be converted corresponding to the current event message.
According to the file conversion method provided by the embodiment of the application, the current event message is obtained from the message queue, wherein the current event message is a message corresponding to the target file conversion request; identifying the current event message through a target file converter to obtain the type of a file to be converted, wherein the file to be converted is a file requested to be converted by a target file conversion request; judging whether the type of the file to be converted is matched with a preset file type, wherein the preset file type is a file type which is supported by the target file converter for conversion; when the type of the file to be converted is matched with the type of the preset file, the target file converter is used for converting the file to be converted, so that the problems that the conversion efficiency of a file conversion mode in the related technology is low and the conversion process is easy to generate abnormity are solved. A mode that a plurality of file converters acquire event messages from the message queue and execute file conversion is adopted, and therefore the effects of improving the file conversion efficiency and reducing abnormal file conversion conditions are achieved.
Optionally, when the type of the file to be converted is matched with the preset file type, performing conversion on the file to be converted by using the target file converter includes: downloading a file to be converted from a file warehouse; executing file conversion on the downloaded file to be converted to obtain a converted file; and uploading the converted file to a file warehouse.
Specifically, the event message does not include specific file data of the file to be converted, but includes address information of the file to be converted, the target file converter may download and cache the file to be converted from the file repository according to the file address in the event message, perform conversion and cache on the current file to be converted after the conversion of the previous file to be converted is completed, and upload the current converted file to a corresponding address in the file repository when the upload of the previous converted file is completed.
Optionally, after determining whether the type of the file to be converted matches the preset file type, the method further includes: and when the type of the file to be converted is not matched with the preset file type, acquiring a next event message from the message queue, wherein the next event message is the next event message of the current event message.
Specifically, when the target file converter identifies that the type information of the file to be converted in the current event message is not the type which supports conversion, the current event message is skipped, and the next event message is acquired from the message queue for identification.
According to the embodiment, the asynchronous message queue is introduced to drive file conversion by the event message, the file conversion server acquires the conversion task by subscribing the message queue, the conversion task does not need to be scheduled by a cooperative system, and the front-end task does not need to wait for the rear end after being sent out, so that decoupling of the front-end application program and the file converter is realized, occupation of front-end resources is eliminated immediately, and the system jamming condition is reduced.
In order to enable the message queue to know the conversion condition of the file to be converted, optionally, when the type of the file to be converted matches the preset file type, after the file to be converted is converted by the target file converter, the method further includes: and sending a first message to a message queue, wherein the first message is used for indicating that the conversion of the file to be converted is completed.
In order to make the user timely know the abnormal conversion condition, optionally, the method further includes: and in the process of executing conversion on the file to be converted through the target file converter, sending a second message to the target application program under the condition of abnormal conversion, wherein the second message is used for indicating that the conversion process of the file to be converted is abnormal.
Specifically, under the condition that the conversion is abnormal, the target file converter sends a second message to the browser or the client to prompt the user that the file conversion is abnormal, and the user can judge whether the format of the file to be converted is abnormal or not and whether the conversion request can be realized or not, so that the reason of the conversion abnormality is determined.
In an alternative implementation, as shown in fig. 4, a schematic diagram of an alternative file conversion method according to an embodiment of the present application is shown:
the file conversion method of the embodiment of the present application is applied to a CAD lightweight file conversion system, and the CAD lightweight file conversion system includes a message processing service, a CAD lightweight service, an electronic file repository, and an error processing module.
Wherein the client/browser sends a document lightweight request to the message processing service. The message agent service receives a client lightweight request, expands the lightweight request into a transaction message, and sends the transaction message to a lightweight transaction message queue, specifically, the format of the transaction message is shown in table 1, wherein the information of the file to be transferred at least comprises type information and address information of the document:
TABLE 1
Task initiator information
Information of file to be transferred
Supplementary information
Further, the lightweight conversion service operates with a plurality of CAD converters that download a plurality of CAD model files from the electronic file repository, convert the downloaded files, and upload the converted files to the electronic file repository.
It should be noted that, multiple CAD converters acquire conversion tasks from the lightweight transaction message queue in a subscription manner, wherein different CAD converters can convert different types of CAD model files, and the identification of the tasks to be converted is performed by the CAD converters themselves.
In an optional implementation manner, a conversion process of the CAD converter is introduced by taking a CATIA model file converter as an example, after the converter acquires a transaction message from a message queue, it is determined whether a conversion file corresponding to a conversion task is a CATIA model file according to message content, if so, subsequent downloading, converting and uploading processes are performed, otherwise, the transaction message is skipped and a next conversion task is acquired.
Specifically, as shown in fig. 5, the converter includes a download module, a conversion module, and an upload module. The downloading module reads and screens the downloading task from the lightweight message queue on one hand, and downloads the file to be converted from the file warehouse on the other hand, and puts the downloaded file into the conversion channel. The conversion module reads the conversion task from the conversion task channel, and the file conversion result is put into the uploading task channel, it should be noted that different CAD converters have different model conversion interfaces to perform corresponding file conversion. The uploading module reads the uploading task from the uploading task channel, uploads the lightweight file to the file warehouse according to the uploading task, and sends a conversion completion confirmation message to the message queue.
In addition, the conversion system also comprises an error processing module which is used for collecting error information which occurs when the message processing service and various CAD converters work, such as file downloading failure, internal errors of converted files and the like, and feeding the error information back to the client/browser. Furthermore, the user can confirm the reason of the error according to the error information displayed by the client or the browser, and manually submit the lightweight task again, so that the lightweight task is better completed.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present application further provides a file conversion device, and it should be noted that the file conversion device in the embodiment of the present application may be used to execute the file conversion method provided in the embodiment of the present application. The following describes a file conversion apparatus provided in an embodiment of the present application.
Fig. 6 is a schematic diagram of a file conversion apparatus according to an embodiment of the present application. As shown in fig. 6, the apparatus includes: the device comprises an acquisition unit 10, a recognition unit 20, a judgment unit 30 and a conversion unit 40.
Specifically, the obtaining unit 10 is configured to obtain a current event message from a message queue, where the current event message is a message corresponding to a target file conversion request;
the identification unit 20 is configured to identify the current event message through the target file converter to obtain a type of a file to be converted, where the file to be converted is a file requested to be converted by the target file conversion request;
the determining unit 30 is configured to determine whether the type of the file to be converted matches a preset file type, where the preset file type is a file type supported by the target file converter for conversion;
and the conversion unit 40 is used for performing conversion on the file to be converted through the target file converter when the type of the file to be converted is matched with the preset file type.
In the file conversion apparatus provided in the embodiment of the present application, the obtaining unit 10 obtains a current event message from the message queue, where the current event message is a message corresponding to a target file conversion request; the identification unit 20 identifies the current event message through the target file converter to obtain the type of the file to be converted, wherein the file to be converted is the file requested to be converted by the target file conversion request; the determining unit 30 determines whether the type of the file to be converted matches a preset file type, wherein the preset file type is a file type supported by the target file converter for conversion; when the type of the file to be converted is matched with the preset file type, the conversion unit 40 performs conversion on the file to be converted through the target file converter, so that the problems that the conversion efficiency of a file conversion mode in the related art is low and the conversion process is easy to generate abnormity are solved.
The file conversion device comprises a processor and a memory, wherein the acquisition unit 10, the identification unit 20, the judgment unit 30, the conversion unit 40 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the problems that the conversion efficiency of a file conversion mode in the related technology is low and the conversion process is easy to generate abnormity are solved by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
The embodiment of the application also provides a nonvolatile storage medium, wherein the nonvolatile storage medium comprises a stored program, and the program controls the equipment where the nonvolatile storage medium is located to execute a file conversion method when running.
The embodiment of the application also provides an electronic device, which comprises a processor and a memory; the memory has stored therein computer readable instructions, and the processor is configured to execute the computer readable instructions, wherein the computer readable instructions when executed perform a file conversion method. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may 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 instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may 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 flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A file conversion system, comprising:
the message processing server is used for receiving the file conversion request, generating an event message according to the file conversion request and sending the event message to a message queue;
the file conversion server runs with a plurality of file converters, wherein each file converter acquires the event message from the message queue and executes file conversion on a file to be converted when the file type indicated by the event message is matched with a preset file type, wherein the preset file type is the file type which is supported by the file converter for conversion;
and the file warehouse is used for storing the files to be converted and the converted files.
2. The system of claim 1, wherein the file converter comprises:
the downloading module is used for downloading the file to be converted from the file warehouse and storing the file to be converted to a first storage address when the file type indicated by the event message corresponds to a preset file type;
the first data channel is connected with the downloading module and is used for caching the associated information of the file to be converted, wherein the associated information of the file to be converted at least comprises the first storage address;
the conversion module is connected with the first data channel and used for acquiring the first storage address, acquiring the file to be converted according to the first storage address, performing file conversion on the file to be converted to obtain the converted file, and storing the converted file to a second storage address;
the second data channel is connected with the conversion module and used for caching the associated information of the converted file, wherein the associated information of the converted file at least comprises the second storage address;
and the uploading module is connected with the second data channel and used for acquiring the second storage address, acquiring the converted file according to the second storage address and uploading the converted file to the file warehouse.
3. A method of file conversion, comprising:
acquiring a current event message from a message queue, wherein the current event message is a message corresponding to a target file conversion request;
identifying the current event message through a target file converter to obtain the type of a file to be converted, wherein the file to be converted is a file requested to be converted by the target file conversion request;
judging whether the type of the file to be converted is matched with a preset file type, wherein the preset file type is a file type which is supported by the target file converter for conversion;
and when the type of the file to be converted is matched with the preset file type, converting the file to be converted through the target file converter.
4. The method of claim 3, wherein prior to said retrieving a current event message from a message queue, the method further comprises:
receiving a file conversion request sent by a target application program;
generating a corresponding event message according to the file conversion request, wherein the event message at least comprises the type information of the file to be converted and the address information of the file to be converted;
and sending the event message to the message queue.
5. The method according to claim 3, wherein the performing, by the target file converter, the conversion on the file to be converted when the type of the file to be converted matches the preset file type comprises:
downloading the file to be converted from a file warehouse;
executing file conversion on the downloaded file to be converted to obtain a converted file;
and uploading the converted file to the file warehouse.
6. The method according to claim 3, wherein after the determining whether the type of the file to be converted matches a preset file type, the method further comprises:
and when the type of the file to be converted is not matched with the preset file type, acquiring a next event message from the message queue, wherein the next event message is the next event message of the current event message.
7. The method according to claim 3, wherein when the type of the file to be converted matches the preset file type, after the conversion is performed on the file to be converted by the target file converter, the method further comprises:
and sending a first message to the message queue, wherein the first message is used for indicating that the conversion of the file to be converted is completed.
8. The method of claim 4, further comprising:
and in the process of converting the file to be converted through the target file converter, sending a second message to the target application program under the condition of abnormal conversion, wherein the second message is used for indicating that the conversion process of the file to be converted is abnormal.
9. The method according to claim 3, wherein the file to be converted is a CAD file and the file converter is a CAD file converter.
10. A file conversion apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a current event message from a message queue, and the current event message is a message corresponding to a target file conversion request;
the identification unit is used for identifying the current event message through a target file converter to obtain the type of a file to be converted, wherein the file to be converted is a file requested to be converted by the target file conversion request;
the judging unit is used for judging whether the type of the file to be converted is matched with a preset file type, wherein the preset file type is a file type which is supported by the target file converter to be converted;
and the conversion unit is used for executing conversion on the file to be converted through the target file converter when the type of the file to be converted is matched with the preset file type.
CN202110963726.5A 2021-08-20 2021-08-20 File conversion system, method and device Pending CN113688098A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110963726.5A CN113688098A (en) 2021-08-20 2021-08-20 File conversion system, method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110963726.5A CN113688098A (en) 2021-08-20 2021-08-20 File conversion system, method and device

Publications (1)

Publication Number Publication Date
CN113688098A true CN113688098A (en) 2021-11-23

Family

ID=78581294

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110963726.5A Pending CN113688098A (en) 2021-08-20 2021-08-20 File conversion system, method and device

Country Status (1)

Country Link
CN (1) CN113688098A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681903A (en) * 2011-03-15 2012-09-19 深圳光启高等理工研究院 Data processing method
CN105045802A (en) * 2015-05-22 2015-11-11 杭州亿方云网络科技有限公司 Message-driven multi-type file preview system
CN109710569A (en) * 2018-12-26 2019-05-03 上海百事通信息技术股份有限公司 A kind of file online browse method
CN111949614A (en) * 2020-08-12 2020-11-17 中国工商银行股份有限公司 Bank system file conversion method and device
CN112035405A (en) * 2020-08-29 2020-12-04 平安科技(深圳)有限公司 Document transcoding method and device, scheduling server and storage medium
CN112287265A (en) * 2020-12-24 2021-01-29 深圳市蓝凌软件股份有限公司 Asynchronous event driven based file conversion method and system
CN112486912A (en) * 2020-12-03 2021-03-12 北京普睿德利科技有限公司 File conversion system, method, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681903A (en) * 2011-03-15 2012-09-19 深圳光启高等理工研究院 Data processing method
CN105045802A (en) * 2015-05-22 2015-11-11 杭州亿方云网络科技有限公司 Message-driven multi-type file preview system
CN109710569A (en) * 2018-12-26 2019-05-03 上海百事通信息技术股份有限公司 A kind of file online browse method
CN111949614A (en) * 2020-08-12 2020-11-17 中国工商银行股份有限公司 Bank system file conversion method and device
CN112035405A (en) * 2020-08-29 2020-12-04 平安科技(深圳)有限公司 Document transcoding method and device, scheduling server and storage medium
CN112486912A (en) * 2020-12-03 2021-03-12 北京普睿德利科技有限公司 File conversion system, method, electronic equipment and storage medium
CN112287265A (en) * 2020-12-24 2021-01-29 深圳市蓝凌软件股份有限公司 Asynchronous event driven based file conversion method and system

Similar Documents

Publication Publication Date Title
CN107229555A (en) Mark generating method and device
US9535754B1 (en) Dynamic provisioning of computing resources
WO2020082611A1 (en) Method for carrying out deep learning on basis of blockchain platform and electronic device
CN102255866A (en) Method and device for downloading data
CN107798064A (en) Page processing method, electronic equipment and computer-readable recording medium
CN113596078A (en) Service problem positioning method and device
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN112711624A (en) Data packaging control method and device, electronic equipment and storage medium
CN113688098A (en) File conversion system, method and device
CN105760215A (en) Map-reduce model based job running method for distributed file system
CN115905151A (en) Method, system and device for querying circulation information based on backup log
CN112667393B (en) Method and device for building distributed task computing scheduling framework and computer equipment
CN112688980B (en) Resource distribution method and device, and computer equipment
CN114895851A (en) Data processing method, data processing device, storage medium and electronic equipment
CN114090242A (en) Model training method, device, equipment, storage medium and program product
CN112597119A (en) Method and device for generating processing log and storage medium
CN112560938A (en) Model training method and device and computer equipment
CN113900811A (en) Event-driven task scheduling method and device
CN106557530A (en) Operation system, data recovery method and device
CN110474954A (en) Sharing files method, apparatus, computer equipment and readable storage medium storing program for executing based on block chain
CN110673931A (en) Distributed calculation method for document synthesis, document synthesis system and control device thereof
CN112579189A (en) Configuration file updating method and device
CN111431951A (en) Data processing method, node equipment, system and storage medium
CN112286946B (en) Data processing method, server and medium
CN112817691B (en) Resource allocation method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination