CN112463731B - File format conversion method and system and electronic equipment - Google Patents

File format conversion method and system and electronic equipment Download PDF

Info

Publication number
CN112463731B
CN112463731B CN202011511068.8A CN202011511068A CN112463731B CN 112463731 B CN112463731 B CN 112463731B CN 202011511068 A CN202011511068 A CN 202011511068A CN 112463731 B CN112463731 B CN 112463731B
Authority
CN
China
Prior art keywords
file
processed
format
transcoded
transcoding
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.)
Active
Application number
CN202011511068.8A
Other languages
Chinese (zh)
Other versions
CN112463731A (en
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.)
Hangzhou Miluoxing Technology Group Co ltd
Original Assignee
Hangzhou Miluoxing Technology Group 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 Hangzhou Miluoxing Technology Group Co ltd filed Critical Hangzhou Miluoxing Technology Group Co ltd
Priority to CN202011511068.8A priority Critical patent/CN112463731B/en
Publication of CN112463731A publication Critical patent/CN112463731A/en
Application granted granted Critical
Publication of CN112463731B publication Critical patent/CN112463731B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a method, a system and electronic equipment for converting a file format, and relates to the field of file format conversion, wherein the method is applied to the process of converting a file into a webpage, and firstly, a resource locator of the file to be converted is obtained; the resource locator of the file to be transcoded contains file format information of the file to be transcoded; then, downloading the file to be transcoded by using the resource locator of the file to be transcoded, and marking the downloaded file to be transcoded as a first file to be processed; according to the file format information of the first file to be processed, converting the first file to be processed into a second file to be processed which meets the requirements of the file transcoding webpage; and then generating a resource locator of the second file to be processed, and downloading the second file to be processed by using the resource locator of the second file to be processed and using the second file to be processed in a process of transcoding the webpage. The method reduces the format requirement of the original input file in the webpage conversion process through the preprocessing operation of the input file.

Description

