Office file analysis and generation method and equipment based on web terminal

Through the combination of modular web service architecture and self-developed library office Maintainability.

CN118734803APending Publication Date: 2024-10-01FUJIAN BOSS SOFTWARE
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410750627.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing web-side Office file parsing technology has compatibility issues, data leakage risks, limited functions, and poor user experience, which limits its effectiveness and convenience in a wider range of application scenarios.

Method used

It adopts a modular web service architecture, combines JavaScript framework, HTML5 and CSS3 design to implement a responsive operation interface, parses the Office files uploaded by users, generates editable HTML nodes or JSON formatted structural data, and uses the self-research library officeX according to the The ECMA-376 standard is parsed and packaged, and Tinymce, YeeTable, and YeePpt editors are used for online editing, supporting cross-platform compatibility and rich editing functions.

Benefits of technology

It achieves cross-platform compatibility, improves user experience, reduces learning costs and conversion barriers, provides a user interface and operating habits similar to traditional Office software, improves system maintainability and scalability, and supports external data insertion functions. Generate chart files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734803A_ABST
    Figure CN118734803A_ABST
Patent Text Reader

Abstract

The invention discloses an office file analysis and generation method and device based on a web end, and the method comprises the steps: S1, employing a modular web service architecture, and combining a JavaScript framework, HTML5 and CSS3 design to achieve a responsive operation interface; s2, performing office file analysis on an office file which is uploaded by a user and needs to be edited to obtain corresponding HTML (Hypertext Markup Language) nodes or JSON (JavaScript Object Notation) formatted structure data; and S3, inputting the corresponding HTML node or JSON formatted structure data into an editor for web-end online editing, storing the edited office file, and packaging the office file according to an open packaging agreement of the ECMA-376 standard. According to the method and the device, the problems of limited compatibility, limited functions, data leakage risk and poor user experience of an office file analysis technology of a web end at present are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer software technology, and in particular relates to a method and device for parsing and generating office files based on a web terminal. Background Art

[0002] With the rapid development of information technology, office automation and document digitization have become standard configurations in the daily work of modern enterprises. The Microsoft Office suite, including applications such as Word, Excel, and PowerPoint, has become the de facto standard for processing text documents, spreadsheets, and presentations. However, with the rise of cloud computing and Web technology, people are increasingly in need of being able to process these files directly online without having to rely on desktop applications. At present, the parsing of Office files on the Web is mainly achieved by using various libraries and APIs. However, existing solutions usually have the following problems: 1. Compatibility issues: There are differences between different versions of Office file formats, and existing tools are often difficult to perfectly compatible with all versions. 2. Security concerns: Uploading files to third-party servers for parsing may cause the risk of data leakage. 3. Functional limitations: The functions of existing Web parsing tools are often limited and cannot provide the same rich editing features as desktop applications. 4. Poor user experience: Due to browser differences and network latency issues, users may encounter inconveniences when operating Office files on the Web. Therefore, although the existing Web-based Office file parsers have met market demand to a certain extent, there are still many problems and shortcomings, which limit their effectiveness and convenience in a wider range of application scenarios.

[0003] The Chinese patent with publication number CN109558552A discloses a method, device, equipment and medium for accessing the content of office files. The steps of the method include: receiving an access request from a user terminal, and obtaining the corresponding office file according to the access request; calling an API interface corresponding to the type of office file in Apache POI to parse the data content in the office file through the API interface; writing the data content into a web page file, and sending the web page file to the user terminal. The invention realizes the carrying of data content in the form of a web page file, so that the content of the office file can be presented to the browser of the user device, but the parsing of the office file requires calling the API interface corresponding to the office file type in Apache POI, which may cause the risk of data leakage. Summary of the invention

[0004] The present invention provides a web-based office file parsing generation method and device, aiming to solve the problems of limited compatibility, limited functions, data leakage risks and poor user experience of current web-based office file parsing technology.

[0005] In order to solve the above technical problems, the present invention provides a method for parsing and generating office files based on a web terminal, comprising the following steps:

[0006] S1: Adopt modular web service architecture, combine JavaScript framework, HTML5 and CSS3 to design a responsive operation interface.

[0007] S2: Parse the office file uploaded by the user and requiring editing, and obtain the corresponding HTML node or JSON formatted structure data that can be edited on the web side.

[0008] S3: Input the corresponding HTML node or JSON formatted structure data into the editor for online editing on the web, save the edited office file, and package the office file into the corresponding .docx, .xlsx, .pptx related file formats according to the open packaging convention of the ECMA-376 standard.

