A method, device and medium for parsing a Word document

By automatically extracting and parsing Word document titles and content, constructing a directory tree structure and displaying it visually, the problem of low efficiency in existing document management is solved, achieving efficient document processing and a user-friendly parsing method.

CN117454877BActive Publication Date: 2026-08-04INSPUR GENERSOFT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR GENERSOFT CO LTD
Filing Date
2023-11-30
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing document management methods are inefficient and provide a poor user experience, especially when dealing with massive amounts of Word documents. Traditional methods rely on manual reading and organization, and existing systems cannot accurately parse document content, resulting in low efficiency in searching and viewing.

Method used

This paper provides a Word document parsing method that automatically extracts document titles and constructs a directory tree structure by receiving attachments uploaded by the client, parses the document content, and stores it in a database for visualization, including chart conversion and drawing. It also supports fast and accurate document structure and content querying.

Benefits of technology

It improves document processing efficiency, reduces manual operations, and realizes automated document management and storage. Users can intuitively view document structure and content, thus improving user experience and work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117454877B_ABST
    Figure CN117454877B_ABST
Patent Text Reader

Abstract

This application discloses a method, device, and medium for parsing Word documents, addressing the technical problems of low document management efficiency and poor user experience in existing document management methods. The method includes: receiving Word document attachments uploaded by a client, and triggering an API call request from the client based on the attachment upload; reading the document table of contents from the attachment based on the API call request to extract the titles from the Word document, and constructing a directory tree structure corresponding to the extracted titles; parsing the Word document in the attachment to read the corresponding document content, and storing the directory tree structure and document content in a database; and responding to the client's API call request by visually displaying the directory tree structure on the left side of the client's page and visually displaying the document content on the right side of the client's page, thereby achieving the parsing of Word documents with titles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, device and medium for parsing Word documents. Background Technology

[0002] Currently, with the rapid development of information technology and the continuous improvement of corporate standardization, the amount of documents related to external laws and regulations and internal rules and regulations is constantly increasing. Traditional management methods usually rely on manual reading and organization, which is inefficient and prone to errors when faced with massive amounts of documents.

[0003] To address this issue, system management systems have emerged in the market. While some of these systems can convert document content into data stored in a database, they typically require users to use specific conversion tools to store the document content as a file stream in the database, or to manually upload attachments to a file server. This not only increases the complexity of use but may also prevent the conversion tools from fully and accurately parsing the document content, thus failing to present the document content intuitively to the user. Consequently, users need to spend more time and effort searching for and viewing the document content. Summary of the Invention

[0004] This application provides a method, device, and medium for parsing Word documents, in order to solve the technical problems of low document management efficiency and poor user experience in existing document management methods.

[0005] On the one hand, embodiments of this application provide a method for parsing Word documents, including:

[0006] Receive attachments to a Word document uploaded by the client, and obtain the client's interface call request based on the upload of the attachment;

[0007] Based on the interface call request, the document directory in the attachment is read to extract the titles in the Word document, and a directory tree structure corresponding to the document directory is constructed based on the extracted titles;

[0008] The Word documents in the attachments are parsed to read the document content corresponding to the Word documents, and the directory tree structure and document content are stored in the database;

[0009] In response to the client's interface call request, the directory tree structure is visualized on the left side of the client's page, and the document content is visualized on the right side of the client's page, so as to realize the parsing of Word documents with titles.

[0010] In one implementation of this application, the step of reading the document directory in the attachment based on the interface call request to extract the titles in the Word document specifically includes:

[0011] Based on the client's interface call request, and through the document class, the paragraphs in the Word document are obtained;

[0012] The getText method in the text object is used to determine whether each paragraph contains a heading style, and if the paragraph contains a heading style, the heading level and heading text of the target paragraph are obtained.

[0013] The getText method in the text object is used to determine whether the target paragraph contains a subheading style. If the target paragraph contains a subheading style, the corresponding subheading level and subheading text are obtained.

