Document analysis method and device

By converting Word documents to markdown format and combining XML format analysis, the problem of low efficiency and accuracy of Word documents is solved, and efficient and accurate document parsing and layout maintenance is achieved.

CN119250056APending Publication Date: 2025-01-03WEICHAI POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411101449.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The existing technology has problems with low parsing efficiency and accuracy in parsing Word documents, especially in the process of merging cells and other table parsing, which requires a lot of code to be written and the original layout effect cannot be maintained.

Method used

By converting Word documents to markdown format documents, identify content based on preset style templates, determine whether there is content that does not conform to markdown format, and parse content that does not conform to format through markdown format, use XML format to parse content that does not conform to format, and merge Both are used to achieve parsing.

Benefits of technology

Improve the efficiency and accuracy of document parsing, realize efficient parsing of Word documents, and ensure the accuracy and layout effect of the analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119250056A_ABST
    Figure CN119250056A_ABST
Patent Text Reader

Abstract

The invention provides a document parsing method and device, and relates to the field of document processing, the document parsing method comprises the steps: obtaining a to-be-parsed document, converting the to-be-parsed document into a Markdown format document, the to-be-parsed document being a word document; based on a preset style template, identifying the content in the markdown format document to obtain an identification result, the identification result being used for representing whether the content which does not conform to the markdown format exists in the markdown format document; based on the recognition result, the document in the Markdown format is analyzed through a target format, the analysis content of the document to be analyzed is obtained, and the target format comprises at least one of the Markdown format and the xml format. According to the Word document analysis method and device, the Word document analysis efficiency and accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of document processing, and in particular to a document parsing method and device. Background Art

[0002] Word document is a format of electronic document. In order to extract information from the document, convert the format, integrate information, etc., Word document needs to be parsed.

[0003] However, the underlying native format of word documents is XML, and the XML document structure is relatively complex, which requires a lot of code to be written during table parsing such as merging cells, and the original layout effect cannot be maintained. Although the related art uses a converter to convert the XML structure into a Markdown structure before parsing, Markdown cannot recognize complex document structures, that is, the existing technology has problems with low parsing efficiency and accuracy in parsing Word documents.

[0004] It should be noted that the above statements are only used to provide background technical information related to the present application and do not necessarily constitute prior art. Summary of the invention

[0005] In view of this, the purpose of the present application is to propose a document parsing method and device, which can specifically solve the problems of low parsing efficiency and accuracy in the existing Word document parsing.

[0006] Based on the above-mentioned purpose, in the first aspect, the present application proposes a document parsing method, the method comprising: obtaining a document to be parsed, converting the document to be parsed into a markdown format document, wherein the document to be parsed is a word document; identifying the content in the markdown format document based on a preset style template to obtain a recognition result, wherein the recognition result is used to characterize whether there is content in the markdown format document that does not conform to the markdown format; based on the recognition result, parsing the markdown format document through a target format to obtain the parsed content of the document to be parsed, wherein the target format includes at least one of a markdown format and an xml format.

[0007] In one embodiment, before obtaining the document to be parsed, the method includes: generating a word content template based on a compatible style of the word document, wherein the compatible style of the word document includes at least one of a title, a text format, a table, and a picture; converting the word content template into a markdown format to obtain the style template.

[0008] In one embodiment, the identifying of the content in the markdown format document based on a preset style template to obtain an identification result includes: reading all recognizable markdown styles in the style template; searching the style template for matches with all styles in the markdown format document; and when there are no matches for the markdown format document style in the style template, determining that there is content in the markdown format document that does not conform to the markdown format.

[0009] In one embodiment, when the recognition result indicates that there are contents that do not conform to the markdown format in the markdown format document, based on the recognition result, the markdown format document is parsed through the target format to obtain the parsed content of the document to be parsed, and the method includes: respectively obtaining the contents that conform to the markdown format and the contents that do not conform to the markdown format in the markdown format document; parsing the contents that conform to the markdown format through the markdown format to obtain first parsed content; parsing the contents that do not conform to the markdown format through the xml format to obtain second parsed content; and merging the first parsed content and the second parsed content to obtain the parsed content of the document to be parsed.