File format conversion method and system and electronic equipment
Technical Field
The present invention relates to the field of file format conversion technologies, and in particular, to a method, a system, and an electronic device for converting a file format.
Background
In the prior art, the web page conversion process transcodes an input file into an available web page file through a corresponding file transcoding web page system. Because of the limited number of types of web page file formats, strict format requirements are placed on the input file prior to transcoding. In the actual use process, the formats of the input files are complex and various, and the current file transcoding webpage system is difficult to meet the transcoding requirements of the input files in various formats.
Therefore, the existing web page conversion process also has the problem of higher requirement on the input file format.
Disclosure of Invention
Accordingly, the present invention is directed to a method, a system, and an electronic device for converting a file format, wherein the file to be transcoded is downloaded in advance through a resource locator of the file to be transcoded, and is converted into a file meeting the requirements of a file transcoding web page through two layers of a file type and a file content, and finally the converted file is used for transcoding by the file transcoding web page system. Through preprocessing operation on the input file, the input file is finally converted into a file format which can be supported by a file transcoding webpage system, and the format requirement on the original input file in the webpage conversion process is reduced.
In a first aspect, an embodiment of the present invention provides a method for converting a file format, where the method is applied to a process of transcoding a web page from a file, and the method includes:
acquiring a resource locator of a file to be transcoded; the resource locator of the file to be transcoded comprises file format information of the file to be transcoded;
downloading the file to be transcoded by using the resource locator of the file to be transcoded, and marking the downloaded file to be transcoded as a first file to be processed; the file format information of the first file to be processed is the same as the file format information of the file to be transcoded;
according to the file format information of the first file to be processed, converting the first file to be processed into a second file to be processed which meets the requirements of the file transcoding webpage;
generating a resource locator of the second to-be-processed file, downloading the second to-be-processed file by using the resource locator of the second to-be-processed file, and using the downloaded second to-be-processed file for a process of file transcoding the webpage.
In some embodiments, the step of converting the first to-be-processed file into the second to-be-processed file meeting the requirement of the file transcoding web page according to the file format information of the first to-be-processed file includes:
Acquiring a preset input file support type and an output file support type; the input file support type is the type of the input file supported in the process of transcoding the webpage; the output file support type is the type of the output file supported in the process of transcoding the webpage;
carrying out format judgment on file format information of the first file to be processed, and determining whether the first file to be processed meets the input file support type;
and if the first to-be-processed file meets the input file supporting type and does not meet the output file supporting type, converting the first to-be-processed file into a second to-be-processed file meeting the output file supporting type.
In some implementations, entering the file support type includes: a presentation input file, a form input file, a text input file, a PDF input file and a text input file, wherein the file formats correspond to one or more of the above files;
the file format corresponding to the input file is demonstrated, which comprises the following steps: pptx, ppt, pot, potx, pps, ppsx, dps, dpt, pptm, potm, ppsm;
the file format corresponding to the form input file comprises: xls, xlt, et, ett, xlsx, xltx, csv, xlsb, xlsm, xltm;
The file format corresponding to the text input file comprises: doc, dot, wps, wpt, docx, dotx, docm, dotm;
the file format corresponding to the PDF input file comprises: pdf;
the text format corresponding to the text input file comprises: lrc, c, cpp, h, asm, s, java, asp, bat, bas, prg, cmd, rtf, txt, xml, json.
In some implementations, outputting the file support types includes: presentation output file, form output file, text output file, PDF output file and text output file, and one or more corresponding file formats;
the file format corresponding to the demonstration output file comprises: pptx, ppt;
the file format corresponding to the form output file comprises: xls, xlsx;
the file format corresponding to the text output file comprises: doc, docx;
the file format corresponding to the PDF output file comprises: pdf;
the text format corresponding to the text output file comprises: txt.
In some embodiments, performing format judgment on file format information of a first to-be-processed file to determine whether the first to-be-processed file meets an input file support type includes:
acquiring a file header, file content and a file extension contained in file format information of a first file to be processed;
And judging whether the first file to be processed meets the input file support type or not by using the file header, the file content and the file extension of the first file to be processed.
In some embodiments, after the step of converting the first to-be-processed file into the second to-be-processed file satisfying the file transcoding web page requirement according to the file format information of the first to-be-processed file, the method further includes:
acquiring a preset file format standard; the file format standard is a format standard required by the file in the process of transcoding the webpage;
judging whether the second file to be processed meets the file format standard or not;
if not, carrying out format conversion on the second file to be processed according to the file format standard.
In some embodiments, before the step of downloading the file to be transcoded using the resource locator of the file to be transcoded and marking the downloaded file to be transcoded as the first file to be processed, the method further includes:
judging whether the resource locator of the file to be transcoded has completed conversion;
and if so, downloading the file to be transcoded by using the resource locator of the file to be transcoded, and using the downloaded file to be transcoded in the process of file transcoding web pages.
In a second aspect, an embodiment of the present invention provides a system for converting a file format, where the system is used in a process of transcoding a web page from a file, and the system includes:
the file resource locator acquisition module is used for acquiring a resource locator of a file to be transcoded; the resource locator of the file to be transcoded comprises file format information of the file to be transcoded;
the first to-be-processed file acquisition module is used for downloading the to-be-transcoded file by utilizing the resource locator of the to-be-transcoded file and marking the downloaded to-be-transcoded file as the first to-be-processed file; the file format information of the first file to be processed is the same as the file format information of the file to be transcoded;
the second to-be-processed file acquisition module is used for converting the first to-be-processed file into a second to-be-processed file meeting the requirements of the file transcoding webpage according to the file format information of the first to-be-processed file;
the file format conversion generating module is used for generating a resource locator of the second to-be-processed file, downloading the second to-be-processed file by using the resource locator of the second to-be-processed file, and using the downloaded second to-be-processed file in a process of file transcoding the webpage.
In a third aspect, an embodiment of the present invention further provides an electronic device, including: a processor and a memory; the memory has stored thereon a computer program which, when run by a processor, implements the steps of the method of converting a file format mentioned in any of the possible embodiments of the first aspect described above.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium, on which a computer program is stored, where the computer program when executed by a processor implements the steps of the method for converting a file format mentioned in any possible implementation manner of the first aspect.
The embodiment of the invention has the following beneficial effects:
the invention provides a method, a system and electronic equipment for converting a file format, which are applied to a process of transcoding a webpage of a file, wherein the method firstly obtains a resource locator of the file to be transcoded; the resource locator of the file to be transcoded comprises file format information of the file to be transcoded; then, downloading the file to be transcoded by using the resource locator of the file to be transcoded, and marking the downloaded file to be transcoded as a first file to be processed; the file format information of the first file to be processed is the same as the file format information of the file to be transcoded; according to the file format information of the first file to be processed, converting the first file to be processed into a second file to be processed which meets the requirements of the file transcoding webpage; and then generating a resource locator of the second to-be-processed file, downloading the second to-be-processed file by using the resource locator of the second to-be-processed file, and using the downloaded second to-be-processed file in a process of file transcoding web pages. According to the method, through preprocessing operation on the input file, the input file is finally converted into a file format which can be supported by a file transcoding webpage system, so that the format requirement on the original input file in the webpage conversion process is reduced, and the success rate of webpage transcoding is improved.
Additional features and advantages of the invention will be set forth in the description which follows, or in part will be obvious from the description, or may be learned by practice of the invention.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for converting a file format according to an embodiment of the present invention;
fig. 2 is a flowchart of step S103 in a method for converting a file format according to an embodiment of the present invention;
fig. 3 is a flowchart of determining a second converted file to be processed in a method for converting a file format according to an embodiment of the present invention;
Fig. 4 is a flowchart for judging a format conversion result of a file to be transcoded in the method for converting a file format according to the embodiment of the present invention;
fig. 5 is a schematic structural diagram of a file format conversion system according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of another embodiment of a system for converting a file format;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Icon: 510-a file resource locator acquisition module; 520-a first file to be processed acquisition module; 530-a second file to be processed acquisition module; 540-a file format conversion generation module; 610-client; 620-a file transcoding web page system; 630-conversion system of file format; 640-a file format judgment service system; 650-a file format conversion service system; 660-file exception checking service system; 670-a file repair service module; 680-a distributed file storage system; 690-cache database; a 101-processor; 102-memory; 103-bus; 104-communication interface.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the prior art, the web page conversion process transcodes an input file into an available web page file through a corresponding file transcoding web page system. And the user sends the file to be transcoded to the file transcoding webpage system through the client, and then the webpage conversion process is completed through the file transcoding webpage system, so that the webpage file is finally generated. Because of the limited number of types of web page file formats, strict format requirements are placed on the input file prior to transcoding.
In the actual use process, the format of the input file uploaded by the user through the client is complex and various, but the input file format supported by the current file transcoding webpage system is less, so that the transcoding requirements of the input files in various formats are difficult to meet. The problem that the requirement on the format of an input file is high in the existing webpage conversion process is caused, and the success rate of webpage transcoding is further improved.
Based on the above, the embodiment of the invention provides a method, a system and an electronic device for converting a file format, which are used for finally converting the file format into a file format which can be supported by a file transcoding webpage system through preprocessing operation on an input file, so that the format requirement on the original input file in the webpage conversion process is reduced, and the success rate of webpage transcoding is improved.
For the sake of understanding the present embodiment, a method for converting a file format disclosed in the present embodiment will be described in detail.
Referring to a flowchart of a method for converting a file format shown in fig. 1, the method includes the steps of:
step S101, acquiring a resource locator of a file to be transcoded; the resource locator of the file to be transcoded contains file format information of the file to be transcoded.
The resource locator of the file to be transcoded is obtained by the user via the client. Specifically, the files to be transcoded are stored in the corresponding file storage systems in advance, and the resource locators are stored in the corresponding cache databases. And the user sends a request to the cache database through the client, and then the resource locator of the file to be transcoded can be obtained. And for the file to be transcoded locally at the user client, the file to be transcoded can be directly uploaded to the file storage system, and after the uploading is successful, the cache database is updated, and the corresponding resource locator is obtained.
The resource locator of the file to be transcoded contains file format information of the file to be transcoded, for example: the end field of the resource locator contains the format, name information of the file to be transcoded. The file format information is used as key information for determining the file format to be transcoded for use in subsequent steps.
Step S102, downloading the file to be transcoded by using a resource locator of the file to be transcoded, and marking the downloaded file to be transcoded as a first file to be processed; the file format information of the first file to be processed is the same as the file format information of the file to be transcoded.
The step is a file downloading step, the file to be transcoded is downloaded through the resource locator to serve as original processing data, and the original processing data is marked as a first file to be processed, so that the description of the subsequent steps is facilitated. It should be noted that the file format information of the first file to be processed is the same as the file format information of the file to be transcoded, so as to prevent the occurrence of an abnormality in the downloading process.
Step S103, converting the first to-be-processed file into a second to-be-processed file meeting the requirement of the file transcoding webpage according to the file format information of the first to-be-processed file.
The requirements of file transcoding web pages include two categories: format and content. In the implementation process, the format conversion can be firstly carried out on the first file to be processed, and the converted target format is a format supported by a file transcoding webpage system. Because the file has uncertainty in the format conversion process, the content of the converted first to-be-processed file needs to be scanned and judged after the conversion is completed, so that the requirement of the file transcoding webpage on the file format is met.
For example, according to the file format information of the first file to be processed, judging whether the file format meets the requirements of a file transcoding webpage system by judging the file header, the content, the file extension name and the like in the file format information; if format conversion is needed, the first file to be processed is converted into a format supported by the file transcoding webpage system through the corresponding file format conversion service system.
After the format conversion is completed, whether the content of the file to be processed meets the standard of a file transcoding webpage system or not needs to be judged, and if the content does not meet the standard, the file transcoding webpage system is repaired. For example, converting fonts in the file to be processed into fonts supported by a file transcoding webpage system; and formatting the file to be processed in the JSON (JavaScript Object Notation, JS object numbered musical notation) format according to the JSON format.
The first to-be-processed file obtains a second to-be-processed file through format conversion and content restoration, and the second to-be-processed file at the moment meets the requirements of the file transcoding webpage.
Step S104, generating a resource locator of the second to-be-processed file, downloading the second to-be-processed file by using the resource locator of the second to-be-processed file, and using the downloaded second to-be-processed file in a process of file transcoding web pages.
The resource locator of the second file to be processed is obtained through a corresponding cache database in a similar process to the file to be transcoded. After the second to-be-processed file is generated, the second to-be-processed file can be uploaded to the file storage system, and the cache database is updated after the second to-be-processed file is uploaded successfully so as to update the resource locator of the second to-be-processed file.
After the resource locator of the second to-be-processed file is obtained, the file can be used for a file transcoding process, the second to-be-processed file is downloaded, and the downloaded second to-be-processed file is used for a file transcoding webpage process.
According to the method for converting the file format provided by the embodiment, the method is used for finally converting the input file into the file format which can be supported by the file transcoding webpage system through preprocessing operation of the input file, so that the format requirement on the original input file in the webpage conversion process is reduced, and the success rate of webpage transcoding is improved.
In some embodiments, according to the file format information of the first to-be-processed file, the step S103 of converting the first to-be-processed file into the second to-be-processed file meeting the requirement of the file transcoding web page, as shown in fig. 2, includes:
Step S201, obtaining a preset input file support type and an output file support type; the input file support type is the type of the input file supported in the process of transcoding the webpage; the output file support type is the type of the output file supported in the process of transcoding the webpage by the file.
The final result of the file transcoding web page process is the web page type, so that the output file support type can be various files which can be supported by the web page. In a specific embodiment, the output file support types include: presentation output file, form output file, text output file, PDF output file and text output file, and one or more corresponding file formats;
the file format corresponding to the demonstration output file comprises: pptx, ppt;
the file format corresponding to the form output file comprises: xls, xlsx;
the file format corresponding to the text output file comprises: doc, docx;
the file format corresponding to the PDF output file comprises: pdf;
the text format corresponding to the text output file comprises: txt.
The output file is used as a final web page file and can be directly played through a browser, so that the output file is usually a text file, an office file and a related file capable of being edited by text.
Similar to the output file support type, the input file support type is the type of input file supported in the process of transcoding the web page. In a specific embodiment, the input file support types include: a presentation input file, a form input file, a text input file, a PDF input file and a text input file, wherein the file formats correspond to one or more of the above files;
the file format corresponding to the input file is demonstrated, which comprises the following steps: pptx, ppt, pot (PowerPoint template File Format), potx (PowerPoint template File Format), pps (PowerPoint presentation File Format), ppsx (PowerPoint presentation File Format), dps (WPS presentation File Format), dpt (WPS presentation File Format), pptm (PowerPoint File Format), potm (PowerPoint File Format), ppsm (PowerPoint File Format);
the file format corresponding to the form input file comprises: xls (format of Excel 1997-2003), xlt (format of Excel template file), et (format of WPS table file), ett (format of WPS table template file), xlsx (format of Excel 2007 and later), xltx (format of Excel 2007 and later), csv (command-Separated Values, comma Separated Values), xlsb (format of table file with macros), xlsm (format of XML-based and macro-enabled Excel 2007 and later), xltm (format of macro-enabled Excel 2007 and later template file);
The file format corresponding to the text input file comprises: doc (Document format), dot (Word template file), WPS (WPS Document mode), wpt (WPS template file), docx (Word 2007 and later), dotx (template file of Word 2007 and later), docm (macro-enabled Word 2007 and later), dotm (macro-enabled Word 2007 and later);
the file format corresponding to the PDF input file comprises: pdf;
the text format corresponding to the text input file comprises: lrc (lyric lyrics file), C (C language source file), cpp (c++ language source file), h (C language header file), asm (Assembly Language, assembly language file), s (assembly language source program file), java (java source code file), asp (Active Server Page, dynamic server page), bat (batch file), bas (VB module file), prg (Points Ranking Game source program file), cmd (linker configuration file), rtf (Rich Text Format), txt (Text Format file), xml (extensible markup language file), json (JavaScript Object Notation, json object numbered musical notation).
Step S202, format judgment is performed on file format information of a first file to be processed, and whether the first file to be processed meets an input file support type is determined.
After the input file support type and the output file support type are acquired, preliminary judgment is needed to be carried out on the file format of the first file to be processed, and whether the format of the first file to be processed meets the input file support type and the output file support type is determined.
Specifically, in step S202, a header, a content and an extension of a file included in the file format information of the first file to be processed may be obtained first; and then judging whether the first file to be processed meets the input file support type or not by using the file header, the file content and the file extension of the first file to be processed respectively.
If the format of the first file to be processed meets the input file support type and meets the output file support type, the process of transcoding the file into a webpage can be directly carried out without converting the file;
if the format of the first file to be processed does not meet the input file support type, but meets the output file support type, the file conversion is not needed, and the process of transcoding the file into a webpage is directly carried out on the file;
if the format of the first file to be processed meets the input file support type, but does not meet the output file support type; the first file to be processed needs to be converted, step S203 is performed.
In step S203, if the first to-be-processed file satisfies the input file support type and does not satisfy the output file support type, the first to-be-processed file is converted into a second to-be-processed file satisfying the output file support type.
In some embodiments, after the step S103 of converting the first to-be-processed file into the second to-be-processed file meeting the requirement of the file transcoding web page according to the file format information of the first to-be-processed file, it is required to determine whether the converted second to-be-processed file is abnormal. As shown in fig. 3, the method for converting a file format further includes:
step S301, acquiring a preset file format standard; the file format standard is a format standard required by the file in the process of transcoding the webpage.
The format standard refers to the format standard of the file transcoding webpage system for file requirements, and because uncertain abnormal conditions can occur in the file conversion process, the converted second to-be-processed file needs to be subjected to abnormal verification by utilizing the format standard required by the file transcoding webpage system. Standards for file formats may include fonts, content, coding, and the like.
Step S302, judging whether the second file to be processed meets the file format standard.
Step S303, if not, carrying out format conversion on the second file to be processed according to the file format standard.
For example, the file to be processed is a ppt format type file, wherein the font used is A; the file transcoding web page system does not contain the font library of the font A and only supports the font library of the font B. At this time, it is determined by S302 that the second to-be-processed file does not meet the file format standard, and then, according to step S303, the font a in the second to-be-processed file is converted into the font B.
For example, the file to be processed is a json type file, but the content format of the file is not laid out according to the json tag format; at this time, it is determined by step S302 that the second to-be-processed file does not meet the file format standard, and then, according to step S303, the contents of the second to-be-processed file are formatted and typeset again according to the six constructional characters, the character strings, the numbers and the three literal names included in the json tag.
In some embodiments, before the step S102 of downloading the file to be transcoded by using the resource locator of the file to be transcoded and marking the downloaded file to be transcoded as the first file to be processed, it is required to determine whether the resource locator has been processed, so as to determine whether the file to be transcoded has completed format conversion, as shown in fig. 4, and the method for converting the file format further includes:
In step S401, it is determined whether the conversion of the resource locator of the file to be transcoded is completed.
The result of the conversion can be directly set in the resource locator through the mark, and whether the file to be transcoded is converted is judged through judging the mark. If the file to be transcoded has completed conversion, the corresponding tag in the corresponding resource locator also needs to be updated.
Step S402, if yes, the resource locator of the file to be transcoded is used for downloading the file to be transcoded, and the downloaded file to be transcoded is used for the process of transcoding the webpage.
If the file to be transcoded has completed the conversion, it is indicated that the file to be transcoded can meet the requirements of the file transcoding web page system, at this time, the subsequent conversion step can be omitted, the file downloading is directly performed by using the resource locator with the transcoded file, and the file to be transcoded is used for the file transcoding web page process.
The method for converting the file format according to the above embodiment can be known, where the method first obtains a resource locator of a file to be transcoded; the resource locator of the file to be transcoded comprises file format information of the file to be transcoded; then, downloading the file to be transcoded by using the resource locator of the file to be transcoded, and marking the downloaded file to be transcoded as a first file to be processed; the file format information of the first file to be processed is the same as the file format information of the file to be transcoded; according to the file format information of the first file to be processed, converting the first file to be processed into a second file to be processed which meets the requirements of the file transcoding webpage; and then generating a resource locator of the second to-be-processed file, downloading the second to-be-processed file by using the resource locator of the second to-be-processed file, and using the downloaded second to-be-processed file in a process of file transcoding web pages. According to the method, through preprocessing operation on the input file, the input file is finally converted into a file format which can be supported by a file transcoding webpage system, so that the format requirement on the original input file in the webpage conversion process is reduced, and the success rate of webpage transcoding is improved.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a system for converting a file format, where the system is used for a process of transcoding a web page from a file, and a schematic structure of the system is shown in fig. 5, and the system includes:
a file resource locator obtaining module 510, configured to obtain a resource locator of a file to be transcoded; the resource locator of the file to be transcoded comprises file format information of the file to be transcoded;
the first to-be-processed file obtaining module 520 is configured to download the to-be-transcoded file using the resource locator of the to-be-transcoded file, and mark the downloaded to-be-transcoded file as the first to-be-processed file; the file format information of the first file to be processed is the same as the file format information of the file to be transcoded;
the second to-be-processed file obtaining module 530 is configured to convert the first to-be-processed file into a second to-be-processed file that meets the requirement of the file transcoding web page according to the file format information of the first to-be-processed file;
the file format conversion generating module 540 is configured to generate a resource locator of the second to-be-processed file, download the second to-be-processed file by using the resource locator of the second to-be-processed file, and use the downloaded second to-be-processed file in a process of file transcoding the web page.
The file format conversion system provided by the embodiment of the invention has the same technical characteristics as the file format conversion method provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved. For a brief description, reference is made to the corresponding content of the preceding method embodiments, where the examples section is not mentioned.
The following describes a file format conversion process in conjunction with a schematic structural diagram of another file format conversion system, as shown in fig. 6.
The client 610 sends the URL of the file to be transcoded to the file transcoding web system 620 for transcoding; the file transcoding web system 620 sends the received URL of the file to be transcoded to the conversion system 630 of the file format for format conversion.
If the URL to be transcoded has been processed, the conversion system 630 in the file format returns the URL of the file directly from the cache database 690 and performs the transcoding process using the file transcoding web system 620.
If the URL to be transcoded is not processed, the conversion system 630 in the file format downloads the file according to the URL to be transcoded, marks the downloaded file to be processed as the first file to be processed, and performs type judgment on the first file to be processed through the file format judgment service system 640. Specifically, the file format determining service system 640 determines whether the file is the input file type supported by the file transcoding web system 620 by reading the file header, the content, and the file extension of the first file to be processed.
If the first to-be-processed file is an input type supported by the file-transcoding web-page system 620, but not an output file type supported by the file-transcoding web-page system 620, the first to-be-processed file is converted into a second to-be-processed file of the file type outputted by the file-transcoding web-page system 620 using the file format conversion service system 650.
The converted second to-be-processed file passes through the file exception checking service system 660 to determine whether the content of the second to-be-processed file meets the file standard of the file transcoding web system 620. And if not, repairing the second to-be-processed file by using the file repairing service module 670. If the second to-be-processed file is a ppt type file and the file font library is not supported by the file transcoding web system 620, converting the fonts in the second to-be-processed file into default fonts supported by the file transcoding web system 620; if the second file to be processed is a json file, but the content format of the file is not laid out according to the json tag format, the content of the second file to be processed is formatted and typeset again according to six construction characters, character strings, numbers and three literal names contained in the json tag.
The second pending file is uploaded to the distributed file storage system 680 and the URL of the second pending file is obtained, where the second pending file meets the output file type of the file transcoding web system 620. While saving the URL to the cache database 690 and returning the URL to the file transcoded web system 620.
The file-transcoding web-page system 620 downloads the file from the distributed file-storage system 680 according to the URL of the second pending file and uses the file for subsequent processes of the file-transcoding web-page.
According to the conversion system of the file format, which is mentioned in the embodiment, the system can finally convert the file format into the file format which can be supported by the file transcoding webpage system through preprocessing operation on the input file, so that the format requirement on the original input file in the webpage conversion process is reduced, and the success rate of webpage transcoding is improved.
The embodiment also provides an electronic device, and a schematic structural diagram of the electronic device is shown in fig. 7, where the device includes a processor 101 and a memory 102; the memory 102 is configured to store one or more computer instructions, where the one or more computer instructions are executed by the processor to implement the method for converting a file format as described above.
The electronic device shown in fig. 7 further comprises a bus 103 and a communication interface 104, the processor 101, the communication interface 104 and the memory 102 being connected by the bus 103.
The memory 102 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. Bus 103 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 7, but not only one bus or type of bus.
The communication interface 104 is configured to connect with at least one user terminal and other network units through a network interface, and send the encapsulated IPv4 message or the IPv4 message to the user terminal through the network interface.
The processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 101 or instructions in the form of software. The processor 101 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks of the disclosure in the embodiments of the disclosure may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present disclosure may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 102, and the processor 101 reads information in the memory 102, and in combination with its hardware, performs the steps of the method of the previous embodiment.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the preceding embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, indirect coupling or communication connection of devices or units, electrical, mechanical, or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. A method for converting a file format, the method being applied to a process of transcoding a web page of a file, the method comprising:
acquiring a resource locator of a file to be transcoded; wherein, the resource locator of the file to be transcoded contains file format information of the file to be transcoded; the resource locator is pre-stored in a cache database;
downloading the file to be transcoded by utilizing the resource locator of the file to be transcoded, and marking the downloaded file to be transcoded as a first file to be processed; the file format information of the first file to be processed is the same as the file format information of the file to be transcoded;
according to the file format information of the first file to be processed, converting the first file to be processed into a second file to be processed which meets the requirements of the file transcoding webpage;
generating a resource locator of the second to-be-processed file, downloading the second to-be-processed file by using the resource locator of the second to-be-processed file, and using the downloaded second to-be-processed file for a file transcoding webpage;
according to the file format information of the first to-be-processed file, the step of converting the first to-be-processed file into a second to-be-processed file meeting the requirement of the file transcoding webpage comprises the following steps:
Acquiring a preset input file support type and an output file support type; the input file support type is the type of the input file supported in the process of transcoding the webpage; the output file support type is the type of the output file supported in the process of transcoding the webpage;
carrying out format judgment on the file format information of the first file to be processed, and determining whether the first file to be processed meets the input file support type;
and if the first to-be-processed file meets the input file supporting type and does not meet the output file supporting type, converting the first to-be-processed file into the second to-be-processed file meeting the output file supporting type.
2. The method of claim 1, wherein the input file support type comprises: a presentation input file, a form input file, a text input file, a PDF input file and a text input file, wherein the file formats correspond to one or more of the above files;
the file format corresponding to the demonstration input file comprises: pptx, ppt, pot, potx, pps, ppsx, dps, dpt, pptm, potm, ppsm;
the file format corresponding to the table input file comprises: xls, xlt, et, ett, xlsx, xltx, csv, xlsb, xlsm, xltm;
The file format corresponding to the text input file comprises: doc, dot, wps, wpt, docx, dotx, docm, dotm;
the file format corresponding to the PDF input file comprises: pdf;
the text format corresponding to the text input file comprises: lrc, c, cpp, h, asm, s, java, asp, bat, bas, prg, cmd, rtf, txt, xml, json.
3. The method of claim 1, wherein the output file support type comprises: presentation output file, form output file, text output file, PDF output file and text output file, and one or more corresponding file formats;
the file format corresponding to the demonstration output file comprises: pptx, ppt;
the file format corresponding to the table output file comprises: xls, xlsx;
the file format corresponding to the text output file comprises: doc, docx;
the file format corresponding to the PDF output file comprises: pdf;
the text format corresponding to the text output file comprises: txt.
4. The method of claim 1, wherein performing a format determination on file format information of the first file to be processed, determining whether the first file to be processed satisfies the input file support type, comprises:
Acquiring a file header, file content and a file extension contained in the file format information of the first file to be processed;
and judging whether the first file to be processed meets the input file support type or not by using the file header, the file content and the file extension of the first file to be processed.
5. The method of claim 1, wherein after the step of converting the first to-be-processed file into a second to-be-processed file satisfying file transcoding web page requirements according to file format information of the first to-be-processed file, the method further comprises:
acquiring a preset file format standard; the file format standard is a format standard required by a file in the process of transcoding the webpage;
judging whether the second file to be processed meets the file format standard or not;
if not, carrying out format conversion on the second file to be processed according to the file format standard.
6. The method of claim 1, wherein prior to the step of downloading the file to be transcoded using the resource locator of the file to be transcoded and marking the downloaded file to be transcoded as the first file to be processed, the method further comprises:
Judging whether the resource locator of the file to be transcoded has completed conversion;
and if so, downloading the file to be transcoded by using the resource locator of the file to be transcoded, and using the downloaded file to be transcoded for a file transcoding webpage.
7. A system for converting a file format, the system being applied to a process for transcoding web pages from a file, the system comprising:
the file resource locator acquisition module is used for acquiring a resource locator of a file to be transcoded; wherein, the resource locator of the file to be transcoded contains file format information of the file to be transcoded; the resource locator is pre-stored in a cache database;
the first to-be-processed file acquisition module is used for downloading the to-be-transcoded file by utilizing the resource locator of the to-be-transcoded file and marking the downloaded to-be-transcoded file as a first to-be-processed file; the file format information of the first file to be processed is the same as the file format information of the file to be transcoded;
the second to-be-processed file acquisition module is used for converting the first to-be-processed file into a second to-be-processed file meeting the requirement of the file transcoding webpage according to the file format information of the first to-be-processed file;
The file format conversion generating module is used for generating a resource locator of the second to-be-processed file, downloading the second to-be-processed file by utilizing the resource locator of the second to-be-processed file, and using the downloaded second to-be-processed file in a file transcoding webpage process;
the second to-be-processed file obtaining module is further used for: acquiring a preset input file support type and an output file support type; the input file support type is the type of the input file supported in the process of transcoding the webpage; the output file support type is the type of the output file supported in the process of transcoding the webpage; carrying out format judgment on the file format information of the first file to be processed, and determining whether the first file to be processed meets the input file support type; and if the first to-be-processed file meets the input file supporting type and does not meet the output file supporting type, converting the first to-be-processed file into the second to-be-processed file meeting the output file supporting type.
8. An electronic device, comprising: a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, implements the steps of the method of converting a file format as claimed in any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor realizes the steps of the method for converting a file format according to any of the preceding claims 1 to 6.
CN202011511068.8A 2020-12-18 2020-12-18 File format conversion method and system and electronic equipment Active CN112463731B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011511068.8A CN112463731B (en) 2020-12-18 2020-12-18 File format conversion method and system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011511068.8A CN112463731B (en) 2020-12-18 2020-12-18 File format conversion method and system and electronic equipment