[0014] The heading level, heading text, subheading level, and subheading text corresponding to the target paragraph are stored in a key-value pair set.

[0015] In one implementation of this application, the step of constructing a directory tree structure corresponding to the document directory based on the extracted titles specifically includes:

[0016] Among the multiple title texts obtained, the document title of the Word document is determined and the document title is used as the root node;

[0017] Determine the hierarchical level corresponding to each child node under the root node, and determine the level to which the corresponding title text belongs based on the title level among the multiple title texts;

[0018] According to the level to which each title text belongs, the multiple title texts are added to the child nodes of the corresponding level to construct the directory tree structure corresponding to the document directory.

[0019] In one implementation of this application, parsing the Word document in the attachment to read the document content corresponding to the Word document specifically includes:

[0020] Based on the client's interface call request, the Word document in the attachment is parsed, and the document type corresponding to the Word document is determined; wherein, the document type includes text and charts;

[0021] When the document type is text, the data format of the document content is parsed into HTML format, and each line of the HTML document content is read separately to determine the content type of the document content corresponding to the current line; wherein, the content type includes: title and body text.

[0022] In one implementation of this application, after reading each line of the HTML document content to determine the content type of the current line, the method further includes:

[0023] If the content type of the document content corresponding to the current line is a heading, set the corresponding heading tag for the heading line, and set the corresponding tag level for the heading tag according to the heading level of the heading line;

[0024] Add an anchor point attribute to the title row and determine the anchor point value corresponding to the title row, so that the anchor point value is used as the ID value of the tree node where the title of the title row is located.

[0025] In one implementation of this application, parsing the Word document in the attachment to read the document content corresponding to the Word document, and storing the directory tree structure and document content in the database, specifically includes:

[0026] If the content type of the document content corresponding to the current line is body text, set the corresponding body text tag for the body text line;

[0027] The document content and directory tree structure corresponding to each row are determined and stored in the database, and the document content is associated with the title tree node ID corresponding to the title row.

[0028] In one implementation of this application, after parsing the Word document in the attachment based on the client's interface call request and determining the document type corresponding to the Word document, the method further includes:

[0029] When the document type is chart, the chart information in the Word document is obtained through the chart class, and the corresponding chart type is determined based on the chart information; wherein, the chart type includes at least: line chart, bar chart and pie chart;

[0030] Based on the chart type, the charts in the Word document are converted into corresponding graphic objects, and the graphic objects are drawn according to a preset method.

[0031] In one implementation of this application, responding to the client's interface call request by visually displaying the directory tree structure on the left side of the client's page and visually displaying the document content on the right side of the client's page, to achieve the parsing of a Word document with titles, specifically includes:

[0032] In response to the client's interface call request, the system retrieves the directory tree structure and document content corresponding to the Word document from the database, and displays the directory tree structure on the left side of the client's page and the document content on the right side of the client's page.

[0033] Determine the document query requirements corresponding to the client, and determine the location information of the document content corresponding to the document query requirements in the directory tree structure;

[0034] Based on the location information, the document content corresponding to the document query request is highlighted on the right side of the client's page.

[0035] On the other hand, embodiments of this application also provide a Word document parsing device, the device comprising:

[0036] At least one processor;

[0037] And, a memory communicatively connected to the at least one processor;

[0038] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a Word document parsing method as described above.

[0039] On the other hand, embodiments of this application also provide a non-volatile computer storage medium storing computer-executable instructions, wherein the computer, when executing the executable instructions, implements a Word document parsing method as described above.

[0040] This application provides a method, device, and medium for parsing Word documents, which has at least the following beneficial effects:

[0041] By receiving Word document attachments uploaded by clients, the system automates the processing of Word documents, reducing the time and workload of manually extracting and organizing the table of contents, and improving document processing efficiency. The upload of attachments triggers API calls from clients, enabling the system to respond and process client operation requests promptly, improving system response speed and user experience. By reading the document's table of contents from the attachments, the system extracts the titles from the Word documents and constructs a table of contents tree structure based on the titles, allowing the system to quickly and accurately obtain the document's structural information, facilitating subsequent document processing and display. By parsing the Word documents, reading their corresponding document content, and storing the table of contents tree structure and document content in the database, the system achieves automated document management and storage, facilitating subsequent querying and access. Visualizing the table of contents tree structure and document content enables effective parsing and display of titled Word documents, allowing users to intuitively view the document's structure and content, improving user experience and work efficiency. Attached Figure Description

[0042] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0043] Figure 1 A flowchart illustrating a Word document parsing method provided in an embodiment of this application;

[0044] Figure 2 This is a schematic diagram of the internal structure of a Word document parsing device provided in an embodiment of this application. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] This application provides a method, device, and medium for parsing Word documents. By receiving attachments to Word documents uploaded by a client, it automates the processing of Word documents, improving document processing efficiency. The upload of attachments triggers interface call requests from the client, enabling the system to respond and process client operation requests promptly, improving system response speed and user experience. By reading the document's table of contents from the attachments, the system extracts the titles from the Word document and constructs a directory tree structure based on the titles, allowing for quick and accurate acquisition of the document's structural information, facilitating subsequent document processing and display. By parsing the Word document, reading its corresponding document content, and storing the directory tree structure and document content in a database, it achieves automated document management and storage, facilitating subsequent querying and access. Visualizing the directory tree structure and document content allows users to intuitively view the document's structure and content, improving user experience and work efficiency. This solves the technical problems of low document management efficiency and poor user experience in existing document management methods.

[0047] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0048] Figure 1 This is a flowchart illustrating a Word document parsing method provided in an embodiment of this application.

[0049] The analysis method involved in the embodiments of this application can be implemented by a terminal device or a server, and this application does not impose any special limitations on it. For ease of understanding and description, the following embodiments are all described in detail using a server as an example.

[0050] It should be noted that the server can be a single device or a system composed of multiple devices, i.e., a distributed server. This application does not make any specific limitations on this.

[0051] like Figure 1 As shown in the embodiment of this application, a method for parsing a Word document includes:

[0052] 101. Receive Word document attachments uploaded by the client, and based on the attachment upload trigger, obtain the client's interface call request.

[0053] This application can automatically parse and store document titles and content in a database to achieve automated document management and fast retrieval, greatly improving the efficiency and accuracy of document processing while reducing the complexity of manual operations. First, an API interface is created using a backend framework (such as Flask, Django, etc.) to receive Word documents uploaded by clients, and the uploaded Word documents are stored on a server.

[0054] 102. Based on the API call request, read the document directory in the attachment to extract the titles in the Word document, and construct the directory tree structure corresponding to the document directory based on the extracted titles.

[0055] Specifically, in one embodiment of this application, the server, based on the client's interface call request, retrieves paragraphs from a Word document using the XWPFDocument document class. This enables the system to quickly and accurately obtain paragraph information, facilitating subsequent processing and display. The server uses the getText method of the XWPFRun text object to determine whether each paragraph contains a heading style. If the paragraph contains a heading style, the server obtains the heading level and heading text corresponding to the target paragraph, allowing the system to automatically extract heading information from the document, improving the accuracy and efficiency of extraction. The server also uses the getText method of the XWPFRun text object to determine whether the target paragraph contains subheading styles. If the target paragraph contains subheading styles, the server obtains the corresponding subheading level and subheading text, enabling the system to extract subheading information from the document, resulting in a more comprehensive extraction of heading information. Then, the server stores the heading level, heading text, subheading level, and subheading text of the target paragraph into key-value pairs, enabling the system to manage and store the extracted heading information in a unified manner, facilitating subsequent queries and access. This helps improve the efficiency of structured processing of document content and provides strong support for subsequent document parsing and display, resulting in benefits such as high efficiency, accuracy, and convenience.

[0056] In one embodiment of this application, the server can accurately determine the document title of a Word document from multiple title texts and use it as the root node, thereby automating the construction of the document structure, reducing the workload of manually determining document titles, and providing accurate direction for subsequent document structuring processing. Then, the server determines the hierarchical level corresponding to each child node based on the title level, and determines the level to which the corresponding title text belongs based on the title level among the multiple title texts. This allows the system to classify and manage title texts of different levels, facilitating the construction of a hierarchical directory tree. Furthermore, the server adds multiple title texts to the child nodes of the corresponding level according to the level to which each title text belongs, effectively constructing the directory tree structure corresponding to the document directory. This allows the system to establish a corresponding directory tree structure based on the level of the title texts, facilitating user browsing and navigation of document content. This helps to automatically construct the directory tree structure of the document directory, improving the efficiency and accuracy of document structuring processing.

[0057] 103. Parse the Word documents in the attachments to read the corresponding document content, and store the directory tree structure and document content in the database.

[0058] Specifically, in one embodiment of this application, the server parses the Word document in the attachment based on the client's interface call request and determines the document type corresponding to the Word document. This enables the system to quickly and accurately identify the document type and perform corresponding processing according to different document types, providing basic data for subsequent processing. When the document type is text, the server parses the document content data format into HTML format and reads each line of the HTML document content separately to determine the content type of the current line, allowing the system to perform refined processing and display of the text document content.

[0059] This application parses document content into HTML format, which facilitates the styling and layout of the document content, improving its readability and aesthetics. By determining the content type of each line of document content, it is easy to classify and organize the document content, improving document management and retrieval efficiency. This helps to achieve automated analysis and processing of different types of documents, providing basic support for the refined processing of document content.

[0060] In one embodiment of this application, after parsing the Word document in the attachment based on the client's interface call request and determining the document type of the Word document, the server can obtain the chart information in the Word document through the chart class when the document type is chart, and determine the corresponding chart type according to the chart information. This enables the system to accurately identify and classify different types of charts, providing a data foundation for subsequent processing. Then, according to the chart type, the chart in the Word document is converted into the corresponding graphic object, and the graphic object is drawn according to a preset method. This enables the system to convert the chart into a graphic object that is easy to process and display, facilitating subsequent chart display and analysis.

[0061] This application, through steps such as converting chart types and drawing graphic objects, can easily parse, convert, and display charts in Word documents, improving the usability and readability of charts. Through preset drawing methods, it can quickly and accurately generate various types of graphic objects, enabling the system to efficiently process large amounts of chart data of different types. This facilitates the automated parsing and processing of chart information, providing users with a more intuitive and effective way to display chart content.

[0062] In one embodiment of this application, after reading each line of the HTML document content to determine the content type of the current line, the server sets a corresponding title tag for the title line if the content type of the current line is a title. The server also sets a corresponding tag level for the title tag based on the title level of the title line. This allows the system to classify and identify titles according to their title levels, facilitating subsequent document display and processing, and providing convenience for the structured display of document content. The server adds anchor attributes to the title lines and determines the corresponding anchor values, using these anchor values ​​as the ID value of the tree node containing the title. This allows the system to establish a connection between titles and tree nodes through anchor attributes, enabling users to quickly locate and jump to specific titles within the document, achieving rapid document content location and navigation.

[0063] This application allows for convenient organization and structuring of document content by setting anchor attributes and tag levels, improving document readability and usability. By using anchor values ​​as the ID values ​​of tree nodes, document content can be dynamically updated and maintained, improving document flexibility and scalability. This helps improve the efficiency of structured processing and display of document content, providing users with a more convenient way to access and manage document content.

[0064] In one embodiment, when the content type of the document content corresponding to the current line is body text, the server sets a corresponding body text tag for the body text line. This allows the system to perform fine-grained classification and identification of the document based on the body text content, which helps to effectively manage document content from a structured perspective and improves document readability and usability. By setting a corresponding body text tag for the body text line when the content type of the document content corresponding to the current line is body text, the server enables the system to perform fine-grained classification and identification of the document based on the body text content, improving document readability and usability and facilitating subsequent retrieval and processing. Then, the server associates the document content with the title tree node ID corresponding to the title line, enabling the system to establish a relationship between document content and title, facilitating subsequent document querying and access. Through steps such as setting body text tags, storing document content and directory tree structure, and establishing relationships, the server can easily automate and intelligently manage documents, improving the efficiency and accuracy of document processing. This helps to improve the efficiency of persistent storage and management of document content, providing users with a convenient way to retrieve and process document content.

[0065] 104. In response to the client's interface call request, the directory tree structure is displayed visually on the left side of the client's page, and the document content is displayed visually on the right side of the client's page, so as to realize the parsing of Word documents with titles.

[0066] Specifically, in one embodiment of this application, the server responds to the client's interface call request by retrieving the directory tree structure and document content corresponding to the Word document from the database. The server then visualizes the directory tree structure on the left side of the client's page and the document content on the right side, allowing the user to intuitively view the document's structure and content. The server determines the client's document query request and the location information of the corresponding document content within the directory tree structure. This enables the system to quickly locate the content within the document and, based on the location information, highlights the corresponding document content on the right side of the client's page. This allows the user to quickly and accurately find and focus on the content corresponding to their query, improving the efficiency of browsing and querying documents.

[0067] This application facilitates document reading and analysis through visualizing the directory tree structure and document content, as well as highlighting search results. This allows users to quickly locate the content they need, improving user experience and work efficiency. It enhances the efficiency of document retrieval and browsing, providing an intuitive and convenient method for displaying and searching document content.

[0068] After the client uploads the attachment, the application sends an API call request to the server. Based on the API call request, the server parses the Word document in the attachment uploaded by the client, stores the parsed document content in the database, and finally displays it on the client page in the form of data.

[0069] The above are embodiments of the method proposed in this application. Based on the same inventive concept, embodiments of this application also provide a Word document parsing device, the structure of which is as follows: Figure 2 As shown.

[0070] Figure 2 This is a schematic diagram of the internal structure of a Word document parsing device provided in an embodiment of this application. Figure 2 As shown, the device includes:

[0071] At least one processor;

[0072] And, a memory that is communicatively connected to at least one processor;

[0073] The memory stores instructions that can be executed by at least one processor, and the instructions, when executed by at least one processor, enable at least one processor to:

[0074] Receive Word document attachments uploaded by the client, and obtain the client's API call request based on the attachment upload trigger;

[0075] Based on the API call request, read the document directory in the attachment to extract the titles in the Word document, and construct the directory tree structure corresponding to the document directory based on the extracted titles;

[0076] The attached Word document is parsed to read the corresponding document content, and the directory tree structure and document content are stored in the database.

[0077] In response to the client's API call request, the directory tree structure is displayed visually on the left side of the client's page, and the document content is displayed visually on the right side of the client's page, so as to realize the parsing of Word documents with titles.

[0078] This application also provides a non-volatile computer storage medium storing computer-executable instructions, which, when executed by a computer, enable the following:

[0079] Receive Word document attachments uploaded by the client, and obtain the client's API call request based on the attachment upload trigger;

[0080] Based on the API call request, read the document directory in the attachment to extract the titles in the Word document, and construct the directory tree structure corresponding to the document directory based on the extracted titles;

[0081] The attached Word document is parsed to read the corresponding document content, and the directory tree structure and document content are stored in the database.

[0082] In response to the client's API call request, the directory tree structure is displayed visually on the left side of the client's page, and the document content is displayed visually on the right side of the client's page, so as to realize the parsing of Word documents with titles.

[0083] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.

[0084] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0085] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0086] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0087] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0088] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0089] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0090] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0091] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0092] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0093] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0094] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for parsing Word documents, characterized in that, The method includes: Receive attachments to a Word document uploaded by the client, and obtain the client's interface call request based on the upload of the attachment; Based on the interface call request, the document directory in the attachment is read to extract the titles in the Word document, and a directory tree structure corresponding to the document directory is constructed based on the extracted titles; The Word documents in the attachments are parsed to read the document content corresponding to the Word documents, and the directory tree structure and document content are stored in the database; Based on the client's interface call request, the Word document in the attachment is parsed, and the document type corresponding to the Word document is determined; wherein, the document type includes text and charts; When the document type is text, the data format of the document content is parsed into HTML format, and each line of the HTML document content is read separately to determine the content type of the document content corresponding to the current line; wherein, the content type includes: title and body text; If the content type of the document content corresponding to the current line is a heading, set the corresponding heading tag for the heading line, and set the corresponding tag level for the heading tag according to the heading level of the heading line; Add an anchor point attribute to the title row and determine the anchor point value corresponding to the title row, so as to use the anchor point value as the ID value of the tree node where the title of the title row is located; In response to the client's interface call request, the directory tree structure is visualized on the left side of the client's page, and the document content is visualized on the right side of the client's page, so as to realize the parsing of Word documents with titles.

2. The method for parsing a Word document according to claim 1, characterized in that, The step of reading the document directory in the attachment based on the interface call request to extract the titles from the Word document specifically includes: Based on the client's interface call request, and through the document class, the paragraphs in the Word document are obtained; The getText method in the text object is used to determine whether each paragraph contains a heading style, and if the paragraph contains a heading style, the heading level and heading text of the target paragraph are obtained. The getText method in the text object is used to determine whether the target paragraph contains a subheading style. If the target paragraph contains a subheading style, the corresponding subheading level and subheading text are obtained. The heading level, heading text, subheading level, and subheading text corresponding to the target paragraph are stored in a key-value pair set.

3. The method for parsing a Word document according to claim 1, characterized in that, The step of constructing a directory tree structure corresponding to the document directory based on the extracted titles specifically includes: Among the multiple title texts obtained, the document title of the Word document is determined and the document title is used as the root node; Determine the hierarchical level corresponding to each child node under the root node, and determine the level to which the corresponding title text belongs based on the title level among the multiple title texts; According to the level to which each title text belongs, the multiple title texts are added to the child nodes of the corresponding level to construct the directory tree structure corresponding to the document directory.

4. The method for parsing a Word document according to claim 1, characterized in that, The step of parsing the Word document in the attachment to read the document content corresponding to the Word document and storing the directory tree structure and document content in the database specifically includes: If the content type of the document content corresponding to the current line is body text, set the corresponding body text tag for the body text line; The document content and directory tree structure corresponding to each row are determined and stored in the database, and the document content is associated with the title tree node ID corresponding to the title row.

5. The method for parsing a Word document according to claim 1, characterized in that, After parsing the Word document in the attachment based on the client's interface call request and determining the document type corresponding to the Word document, the method further includes: When the document type is chart, the chart information in the Word document is obtained through the chart class, and the corresponding chart type is determined based on the chart information; wherein, the chart type includes at least: line chart, bar chart and pie chart; Based on the chart type, the charts in the Word document are converted into corresponding graphic objects, and the graphic objects are drawn according to a preset method.

6. The method for parsing a Word document according to claim 1, characterized in that, In response to the client's interface call request, the directory tree structure is visualized on the left side of the client's page, and the document content is visualized on the right side of the client's page, to achieve the parsing of Word documents with titles, specifically including: In response to the client's interface call request, the system retrieves the directory tree structure and document content corresponding to the Word document from the database, and displays the directory tree structure on the left side of the client's page and the document content on the right side of the client's page. Determine the document query requirements corresponding to the client, and determine the location information of the document content corresponding to the document query requirements in the directory tree structure; Based on the location information, the document content corresponding to the document query request is highlighted on the right side of the client's page.

7. A Word document parsing device, characterized in that, The device includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a Word document parsing method as described in any one of claims 1-6.

8. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer, when executing executable instructions, implements a Word document parsing method as described in any one of claims 1-6.