[0010] In one embodiment, the content that does not conform to the markdown format is parsed in XML format to obtain second parsed content, including: obtaining the word style name corresponding to the content that does not conform to the markdown format in the document to be parsed; traversing the word style name based on the POI framework to obtain the XML content corresponding to the content that does not conform to the markdown format as the second parsed content.

[0011] In a second aspect, a document parsing device is provided, the device comprising: a conversion module, used to obtain a document to be parsed, and convert the document to be parsed into a markdown format document, wherein the document to be parsed is a word document; a recognition module, used to recognize the content in the markdown format document based on a preset style template, and obtain a recognition result, wherein the recognition result is used to characterize whether there is content in the markdown format document that does not conform to the markdown format; a parsing module, used to parse the markdown format document through a target format based on the recognition result, and obtain the parsed content of the document to be parsed, wherein the target format includes at least one of a markdown format and an XML format.

[0012] In one embodiment, the device also includes a template creation module; the template creation module is used to generate a word content template based on the compatible style of the word document before obtaining the document to be parsed, and the compatible style of the word document includes at least one of a title, text format, table, and picture; convert the word content template into a markdown format to obtain the style template.

[0013] In one embodiment, the recognition module is used to read all recognizable markdown styles in the style template; search for matching items with all styles in the markdown format document in the style template; and when there is no matching item for the markdown format document style in the style template, determine that there is content in the markdown format document that does not conform to the markdown format.

[0014] In one embodiment, when the recognition result indicates that there are contents that do not conform to the markdown format in the markdown format document, the parsing module is used to respectively obtain the contents that conform to the markdown format and the contents that do not conform to the markdown format in the markdown format document; parse the contents that conform to the markdown format through the markdown format to obtain first parsed contents; parse the contents that do not conform to the markdown format through the xml format to obtain second parsed contents; and merge the first parsed contents and the second parsed contents to obtain the parsed contents of the document to be parsed.

[0015] In one embodiment, the parsing module is also used to obtain the word style name corresponding to the content that does not conform to the markdown format in the document to be parsed; traverse the word style name based on the POI framework to obtain the xml content corresponding to the content that does not conform to the markdown format as the second parsed content.

[0016] In general, this application has at least the following beneficial effects:

[0017] This embodiment converts a Word document into a Markdown format document by combining the respective advantages of Markdown and XML, which can realize the processing of simple content and improve the efficiency of document parsing. It can parse complex content that does not conform to the Markdown format through the XML format, improve the accuracy of document parsing, and achieve improved efficiency and accuracy of Word document parsing.

[0018] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application. In addition, the same reference numerals are used to represent the same parts in all the drawings.

[0020] Figure 1 A flowchart showing the steps of the document parsing method of the present application;

[0021] Figure 2 A schematic diagram of converting a cell style in a Word document into a table style in a markdown document format is shown;

[0022] Figure 3 A schematic diagram of a Word document style is shown;

[0023] Figure 4 A schematic diagram of a markdown document style is shown;

[0024] Figure 5 A schematic diagram of an XML document style is shown;

[0025] Figure 6 A schematic diagram of the structure of a document parsing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0028] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0029] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0030] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0031] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).

[0032] In the description of the embodiments of the present application, the technical terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the embodiments of the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the embodiments of the present application.

[0033] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.

[0034] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0035] The relevant terms and explanations of the embodiments of the present application include the following: Word document is a format of electronic document, usually with a file extension of ".doc" or ".docx".

[0036] Markdown is a lightweight markup language that enables people to write documents in a plain text format that is easy to read and write.

[0037] A format converter is a software tool that can convert documents in different formats.

[0038] The Apache POI framework is an open source Java library that can greatly simplify Java programs' operations on Microsoft Office files.

[0039] The document parsing method of the embodiment of the present application is described below using Word as an example.

[0040] Figure 1 The flowchart of the document parsing method of the present application is shown in FIG. Figure 1 In an embodiment of the present application, the document parsing method includes:

[0041] S101, obtaining a document to be parsed, and converting the document to be parsed into a markdown format document.

[0042] In this embodiment, the document to be parsed is a word document. The document to be parsed is converted into a markdown format document. The Word document can be converted into a plain text format that is easy to read and write. The markdown document format is simple, and the word document parsing can be achieved using simple code.

[0043] Figure 2 A schematic diagram of converting a cell style in a Word document into a table style in a markdown document format is shown, Figure 2 As shown, the cell styles in a Word document include the formats of a single cell and merged cells, which can be converted into a markdown document to form a cell-free table style.

[0044] A markdown format document can be represented by a markdown format string, and then the markdown content string can be parsed to determine whether the content in the markdown format document can be recognized by the markdown format in the style template.

[0045] S102: Recognize the content in the markdown format document based on a preset style template to obtain a recognition result.

[0046] Word documents may contain different formats, and in the process of converting different formats into markdown documents, there may be content that markdown cannot recognize, that is, content that does not conform to the markdown format. Therefore, this embodiment uses a preset style template, which is generated based on different compatible styles of word documents, and then can recognize the content in the markdown document based on the preset style template to obtain a recognition result.

[0047] The recognition result is used to indicate whether there is content that does not conform to the markdown format in the markdown format document.

[0048] In one example, the recognition result includes that all contents in the markdown format document are in conformity with the markdown format, part of the contents in the markdown format document are in conformity with the markdown format, and the other part is not in conformity with the markdown format; and all contents in the markdown format document are not in conformity with the markdown format.

[0049] S103. Based on the recognition result, the markdown format document is parsed through the target format to obtain the parsed content of the document to be parsed.

[0050] In this embodiment, the target format includes at least one of the markdown format and the xml format. The markdown format is used to parse the content that conforms to the markdown format in the markdown format document, and the xml format is used to parse the content that does not conform to the markdown format in the markdown format document.

[0051] This embodiment converts a Word document into a Markdown format document by combining the respective advantages of Markdown and XML, which can realize the processing of simple content and improve the efficiency of document parsing. It can parse complex content that does not conform to the Markdown format through the XML format, improve the accuracy of document parsing, and achieve improved efficiency and accuracy of Word document parsing.

[0052] Before obtaining the document to be parsed, the method of this embodiment includes: generating a word content template based on a compatible style of the word document, converting the word content template into a markdown format, and obtaining a style template.

[0053] In this embodiment, the compatible styles of the word document include at least one of the title, text format, table, and picture. In this way, compatibility with different formats of content in the word document can be achieved, thereby improving recognition efficiency.

[0054] In this embodiment, the content in the markdown format document is identified based on a preset style template to obtain an identification result, including: reading all recognizable markdown styles in the style template; searching for matches with all styles in the markdown format document in the style template; and when there are no match items for the markdown format document style in the style template, determining that there is content in the markdown format document that does not conform to the markdown format.

[0055] For example, all recognizable markdown styles in the style template include five styles: A, B, C, D, and E, and all styles in the markdown format document include six styles: A, B, C, D, E, and F. Therefore, it can be seen that style F does not exist in the style template, that is, there is no match for style F of the markdown format document in the style template, and it is determined that there is content in the markdown format document that does not conform to the markdown format. Then, the content that cannot be recognized by the markdown format is read in XML format.

[0056] In this embodiment, when the recognition result indicates that there is content that does not conform to the markdown format in the markdown format document, based on the recognition result, the markdown format document is parsed through the target format to obtain the parsed content of the document to be parsed, and the method includes: respectively obtaining the content that conforms to the markdown format and the content that does not conform to the markdown format in the markdown format document; parsing the content that conforms to the markdown format through the markdown format to obtain the first parsed content; parsing the content that does not conform to the markdown format through the xml format to obtain the second parsed content; merging the first parsed content and the second parsed content to obtain the parsed content of the document to be parsed.

[0057] Continuing with the above example, assume that all styles in the markdown document include contents corresponding to six styles: A, B, C, D, E, and F, including A, B, C, D, and E as contents that conform to the markdown format, and F as content that does not conform to the markdown format. Then, the contents of A, B, C, D, and E that conform to the markdown format are parsed in the markdown format to obtain the first parsed content. The content of F that does not conform to the markdown format is parsed in the xml format to obtain the second parsed content. The first parsed content and the second parsed content are then merged to obtain the parsed content of the document to be parsed.

[0058] In this embodiment, the content that does not conform to the markdown format is parsed in XML format to obtain the second parsed content, including: obtaining the word style name corresponding to the content that does not conform to the markdown format in the document to be parsed; traversing the word style name based on the POI framework to obtain the XML content corresponding to the content that does not conform to the markdown format as the second parsed content.

[0059] That is to say, for the content in the document to be parsed that cannot be recognized and parsed by markdown, this application uses xml to identify and parse it, and then merges the content parsed by markdown and the content parsed by xml into a complete document. The output document can be markdown or other required formats.

[0060] The present application is described below by means of an embodiment.

[0061] Figure 3 A schematic diagram of a Word document style is shown. Figure 4 A schematic diagram of a markdown document style is shown. Figure 5 A schematic diagram of an XML document style is shown.

[0062] The various styles of the word document content that needs to be parsed, including titles, text formats, tables, pictures, etc., are unified into the word content template to form the following Figure 3 The Word document style shown in the figure can be converted into a markdown document through a document format converter to form the following Figure 4 The markdown document shown in the figure includes the first-level title, second-level title and body part. By parsing the markdown document content string, the content in the markdown format document is recognized based on the preset style template to obtain the recognition result. The recognition result is used to characterize whether there is content that does not conform to the markdown format in the markdown format document. The markdown style that can be matched in the style template is considered to be recognized and processed. If there is no matching style in the style template, it is considered that the markdown cannot be processed and the original XML format of the Word document needs to be read for parsing. The original XML format of the Word document can be as follows Figure 5 shown.

[0063] When the recognition result indicates that there is content that does not conform to the markdown format in the markdown format document, the word style name is traversed based on the POI framework to obtain the XML content corresponding to the content that does not conform to the markdown format. After parsing this part of the XML content, it is merged with the content obtained by markdown parsing to obtain the parsed content of the document to be parsed.

[0064] This embodiment first parses the document to be parsed through the markdown document format, which can quickly parse the relatively simple content in the word document. The desired content can be parsed using simple codes to improve the parsing efficiency. For the content that cannot be parsed by markdown, XML parsing is used to improve the accuracy of parsing. And by converting the document to be parsed into a markdown format document, all document contents are saved in the same string, and the relationship layout of different contents, including pictures and tables, can be clearly obtained, reducing the occurrence of the situation where the layout effects between different styles cannot be recognized.

[0065] Figure 6 A schematic diagram of the structure of a document parsing device provided in an embodiment of the present application is shown. The document parsing device 600 includes:

[0066] The conversion module 601 is used to obtain a document to be parsed and convert the document to be parsed into a markdown format document, wherein the document to be parsed is a word document;

[0067] The recognition module 602 is used to recognize the content in the markdown format document based on a preset style template to obtain a recognition result, wherein the recognition result is used to indicate whether there is content in the markdown format document that does not conform to the markdown format;

[0068] The parsing module 603 is used to parse the markdown format document through a target format based on the recognition result to obtain the parsed content of the document to be parsed, and the target format includes at least one of the markdown format and the XML format.

[0069] In one embodiment, the above-mentioned device also includes a template creation module; the template creation module is used to generate a word content template based on the compatible style of the word document before obtaining the document to be parsed, and the compatible style of the word document includes at least one of a title, text format, table, and picture; convert the word content template into a markdown format to obtain the style template.

[0070] In one embodiment, the identification module 602 is used to read all recognizable markdown styles in the style template; search for matching items with all styles in the markdown format document in the style template; and when there is no matching item for the markdown format document style in the style template, determine that there is content in the markdown format document that does not conform to the markdown format.

[0071] In one embodiment, when the recognition result indicates that there are contents that do not conform to the markdown format in the markdown format document, the parsing module 603 is used to respectively obtain the contents that conform to the markdown format and the contents that do not conform to the markdown format in the markdown format document; parse the contents that conform to the markdown format through the markdown format to obtain first parsed contents; parse the contents that do not conform to the markdown format through the xml format to obtain second parsed contents; and merge the first parsed contents and the second parsed contents to obtain the parsed contents of the document to be parsed.

[0072] In one embodiment, the parsing module 603 is also used to obtain the word style name corresponding to the content that does not conform to the markdown format in the document to be parsed; traverse the word style name based on the POI framework to obtain the xml content corresponding to the content that does not conform to the markdown format as the second parsed content.

[0073] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0074] The document parsing device provided in the above-mentioned embodiment of the present application and the document parsing method provided in the embodiment of the present application are based on the same application concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.

[0075] It should be noted that:

[0076] In the above text, the term "comprises", "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be noted that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0077] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0078] The embodiments of the present application are described above in conjunction with the accompanying drawings, which are only specific implementation modes of the present application. However, the present application is not limited to the above-mentioned specific implementation modes. The above-mentioned specific implementation modes are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A document parsing method, characterized in that: The method comprises: Obtain a document to be parsed, and convert the document to be parsed into a markdown format document, wherein the document to be parsed is a word document; Recognize the content in the markdown format document based on a preset style template to obtain a recognition result, wherein the recognition result is used to indicate whether there is content in the markdown format document that does not conform to the markdown format; Based on the recognition result, the markdown format document is parsed through a target format to obtain parsed content of the document to be parsed, and the target format includes at least one of a markdown format and an xml format.

2. The method according to claim 1, characterized in that Before obtaining the document to be parsed, the method includes: Generate a word content template based on a compatible style of a word document, wherein the compatible style of the word document includes at least one of a title, a text format, a table, and a picture; The word content template is converted into markdown format to obtain the style template.

3. The method according to claim 1, characterized in that The identifying the content in the markdown format document based on the preset style template to obtain the identification result includes: Read all recognizable markdown styles in the style template; Searching the style template for matches to all styles in the markdown format document; When there is no markdown format document style matching item in the style template, it is determined that there is content that does not conform to the markdown format in the markdown format document.

4. The method according to any one of claims 1 to 3, characterized in that: In a case where the recognition result indicates that the markdown format document contains content that does not conform to the markdown format, based on the recognition result, the markdown format document is parsed in a target format to obtain parsed content of the document to be parsed, the method comprising: Respectively obtain the content that complies with the markdown format and the content that does not comply with the markdown format in the markdown format document; Parsing the content in the markdown format using the markdown format to obtain first parsed content; Parsing the content that does not conform to the markdown format in XML format to obtain second parsed content; The first parsed content and the second parsed content are combined to obtain the parsed content of the document to be parsed.

5. The method according to claim 4, characterized in that Parsing the content that does not conform to the markdown format in XML format to obtain second parsed content includes: Get the word style name corresponding to the content that does not conform to the markdown format in the document to be parsed; Based on the POI framework, the word style name is traversed to obtain the XML content corresponding to the content that does not conform to the markdown format as the second parsed content.

6. A document parsing device, characterized in that: The device comprises: A conversion module is used to obtain a document to be parsed and convert the document to be parsed into a document in markdown format, wherein the document to be parsed is a word document; An identification module is used to identify the content in the markdown format document based on a preset style template to obtain an identification result, wherein the identification result is used to indicate whether there is content in the markdown format document that does not conform to the markdown format; A parsing module is used to parse the markdown format document through a target format based on the recognition result to obtain the parsed content of the document to be parsed, and the target format includes at least one of the markdown format and the XML format.

7. The device according to claim 6, characterized in that The device also includes a template creation module; The template creation module is used to generate a word content template based on a compatible style of a word document before obtaining a document to be parsed, wherein the compatible style of the word document includes at least one of a title, a text format, a table, and a picture; The word content template is converted into markdown format to obtain the style template.

8. The device according to claim 6, characterized in that The identification module is used to read all recognizable markdown styles in the style template; search for matching items with all styles in the markdown format document in the style template; and determine that there is content in the markdown format document that does not conform to the markdown format when there is no matching item for the markdown format document style in the style template.

9. The device according to claim 6, characterized in that When the recognition result indicates that there are contents that do not conform to the markdown format in the markdown format document, the parsing module is used to respectively obtain the contents that conform to the markdown format and the contents that do not conform to the markdown format in the markdown format document; parse the contents that conform to the markdown format through the markdown format to obtain first parsed contents; parse the contents that do not conform to the markdown format through the xml format to obtain second parsed contents; and merge the first parsed contents and the second parsed contents to obtain the parsed contents of the document to be parsed.

10. The device according to claim 9, characterized in that The parsing module is also used to obtain the word style name corresponding to the content that does not conform to the markdown format in the document to be parsed; traverse the word style name based on the POI framework to obtain the xml content corresponding to the content that does not conform to the markdown format as the second parsed content.