[0009] Preferably, the office file parsing for the office file uploaded by the user and to be edited is specifically as follows: after the user uploads the office file to be parsed, the self-developed library officeX is used to parse the office file. The self-developed library officeX parses and processes the three file types of document files, spreadsheet files, and slide files according to the Office Open XML file format of the ECMA-376 standard, and generates corresponding HTML nodes or JSON formatted structure data that can be edited on the web.

[0010] Preferably, the corresponding HTML node or JSON formatted structure data is input into the editor for online editing on the web: the editor is modularly integrated by Tinymce editor, YeeTable editor, and YeePpt editor, and the document file is edited online on the web using the Tinymce editor, the table file is edited online on the web using the YeeTable editor, and the slide file is edited online on the web using the YeePpt editor.

[0011] Preferably, the method further comprises editing the uploaded external data online through a web terminal to generate a chart file consisting of the external data.

[0012] On the other hand, the present invention also provides a web-based office file parsing and generating device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer program:

[0013] S1: Adopt modular web service architecture, combine JavaScript framework, HTML5 and CSS3 to design a responsive operation interface.

[0014] S2: Parse the office file uploaded by the user and requiring editing, and obtain the corresponding HTML node or JSON formatted structure data that can be edited on the web side.

[0015] S3: Input the corresponding HTML node or JSON formatted structure data into the editor for online editing on the web, save the edited office file, and package the office file into the corresponding .docx, .xlsx, .pptx related file formats according to the open packaging convention of the ECMA-376 standard.

[0016] Preferably, the office file parsing for the office file uploaded by the user and to be edited is specifically as follows: after the user uploads the office file to be parsed, the self-developed library officeX is used to parse the office file. The self-developed library officeX parses and processes the three file types of document files, spreadsheet files, and slide files according to the Office Open XML file format of the ECMA-376 standard, and generates corresponding HTML nodes or JSON formatted structure data that can be edited on the web.

[0017] Preferably, the corresponding HTML node or JSON formatted structure data is input into the editor for online editing on the web: the editor is modularly integrated by Tinymce editor, YeeTable editor, and YeePpt editor, and the document file is edited online on the web using the Tinymce editor, the table file is edited online on the web using the YeeTable editor, and the slide file is edited online on the web using the YeePpt editor.

[0018] Preferably, the device also realizes online editing of the uploaded external data through a web terminal to generate a chart file consisting of the external data.

[0019] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for parsing and generating office files based on a web terminal as described in any embodiment of the present invention is implemented.

[0020] Compared with the prior art, the present invention has the following technical effects:

[0021] 1. Since the method proposed in the present invention is a web-based solution, no matter what operating system or device the user uses, as long as it can connect to the Internet and has a modern browser, the present invention can be used seamlessly to parse office files, and it has cross-platform compatibility.

[0022] 2. The present invention can recognize and compatibly process different versions of office file formats, including traditional and latest Office documents. At the same time, by providing a user interface and operating habits similar to traditional Office software, the user experience when editing documents on the Web side is close to that of traditional software, reducing learning costs and conversion barriers, and greatly improving the user's online editing experience.

[0023] 3. The present invention not only improves maintainability and scalability by designing the system as a modular service, but also facilitates future upgrades or replacements of various components without affecting the operation of the entire system. At the same time, the present invention also designs an external data insertion function, dynamically inserts data according to conditions to produce documents, and realizes the insertion of external data to generate chart files through the editor. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is an overall flow chart of a method for parsing and generating office files based on a web terminal according to the present invention;

[0025] Figure 2 It is a schematic diagram of the operation interface of the present invention. DETAILED DESCRIPTION

[0026] In order to make the objectives, technical solutions and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in combination with specific embodiments of the present application and with reference to the accompanying drawings.

[0027] Embodiment 1

[0028] This embodiment provides a method for parsing and generating office files based on a web terminal. Figure 1 As shown, the following steps are included:

[0029] S1: Adopt modular web service architecture, that is, B / S architecture that uses web browsers to interact with users, and realize modularization by packaging and controlling versions of self-developed libraries officeX, Tinymce editor, YeeTable editor, and YeePpt editor separately, and combine JavaScript framework (such as React or Vue.js), HTML5 and CSS3 to design a responsive and user-friendly operation interface, see Figure 2 shown.

[0030] S2: Parse the office file uploaded by the user and requiring editing, and obtain the corresponding HTML node or JSON formatted structure data that can be edited on the web side.

[0031] As a preferred implementation of this embodiment, the office file parsing for the office file uploaded by the user and to be edited is specifically as follows: after the user uploads the office file to be parsed, the self-developed library officeX is used to parse the office file. The self-developed library officeX parses and processes the three file types of document files, table files, and slide files according to the Office Open XML file format of the ECMA-376 standard, and generates corresponding HTML nodes or JSON formatted structure data that can be edited on the web side. Specifically, the self-developed library officeX is a JavaScript library for converting office-related files (.docx, .xlsx, .pptx) into corresponding HTML nodes or JSON formatted structure data, or converting corresponding HTML nodes or JSON formatted structure data into the above office-related files. The library provides a set of APIs for processing the mutual conversion process of office-related files, which can be run in the Node.js environment or integrated in the front-end project by adding dependencies. In this embodiment, the self-developed library officeX and the editor are integrated into the existing web application. The ECMA-376 standard is an international standard developed by Ecma, which aims to describe and define electronic document formats so that different applications and platforms can be compatible with each other and exchange electronic documents. The ECMA-376 standard includes Office Open XML (OOXML) and Open Packaging Convention (OPC): The ECMA-376 standard defines a specification for packaging and organizing electronic documents, and organizes different document parts (text, images, metadata) in a zip compression package through the open packaging convention. Further, officeX parses the document file specifically as follows: decompress the document file to obtain a decompressed file, read the xml parsing node from the decompressed file, parse the xml parsing node into a corresponding HTML node, and input the corresponding HTML node into the Tinymce editor for subsequent editing. OfficeX parses the table file specifically as follows: decompress the table file to obtain a decompressed file, read the xml parsing node from the decompressed file, parse the xml parsing node into JSON formatted structure data, and input the JSON formatted structure data into the YeeTable editor for subsequent editing. OfficeX parses the slide file specifically as follows: decompress the slide file to obtain a decompressed file, read the xml parsing node from the decompressed file, parse the xml parsing node into JSON formatted structure data, and input the JSON formatted structure data into the YeePpt editor for subsequent editing.

[0032] S3: After the user performs online editing on the web side, the edited office file is saved, and the file is packaged into the corresponding .docx, .xlsx, .pptx and other related file formats according to the open packaging convention of the ECMA-376 specification. Specifically, in the ECMA-376 standard, the open packaging convention is used to organize and store various document components in a compressed package. The open packaging convention defines a general packaging structure that can be used to store different types of document content, such as text, images, style sheets, etc. In the packaging structure, an XML-based descriptive file (called a package description file) is used to describe the relationship between the packaging structure and each component. Further, the officeX packaged document file is specifically: the corresponding HTML node is obtained from the edited document data, the corresponding HTML node is converted into an xml node, and the package is compressed into a document file. The officeX packaged table file is specifically: the edited JSON formatted structure data is converted into an xml node, and the package is compressed into a table file. The officeX packaged slide file is specifically: the edited JSON formatted structure data is converted into an xml node, and the package is compressed into a slide file.

[0033] As a preferred implementation of this embodiment, the corresponding HTML node or JSON formatted structure data is input into the editor for online editing on the web: the editor is modularly integrated by the Tinymce editor, YeeTable editor, and YeePpt editor, and the Tinymce editor is used to edit the document file online on the web, the YeeTable editor is used to edit the table file online on the web, and the YeePpt editor is used to edit the slide file online on the web. Among them, the Tinymce editor is an open source rich text editor, and the YeeTable editor and YeePpt editor are self-developed editors. Tinymce editor: Use HTML contenteditable to make HTML content editable. YeeTable editor: Use the HTML tag Table to present table data and configure interaction. YeePpt editor: Provides a configuration interface in which drag elements can be added to an area.

[0034] As a preferred implementation of this embodiment, the method also includes generating a chart file composed of external data through online editing of the uploaded external data (i.e., the configured database) on the web side, specifically: the web-side plug-in provides an element insertion API to support tables and charts, and marks the chart type configuration information and data source information in the web-side conf configuration. Specifically, the data source information can be the database link address account password and the data table name used. If it is detected that the generation function needs to be called, the external data is accessed through the Tinymce editor, and the user chooses to generate a graph or table, and the external data is converted into an xml parsing node and the hidden node information is set to carry the chart type and data source information selected by the user. The self-developed library officeX parses the HTML tags in the xml parsing node according to the specification (the HTML tags are in the XML fixed xml format), and uses the HTML tags and the elements in the xml parsing node to convert. If an HTML tag that needs to retrieve external data from the database is encountered, the external data and the corresponding chart are obtained through configuration, and the xml parsing node elements are filled in. The filled xml parsing node is compressed and packaged into the corresponding.docx chart file. If no external data is required (i.e., the data has been presented in the Tinymce editor), it is directly compressed and packaged into the corresponding.docx chart file.

[0035] Embodiment 2

[0036] Accordingly, this embodiment provides an office file parsing and generating device based on the web, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, a method for parsing and generating office files based on the web as described in any embodiment of the present invention is implemented.

[0037] Embodiment 3

[0038] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, a web-based office file parsing and generating method as described in any embodiment of the present invention is implemented.

[0039] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0040] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0041] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0042] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.

[0043] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A web-based office file parsing and generation method, characterized in that: The following steps are involved: S1: Adopts modular web service architecture, combines JavaScript framework, HTML5 and CSS3 to design a responsive operation interface; S2: Parse the office file uploaded by the user and requiring editing, and obtain the corresponding HTML node or JSON formatted structure data that can be edited on the web side; S3: Input the corresponding HTML node or JSON formatted structure data into the editor for online editing on the web, save the edited office file, and package the office file into the corresponding .docx, .xlsx, .pptx related file formats according to the open packaging convention of the ECMA-376 standard.

2. According to the web-based office file parsing and generation method according to claim 1, it is characterized in that: The specific steps for parsing office files uploaded by users and needing to be edited are as follows: after users upload office files that need to be parsed, they use the self-developed library officeX to parse the office files. The self-developed library officeX parses and processes the three file types of document files, spreadsheet files, and slide files according to the Office Open XML file format of the ECMA-376 standard, and generates corresponding HTML nodes or JSON formatted structure data that can be edited on the web.

3. The method for parsing and generating office files based on a web terminal according to claim 1, characterized in that: Input the corresponding HTML nodes or JSON formatted structure data into the editor for online editing on the web. Specifically: the editor is modularly integrated by Tinymce editor, YeeTable editor, and YeePpt editor. Use Tinymce editor to edit document files online on the web, use YeeTable editor to edit table files online on the web, and use YeePpt editor to edit slide files online on the web.

4. The method for parsing and generating office files based on a web terminal according to claim 1, characterized in that: The method also includes editing the uploaded external data online through a web terminal to generate a chart file composed of the external data.

5. A web-based office file parsing and generating device, the device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: S1: Adopts modular web service architecture, combines JavaScript framework, HTML5 and CSS3 to design a responsive operation interface; S2: Parse the office file uploaded by the user and requiring editing, and obtain the corresponding HTML node or JSON formatted structure data that can be edited on the web side; S3: Input the corresponding HTML node or JSON formatted structure data into the editor for online editing on the web, save the edited office file, and package the office file into the corresponding .docx, .xlsx, .pptx related file formats according to the open packaging convention of the ECMA-376 standard.

6. The web-based office file parsing and generating device according to claim 5, characterized in that: The specific steps for parsing office files uploaded by users and needing to be edited are as follows: after users upload office files that need to be parsed, they use the self-developed library officeX to parse the office files. The self-developed library officeX parses and processes the three file types of document files, spreadsheet files, and slide files according to the Office Open XML file format of the ECMA-376 standard, and generates corresponding HTML nodes or JSON formatted structure data that can be edited on the web.

7. The web-based office file parsing and generating device according to claim 5, characterized in that: Input the corresponding HTML nodes or JSON formatted structure data into the editor for online editing on the web. Specifically: the editor is modularly integrated by Tinymce editor, YeeTable editor, and YeePpt editor. Use Tinymce editor to edit document files online on the web, use YeeTable editor to edit table files online on the web, and use YeePpt editor to edit slide files online on the web.

8. The web-based office file parsing and generating device according to claim 5, characterized in that: The device also realizes online editing of the uploaded external data through a web terminal to generate a chart file composed of the external data.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, a web-based office file parsing and generating method as claimed in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Rich text editing method for importing documents and device thereof

    CN102662928A

  • Electronic document online editing method and system

    CN109408783A

  • File processing method and device of rich text editor, equipment and storage medium

    CN115048905A

  • Compound Web Document Generation Method and Web-based Editing System for Generating a Compound Web Document

    US20080098298A1