CN105045802B - A kind of polymorphic type previewing file system of message-driven - Google Patents

A kind of polymorphic type previewing file system of message-driven Download PDF

Info

Publication number
CN105045802B
CN105045802B CN201510264911.XA CN201510264911A CN105045802B CN 105045802 B CN105045802 B CN 105045802B CN 201510264911 A CN201510264911 A CN 201510264911A CN 105045802 B CN105045802 B CN 105045802B
Authority
CN
China
Prior art keywords
html
file
preview
message
jpg
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
CN201510264911.XA
Other languages
Chinese (zh)
Other versions
CN105045802A (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 Yifangyun Network Science & Technology Co Ltd
Original Assignee
Hangzhou Yifangyun Network Science & 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 Hangzhou Yifangyun Network Science & Technology Co Ltd filed Critical Hangzhou Yifangyun Network Science & Technology Co Ltd
Priority to CN201510264911.XA priority Critical patent/CN105045802B/en
Publication of CN105045802A publication Critical patent/CN105045802A/en
Application granted granted Critical
Publication of CN105045802B publication Critical patent/CN105045802B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/904Browsing; Visualisation therefor
    • 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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs

Landscapes

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

Abstract

The invention discloses a kind of polymorphic type previewing file systems of message-driven, including trigger assembly: when triggering for the source file preview request information by user, solicited message being converted to preview request message, and be sent to message queue;Message queue: the preview request information persistence received is saved;Linux cluster: it is used for monitoring information queue preview request message, then the source file of preview request message is converted into preview file;Windows cluster: for Office document to be converted into type PDF preview file when by Linux cluster preview request message trigger;Preview component exhibiting: for corresponding preview file being sent to preview component exhibiting and is shown in the triggering by Linux cluster.The present invention can be used in the various terminals such as computer, mobile phone and plate, eliminate the various huge professional softwares of installation, to can greatly facilitate user by this system with the file of the various formats of preview.

Description

A kind of polymorphic type previewing file system of message-driven
Technical field
The present invention relates to file processing technology field more particularly to a kind of polymorphic type previewing file systems of message-driven.
Background technique
With the continuous development of computer technology and Internet technology, the type of file is more and more on internet, data Shared demand is also more and more, and previous user obtains file from internet, needs oneself to judge file type, then install The browsing software of profession could open various types of file, and various professional softwares obtain unsuitable, bulky, valence Lattice are high, and very big puzzlement is brought to user.
Netease has information technology (Beijing) Co., Ltd in Patent No. filed on October 08th, 2006 " a kind of search result quickly previewing device based on search engine " is proposed in 200610113599.5 patent, but it is this Prebrowsing system can only preview web page contents, the pre- of the various types file occurred under fast-developing internet environment can not be adapted to Look at requirement;Patent of the G-cloud Technology Co., Ltd. in Patent No. 201310743351.7 filed on December 29th, 2013 In propose " a kind of online method for previewing of file " and Shenzhen Yuanxing Technology Co., Ltd. on 07 06th, 2012 apply Patent No. 201210233929.X patent in propose that " one kind is based on Hadoop distributed document method for previewing and its being System ", Office document is generally realized in this preview for Office document class file using WPS or OpenOffice To the conversion of PDF document, so that Microsoft Office document preview experience difference and format formula can be brought to show mistake etc. A series of problems, and this just for document class file preview can not also adapt to occur under fast-developing internet environment The requirement of various types previewing file, and realize preview for using the highest Microsoft Office of occupation rate of market and turn It changes, the prior art can't reach such requirement, even if reaching requirement, the cost spent is also very high.
In addition, Shenzhen Zhongbo Kechuang Information Technology Co., Ltd. is in Patent No. filed on May 12nd, 2014 " a kind of method and document handling system of preview file " proposed in 201410199197.6 patent, based on FLASH's Previewing file is to translate the file into greatly to influence for SWF file format since the speed of SWF file conversion is also relatively slow The efficiency of prebrowsing system.
Particularly, the API that existing prebrowsing system is mostly used the third party manufacturer of OpenOffice or WPS etc is carried out The preview of Office document, and this mode preview mode can not accurately show the quality contents such as complicated chart and mathematical formulae, And there is not yet any preview platform for technical documents such as cad file, POSTSCRIPT file and eps files, user is necessary It huge professional software is first installed could open and check, be not very convenient to use.
In short, files various for preview need first to install corresponding professional document viewer in the prior art, it just can be pre- Look at document content, greatly inconvenience user uses, while can also spend user's much unnecessary time and efforts.
Summary of the invention
Aiming at the shortcomings in the prior art, the present invention provides user-friendly, the one of user time and energy is saved The polymorphic type previewing file system of kind message-driven.
To achieve the goals above, the technical solution used in the present invention is:
A kind of polymorphic type previewing file system of message-driven, including
Trigger assembly: when triggering for the source file preview request information by user, solicited message is converted into preview Request message, and be sent to message queue, the source file format include DOC, DOCX, ODT, RTF, XLS, XLSX, ODS, TSV, CSV, PPT, PPTX, ODP, PSD, PDF, PNG, JPG, JPEG, GIF, TIF, TIFF, BMP, SVG, AIX, ICO, MARKDOWN, MD, MDOWN, PS, AI, EPS, HTML, XHTML, HTM, AS, AS3, ASM, BAT, C, CC, CMAKE, CPP, CS, CSH, CSS, CXX, DIFF, ERB, GROOVY, H, HAML, HH, JAVA, JS, LESS, M, MAKE, ML, MM, PHP, PL, PLIST, PROPERTIES, PY, RB, SASS, SCALA, SCM, SCRIPT, SH, SML, SQL, TXT, VI, VIM, XML, XSD, XSL, The file formats such as XSLT, YAML, DWG, DWF, DXF, user's preview request may include multiple object formats;
Message queue: the preview request information persistence for will receive saves, and solicited message is avoided to lose;
Linux cluster: it is converted for the preview request message of monitoring information queue, then by the source file of preview request message At preview file, the preview file format is PDF and JPG, and the Linux cluster is made of at least 2 Linux servers, The Linux server includes task distributed components, task resolution component and file transition components.Task distributed components are for supervising Preview request information is issued task resolution component by the preview request information for hearing message queue, wherein the task distribution group The number of tasks that part can be configured while be handled according to demand, to carry out concurrent flow control;Task resolution component is in the future A corresponding file translation lists are parsed into from the preview request message of task distributed components, by file translation lists Sequence successively calls corresponding specific transition components in file transition components, source file is converted into preview file, when all turns It changes after the completion of task to pass through task distributed components corresponding preview file is sent to preview component exhibiting and is shown preview, Middle task resolution component is pre-configured with using tree structure, switch process needed for from original document to certain file destination Path for the paths in tree structure, multiple format conversion is merged into a convert task tree, when task resolution component After receiving preview request message, according to minimal spanning tree algorithm, generate from preconfigured tree-like task chain comprising all pre- It lookes at the smallest subtree of target, generates corresponding file convert task queue finally by breadth traversal subtree, reuse synchronization Mechanism successively calls corresponding specific transition components in file transition components, to complete corresponding file format conversion, example Next convert task is such as carried out again after the completion of a task, and wherein task resolution component supports the conversion based on time window It is retried after failure retry mechanism, that is, mission failure, the frequency of failure is greater than some configuration item within a certain period of time, then it is assumed that turn It changes unsuccessfully, while task resolution component also support section Mission Success, to its turn after some file convert requests retries unsuccessfully It changes Task Tree and carries out beta pruning, the child node of all failed tasks is all removed from file conversion message queue, and will be corresponding Preview target label is failure, while retaining remaining convert task, continues to convert;There are many specific for file transition components Type, for source file to be converted into preview file or intermediate form file, so as to be carried out in preview component exhibiting Corresponding preview file is sent to preview component exhibiting by task distributed components after all convert and opened up by preview Show preview, and file transition components can detect file content first before starting format conversion, so as to filter out content With the unmatched file of extension name, avoids malicious attack and influence system stability, a variety of concrete types in file transition components There are DOC- > PDF, DOCX- > PDF, ODT- > PDF, RTF- > PDF, XLS- > PDF, XLSX- > PDF, ODS- > PDF, TSV- > PDF, CSV- > PDF, PPT- > PDF, PPTX- > PDF, ODP- > PDF, PSD- > JPG, PDF- > JPG, PNG- > JPG, JPG- > JPG, JPEG- > JPG, GIF- > JPG, TIF- > JPG, TIFF- > JPG, BMP- > JPG, SVG- > JPG, AIX- > JPG, ICO- > JPG, MARKDOWN- > HTML, MD- > HTML, MDOWN- > HTML, PS- > JPG, AI- > JPG, EPS- > JPG, HTML- > PDF, XHTML- > PDF, HTM- > PDF, AS- > HTML, AS3- > HTML, ASM- > HTML, BAT- > HTML, C- > HTML, CC- > HTML, CMAKE- > HTML, CPP- > HTML, CS- > HTML, CSH- > HTML, CSS- > HTML, CXX- > HTML, DIFF- > HTML, ERB- > HTML, GROOVY- > HTML, H- > HTML, HAML- > HTML, HH- > HTML, JAVA- > HTML, JS- > HTML, LESS- > HTML, M- > HTML, MAKE- > HTML, ML- > HTML, MM- > HTML, PHP- > HTML, PL- > HTML, PLIST- > HTML, PROPERTIES- > HTML, PY- > HTML, RB- > HTML, SASS- > HTML, SCALA- > HTML, SCM- > HTML, SCRIPT- > HTML, SH- > HTML, SML- > HTML, SQL- > HTML, TXT- > HTML, VI- > HTML, VIM- > HTML, XML- > HTML, XSD- > HTML, XSL- > HTML, XSLT- > HTML, YAML- > HTML, DWG- > JPG, DWF- > JPG, DXF- > JPG etc., and support flexibly to match It sets, increases and decreases at any time;
Windows cluster: for being converted into Office document when by Linux cluster preview request message trigger Type PDF preview file, the Windows cluster are made of at least 2 Windows servers, and Windows server includes disappearing Listening components, working condition component, task execution component, Office file transition components, bridge joint DLL component, Office is ceased to turn DLL component and share directory component are changed, the Office file transition components pass sequentially through bridge joint DLL component and Office conversion DLL component finally calls Microsoft Office Interop API that the source file in share directory is converted to target text Part, the share directory component and Linux cluster of Windows cluster carry out file-sharing, Windows collection by CIFS protocol mode The message listening components and Linux cluster of group carry out message exchange by Akka Remote Actor mechanism.Message listening components It is communicated with Linux server, message listening components are used to receive heartbeat message and preview from Linux server and ask Seek message, message listening components distributed tasks message gives task execution component, while message listening components send heartbeat message and Preview file message is to Linux server;Wherein working condition component for save Windows server interior joint Word, Whether tri- kinds of conversion class working conditions of Excel, PowerPoint are occupied, transmit in reply or active transmission heartbeat message To Linux server;Task execution component passes through Office file transition components, bridge joint DLL component according to received task Source file is converted into preview file with Office conversion DLL component;Task execution component is adjusted according to received task message File conversion is carried out with method different in Office file transition components, and the transformation result notification message converted is supervised Listen component 109;Office file transition components receive the task message of task execution component, then for every kind of translation type Using singleton pattern, C++ bridging code is called to complete conversion work in a manner of JNA;DLL component is bridged as Transformation Service Java Bridge between code and practical conversion C# code, when Office file transition components call the bridge joint DLL component in a manner of JNA Afterwards, bridge joint DLL component calls Office to convert DLL component in a manner of COM;The C# code that Office converts DLL component calls Microsoft Office Interop API carries out opening, preview optimization and the pdf document export of Office file, with DLL mode is registered to system program collection;Share directory component is mounted to Linux clothes by CIFS mode on Windows server It is engaged on device, it, can also be to avoid repeated downloads source document for the transmitting of source file and target pdf document between two kinds of servers Part;Office conversion DLL component reads the Office file for needing to convert from share directory component, completes conversion and later will Pdf document is written in share directory component;The document that Windows cluster is supported not only includes that Microsoft Office is generated The conventional documents such as DOC, DOCX, XLS, XLSX, PPT, PPTX, also support RTF, WPS, ODP, ODT, DPS, CSV, TSV, ET with And the various complex documents under MESSAGE/RFC822 agreement;
Preview component exhibiting: in the triggering by Linux cluster, corresponding preview file to be sent to preview exhibition Show that component is shown.
The trigger assembly and preview component exhibiting are Web or Android or iOS user platform.
Beneficial effects of the present invention: after trigger assembly receives preview request information first, solicited message is converted to pre- Request message of looking at is sent in message queue, is saved by message queue persistence, solicited message is avoided to lose, then Linux Cluster carries out parsing and the conversion of various previewing file formats after getting preview request message from message queue, and Corresponding preview file information, to the conversion of type PDF, is sent to by Windows cluster for Office document after converting Preview component exhibiting carries out the displaying of preview file, and wherein Linux cluster and Windows cluster support the file of multiple format pre- Look at, without installing professional document viewer in the case where can preview document content, it is convenient for users, save user when Between and energy;The API that prebrowsing system is mostly used the third party manufacturer of OpenOffice or WPS etc in the prior art is carried out The preview of Office document, can not accurately show complicated chart, the effect of the quality contents such as mathematical formulae, and the present invention uses The primary API of Microsoft Office carries out Office document preview, greatly reduces the effect of all kinds of complicated charts, mentions High user experience, it is ineffective when also solving current most of prebrowsing system preview complexity Office documents to ask Topic;In addition, trigger assembly and preview component exhibiting of the invention are tri- user platforms of Web or Android or iOS, Yong Huke With preview file on a variety of platforms whenever and wherever possible, round-the-clock no dead angle is very convenient and practical, in short, the present invention can be used for Computer, mobile phone, the various platforms such as plate, user only need to open file with the present invention, can quickly previewing file content, it is convenient Fast, simple and practical.
Detailed description of the invention
Fig. 1 is system structure diagram of the invention;
Fig. 2 is Linux server structural schematic diagram of the invention;
Fig. 3 is Windows server architecture schematic diagram of the invention;
Fig. 4 is the tree-like convert task chain schematic diagram of task resolution component in Linux server of the present invention;
Fig. 5 is in Fig. 4 task chain comprising D, G, the minimum spanning tree schematic diagram of E targets preview;
Fig. 6 is flow chart of the present invention.
Specific embodiment
Referring to FIG. 1, FIG. 2 and FIG. 3, the polymorphic type previewing file system of a kind of message-driven, including with lower component,
Trigger assembly 101 is converted to solicited message pre- when triggering for the source file preview request information by user It lookes at request message, and is sent to message queue 102, the source file format includes DOC, DOCX, ODT, RTF, XLS, XLSX, ODS, TSV, CSV, PPT, PPTX, ODP, PSD, PDF, PNG, JPG, JPEG, GIF, TIF, TIFF, BMP, SVG, AIX, ICO, MARKDOWN, MD, MDOWN, PS, AI, EPS, HTML, XHTML, HTM, AS, AS3, ASM, BAT, C, CC, CMAKE, CPP, CS, CSH, CSS, CXX, DIFF, ERB, GROOVY, H, HAML, HH, JAVA, JS, LESS, M, MAKE, ML, MM, PHP, PL, PLIST, PROPERTIES, PY, RB, SASS, SCALA, SCM, SCRIPT, SH, SML, SQL, TXT, VI, VIM, XML, XSD, XSL, The file formats such as XSLT, YAML, DWG, DWF, DXF, user's preview request may include multiple object formats;
When triggering for being toggled component 101, the preview request information persistence received is protected for message queue 102 It deposits, solicited message is avoided to lose;
Linux cluster 103 is used for 102 preview request message of monitoring information queue, then by the source file of preview request message It is converted into preview file, the preview file format is PDF and JPG, and the Linux cluster 103 is serviced by least 2 Linux Device composition, the Linux server includes task distributed components 106, task resolution component 107 and file transition components 108.Appoint Business distributed components 106 are used to listen to the preview request information of message queue 102, and preview request information is issued task parsing group Part 107, wherein the number of tasks that the task distributed components 106 can be configured while be handled according to demand, to concurrently be flowed Amount control;Task resolution component 107 be used for by the preview request message from task distributed components 106 be parsed into one it is corresponding File translation lists successively call corresponding specific conversion in file transition components 108 by the sequence in file translation lists Source file is converted into preview file by component, and passing through task distributed components 106 after the completion of all convert tasks will be corresponding pre- File of looking at is sent to preview component exhibiting 105 and is shown preview, and wherein task resolution component 107 is carried out pre- using tree structure It first configures, switch process needed for from original document to certain file destination is the paths in tree structure, multiple format The path of conversion is merged into a convert task tree, after task resolution component 107 receives preview request message, according to most your pupil At tree algorithm, the smallest subtree comprising all preview targets is generated from preconfigured tree-like task chain, finally by wide Degree traversal subtree generates corresponding file convert task queue, reuses synchronization mechanism and successively calls in file transition components 108 Corresponding specific transition components to complete corresponding file format conversion, such as carry out down again after the completion of a task One convert task, wherein task resolution component 107 supports convert failed retry mechanism, that is, mission failure based on time window After retried, within a certain period of time the frequency of failure be greater than some configuration item, then it is assumed that convert failed, while task resolution component Also support section Mission Success carries out beta pruning to its convert task tree after some file convert requests retries unsuccessfully, is lost The child node for losing task is all removed from file conversion message queue, and is failure by corresponding preview target label, simultaneously Retain remaining convert task, continues to convert;There are many concrete types for file transition components 108, for turning source file It changes preview file or intermediate form file into, so as to carry out preview in preview component exhibiting 105, is converted when all It corresponding preview file is sent to preview component exhibiting 105 by task distributed components 106 is shown preview at rear, and File transition components 108 can detect file content first before starting format conversion, so as to filter out content and extension name Unmatched file avoids malicious attack and influences system stability, and a variety of concrete types have DOC- in file transition components 108 > PDF, DOCX- > PDF, ODT- > PDF, RTF- > PDF, XLS- > PDF, XLSX- > PDF, ODS- > PDF, TSV- > PDF, CSV- > PDF, PPT- > PDF, PPTX- > PDF, ODP- > PDF, PSD- > JPG, PDF- > JPG, PNG- > JPG, JPG- > JPG, JPEG- > JPG, GIF- > JPG, TIF- > JPG, TIFF- > JPG, BMP- > JPG, SVG- > JPG, AIX- > JPG, ICO- > JPG, MARKDOWN- > HTML, MD- > HTML, MDOWN- > HTML, PS- > JPG, AI- > JPG, EPS- > JPG, HTML- > PDF, XHTML- > PDF, HTM- > PDF, AS- > HTML, AS3- > HTML, ASM- > HTML, BAT- > HTML, C- > HTML, CC- > HTML, CMAKE- > HTML, CPP- > HTML, CS- > HTML, CSH- > HTML, CSS- > HTML, CXX- > HTML, DIFF- > HTML, ERB- > HTML, GROOVY- > HTML, H- > HTML, HAML- > HTML, HH- > HTML, JAVA- > HTML, JS- > HTML, LESS- > HTML, M- > HTML, MAKE- > HTML, ML- > HTML, MM- > HTML, PHP- > HTML, PL- > HTML, PLIST- > HTML, PROPERTIES- > HTML, PY- > HTML, RB- > HTML, SASS- > HTML, SCALA- > HTML, SCM- > HTML, SCRIPT- > HTML, SH- > HTML, SML- > HTML, SQL- > HTML, TXT- > HTML, VI- > HTML, VIM- > HTML, XML- > HTML, XSD- > HTML, XSL- > HTML, XSLT- > HTML, YAML- > HTML, DWG- > JPG, DWF- > JPG, DXF- > JPG etc., and support flexible configuration, increase and decrease at any time;
Windows cluster 104 is used to turn Office document when by 103 preview request message trigger of Linux cluster Change type PDF preview file into, the Windows cluster 104 is made of at least 2 Windows servers, Windows service Device include message listening components 109, working condition component 110, task execution component 111, Office file transition components 112, DLL component (C++) 113, Office conversion DLL component (.NET Framework c#) 114 and share directory component 115 are bridged, The Office file transition components 114 pass sequentially through bridge joint DLL component 113 and Office conversion DLL component 114 finally calls Source file in share directory component 115 is converted to file destination by Microsoft Office Interop API, is such as passed through Office converts DLL component 114 and calls Microsoft Office Interop API in share directory component 115 Office source file is converted to PDF preview file, and the share directory component 115 and Linux cluster 103 of Windows cluster 104 are logical It crosses CIFS protocol mode and carries out file-sharing, the message listening components 109 and Linux cluster 103 of Windows cluster 104 pass through Akka Remote Actor mechanism carries out message exchange, when using adaptive between Windows cluster 104 and Linux cluster 103 Between the bidirectional broadcast heartbeat mechanism that is spaced, the state of each server of real-time servicing.Message listening components 109 come from for receiving The heartbeat message and preview request message of Linux server, 109 distributed tasks message of message listening components give task execution group Part 111, while message listening components 109 send heartbeat message and preview file message to Linux server;Working condition component 110 for saving three kinds of translation type (Word, Excel, PowerPoint) working conditions of current Windows Transformation Service node It is whether occupied, Linux server is passed in reply or active transmission heartbeat message;111 basis of task execution component Received task message calls method different in Office file transition components 112 to carry out file conversion, and will conversion Good transformation result notification message listening components 109;Office file transition components 112 receive task execution component 111 Then task message uses singleton pattern for every kind of translation type, C++ bridging code is called to complete conversion work in a manner of JNA Make;DLL component (C++) 113 is bridged as the bridge between Transformation Service Java code and practical conversion C# code, works as Office After file transition components 112 call the bridge joint DLL component (C++) 113 in a manner of JNA, DLL component (C++) 113 is bridged with COM Mode call Office convert DLL component 114;The C# code that Office converts DLL component 114 calls Microsoft Office Interop API carries out opening, preview optimization and the pdf document export of Office file, is registered in a manner of DLL To system program collection;On Windows server opening and shares directory component 115 and by CIFS mode be mounted to Linux service On device, for the transmitting of source file and target pdf document between two kinds of servers;Office converts DLL component 114 from shared The Office file for needing to convert is read in directory component 115, completes that pdf document is written to share directory component after converting In 115;Windows cluster 104 support document not only include Microsoft Office generate DOC, DOCX, XLS, The conventional documents such as XLSX, PPT, PPTX, also support RTF, WPS, ODP, ODT, DPS, CSV, TSV, ET and MESSAGE/ Various complex documents under RFC822 agreement;
Preview component exhibiting 105 is used in the triggering by Linux cluster 103, and corresponding preview file is sent to Preview component exhibiting 105 is shown.
Wherein in the form of tree-like task chain, pre-configured all supports turn task resolution component 107 as shown in Figure 4 The format changed, as the support of type-A file is converted into B type file, C type file, D type file, E type file, F type text Part, G type file and H type file, specific switch process are needed by path as shown in Figure 4, for example want to generate D type The preview file of file format needs successively by the conversion of type-A file -> B type file format and B type file -> D class The format of type file is converted, i.e., when task resolution component 107 receives preview request message, according to minimal spanning tree algorithm, The minimum spanning tree for covering all request target files is obtained on tree-like task chain, when preview request is D type file, G type When file, E type file format, as shown in Figure 5, task resolution component 107 is according to wide at this time for the minimum spanning tree that we obtain Priority algorithm is spent, obtains task queue are as follows: type-A file -> B type file, type-A file -> C type file, B type text Part -> D type file, C type file -> E type file, D type file -> G type file, then task resolution component 107 is adjusted With the Task Switching component 108 of B type file format after type-A file -> B type file;Task resolution component 107 is then adjusted With the Task Switching component 108 of C type file format after type-A file -> C type file;Task resolution component 107 followed by The file transition components 108 of D type file format after calling B type file -> D type file;Task resolution component 107 connects again The file transition components 108 of E type file format after calling C type file -> E type file;Task resolution component 107 is most Afterwards call D type file -> G type file after G type file format file transition components 108.Last task resolution component File destination D type file, G type file and E type file are sent to task distributed components 106 by 107, then are distributed by task File destination D type file, G type file and E type file are sent to preview component exhibiting 105 by component 106, are carried out final The displaying of previewing file.Particularly, if B type file -> D type file convert failed, will do it and retry, if be pre-configured Retry to have retried K times in N seconds, and B type file -> D type file conversion was lost in time window at any one N seconds It loses K+1 times, then it is assumed that B type file -> D type file convert failed, while beta pruning is carried out to Task Switching tree, in task team B type file -> D type file, D type file -> G type file convert task, label final goal D type text are removed in column Part and the failure of G type file, but C type file -> E type file convert task is continued to execute, if C- > E is converted into E result can be sent to task distributed components 106 by function, and is ultimately sent to preview component exhibiting 105 and is carried out E type file lattice The preview of formula, the preview of D type file and G type file are notified that user's preview fails, and the benefit of this preview mode is not The preview of extended formatting can be influenced because of partial document convert failed.
The present invention has particularly carried out specially treated for the Office document frequently encountered in routine work, uses Microsoft Office Interop API(Microsoft Office program API) it is converted to reach better preview effect, The Microsoft Office Interop API can only be called by .NET Framework, and Transformation Service uses Java language is write, therefore the present invention at dynamic link library and infuses the code compilation that Office document to pdf document is converted Volume is at com component, and then the present invention writes a C++ bridge joint program assembly again and calls this com component, and final Java passes through JNA Mode calls bridge joint 113 library DLL component (C++) to realize the conversion of Office document, due to the Microsoft Office Interop API service can only be called on Windows machine, and main Transformation Service is deployed under Linux server , it is therefore desirable to Office document -> PDF conversion is realized using Windows cluster 104;Windows cluster 104 of the present invention Share directory component 115 and Linux cluster 103 file-sharing carried out by CIFS agreement, the message of Windows cluster is monitored Component 109 and Linux cluster 103 are by the Netty TCP mechanism progress message exchange in Akka Remote Actor, simultaneously In order to reduce the response time, present invention employs two-way heartbeat mechanisms to keep cluster state, Windows cluster 104 and Linux Cluster 103 regularly sends heartbeat message to other side's service node, and Windows service node updates after receiving heartbeat message Linux service node state simultaneously returns to its own working condition, and update should after Linux server receives heartbeat message The working condition of Windows service node, if the message of some node is not received in a period of time, by its status indication To be unavailable, convert requests no longer are sent toward the node, it is more frequent in the communication under the design between two kinds of services, in order to subtract Network flow in few cluster sends heartbeat time interval according to service node state and uses dynamic self-adapting algorithm, if inspection It measures some Windows service node and has been in available mode, Linux service will be stepped up between the time of transmission heartbeat Every a long heartbeat time interval finally being maintained, when Windows service node is restored to normally from down state Heartbeat is sent to all Linux service nodes with higher frequency when working condition, is restored again after receiving confirmation message Normal frequency sends heartbeat, and the state of all Windows service nodes can be safeguarded by heartbeat mechanism Linux Transformation Service And the service node of available free is selected when carrying out task distribution, while working as Windows service node from unavailable shape State is restored to notify all Linux service nodes in time when normal condition, to improve system availability and reduce response Time.
As shown in fig. 6, Office document conversion work process of the present invention are as follows: the first step, the Office text of trigger assembly 101 For shelves preview task when being triggered by user, Linux Transformation Service downloads source file first, judge the file content for downloading source file and Whether whether extension name consistent (being Office document), if the file content of downloading source file and extension name are consistent, with The task is transferred in Office document message queue afterwards, user's preview request may include multiple object formats, Ke Yitong The preview file of Shi Shengcheng PDF and JPG format, the selection of more convenient user flexibility, if the file content of downloading source file and Extension name is inconsistent, returns to preview failure;Second step, in Linux server the task distributed components 106 of Office conversion every A period of time takes out preview request information from Office document message queue,
Then check whether the Windows Transformation Service node state table of present node maintenance has the type task free time Node sends convert requests to corresponding Windows node if available free, the source file downloaded is copied to target empty In the local carry share directory component 115 of not busy node, while sending new convert task message and giving the Windows Transformation Service section (for more preferably more easily file-sharing, Linux Transformation Service file system uses all Windows of CIFS mode carry to point Transformation Service node is into share directory component 115), it otherwise will be waited for, and be somebody's turn to do every going to check for a period of time again State table is until finding target idle node, wherein using rotation (Round when carrying out the distribution of target free time node tasks Robin) dispatching algorithm stores all Windows switching nodes, a current distribution of variable record with a subordinate ordered array Windows switching node index value, checked whether backward from current distribution Windows switching node when every sub-distribution task Target idle node continues to traverse from the beginning, until finding target idle node, if again if reaching array end It finds current distribution Windows switching node and then illustrates there is no target idle node at this time, into wait state, wherein task Type is divided according to the application program for carrying out Office document conversion, including Word, Excel and PowerPoint Three types, in order to guarantee the stabilization of conversion work, each Windows node simultaneously only processing Word, Excel and PowerPoint task each one;Third step, the message listening components 109 of Windows Transformation Service node listen to file and turn It changes after 108 task of component, Windows Transformation Service calls Microsoft Office Interop API to carry out PDF document Export is to occupy according to the state that task type updates working condition component 110, is called further according to different Doctypes corresponding Microsoft Office Interop API Office document is converted to PDF format preview file and is stored in shared mesh It records in component 115, finally judges whether conversion succeeds, such as convert successfully Windows service node and send success message to Linux Service node, Linux service node receive the successful message of conversion and PDF document are moved to local file system later, simultaneously Temporary file is emptied, then Linux service carries out remaining convert task, for example the content of PDF document is cut out or pdf document It is reconverted into picture format file etc., Linux service will notify task distributed components 106, task point after all work is completed Sending out component 106 notifies preview component exhibiting 105 to carry out preview.If Windows conversion is unsuccessful, see whether to reach retrying time The number upper limit, if not reaching the number of retries upper limit, Windows Transformation Service, which reattempts to, calls Microsoft Office Interop API carries out PDF document export, if reaching maximum number of times, indicates convert failed.
Above to a kind of polymorphic type previewing file system of message-driven provided by the present invention, detailed Jie has been carried out It continues, and applies specific implementation case and the principle of the present invention and embodiment are expounded, the above case study on implementation is said It is bright to be merely used to help understand method and core concept of the invention;At the same time, for those skilled in the art, according to this The thought of invention, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification is not answered It is interpreted as limitation of the present invention.

Claims (6)

1. a kind of polymorphic type previewing file system of message-driven, which is characterized in that
Trigger assembly: when triggering for the source file preview request information by user, solicited message is converted into preview request Message, and be sent to message queue, the source file format include DOC, DOCX, ODT, RTF, XLS, XLSX, ODS, TSV, CSV, PPT, PPTX, ODP, PSD, PDF, PNG, JPG, JPEG, GIF, TIF, TIFF, BMP, SVG, AIX, ICO, MARKDOWN, MD, MDOWN, PS, AI, EPS, HTML, XHTML, HTM, AS, AS3, ASM, BAT, C, CC, CMAKE, CPP, CS, CSH, CSS, CXX, DIFF, ERB, GROOVY, H, HAML, HH, JAVA, JS, LESS, M, MAKE, ML, MM, PHP, PL, PLIST, PROPERTIES, PY, RB, SASS, SCALA, SCM, SCRIPT, SH, SML, SQL, TXT, VI, VIM, XML, XSD, XSL, XSLT, YAML, DWG, DWF, DXF file format;
Message queue: the preview request information persistence for will receive saves;
Linux cluster: it is used for monitoring information queue preview request message, then the source file of preview request message is converted into preview File, the Linux cluster are made of at least 2 Linux servers, and the preview file format is PDF and JPG;
Windows cluster: for Office document to be converted into PDF class when by Linux cluster preview request message trigger Type preview file, the Windows cluster are made of at least 2 Windows servers, the share directory group of Windows cluster Part and Linux cluster pass through the progress file-sharing of CIFS protocol mode, the message listening components and Linux collection of Windows cluster Group carries out message exchange by the Netty TCP mechanism in Akka Remote Actor;
Preview component exhibiting: in the triggering by Linux cluster, corresponding preview file to be sent to preview displaying group Part is shown.
2. a kind of polymorphic type previewing file system of message-driven as described in claim 1, which is characterized in that the triggering group Part and preview component exhibiting are Web or Android or iOS user platform.
3. a kind of polymorphic type previewing file system of message-driven as described in claim 1, which is characterized in that the Linux Server includes task distributed components, for listening to the preview request information of message queue, preview request information is issued and is appointed Business resolution component;Task resolution component, for by the preview request message from task distributed components be parsed into one it is corresponding File translation lists successively call corresponding specific conversion group in file transition components by the sequence in file translation lists Source file is converted into preview file by part, and corresponding preview file is sent to preview component exhibiting by task distributed components It is shown preview;File transition components, there are many concrete types for file transition components, for source file to be converted into preview text Part or intermediate form file.
4. a kind of polymorphic type previewing file system of message-driven as claimed in claim 3, which is characterized in that the task solution Analysis component is pre-configured with using tree structure.
5. a kind of polymorphic type previewing file system of message-driven as claimed in claim 3, which is characterized in that the file turns Changing a variety of concrete types in component has a DOC- > PDF, DOCX- > PDF, ODT- > PDF, RTF- > PDF, XLS- > PDF, and XLSX- > PDF, ODS- > PDF, TSV- > PDF, CSV- > PDF, PPT- > PDF, PPTX- > PDF, ODP- > PDF, PSD- > JPG, PDF- > JPG, PNG- > JPG, JPG- > JPG, JPEG- > JPG, GIF- > JPG, TIF- > JPG, TIFF- > JPG, BMP- > JPG, SVG- > JPG, AIX- > JPG, ICO- > JPG, MARKDOWN- > HTML, MD- > HTML, MDOWN- > HTML, PS- > JPG, AI- > JPG, EPS- > JPG, HTML- > PDF, XHTML- > PDF, HTM- > PDF, AS- > HTML, AS3- > HTML, ASM- > HTML, BAT- > HTML, C- > HTML, CC- > HTML, CMAKE- > HTML, CPP- > HTML, CS- > HTML, CSH- > HTML, CSS- > HTML, CXX- > HTML, DIFF- > HTML, ERB- > HTML, GROOVY- > HTML, H- > HTML, HAML- > HTML, HH- > HTML, JAVA- > HTML, JS- > HTML, LESS- > HTML, M- > HTML, MAKE- > HTML, ML- > HTML, MM- > HTML, PHP- > HTML, PL- > HTML, PLIST- > HTML, PROPERTIES- > HTML, PY- > HTML, RB- > HTML, SASS- > HTML, SCALA- > HTML, SCM- > HTML, SCRIPT- > HTML, SH- > HTML, SML- > HTML, SQL- > HTML, TXT- > HTML, VI- > HTML, VIM- > HTML, XML- > HTML, XSD- > HTML, XSL- > HTML, XSLT- > HTML, YAML- > HTML, DWG- > JPG, DWF- > JPG, DXF- > JPG。
6. a kind of polymorphic type previewing file system of message-driven as described in claim 1, which is characterized in that described Windows server includes message listening components, working condition component, task execution component, Office file transition components, bridge DLL component, Office conversion DLL component and share directory component are connect, message listening components and Linux server carry out intercommunication, Message listening components receive the source file preview request message of Linux server, then assign tasks to task execution component; Wherein working condition component is for saving tri- kinds of conversion class works of Windows server interior joint Word, Excel, PowerPoint Whether occupied make state, replys or when active transmission heartbeat message passes to Linux server;Task execution component according to Received task converts DLL component by Office file transition components, bridge joint DLL component and Office and turns source file Change preview file into, the Office file transition components pass sequentially through bridge joint DLL component and Office conversion DLL component is final Call Microsoft Office Interop API that the source file in share directory is converted to file destination, Windows clothes Share directory component is mounted in Linux server by CIFS mode on business device.
CN201510264911.XA 2015-05-22 2015-05-22 A kind of polymorphic type previewing file system of message-driven Active CN105045802B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510264911.XA CN105045802B (en) 2015-05-22 2015-05-22 A kind of polymorphic type previewing file system of message-driven

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510264911.XA CN105045802B (en) 2015-05-22 2015-05-22 A kind of polymorphic type previewing file system of message-driven

Publications (2)

Publication Number Publication Date
CN105045802A CN105045802A (en) 2015-11-11
CN105045802B true CN105045802B (en) 2019-05-07

Family

ID=54452349

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510264911.XA Active CN105045802B (en) 2015-05-22 2015-05-22 A kind of polymorphic type previewing file system of message-driven

Country Status (1)

Country Link
CN (1) CN105045802B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589957A (en) * 2015-12-22 2016-05-18 新浪网技术(中国)有限公司 Document conversion method and document conversion system
CN106469094A (en) * 2016-09-05 2017-03-01 维沃移动通信有限公司 A kind of Word message sharing method and mobile terminal
CN106649244A (en) * 2017-01-16 2017-05-10 武汉理工数字传播工程有限公司 PDF editing and manuscript reviewing method of mobile terminal
CN108460056A (en) * 2017-02-22 2018-08-28 电子科技大学中山学院 Method for converting effective graphic elements of DXF file into JSON data
CN107977348A (en) * 2017-12-21 2018-05-01 芝倪信息技术(大连)有限公司 A kind of Chinese office documents and the system and method for extended formatting document conversion
CN109725997B (en) * 2018-08-17 2023-11-03 顺维(重庆)科技有限公司 File opening method for terminal application, terminal and storage medium
CN109522277A (en) * 2018-10-10 2019-03-26 江苏中威科技软件系统有限公司 A kind of method and apparatus that multi-format document is read
CN110287146B (en) * 2019-06-19 2021-07-20 上海连尚网络科技有限公司 Method, device and computer storage medium for downloading application
CN110532524A (en) * 2019-07-02 2019-12-03 杭州博世数据网络有限公司 A kind of system and method for PPT document automatic conversion html5 document
CN110619113A (en) * 2019-09-06 2019-12-27 北京新橙科技有限公司 Method and device for previewing iOS specific format file
CN112395833A (en) * 2020-10-09 2021-02-23 贵州电网有限责任公司 Heterogeneous source document staticizing html processing method
CN112612604B (en) * 2020-12-14 2022-03-22 上海哔哩哔哩科技有限公司 Task scheduling method and device based on Actor model
CN112613279A (en) * 2020-12-24 2021-04-06 北京乐学帮网络技术有限公司 File conversion method and device, computer device and readable storage medium
CN113688098A (en) * 2021-08-20 2021-11-23 北京数码大方科技股份有限公司 File conversion system, method and device
CN115114234B (en) * 2022-08-29 2023-01-10 太平金融科技服务(上海)有限公司深圳分公司 File preview method, device, server, terminal and storage medium
CN116861847B (en) * 2023-06-21 2024-02-13 三峡高科信息技术有限责任公司 Online Office file previewing method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389969A (en) * 2012-05-07 2013-11-13 腾讯科技(深圳)有限公司 Method, device and system for previewing PDF (portable document format) file on mobile terminal
CN104462522A (en) * 2014-12-23 2015-03-25 深圳供电局有限公司 File on-line previewing method, terminal and server

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120166928A1 (en) * 2010-12-23 2012-06-28 Sap Ag Field extensibility in service interfaces and forms message types
US11210610B2 (en) * 2011-10-26 2021-12-28 Box, Inc. Enhanced multimedia content preview rendering in a cloud content management system
CN104615391A (en) * 2015-02-03 2015-05-13 九玉(北京)科技有限公司 File previewing method, device and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389969A (en) * 2012-05-07 2013-11-13 腾讯科技(深圳)有限公司 Method, device and system for previewing PDF (portable document format) file on mobile terminal
CN104462522A (en) * 2014-12-23 2015-03-25 深圳供电局有限公司 File on-line previewing method, terminal and server

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Networked multimedia system based on open architecture;F. Lohan.etc;《International Conference on Consumer Electronics》;20020807;第344-345页
可视化定制通用文件对话框实现文件预览;刘其洪等;《交通与计算机》;20030430;第71-73页

Also Published As

Publication number Publication date
CN105045802A (en) 2015-11-11

Similar Documents

Publication Publication Date Title
CN105045802B (en) A kind of polymorphic type previewing file system of message-driven
JP6723329B2 (en) System, method, and computer readable storage medium for customizable event-triggered calculations at edge locations
JP4698756B2 (en) Offline execution of web-based applications
US8161160B2 (en) XML-based web feed for web access of remote resources
US7937716B2 (en) Managing collections of appliances
US20130014004A1 (en) System and method for rendering presentation pages based on locality
JP2010518490A (en) Synchronization framework for irregularly connected applications
US9009740B2 (en) Invocation of additional processing using remote procedure calls
CN105763619A (en) Method and device for communication of client and server
US20070083599A1 (en) System for transforming application data using xslt extensions to render templates from cache and related methods
CN109151056B (en) Method and system for pushing messages based on Canal
CN105183470A (en) Natural language processing systematic service platform
CN107818027B (en) Method and device for switching main name node and standby name node and distributed system
EP3026860B1 (en) Method and system for transmission management of full configuration synchronization between eml-nml
US10771578B2 (en) Webpage loading method and apparatus
US20180004767A1 (en) REST APIs for Data Services
US9733994B2 (en) Method and system for communicating information between a mobile device and an enterprise system
CA2740226A1 (en) Method and system for interfacing disparate networked services
CN113472638B (en) Edge gateway control method, system, device, electronic equipment and storage medium
CN108076111B (en) System and method for distributing data in big data platform
CN102904742B (en) To method of operation and the system of executable node
CN104902022B (en) Distributed file acquisition method and distributed file acquisition system
CN113342785B (en) Data processing method and device, server device and storage medium
CN113439418A (en) Method, system, terminal and storage medium for changing resource state
CN112883103A (en) Method and device for data transfer between clusters

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant