A structured document processing method and device
By generating structured writing templates and using template identification tags, the problem of incomplete structuring of existing document writing is solved, efficient document writing and automatic parsing are achieved, and writing efficiency and parsing accuracy are improved.
Patent Information
- Application Number
- CN202411805493.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The existing document writing method requires users to edit on a blank page, resulting in incompletely structured documents that are difficult to further parse and extract data. The writing process is also time-consuming, reducing writing efficiency.
By assembling basic writing components, a structured writing template is generated, allowing users to write and generate corresponding structured documents based on the structured writing template, and using template identification identifiers and component identification identifiers to achieve automatic document parsing and data extraction.
It improves document writing efficiency, reduces writing difficulty, supports automatic parsing and data extraction of structured documents, and reduces human errors.
Smart Images

Figure CN119692323B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a structured document processing method and device. Background Art
[0002] Local or online document editing provides text editing capabilities, supporting users to write documents using text, tables, charts, and other content. However, the existing writing method requires users to edit and create documents on a blank page based on document writing needs. This writing method makes the final document not completely structured, which is not conducive to subsequent further structured analysis or data extraction of the document. The user writing process is also very time-consuming, which increases the difficulty of document writing and reduces document writing efficiency. Summary of the Invention
[0003] In view of this, the purpose of this application is to at least provide a structured document processing method and device, which generates a structured writing template by assembling basic writing components, allowing users to generate corresponding structured documents based on the structured writing template, thereby improving document writing efficiency and reducing document writing difficulty.
[0004] This application mainly includes the following aspects:
[0005] In the first aspect, an embodiment of the present application provides a structured document processing method, including: creating a writing requirement document based on business needs, the writing requirement document including multiple writing requirement items; creating a writing sub-template corresponding to each writing requirement item based on multiple basic writing components and determining a template identification identifier corresponding to each writing sub-template; encapsulating the writing sub-template corresponding to each writing requirement item to form a requirement document editing template corresponding to the writing requirement document and generating a corresponding template identification identifier; forming a target structured document in response to a document editing operation performed on the requirement document editing template.
[0006] In one possible implementation, each basic writing component provides independent component input and component output. The output data corresponding to the basic writing component is structured JSON data. The basic writing component identifies, locates, and extracts data content in the component through a component identification identifier.
[0007] In one possible implementation, a writing sub-template corresponding to each writing requirement item is created in the following manner: obtaining a writing structure corresponding to the writing requirement item, the writing structure at least indicating multiple components corresponding to the writing requirement item; for each component, splitting the component into a basic component level, and determining multiple first-target basic writing components corresponding to the component; for each component, encapsulating the multiple first-target basic writing components corresponding to the component to form a sub-level writing sub-template corresponding to the component; encapsulating the sub-level writing sub-template and the second-target basic writing component corresponding to each component to form a writing sub-template corresponding to the writing requirement item.
[0008] In a possible implementation, the method further includes: in the process of creating a requirement document editing template, identifying the writing structure corresponding to each writing requirement item; for target writing requirement items with the same writing structure, extracting the target function writing template corresponding to the target writing requirement item from a preset container; and directly determining the target function writing template as the writing sub-template corresponding to the target writing requirement item.
[0009] In one possible implementation, the function writing template is determined in the following manner: determining a reused writing structure from the writing structure corresponding to each writing requirement item; determining multiple basic function writing components corresponding to the reused writing structure from multiple basic writing components; creating a function writing template corresponding to the reused writing structure based on the common writing structure and the multiple basic function writing components and generating a corresponding template identification identifier; and saving the function writing template to a preset container.
[0010] In one possible embodiment, the method further includes: receiving a data extraction request for a target structured document; parsing the data extraction request, determining a content index corresponding to the data extraction request, the content index including a target component identification identifier for locating the target authoring content indicated by the data extraction request and a positioning hierarchy between the target component identification identifiers; extracting the target authoring content corresponding to the data extraction request from the target structured document according to the content index; and storing the target authoring content in a preset asset library.
[0011] In one possible implementation, the target writing content corresponding to the data extraction request is extracted from the target structured document in the following manner: according to the template identification identifier and the component identification identifier corresponding to the basic writing component, the target structured document is parsed layer by layer into a document structure diagram indexed by the writing content identification identifier and the component identification identifier; according to the content index, the basic writing component corresponding to the target writing content is located in the document structure diagram; and the target writing content is extracted from the basic writing component corresponding to the target writing content.
[0012] In a possible implementation, the method further includes: splitting the target structured document according to the corresponding structure of the requirement document editing template to obtain the structured writing content corresponding to each writing requirement item in the requirement document editing template; adding a corresponding template identification identifier to the structured writing content corresponding to each writing requirement item; storing the structured writing content and template identification identifier corresponding to each writing requirement item in a preset asset library to form template reuse data corresponding to each template identification identifier.
[0013] In one possible embodiment, the preset asset library includes writing reuse data corresponding to the writing sub-template corresponding to each writing requirement item, wherein the method further includes: in the process of forming the target structured document, for each writing requirement item, performing the following processing: determining whether the writing requirement item enables the data reuse function; if the requirement item enables the data reuse function, extracting the corresponding target template reuse data from the preset asset library based on the template identification identifier corresponding to the writing sub-template of the writing requirement item; and replacing the target template reuse data with the writing sub-template corresponding to the writing requirement item.
[0014] In the second aspect, an embodiment of the present application also provides a structured document processing device, which includes: a first creation module, used to create a writing requirement document according to business needs, and the writing requirement document includes multiple writing requirement items; a second creation module, used to create a writing sub-template corresponding to each writing requirement item based on multiple basic writing components and determine the template identification identifier corresponding to each writing sub-template; an encapsulation module, used to encapsulate the writing sub-template corresponding to each writing requirement item, form a requirement document editing template corresponding to the writing requirement document and generate a corresponding template identification identifier; a writing module, used to form a target structured document in response to a document editing operation performed on the requirement document editing template.
[0015] The embodiment of the present application provides a structured document processing method and device, including: creating a writing requirement document according to business needs, the writing requirement document including multiple writing requirement items; creating a writing sub-template corresponding to each writing requirement item and determining a template identification identifier corresponding to each writing sub-template according to multiple basic writing components; encapsulating the writing sub-template corresponding to each writing requirement item to form a requirement document editing template corresponding to the writing requirement document and generating a corresponding template identification identifier; forming a target structured document in response to a document editing operation performed on the requirement document editing template. The structured writing template is generated by assembling the basic writing components, so that the entire document is a data fragment that can be disassembled and assembled, and whether it is the basic writing component or the writing sub-template formed by splicing the basic writing components, all provide structured data, so that users can generate corresponding structured documents based on the structured writing template, thereby improving document writing efficiency and reducing document writing difficulty.
[0016] In addition, all basic writing components support structured JSON data output, which is more convenient for subsequent parsing. The basic writing components include digital graph components that support data echo images, which can achieve seamless switching between user-filled content and graphics. In order to improve the efficiency of creating requirement document editing templates, this application proposes to extract such reusable writing structures separately to create corresponding templates and save them. In this way, when such templates are used multiple times, there is no need to create them repeatedly, and they can be directly extracted from the specified location, which can improve the efficiency of creating requirement document editing templates.
[0017] Furthermore, the present application also creates a corresponding document structure diagram through template identification identifiers and component identification identifiers, thereby locating the corresponding basic writing components and the writing content corresponding to the components based on the document structure diagram, thereby improving data extraction and positioning efficiency.
[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 A flowchart of a structured document processing method provided by an embodiment of the present application is shown;
[0021] Figure 2 An example diagram of a sub-template writing method provided in an embodiment of the present application is shown;
[0022] Figure 3 A partial schematic diagram of a document structure diagram provided in an embodiment of the present application is shown;
[0023] Figure 4 A functional module diagram of a structured document processing device provided by an embodiment of the present application is shown;
[0024] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of illustration and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can be implemented out of sequence, and steps without logical context can be reversed or implemented simultaneously. In addition, those skilled in the art, under the guidance of the contents of this application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0026] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0027] Local or online document editing provides text editing capabilities, supporting users to write documents using text, tables, charts, and other content. However, the existing writing method requires users to edit and create documents on a blank page based on document writing needs. This writing method makes the final document not completely structured, which is not conducive to subsequent further structured analysis or data extraction of the document. The user writing process is also very time-consuming, which increases the difficulty of document writing and reduces document writing efficiency.
[0028] Based on this, the embodiments of the present application provide a structured document processing method and apparatus, which generates a structured writing template by assembling basic writing components, allowing users to write and generate corresponding structured documents based on the structured writing template, thereby improving document writing efficiency and reducing document writing difficulty. The details are as follows:
[0029] See also Figure 1 , Figure 1 FIG1 shows a flow chart of a structured document processing method provided by an embodiment of the present application. Figure 1 As shown, the method provided in the embodiment of the present application includes the following steps:
[0030] S100. Create and write requirement documents based on business needs.
[0031] Writing a requirements document includes writing multiple requirements items.
[0032] S200: Create a writing sub-template corresponding to each writing requirement item according to a plurality of basic writing components and determine a template identification identifier corresponding to each writing sub-template.
[0033] S300: Encapsulate the writing sub-template corresponding to each writing requirement item to form a requirement document editing template corresponding to the writing requirement document and generate a corresponding template identification identifier.
[0034] S400: In response to a document editing operation performed on a requirement document editing template, a target structured document is formed.
[0035] In steps S100 to S400 of the present application, based on business needs, structured writing sub-templates are assembled to form a requirement document editing template. This process achieves a structured writing framework for the document. When users use the structured requirement document editing template to write business needs, they only need to fill in the content as required to easily complete the writing of the target structured document. In this process, structured document writing is realized, and the target structured document can be automatically parsed through template recognition identification to improve parsing efficiency.
[0036] In a specific implementation, in step S100, a writing requirement document for online document writing is compiled according to business needs. The writing requirement document can be a document writing outline. The writing requirement document includes multiple levels of directories, and each level of directory includes multiple writing requirement items, as shown in Table 1. Table 1 shows multiple writing requirement items corresponding to a writing requirement document provided in this application.
[0037] Table 1
[0038]
[0039] As shown in Table 1, the multi-level directory includes the first-level directory, the second-level directory, the third-level directory and the fourth-level directory. The multi-level directory is mainly used to distinguish the hierarchical relationship between multiple writing requirement items. Specifically, the corresponding writing requirement items under the first-level directory include introduction, business overview, business functions and appendix. Taking the writing requirement item "introduction" as an example, the writing requirement items such as "writing purpose", "intended readers" and "business terms" under the second-level directory belong to the sub-writing requirement items corresponding to "introduction", and so on.
[0040] The method of the present application is applied to a document editing system, which provides multiple basic writing components for editing and generating document editing templates. Different basic writing components provide different document online editing and drawing functions.
[0041] Specifically, the multiple basic writing components include but are not limited to at least one of the following items: a text component, an input box component, a picture component, a title component, a table component, and a digital image component that supports data echo images.
[0042] Basic writing components are defined and encapsulated as atomic components. Each basic writing component provides independent component input and component output. The output data corresponding to the basic writing component is structured JSON data. Each basic writing component is assigned a corresponding component identification identifier. The component identification identifier can be used to identify and locate the basic writing component, and the data content corresponding to the filled-in basic writing component can be extracted. The component identification identifier can ensure that the most fine-grained data content can be parsed and identified.
[0043] Please refer to Table 2, which shows a basic writing component attribute statistics table provided in an embodiment of the present application.
[0044] Table 2
[0045]
[0046]
[0047] As shown in Table 2, taking the basic writing component "text" as an example, its corresponding component identification identifier is "txt", the component input is text data or rich text data, and the component output is text data or rich text data. For any basic writing component in Table 2, the corresponding component output data format is structured JSON. For example, for the basic writing component "Digital Graph-Flowchart", its corresponding component identification identifier is "flow", the component input is a flowchart drawn online, and it supports input JSON data to echo flowchart graphics. The component output is structured JSON data corresponding to the drawn flowchart. The corresponding display data of the "Digital Graph-Flowchart" component is subsequently parsed into a document format, and can be recognized by the flowchart component and restored to a flowchart drawn by the user, and the elements or data in the flowchart can be recognized.
[0048] In this application, a basic writing component is used to define a writing sub-template with business meaning, and the template identification identifier of the writing sub-template and the component identification identifier corresponding to the basic writing component are specified, so that when the target structured document is subsequently parsed, the target structured document can be parsed and data extracted through the component identification identifier and the template identification identifier.
[0049] And because the basic writing component in this application also includes a digital image component that supports data echo images, seamless conversion between user-filled content and graphics can be achieved.
[0050] In step S200, the basic writing components provided by the document editing system are used to assemble the writing sub-template corresponding to each writing requirement item. The writing sub-template is a parsing unit that contains business significance and can be structured. Each writing sub-template has a unique template identification identifier, and the target basic components used to form the writing sub-template also have corresponding component identification identifiers. Each writing sub-template can be used as an asset matching unit.
[0051] In a preferred embodiment, a writing sub-template corresponding to each writing requirement item is created and each writing sub-template is determined in the following manner:
[0052] Obtain the writing structure corresponding to the writing requirement item, wherein the writing structure at least indicates multiple components corresponding to the writing requirement item. For each component, split the component into the basic component level, determine the multiple first-target basic writing components corresponding to the component, and for each component, encapsulate the multiple first-target basic writing components corresponding to the component to form a sub-level writing sub-template corresponding to the component. The sub-level writing sub-template corresponding to each component and the second-target basic writing component are encapsulated to form a writing sub-template corresponding to the writing requirement item.
[0053] In one example, taking the writing requirement item "Introduction" in Table 1 as an example, assuming that a writing sub-template corresponding to the "Introduction" is created, first sort out and determine the writing structure corresponding to the writing sub-template corresponding to the "Introduction", that is, first clarify the components of the "Introduction". Referring to Table 1, "Introduction" is a writing requirement item in the first-level directory, and its corresponding components include "writing purpose", "intended readers" and "business terms". Then, the components are split into the basic writing component level, and the multiple first-target basic writing components corresponding to each component are determined.
[0054] Taking the "Writing Purpose" splitting process as an example, the "Writing Purpose" includes three basic component-level writing elements, namely "Title", "Description" and "Content" corresponding to the writing purpose. The three writing elements are created using the corresponding basic writing components.
[0055] "Title" can be created using the title component in the basic writing component (the component identification mark is head), and the title component is used to edit the title "writing purpose".
[0056] "Description" can use the text component in the basic writing component (the component identification mark is txt). The text component is used to explain the "writing purpose" and to instruct users how to fill in the writing purpose.
[0057] "Content" can use the input box component (the component identification mark is input), and the user can use the input box component to complete the filling of the specific content corresponding to the "writing purpose".
[0058] From the above process, it can be seen that after the "writing purpose" is split into the basic component level, its corresponding multiple first-target basic writing components are title components, text components, and input box components. Similarly, by splitting the "intended readers" and "business terms", the multiple first-target basic writing components corresponding to them can also be analyzed.
[0059] After analysis, multiple first-target basic writing components corresponding to "writing purpose", "intended readers" and "business terms" are encapsulated to create sub-level writing sub-templates corresponding to "writing purpose", "intended readers" and "business terms", and at the same time, the template identification identifier corresponding to each sub-level writing sub-template must be determined.
[0060] The second target basic writing component can be a title component. Specifically, after obtaining the sub-level writing sub-templates corresponding to "writing purpose", "intended readers" and "business terms", the title component is introduced to create the corresponding title of "introduction", and then the corresponding title of "introduction" is used to encapsulate multiple sub-level writing sub-templates corresponding to "introduction", and finally form the writing sub-template corresponding to "introduction", and at the same time determine the template identification identifier corresponding to the writing sub-template corresponding to "introduction".
[0061] See also Figure 2 , Figure 2 An example diagram of a sub-template provided in an embodiment of the present application is shown. Figure 2 What is shown is the writing sub-template corresponding to the writing requirement item "Introduction", ① represents the sub-level writing sub-template corresponding to "Writing Purpose", and the sub-level writing sub-template ① is encapsulated by the title component "head", the text component "txt" and the text box "input". In the sub-level writing sub-template ①: the title component "head" is displayed as "Writing Purpose" after editing, and the text component "txt" is displayed as "Description: Please write the writing purpose description of this document in this chapter" after editing, and the text box "input" is displayed as the text box and the indicated input prompt "Please enter the writing purpose in this input box" after editing. The template identification identifier corresponding to the sub-level writing sub-template ① is "purpose".
[0062] ② represents the sub-level writing sub-template corresponding to "intended readers". Sub-level writing sub-template ② is encapsulated by the title component "head", the text component "txt" and the text box "input". In sub-level writing sub-template ②: the title component "head" is displayed as "intended readers" after editing, the text component "txt" is displayed as "Instructions: Please write the intended readers of this document in this chapter" after editing, and the text box "input" is displayed as the text box and the indicated input prompt "Please enter the intended readers in this input box" after editing. The template identification identifier corresponding to sub-level writing sub-template ② is "reader".
[0063] ③ represents the sub-level writing sub-template corresponding to "Term Definition". Sub-level writing sub-template ③ is encapsulated by the title component "head", the text component "txt" and the table component "table". In sub-level writing sub-template ③: the title component "head" is displayed as "Term Definition" after editing, the text component "txt" is displayed as "Instructions: Please enter the term definition in the table" after editing, and the table "table" is displayed as the corresponding table after editing (the table columns include serial numbers, business terms and explanations). The template identification mark corresponding to sub-level writing sub-template ③ is "definition".
[0064] ④ represents the writing sub-template corresponding to "Introduction", which is created by introducing the title component "head" to form the corresponding title "Introduction". Then, the title "Introduction" and the sub-level writing sub-templates ①, ② and ③ together form the entire writing sub-template ④. The template identification mark corresponding to the writing sub-template ④ is "Reference".
[0065] In this application, the components corresponding to the writing requirement items need to be split layer by layer to the basic component level. For example, as shown in Table 1, if the writing requirement item is a business function, its corresponding components include multiple business functions, and for each business function, during the basic component level splitting of the business function, the first splitting determines that the writing elements corresponding to the business function include function description, business rules, and input and output. Among them, the function description and business rules belong to the basic component level, but the input and output do not belong to the basic component level, so they need to be further split until the input and output are decomposed to the basic component level such as input and output. After all the decomposition is completed, they can be further assembled according to the decomposition results and the split level to form the writing sub-template corresponding to the business function.
[0066] The method provided in this application also includes:
[0067] This application can select the completed writing sub-template for encapsulation according to its own needs to obtain a more advanced writing sub-template to facilitate richer business expression.
[0068] In a preferred embodiment, the method provided by the present application further includes:
[0069] In the process of creating a requirement document editing template, the writing structure corresponding to each writing requirement item is identified. For the target writing requirement item with the same writing structure, the target function writing template corresponding to the target writing requirement item is extracted from the preset container, and the target function writing template is directly determined as the writing sub-template corresponding to the target writing requirement item.
[0070] In another preferred embodiment, the function writing template is determined in the following manner:
[0071] From the writing structure corresponding to each writing requirement item, determine the reused writing structure; from multiple basic writing components, determine multiple basic function writing components corresponding to the reused writing structure; based on the common writing structure and multiple basic function writing components, create a function writing template corresponding to the reused writing structure and generate a corresponding template identification identifier; save the function writing template to a preset container.
[0072] Preferably, Figure 2 Taking the writing requirement item "business function" shown in as an example, the writing structures corresponding to different business functions are the same, which all include writing structures such as 3.1.1 to 3.1.4. Therefore, 3.1 and the following 3.1.1 to 3.1.4 are determined as a business function point. Then, based on multiple basic function writing components related to the business function point, a corresponding function writing template is created, and the function writing template is defined in a preset container so that when the requirement document editing template is created and applied to the basic function writing component, it can be directly extracted from the preset container.
[0073] In order to improve the efficiency of creating requirement document editing templates, this application proposes to extract such reusable writing structures separately to create corresponding templates and save them. In this way, when such templates are used multiple times, there is no need to create them repeatedly, and they can be directly extracted from the specified location. This can improve the efficiency of creating requirement document editing templates.
[0074] In a preferred embodiment, in step S400, for the formed demand document editing template, when the user writes the corresponding target structured document, he only needs to fill in the demand document editing template according to the requirements of the demand document editing template. The filled-in demand document editing template forms the final target structured document. Specifically, the document editing operation performed by the user on the demand document editing template corresponds to the basic writing component in the document editing template. The content is entered according to the requirements of the basic writing component. After the entry is completed, it is saved and published as the target structured document.
[0075] In a specific embodiment, the document editing operation has different corresponding editing operation interaction methods according to its operation object, as shown in Table 3. Table 3 shows a mapping table between a basic writing component and the editing operation interaction method provided by this application.
[0076] Table 3
[0077]
[0078] As shown in Table 3, taking the basic writing component "Text" as an example, its corresponding editing operation interaction method is "directly enter text content".
[0079] In a preferred embodiment, the method provided by the present application further includes:
[0080] Receive a data extraction request for a target structured document, parse the data extraction request, determine a content index corresponding to the data extraction request, the content index includes a target component identification identifier for locating the target authored content indicated by the data extraction request and a positioning hierarchy between the target component identification identifiers, extract the target authored content corresponding to the data extraction request from the target structured document based on the content index; and store the target authored content in a preset asset library.
[0081] In addition, in the existing technology, when data extraction is required for a document, the document reader understands the content of the document through reading comprehension, and manually identifies, extracts and organizes the structured content information expressed in the document based on the content of the document, and enters the manually identified information into the relevant fields or areas of the relevant business system to complete the human-computer interactive input of the document content. This process relies on the consistent understanding between the document writer and the person responsible for identifying and organizing the document content.
[0082] To reduce misunderstandings, the traditional approach is to agree with the computer on specific characters or symbols to identify and extract specific content. However, this approach also has many problems: unclear character agreement range leads to inaccurate extraction, conflicts between symbols and actual content lead to recognition errors, too many writing restrictions, inability to identify and extract multi-level content into multiple fields, limited parsing capabilities, and inability to reuse.
[0083] Based on this, this application provides the following method to extract the target written content corresponding to the data extraction request from the target structured document:
[0084] According to the template identification identifier and the component identification identifier corresponding to the basic writing component, the target structured document is parsed layer by layer into a document structure diagram indexed by the component identification identifier, and the basic writing component corresponding to the target writing content is located in the document structure diagram according to the content index, and the target writing content is extracted from the basic writing component corresponding to the target writing content.
[0085] Specifically, if there is a data extraction request: a business attribute needs to extract the information corresponding to the [Input] field corresponding to business function 1 in the target structured document, the specific operation method is as follows:
[0086] First, identify the writing sub-template corresponding to the target structured document according to the template identification identifier, and then use the component identification identifier to parse the writing sub-template one by one to obtain the document structure diagram indexed by the component identification identifier. Figure 3 , Figure 3 A partial schematic diagram of a document structure diagram provided in an embodiment of the present application is shown.
[0087] According to the query logic, the title should be determined first, and then the corresponding data should be extracted from the corresponding content under the title. In this application, each title is created through the title component. Therefore, when parsing the data extraction request, the business function 1 and the [input] field can be located by identifying the component identification identifier "head" corresponding to the title component. The [input] field is analyzed, and its corresponding information is stored in the table component indicated by the component identification identifier "table" in the writing sub-template corresponding to the [input] field. Therefore, the content index corresponding to the data extraction request can be determined as:
[0088] head=busuness-req-list, head=busuness-req, head=business function 1, head=in-output, head=[input and output], head=input, head=input, table.
[0089] Based on Figure 3 As shown in the partial schematic diagram, the content index extraction component identifies the structured JSON content input by the user in the table indicated by the identifier table.
[0090] Specifically, since structured documents are written and generated through the corresponding requirement document editing template, the structured documents include template identification identifiers at each level. Based on data extraction requests, the structured parsing of structured documents can be achieved by automatically identifying and extracting specified content through the construction of content indexes.
[0091] Based on the above technical problems, this application utilizes the method of creating a demand document editing template formed by writing sub-templates. Each writing sub-template is composed of corresponding basic writing components. Users edit documents based on the templates, so that the final document is assembled with structured writing sub-templates. Each writing sub-template is content data that can be identified and read. The structured basic writing components are assembled into large writing sub-templates to form the entire document, so that the entire document is a data fragment that can be disassembled and assembled. Regardless of the basic writing components or the writing sub-templates formed by the splicing of basic writing components, all provide structured data. Therefore, the final structured document can be easily supported by the direct recognition and extraction of structured content, which can realize automatic parsing of various types of structured writing documents, improve parsing efficiency, reduce the error caused by human participation in parsing, and improve parsing accuracy.
[0092] In a preferred embodiment, the method further comprises:
[0093] The target structured document is split according to the corresponding structure of the requirement document editing template to obtain the structured writing content corresponding to each writing requirement item in the requirement document editing template, and a corresponding template identification identifier is added to the structured writing content corresponding to each writing requirement item. The structured writing content and template identification identifier corresponding to each writing requirement item are stored in the preset asset library to form template reuse data corresponding to each template identification identifier.
[0094] Specifically, multiple writing sub-templates have been assembled according to the rules in the requirement document editing template, and each writing sub-template has a corresponding template identification identifier. Therefore, if the data corresponding to the writing sub-template needs to be reused, this application proposes to save the data filled in by the user for each writing sub-template in units of writing sub-templates, and also add the corresponding template identification identifier to the saved data to facilitate subsequent reuse and matching, so as to facilitate iterative reuse after get off work. This can save users' document editing time and shorten document editing efficiency.
[0095] From this, it can be seen that the present application also supports data updates based on writing sub-templates. Specifically, since the content corresponding to the structured document is completely composed of structured data filled in through the writing sub-template, when designing and generating the writing sub-template, an independent data storage identifier can be added to the writing sub-template. In this way, when parsing the structured document, after parsing each writing sub-template, the writing sub-template data is saved independently in the asset library and the corresponding template identification identifier is added. The user can update the corresponding writing sub-template data in the asset library according to the template identification identifier. After the update is completed, the corresponding data of the structured document is pulled again to form the latest structured document, thereby realizing automatic preservation of the document.
[0096] In another preferred embodiment, the preset asset library includes writing reuse data corresponding to the writing sub-template corresponding to each writing requirement item, and the method provided by the present application further includes:
[0097] In the process of forming the target structured document, the following processing is performed for each writing requirement item: determine whether the writing requirement item enables the data reuse function; if the requirement item enables the data reuse function, then based on the template identification identifier corresponding to the writing sub-template of the writing requirement item, extract the corresponding target template reuse data from the preset asset library, and replace the target template reuse data with the writing sub-template corresponding to the writing requirement item.
[0098] When it is determined that the writing requirement item requires asset reuse, the template identification identifier of the writing sub-template corresponding to the writing requirement item is matched with the template identification identifier corresponding to the template reuse data stored in the preset asset library. If the match is successful, the matching target template reuse data can be directly replaced into the corresponding writing sub-template.
[0099] Based on the same application concept, the embodiments of the present application also provide a structured document processing device corresponding to the structured document processing method provided in the above embodiments. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the structured document processing method in the above embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0100] See also Figure 4 , Figure 4 FIG1 shows a functional module diagram of a structured document processing device provided by an embodiment of the present application. Figure 4 As shown, the device includes:
[0101] The first creation module 500 is used to create a writing requirement document according to business requirements. The writing requirement document includes multiple writing requirement items.
[0102] The second creation module 510 is used to create a writing sub-template corresponding to each writing requirement item according to multiple basic writing components and determine a template identification identifier corresponding to each writing sub-template.
[0103] The encapsulation module 520 is used to encapsulate the writing sub-template corresponding to each writing requirement item, form a requirement document editing template corresponding to the writing requirement document, and generate a corresponding template identification mark.
[0104] The writing module 530 is configured to generate a target structured document in response to a document editing operation performed on the requirement document editing template.
[0105] Based on the same application idea, please refer to Figure 5 , Figure 5 The following is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 600 includes a processor 610, a memory 620, and a bus 630. The memory 620 stores machine-readable instructions executable by the processor 610. When the electronic device 600 is in operation, the processor 610 and the memory 620 communicate via the bus 630. The machine-readable instructions are executed by the processor 610 to execute the steps of the structured document processing method provided in any of the above embodiments.
[0106] Based on the same application concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps of the structured document processing method provided in the above embodiment are executed.
[0107] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0108] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0109] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0110] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. 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. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0111] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A structured document processing method, characterized in that: The method comprises: Create a writing requirement document based on business needs. The writing requirement document includes a multi-level directory, each level of the directory includes multiple writing requirement items, and the multi-level directory is used to distinguish the hierarchical relationship between the multiple writing requirement items; Based on multiple basic writing components, a writing sub-template corresponding to each writing requirement item is created and a template identification identifier corresponding to each writing sub-template is determined. Each basic writing component is assigned a corresponding component identification identifier, which is used to identify and locate the basic writing component and extract the data content corresponding to the filled basic writing component. The writing sub-template is a business-meaningful and structured parsing unit formed by encapsulating the basic writing components; According to the hierarchical relationship between the writing requirement items indicated by the multi-level directory, encapsulate the writing sub-template corresponding to each writing requirement item, form a requirement document editing template corresponding to the writing requirement document, and generate a corresponding template identification mark; In response to the document editing operation performed on the requirement document editing template, a target structured document is formed.
2. The method according to claim 1, characterized in that Each basic writing component provides independent component input and component output. The output data corresponding to the basic writing component is structured JSON data. The basic writing component uses the component identification identifier to identify, locate, and extract the data content in the component.
3. The method according to claim 2, characterized in that Create a sub-template for each writing requirement item in the following way: Obtaining a writing structure corresponding to the writing requirement item, wherein the writing structure at least indicates a plurality of component elements corresponding to the writing requirement item; For each component, split the component into a basic component level, and determine a plurality of first target basic writing components corresponding to the component; For each component, a plurality of first target basic writing components corresponding to the component are encapsulated to form a sub-level writing sub-template corresponding to the component; The sub-level writing sub-template corresponding to each component and the second target basic writing component are encapsulated to form the writing sub-template corresponding to the writing requirement item.
4. The method according to claim 3, characterized in that The method further comprises: When creating a requirement document editing template, identify the writing structure corresponding to each requirement item; For target writing requirement items with the same writing structure, extract the target function writing template corresponding to the target writing requirement item from the preset container; The target function writing template is directly determined as the writing sub-template corresponding to the target writing requirement item.
5. The method according to claim 4, characterized in that The function writing template is determined by: Determine the reusable writing structure from the writing structure corresponding to each writing requirement item; Determining, from the plurality of basic writing components, a plurality of basic function writing components corresponding to the reused writing structure; Creating a function writing template corresponding to the reused writing structure and generating a corresponding template identification mark according to the same writing structure and the multiple basic function writing components; The function writing template is saved in a preset container.
6. The method according to claim 3, characterized in that The method further comprises: receiving a data extraction request for the target structured document; Parsing the data extraction request to determine a content index corresponding to the data extraction request, the content index including a target component identification identifier for locating the target authored content indicated by the data extraction request and a location hierarchy between target component identification identifiers; extracting target written content corresponding to the data extraction request from the target structured document according to the content index; The target authored content is stored in a preset asset library.
7. The method according to claim 6, characterized in that Extracting target written content corresponding to the data extraction request from the target structured document in the following manner: According to the template identification identifier and the component identification identifier corresponding to the basic writing component, the target structured document is parsed layer by layer into a document structure graph indexed by the writing content identification identifier and the component identification identifier; Locating a basic writing component corresponding to the target writing content in the document structure diagram according to the content index; The target authoring content is extracted from the basic authoring components corresponding to the target authoring content.
8. The method according to claim 1, characterized in that The method further comprises: Split the target structured document according to the corresponding structure of the requirement document editing template to obtain the structured writing content corresponding to each writing requirement item in the requirement document editing template; Add a corresponding template identification mark to the structured writing content corresponding to each writing requirement item; The structured writing content and template identification corresponding to each writing requirement item are stored in a preset asset library to form template reuse data corresponding to each template identification identification.
9. The method according to claim 8, characterized in that The preset asset library includes the writing reuse data corresponding to the writing sub-template corresponding to each writing requirement item. The method further comprises: In the process of forming the target structured document, the following processing is performed for each writing requirement item: Determine whether the data reuse function is enabled for this writing requirement item; If the data reuse function is enabled for the requirement item, then extracting the corresponding target template reuse data from the preset asset library according to the template identification identifier corresponding to the writing sub-template of the writing requirement item; The target template reuse data is replaced with the writing sub-template corresponding to the writing requirement item.
10. A structured document processing device, characterized in that: The device comprises: A first creation module is used to create a writing requirement document based on business needs. The writing requirement document includes a multi-level directory, each level of the directory includes multiple writing requirement items, and the multi-level directory is used to distinguish the hierarchical relationship between the multiple writing requirement items; A second creation module is used to create a writing sub-template corresponding to each writing requirement item based on multiple basic writing components and determine a template identification identifier corresponding to each writing sub-template. Each basic writing component is assigned a corresponding component identification identifier, which is used to identify and locate the basic writing component and extract the data content corresponding to the filled basic writing component. The writing sub-template is a business-meaningful and structured parsing unit formed by encapsulating the basic writing components; An encapsulation module is used to encapsulate the writing sub-template corresponding to each writing requirement item according to the hierarchical relationship between the writing requirement items indicated by the multi-level directory, form a requirement document editing template corresponding to the writing requirement document, and generate a corresponding template identification mark; The writing module is used to form a target structured document in response to a document editing operation performed on the requirement document editing template.
Citation Information
Patent Citations
Program document generation method based on vehicle business development platform and development platform
CN114296727A
System for generating a structured document
US20020143818A1