Publications (2)

Publication Number Publication Date
CN112463731A CN112463731A (en) 2021-03-09
CN112463731B true CN112463731B (en) 2023-06-16

Family

ID=74803126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011511068.8A Active CN112463731B (en) 2020-12-18 2020-12-18 File format conversion method and system and electronic equipment

Country Status (1)

Country Link
CN (1) CN112463731B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677730A (en) * 2013-12-20 2014-03-26 北京奇虎科技有限公司 Method and device for displaying files in browser
CN105589957A (en) * 2015-12-22 2016-05-18 新浪网技术(中国)有限公司 Document conversion method and document conversion system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7702995B2 (en) * 2000-04-24 2010-04-20 TVWorks, LLC. Method and system for transforming content for execution on multiple platforms
US11030537B2 (en) * 2017-09-25 2021-06-08 Microsoft Technology Licensing, Llc Intelligent inferences of authoring from document layout and formatting
CN110018984A (en) * 2017-10-31 2019-07-16 北京国双科技有限公司 A kind of conversion method and device of file format
CN111475477A (en) * 2019-01-23 2020-07-31 北京二六三企业通信有限公司 File format conversion method, client and format conversion server
US11379496B2 (en) * 2019-04-18 2022-07-05 Oracle International Corporation System and method for universal format driven data transformation and key flex fields in a analytic applications environment
CN111476002B (en) * 2020-04-07 2021-01-15 北京东方金信科技股份有限公司 Data file coding format conversion method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103677730A (en) * 2013-12-20 2014-03-26 北京奇虎科技有限公司 Method and device for displaying files in browser
CN105589957A (en) * 2015-12-22 2016-05-18 新浪网技术(中国)有限公司 Document conversion method and document conversion system

Also Published As

Publication number Publication date
CN112463731A (en) 2021-03-09

Similar Documents

Publication Publication Date Title
CN110597500B (en) Method and device for serialization and deserialization of message structure
US20100312821A1 (en) Web Page Optimization
US7908344B2 (en) Methods, apparatus, and systems for providing local and online data services
CN107704615B (en) Webpage font display method and system based on Chinese font subset
CN109978629B (en) Advertisement putting method and device, electronic equipment and storage medium
CN111309312B (en) Editing method and device for rich text object, terminal equipment and computer storage medium
Balfanz et al. FIDO U2F Javascript API
CN111858376A (en) Request message generation method and interface test method
US9798721B2 (en) Innovative method for text encodation in quick response code
CN113382083A (en) Webpage screenshot method and device
CN107463536A (en) A kind of method and system for realizing document in online preview server in Android device
US9317489B2 (en) Vector graphic conversion into fonts
CN103024098A (en) Domain name resolution method, system and device
CN112463731B (en) File format conversion method and system and electronic equipment
CN111124924B (en) API deployment method and device, electronic equipment and storage medium
CN112947900B (en) Web application development method and device, server and development terminal
CN104378362A (en) Method and device for carrying out conversion of message interfaces
US8234412B2 (en) Method and system for transmitting compacted text data
JP5885702B2 (en) Image forming apparatus and web page language adding method
CN112487765B (en) Method and device for generating notification text
CN113626392A (en) Method and device for updating document data, electronic equipment and storage medium
CN113961286A (en) Page generation method, device and equipment for application program
KR101560159B1 (en) Method and apparatus for outputting replacing electronic documents
CN112749353A (en) Processing method and device of webpage icon
CN112632332A (en) Configurable verification method, system, equipment and storage medium for XML file

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
GR01 Patent grant
GR01 Patent grant