Document processing method and device
By invoking intelligent agents for format conversion and online structured template filling, the efficiency and accuracy issues of converting local documents into online structured documents are resolved, achieving efficient and accurate document processing and a user-friendly interactive editing experience.
Patent Information
- Application Number
- CN202511666942.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-03-20
AI Technical Summary
Existing technologies suffer from low conversion efficiency and poor accuracy when converting local documents into online structured documents, especially due to mismatches and recognition errors caused by inconsistent chapter order, making it difficult to meet users' needs for efficient office work.
By acquiring the pending requirement documents associated with the target business, the intelligent agent performs format conversion based on the prompts of the business requirement template, generates a structured markup document in markup language format, and populates the online structured template based on the structured markup document, supporting visual presentation and interactive editing.
It automates and standardizes document content processing, improves conversion efficiency and accuracy, enhances user experience and the completeness of information extraction, supports interactive editing, and improves user interaction with documents.
Smart Images

Figure CN121706731A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a document processing method and apparatus. Background Technology
[0002] As enterprises deepen their IT infrastructure development, a large amount of business knowledge, technical specifications, and management processes accumulate continuously in the form of unstructured local documents, serving as the source of business needs. These documents face numerous challenges in cross-system sharing, intelligent retrieval, and automated processing. By transforming traditional documents into online structured requirement documents, standardized organization, efficient reuse, and long-term maintenance of information can be achieved, thereby enhancing the intelligence level of enterprise knowledge management. Summary of the Invention
[0003] This disclosure provides a document processing method and apparatus to at least partially solve one of the technical problems in the related art. The technical solution of this disclosure is as follows: According to a first aspect of the present disclosure, a document processing method is provided, comprising: acquiring a pending requirement document associated with at least one target business; invoking an agent to perform format conversion on the pending requirement document based on prompt information associated with the agent, so as to obtain a structured markup document in markup language format returned by the agent; wherein the prompt information is obtained by filling a prompt template of the agent based on a business requirement template acquired in response to a selection operation, and the prompt information is used to guide the agent to perform structured reorganization and formatted output of the content of the pending requirement document according to the structured fields and hierarchies defined in the business requirement template; and filling a configured online structured template based on the structured markup document to generate an online structured requirement document that supports visual presentation and / or interactive editing.
[0004] According to a second aspect of the present disclosure, a document processing apparatus is provided, comprising: a first acquisition module, configured to acquire a pending requirement document associated with at least one target business; an invocation module, configured to invoke an agent to perform format conversion on the pending requirement document based on prompt information associated with the agent, so as to obtain a structured markup document in markup language format returned by the agent; wherein the prompt information is obtained by filling a prompt template of the agent based on a business requirement template acquired in response to a selection operation, and the prompt information is used to guide the agent to perform structured reorganization and formatted output of the content of the pending requirement document according to the structured fields and hierarchies defined in the business requirement template; and a generation module, configured to fill a configured online structured template based on the structured markup document to generate an online structured requirement document that supports visual presentation and / or interactive editing.
[0005] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the document processing method as described in the first aspect of the present disclosure.
[0006] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided that, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform a document processing method as described in the first aspect of the present disclosure.
[0007] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising: a computer program that, when executed by a processor, implements the document processing method as described in the first aspect of the present disclosure.
[0008] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects: In this technical solution, by acquiring the pending requirement document associated with at least one target business, the accuracy and relevance of the information source are ensured. Next, an intelligent agent is invoked and processed based on the prompts obtained from filling in the prompt template. This precisely guides the agent to structurally reorganize and format the content of the pending requirement document according to the structured fields and hierarchies defined in the business requirement template, resulting in a structured markup document in markup language format. This achieves automated and standardized processing of document content, greatly improving the efficiency and accuracy of document processing and avoiding errors and omissions that may occur during manual processing. Finally, based on the structured markup document, a configured online structured template is filled in to generate an online structured requirement document that supports visual presentation and / or interactive editing. This not only presents the document content in a more intuitive and clear way, facilitating users to quickly understand and obtain key information, but also supports interactive editing, enhancing the interaction between users and the document, and improving user experience and work efficiency. In generating online structured requirement documents, the system can automatically identify the mapping relationship between the fields of the original document content and the target template structure by semantically aligning any chapter title in the structured markup document with the template fields of the online structured template. Then, based on the established mapping relationship, the extracted text content is filled into the corresponding field area in the template, realizing the automatic injection of data into structured interface elements and improving the automation level of document conversion. In addition, in the process of filling the text content in the structured markup document into the online structured template according to the mapping relationship, it is necessary to extract the content fragment corresponding to any chapter title from the structured markup document. Specifically, by comprehensively analyzing the level and position information of the chapter title in the directory tree structure, the existence of adjacent chapters at the same level is dynamically judged, and the start and end boundaries of the content are accurately delineated based on the judgment result. This realizes intelligent understanding and adaptation to the logical structure of the document, which can effectively cope with complex and ever-changing document structures and significantly improve the completeness of information extraction and semantic accuracy.
[0009] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0010] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0011] Figure 1 This is a flowchart illustrating the document processing method shown in the first embodiment of this disclosure; Figure 2 This is a flowchart illustrating the document processing method shown in the second embodiment of this disclosure; Figure 3This is a flowchart illustrating the document processing method shown in the third embodiment of this disclosure; Figure 4 This is a flowchart illustrating the document processing method shown in the fourth embodiment of this disclosure; Figure 5 This is a flowchart illustrating the document processing method shown in the fifth embodiment of this disclosure; Figure 6 This is a schematic diagram illustrating the principle of the document processing method shown in the embodiments of this disclosure; Figure 7 This is a schematic diagram of the interface of the business requirement template shown in the embodiments of this disclosure; Figure 8 This is a schematic diagram of the document processing apparatus shown in the sixth embodiment of this disclosure; Figure 9 This is a schematic diagram of the structure of an electronic device shown in an exemplary embodiment of the present disclosure. Detailed Implementation
[0012] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0013] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0014] It should be noted that the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in the technical solution disclosed herein are all carried out with the consent of the user, and all comply with the provisions of relevant laws and regulations, and do not violate public order and good morals.
[0015] With the continued development of digital office work, converting local documents into online structured documents has become a key requirement for improving work efficiency and optimizing information management. Currently, most systems employ solutions with limitations. One common approach is to only support uploading local files as attachments, then performing simple text recognition on the document content. The table of contents is compared with a template of the structured document to be converted, and the corresponding content is located by chapter. The content under each chapter is then filled into the template to create the online structured document. This method only achieves preliminary document digitization and often results in mismatches or recognition errors due to inconsistent chapter order. Consequently, only a small portion of the document can be converted, while a large amount of content cannot be successfully matched to the correct structured chapters. This leads to a significant amount of manual processing and assistance required for the conversion, resulting in low efficiency.
[0016] Another solution is to match and recognize documents in segments. Segment-by-segment matching and recognition can, to some extent, avoid the problem of the entire document being unable to be converted due to inconsistent chapter order. However, it still places requirements on the structure of chapters and table of contents within each segment. The chapter structure of the table of contents needs to match the chapter structure of a certain segment in the template in order to accurately identify and extract content, thereby achieving the goal of converting the content in the local document to the online document. This solution improves the accuracy to a certain extent compared to the first solution, and the success rate of conversion is also improved. However, the result still cannot meet the required accuracy and success rate, and it is difficult to meet the growing demand of users for efficient office work.
[0017] To address any of the above problems, this disclosure proposes a document processing method and apparatus.
[0018] The document processing method and apparatus of this disclosure are described below with reference to the accompanying drawings.
[0019] Figure 1 This is a flowchart illustrating the document processing method shown in the first embodiment of this disclosure.
[0020] like Figure 1 As shown, this document processing method includes the following steps: Step 101: Obtain the pending requirement document associated with at least one target business.
[0021] To improve the targeting of document processing, one possible approach is to retrieve the original requirement documents (i.e., the requirement documents to be processed) from a specified data source. These requirement documents are all associated with at least one target business function, such as specific business scenarios like "account registration function," "payment reconciliation process," or "data access control." The document format of the requirement documents to be processed can include, but is not limited to, unstructured or semi-structured formats such as PDF, Word, or scanned images. The specified data source can include, but is not limited to, local files, databases, and cloud storage.
[0022] Step 102: The agent is invoked to perform format conversion on the document to be processed based on the prompt information associated with the agent, so as to obtain a structured markup document in markup language format returned by the agent.
[0023] The prompt information is obtained by filling the prompt template of the agent based on the business requirement template obtained in response to the selection operation. The prompt information is used to guide the agent to restructure and format the content of the requirement document to be processed according to the structured fields and hierarchy defined in the business requirement template.
[0024] To improve the accuracy and flexibility of document processing, one possible approach is to call an agent through an Application Programming Interface (API). The agent identifies, extracts, and reorganizes relevant content from the document to be processed based on the structured requirements in the prompts, and finally outputs a structured markup document in a markup language format, such as HTML, XML, or Markdown.
[0025] It should be noted that the prompt information is obtained by filling the prompt template of the intelligent agent based on the business requirement template obtained in response to the selection operation. The business requirement template is a standardized configuration template composed of multiple reusable basic interface components combined in a specific structure based on the business requirements of the target business, used to standardize data input or document structure. The prompt information is used to guide the intelligent agent to accurately understand the task objective and generate output results that meet the requirements. The prompt information integrates the structured fields and hierarchical relationships defined in the business requirement template, such as the contract name, signing parties, effective date, and the subordinate structure between these information in the contract management scenario.
[0026] For example, when an intelligent agent is invoked to process a pending requirement document, the agent, based on the instructions in the prompts, identifies the content in the document that corresponds to the structured fields defined in the business requirement template, and reorganizes the content according to a preset hierarchical organization method. For instance, it gathers the signatory information scattered throughout the text under the main information node, and expands the payment terms item by item. Finally, the agent outputs the reorganized content in a clearly structured and formatted manner, such as generating an HTML document with headings, paragraph marks, and hierarchical tags.
[0027] In some embodiments, such as Figure 2 As shown, step 102 includes steps 1021 to 1023, as detailed below: Step 1021: In response to the selection operation triggered by the business requirement template in the local template knowledge base, obtain the template metadata of the business requirement template.
[0028] To achieve precise invocation and context binding of business requirement templates, as an example, when a user triggers a selection operation on a business requirement template in the local template knowledge base, the template metadata of that template is obtained. For example, if the user clicks or selects a predefined template, such as "contract review template", the template metadata of that template is read from the local storage, including basic information such as template name, version number, business type, creation time, and field structure description.
[0029] Step 1022: Generate a template knowledge base index for business requirement templates according to the template metadata and the first set naming rules.
[0030] To achieve standardized management and efficient retrieval of templates, as an example, a template knowledge base index for the business requirement template is generated based on the acquired template metadata according to a predefined first naming rule. The first naming rule refers to a predefined set of standardized string generation logic to ensure the uniqueness, readability, and searchability of each template index. For example, the naming rule is: "template name@_[template number]@_[version number]". The template knowledge base index is a unique identifier string generated based on the above rule, used to quickly locate, query, and reference the corresponding business requirement template in a local or remote knowledge base.
[0031] Step 1023: Send a call request to the agent through the agent call interface; wherein, the call request is used to trigger the agent to perform a document format conversion task on the document to be processed.
[0032] The call request includes a template knowledge base index, which is used to construct prompt information containing template context based on the business requirement template and the prompt template of the agent corresponding to the template knowledge base index. This information guides the agent to perform structured reorganization and formatted output of the content of the requirement document to be processed according to the structured fields and hierarchy defined in the business requirement template when performing document format conversion tasks.
[0033] To achieve automatic document structuring conversion, as an example, a call request is sent to the agent via an API call. This call request is used to trigger the agent to perform a document format conversion task on the document to be processed. The goal of this task is to convert the natural language content in the original document into a well-structured and clearly defined markup language format, such as HTML or JSON, based on a specific business structure.
[0034] To achieve intelligent document processing tasks and business adaptability, one possible approach is to send a call request to the agent via an API call, triggering the agent to perform a document format conversion task on the document to be processed. This call request includes not only the access path or content data of the document to be processed but also a template knowledge base index. This index is used to locate and load the corresponding business requirement template and dynamically merge it with a pre-set agent prompt template to construct a prompt containing a complete business context. This prompt guides the agent on which structured fields to extract, the hierarchical relationships between fields, and the output format requirements. Guided by this context, the agent performs semantic understanding, information extraction, and logical reorganization on the document to be processed, ultimately generating a structured marked document that meets business requirements.
[0035] In summary, by responding to the user's selection of a business requirement template, the system automatically obtains template metadata and generates a unique template knowledge base index according to set rules. Then, it passes this index to the intelligent agent through a call request to dynamically construct prompts that integrate business context. This achieves intelligent document format conversion tasks and business adaptability. Under the guidance of a context containing structured fields and hierarchical definitions, the intelligent agent can accurately perform semantic parsing, content reorganization, and formatted output of the documents to be processed.
[0036] It should be noted that the business requirement template in this embodiment of the disclosure is generated using the following steps: (1) Obtain a sample requirement document containing the business requirements of the target business; wherein, the sample requirement document includes multiple business requirement items; To ensure that the generated business requirement template accurately reflects the actual business intent, as an example, a sample requirement document containing complete business requirements for the target business is provided. This sample requirement document, which can be provided by the business party, details the functional objectives, process logic, and data requirements for a specific business scenario. It contains multiple independent business requirement items, each corresponding to a specific functional unit or data collection point within the business. For example, in the "Loan Application" business, "Borrower Basic Information," "Income Proof Materials," and "Guarantee Information" are all independent requirement items.
[0037] (2) For any business requirement item, create a business sub-template for any business requirement item based on multiple basic interface components; To map business requirements to the user interface, as an example, for any given business requirement, a corresponding business sub-template is created based on several predefined basic interface components. This sub-template encapsulates the data fields, field types, validation rules, and corresponding UI component types and layout attributes required for that requirement. These basic interface components may include, but are not limited to, text input boxes, dropdown selectors, date controls, checkboxes, and tables.
[0038] (3) Based on business requirements, assemble multiple business sub-templates to obtain and publish the business requirement template; To achieve complete coverage and logical integration of business processes, as an example, based on the structure and process relationships of overall business requirements, multiple created business sub-templates are assembled according to business logic order, data dependencies, or user operation paths. The assembly process includes determining the display order of business sub-templates, setting conditional display rules, defining nesting levels, etc., ultimately forming a complete and logically clear business requirement template, which is then published to the template library.
[0039] To achieve efficient distribution of business requirement templates and collaboration among multiple systems, one possible implementation involves downloading the business requirement template to a local cache after its release; generating a template file associated with the downloaded template; renaming the template file according to a second predefined naming rule and the template's identifier; and broadcasting a template event notification to agents subscribing to template events via a message queue upon completion of the renaming. Template events include the addition, updating, deletion, enabling, or disabling of templates, and the template event notification triggers agents to synchronously update their local template knowledge base based on the template file.
[0040] In other words, after the business requirement template is published, it is automatically downloaded to the local cache to ensure that the template data can be quickly accessed and processed in the current operating environment. Subsequently, a template file associated with the downloaded template content is generated. This file is usually in a structured format, which is easy to parse and integrate. Then, according to the preset second naming rule and combined with the unique identification information of the template, the generated template file is renamed in a standardized manner to ensure the uniqueness, readability and system consistency of the file name. After the template file is renamed, a template event notification is broadcast to all agents that subscribe to the template event through a message queue. This notification clearly identifies the event type, such as addition, update, deletion, enable or disable, and includes the storage path or metadata information of the template file. This mechanism is used to trigger agents to automatically pull the latest template file and synchronously update their local template knowledge base after receiving the notification, so as to ensure that each agent always uses the latest business rules when performing tasks such as document parsing and format conversion.
[0041] To achieve manageability and callability of agents in document processing tasks, before invoking an agent to convert the format of the document to be processed based on the prompt information associated with the agent, and obtaining a structured markup document in markup language format returned by the agent, an agent is first created on the agent platform. The agent includes a prompt template, which contains task instructions, output format requirements, structured field definitions, and a context injection mechanism. This guides the agent to accurately understand the content of the input document when performing document format conversion tasks and to convert it into a structured result in markup language format that conforms to the specifications. After the agent is created, it is registered and stored in a unified agent repository. At the same time, a unique agent identifier is generated for the agent. This identifier serves as the agent's identity credential and is used to accurately locate and call its running instance in subsequent business processes. This ensures that the correct agent and its prompt template can be dynamically bound when facing different document conversion requirements, thereby automating task scheduling.
[0042] Step 103: Based on the structured markup document, populate the configured online structured template to generate an online structured requirements document that supports visual presentation and / or interactive editing.
[0043] To further enhance user experience, one possible approach is to use structured markup documents as a data source, filling them into a pre-configured online structured template. This online template is a front-end renderable framework that defines page layout, style, component behavior, and data binding rules. As an example, through a data mapping mechanism, the values of each field in the structured markup document are automatically filled into the corresponding display areas or input controls in the template. The resulting online structured requirements document can be opened directly in a browser, supporting clear visual presentation in tables, forms, or cards. It also allows users to interactively edit the content, such as modifying field values, adding notes, and submitting for approval.
[0044] In some embodiments, such as Figure 3 As shown, step 103 may include steps 1031 to 1032, as follows: Step 1031: For any chapter title in the structured markup document, perform semantic alignment between the chapter title and the template field of the online structured template to obtain the mapping relationship between the chapter title and the template field.
[0045] To improve the accuracy of document processing and avoid fill failures due to inconsistent terminology, as an example, for each chapter title in the structured markup document, each chapter title is matched and semantically aligned with predefined template fields in the online structured template to obtain the mapping relationship between each chapter title and the template field; for example, the semantic meaning of the "Project Background" chapter title in the structured document is identified, and a mapping relationship is established between it and the "Project Overview" field with similar semantics in the online structured template. Step 1032: Based on the mapping relationship, populate the text content in the structured markup document into the online structured template to generate an online structured requirements document that supports visual presentation and / or interactive editing.
[0046] It's important to understand that because the mapping relationship indicates the semantic correspondence between each chapter title in the structured document and the specific fields in the template, it ensures that the content is correctly filled according to business logic. Therefore, during the filling process, the hierarchical structure and tag information of the structured markup document are parsed, valid text is extracted, and the extracted text is injected into the display area or editable control of the template, ultimately generating an online structured requirements document. This online structured requirements document can be loaded directly in a browser and supports a clear layout for visual presentation.
[0047] In some embodiments, such as Figure 4 As shown, step 1032 may include steps 10321 to 10323, as follows: Step 10321: Extract the content fragment corresponding to any chapter title from the structured markup document.
[0048] To achieve accurate transfer and visualization of structured information, one possible approach is to extract content fragments corresponding to each chapter title from the structured markup document. For example, by parsing the markup language structure of the document, such as the tag hierarchy of HTML or XML, the node where the chapter title is located can be located, and all text content under the chapter title can be extracted to form an independent content unit. In some embodiments, such as Figure 5 As shown, step 10321 may include steps 103211 to 103212, as follows: Step 103211: Determine the text extraction boundary of any chapter title based on its position information and document hierarchy in the structured markup document.
[0049] To accurately identify the semantic scope of each chapter and avoid content truncation or mixing with content from other chapters, one possible approach is to comprehensively determine the content scope covered by each chapter title based on its position information (such as the starting character position) and document hierarchy (such as the nesting depth of first-level headings, second-level headings, etc.) within the structured markup document, thereby determining its text extraction boundaries. Position information is used to accurately locate the physical or logical position of the title in the document, while document hierarchy is used to identify its contextual structure relationship, such as the starting position of a sibling heading or the ending position of a parent node. By combining these two dimensions, the system can accurately delineate the start and end points of the chapter content, avoiding content omissions or confusion with other chapters.
[0050] As an example, the extraction boundaries are determined by combining the position of any chapter title in the structured markup document with the document hierarchy. The specific steps are as follows: (1) Based on the document level and position information of any chapter title in the directory tree structure of the structured markup document, determine whether there is a preceding chapter title and a following chapter title that are at the same level and adjacent in document order as any chapter title; To achieve accurate identification of the content scope of chapters in structured documents, as an example, based on the document hierarchy and position information of any chapter title in the directory tree structure of the structured markup document, it is determined whether there exists a preceding and succeeding chapter title at the same level and adjacent in document order. For example, by traversing the linked list of sibling nodes or analyzing the sibling node relationships in the DOM structure, the context of the current title in the sibling sequence can be determined.
[0051] (2) If there is an adjacent preceding chapter title, determine the starting boundary of the content of any chapter title based on the ending position of the content of the adjacent preceding chapter title and the ending position of the title of any chapter title; if there is no adjacent preceding chapter title, determine the starting boundary of the content of any chapter title based on the ending position of the title of any chapter title. To dynamically determine the starting position of content, as an example, if an adjacent previous chapter title exists, the actual end position of the content in that previous chapter title is used as a reference, combined with the end position of the current chapter title, and the larger of the two values is taken as the starting boundary of the current chapter's content. This ensures that content extraction does not include residual content from the previous chapter, while avoiding errors in the starting position caused by the title and content being adjacent.
[0052] To ensure the correct extraction of the first chapter's content, as an example, if there is no adjacent preceding chapter title, meaning the current chapter is the first chapter at this level, the starting boundary for content extraction will be the end position of the current chapter title itself. In other words, the extraction operation will start immediately after the title. This is suitable for scenarios at the beginning of a document or the first chapter title, ensuring that no content is missed.
[0053] (3) If there is an adjacent next chapter title, the starting position of the adjacent next chapter title shall be used as the content end boundary of any chapter title; if there is no adjacent next chapter title, the end of the structured requirements document shall be used as the content end boundary of any chapter title. To ensure a reasonable definition of the end position of content, as an example, if there is an adjacent subsequent chapter title, the starting position of that subsequent chapter title shall be used as the end boundary of the current chapter content.
[0054] To ensure the integrity of the content of the last chapter, if there is no adjacent chapter title following it, meaning the current chapter is the last chapter of this level, the end of the entire structured markup document will be used as the end boundary of the current chapter's content. This ensures that the last chapter of the document can contain all the content below it.
[0055] (4) Determine the text extraction boundary of any chapter title based on the content start boundary and content end boundary.
[0056] To achieve high-fidelity extraction of the target chapter content, as an example, a continuous text range is defined based on the determined start and end boundaries of the content, and this text range is used as the text extraction boundary corresponding to the chapter title.
[0057] In summary, by comprehensively analyzing the hierarchy and position information of chapter titles in the directory tree structure, dynamically determining the existence of adjacent chapters at the same level, and accurately defining the start and end boundaries of content based on the judgment results, intelligent understanding and adaptation to the document's logical structure are achieved. This can effectively cope with complex and ever-changing document structures and significantly improve the completeness of information extraction and semantic accuracy.
[0058] Step 103212: Extract the text content within the text extraction boundary from the structured markup document, and use the text content within the text extraction boundary as the content fragment corresponding to any chapter title.
[0059] Furthermore, after determining the text extraction boundaries of each chapter title, all text content within that boundary range is read from the structured markup document and used as the content fragment corresponding to the chapter title. Thus, this process can preserve the semantic integrity of the content, ensuring that the extracted content can include all relevant information under the title, while excluding interfering content that does not belong to the chapter.
[0060] In summary, by combining the positional information of chapter titles in the structured marked document with the document hierarchy to determine the text extraction boundaries, the logical scope of each chapter can be accurately identified. Furthermore, the complete text content is extracted from the defined text extraction boundaries and used as corresponding content fragments, ensuring the integrity and structural consistency of information extraction. This effectively improves the accuracy of document parsing, reduces interference caused by complex hierarchical nesting or interlaced multi-level headings, and provides a high-quality, semantically clear data foundation for the subsequent automated filling of content into templates, significantly enhancing the system's adaptability to document structures.
[0061] Step 10322: Based on the mapping relationship, fill the content fragment corresponding to any chapter title into the area where the corresponding template field of the online structured template is located to generate an online structured requirements document.
[0062] To automate the filling of online structured templates, one possible approach is to use the established mapping between chapter titles and template fields to populate the extracted content fragments into the corresponding field areas of the online structured template. For example, if the "Project Background" chapter maps to the "Background Description" field in the template, the content of "Project Background" will be automatically written into the display or editing area of the "Background Description" field. Step 10323: Render the online structured requirements document and display it in the client interface.
[0063] To improve system usability and user experience, one possible approach is to render the generated online structured requirements document after content population. This involves converting the template and its data into visual interface elements that can be displayed in a browser, such as titles, paragraphs, and form controls. Once rendered, the document is displayed on the client interface, allowing users to browse, edit, and submit it. This process achieves visual presentation of information and human-computer interaction capabilities, making the results of automated processing readily visible and usable.
[0064] In summary, by extracting content fragments corresponding to chapter titles from structured markup documents, precise segmentation and semantic organization of raw information are achieved. Furthermore, based on preset mapping relationships, each content fragment is automatically filled into the corresponding field areas in the online structured template, ensuring accurate matching and orderly integration of data content and display structure. Finally, by rendering the generated online structured requirement document and displaying it on the client interface, document processing is automated and standardized, significantly reducing the workload of manual transcription and format adjustment, improving the accuracy and consistency of information presentation, and supporting real-time browsing and interactive editing of content, effectively enhancing the system's usability and flexibility.
[0065] The document processing method of this disclosure ensures the accuracy and relevance of information sources by acquiring the required documents to be processed that are associated with the target business. Next, an intelligent agent is invoked to process the required documents based on prompts obtained from filling in the prompt template. This accurately guides the intelligent agent to restructure and format the content of the required documents according to the structured fields and hierarchies defined in the business requirement template, thereby obtaining a structured markup document in markup language format. This achieves automated and standardized processing of document content, greatly improving the efficiency and accuracy of document processing and avoiding errors and omissions that may occur during manual processing. Finally, the structured markup document is used to fill in a configured online structured template to generate an online structured requirement document that supports visual presentation and / or interactive editing. This not only presents the document content in a more intuitive and clear way, facilitating users to quickly understand and obtain key information, but also supports interactive editing, enhancing the interactivity between users and documents, and improving user experience and work efficiency.
[0066] To clearly illustrate the above embodiments, examples are given below.
[0067] For example, such as Figure 6 As shown, the document processing method of this disclosure embodiment can also be implemented based on the following steps: S01: Define a structured requirements template (also known as a sample requirements template). As an example, such as Figure 7As shown, the online structured requirements template definition function is used to assemble the structured requirements template using business sub-templates defined in rich text: Business sub-templates are encapsulated and defined in rich text using the basic atomic components provided by the system (including text, input boxes, images, titles, tables, and graphs (various components that can be drawn online or display graphics by inputting data)). Then, the business sub-templates are assembled into a structured requirements template according to business needs. Through this assembly and definition step, the defined structured requirements template serves as the basis for online structured writing. This allows users to fill in or draw various business contents in a structured way in the structured requirements document by filling in online forms, just like using a software system.
[0068] Each business sub-template is assembled according to the outlined chapter structure. Since the template is modularly assembled from these business sub-templates, it also possesses the basic capability to support structured parsing. Documents written using this template can be parsed in a structured manner. After the structured requirement template is created, it is published as a fixed-version sample requirement template. The content of the sample requirement template is saved to a specific version of the defined requirement template (uniquely identified by the requirement template number). Subsequently, when agents and users select templates, the specific structured requirement template number + version number combination is used to determine the specific structured requirement template, thereby determining which template framework should be used to generate the structured marked document (structured requirement document).
[0069] S02: Download the structured requirements template After the online structured requirements template is published, the structured document engineering team will notify the agent engineering team, requesting an update to the knowledge base of the structured requirements template and providing a Word version of the requirements template file. The provided requirements template file should be named as follows: "Requirement Template Name@_[Requirement Template Number]@_[Version Number].docx". This naming convention helps the agent identify the accurate knowledge base. The specific implementation process is as follows: (1) After the document is published, perform an automated operation to download the structured template to the cache. In the cache, modify the file name of this template according to the format "Requirement Template Name@_[Requirement Template Number]@_[Version Number].docx". For example, if the title of the generated structured template file is "Business Requirement Template", its number is TEMP0002, and its version number is 20240202001, then the generated file name is: Business Requirement Template@_[TEMP0002]@_[20240202001].docx; (2) After the file is generated, a notification message is sent through MQ (message queue) to broadcast the addition / update / deletion / enable / disable events of the template. That is, when the required template is added, updated, deleted, enabled, or disabled, the status of the message notification is "new", "update", "delete", "enable", and "disabled" respectively. S03: Import structured requirement templates into the knowledge base in the intelligent agent platform. In the intelligent agent platform, the structured requirement templates downloaded in S02 are imported into the platform's knowledge base. Different knowledge bases are created within the intelligent agent's knowledge base according to different template numbers. For existing knowledge bases, the latest version of the knowledge base is updated to the corresponding knowledge base, forming the latest version of the intelligent agent platform's requirement template knowledge base. The specific implementation process is as follows: (1) After the intelligent agent platform receives the message of the subscription template update, it updates the knowledge base in the intelligent agent platform according to the message status categories of new, updated, deleted, enabled, and disabled messages, and handles them in different ways. New Creation: Upon receiving a notification to create a new template, the intelligent agent platform creates a new template information entry based on the structured requirement template name. The template information includes: the requirement template name, the requirement template number, and the requirement template version number. For example, if a business requirement template is: "Business Requirement Template@_
TEMP0002
TEMP0002
TEMP0002
TEMP0002
[0070] Corresponding to the document processing method provided in the above embodiments, this disclosure also provides a document processing apparatus. Since the document processing apparatus provided in this disclosure corresponds to the document processing method provided in the above embodiments, the implementation of the document processing method is also applicable to the document processing apparatus provided in this disclosure, and will not be described in detail in this disclosure.
[0071] Figure 8 This is a schematic diagram of the document processing apparatus shown in the sixth embodiment of this disclosure.
[0072] like Figure 8 As shown, the document processing device 800 includes: a first acquisition module 810, a calling module 820, and a generation module 830.
[0073] The first acquisition module 810 is used to acquire a pending requirement document associated with at least one target business; the invocation module 820 is used to invoke an agent to perform format conversion on the pending requirement document based on the prompt information associated with the agent, so as to obtain a structured markup document in markup language format returned by the agent; wherein, the prompt information is obtained by filling the prompt template of the agent based on the business requirement template obtained in response to the selection operation, and the prompt information is used to guide the agent to perform structured reorganization and formatted output of the content of the pending requirement document according to the structured fields and hierarchies defined in the business requirement template; the generation module 830 is used to fill the configured online structured template based on the structured markup document to generate an online structured requirement document that supports visual presentation and / or interactive editing.
[0074] As one possible implementation of this disclosure, the generation module 830 is used to semantically align any chapter title in the structured markup document with the template field of the online structured template to obtain a mapping relationship between the chapter title and the template field; based on the mapping relationship, the text content in the structured markup document is filled into the online structured template to generate an online structured requirement document that supports visual presentation and / or interactive editing.
[0075] As one possible implementation of this disclosure, the generation module 830 is used to extract the content fragment corresponding to any chapter title from the structured markup document; fill the content fragment corresponding to any chapter title into the area where the corresponding template field of the online structured template is located according to the mapping relationship, so as to generate an online structured requirement document; render the online structured requirement document and display it in the client interface.
[0076] As one possible implementation of this disclosure, the generation module 830 is used to determine the text extraction boundary of any chapter title based on the position information and document level of any chapter title in the structured markup document; extract the text content within the text extraction boundary from the structured markup document; and use the text content within the text extraction boundary as the content fragment corresponding to any chapter title.
[0077] As one possible implementation of this disclosure, the generation module 830 is configured to determine, based on the document level and position information of any chapter title in the directory tree structure of the structured markup document, whether there exists a preceding chapter title and a following chapter title that are at the same level and sequentially adjacent to any chapter title; if a preceding chapter title exists, the content start boundary of any chapter title is determined based on the content end position of the preceding chapter title and the title end position of any chapter title; if no preceding chapter title exists, the content start boundary of any chapter title is determined based on the title end position of any chapter title; if a following chapter title exists, the title start position of the following chapter title is used as the content end boundary of any chapter title; if no following chapter title exists, the end of the structured requirements document is used as the content end boundary of any chapter title; and the text extraction boundary of any chapter title is determined based on the content start boundary and the content end boundary.
[0078] As one possible implementation of this disclosure, the calling module 820 is used to obtain the template metadata of the business requirement template in response to a selection operation triggered by a business requirement template in the local template knowledge base; generate a template knowledge base index of the business requirement template according to the template metadata and a first set naming rule; and send a calling request to the intelligent agent through the intelligent agent calling interface; wherein the calling request is used to trigger the intelligent agent to perform a document format conversion task on the document to be processed; wherein the calling request includes the template knowledge base index, which is used to construct a prompt information containing the template context based on the business requirement template corresponding to the template knowledge base index and the prompt template of the intelligent agent, so as to guide the intelligent agent to perform structured recombination and formatted output of the content of the document to be processed according to the structured fields and hierarchies defined in the business requirement template when performing the document format conversion task.
[0079] As one possible implementation of this disclosure, the business requirement template is generated using the following modules: a second acquisition module, a first creation module, and an assembly module.
[0080] The second acquisition module is used to acquire a sample requirement document containing the business requirements of the target business; wherein the sample requirement document includes multiple business requirement items; the first creation module is used to create a business sub-template for any business requirement item based on multiple basic interface components; the assembly module is used to assemble multiple business sub-templates based on the business requirements to obtain and publish the business requirement template.
[0081] As one possible implementation of this disclosure, the document processing apparatus 800 further includes a notification module.
[0082] The notification module is used to download the business requirement template to the local cache after the business requirement template is published; generate a template file associated with the business requirement template based on the downloaded business requirement template; rename the template file according to the second set naming rules and the identification information of the business requirement template; and broadcast a template event notification to the agents subscribing to the template event through a message queue after the template file renaming is completed. The template event includes the addition, update, deletion, enabling or disabling of templates, and the template event notification is used to trigger the agents to synchronously update the local template knowledge base based on the template file.
[0083] As one possible implementation of this disclosure, the document processing apparatus 800 further includes a second creation module.
[0084] The second creation module is used to create an agent on the agent platform. The agent includes a prompt template to guide the agent to perform a document format conversion task. In response to the completion of agent creation, the agent is stored in the agent repository and an agent identifier is generated. The agent identifier is used to identify the agent so that the running instance associated with the agent can be called in the document format conversion task.
[0085] The document processing apparatus of this disclosure ensures the accuracy and relevance of information sources by acquiring a document of requirements to be processed that is associated with at least one target business. Then, it invokes an intelligent agent and processes the document of requirements to be processed based on prompts obtained from filling in a prompt template. This accurately guides the intelligent agent to restructure and format the content of the document of requirements to be processed according to the structured fields and hierarchies defined in the business requirement template, thereby obtaining a structured markup document in markup language format. This achieves automated and standardized processing of document content, greatly improving the efficiency and accuracy of document processing and avoiding errors and omissions that may occur during manual processing. Finally, based on the structured markup document, it fills in a configured online structured template to generate an online structured requirement document that supports visual presentation and / or interactive editing. This not only makes the document content displayed in a more intuitive and clear way, facilitating users to quickly understand and obtain key information, but also supports interactive editing, enhancing the interactivity between users and documents, and improving user experience and work efficiency.
[0086] In an exemplary embodiment, an electronic device is also proposed.
[0087] The electronic devices include: processor; Memory used to store processor-executable instructions; The processor is configured to execute instructions to implement the face authentication method as proposed in any of the foregoing embodiments.
[0088] As an example, Figure 9 This is a schematic diagram of the structure of an electronic device 900 as shown in an exemplary embodiment of this disclosure, as follows: Figure 9 As shown, the aforementioned electronic device 900 may further include: The present invention includes a memory 910 and a processor 920, and a bus 930 connecting different components (including the memory 910 and the processor 920). The memory 910 stores a computer program, and when the processor 920 executes the program, it implements the document processing method described in the embodiments of the present disclosure.
[0089] Bus 930 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0090] Electronic device 900 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by electronic device 900, including volatile and non-volatile media, removable and non-removable media.
[0091] The memory 910 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 940 and / or cache memory 950. The electronic device 900 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 960 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 9 Not shown; usually referred to as a "hard drive"). Although Figure 9 As not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 930 via one or more data media interfaces. Memory 910 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this disclosure.
[0092] A program / utility 980 having a set (at least one) of program modules 970 may be stored, for example, in memory 910. Such program modules 970 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 970 typically perform the functions and / or methods described in the embodiments of this disclosure.
[0093] Electronic device 900 can also communicate with one or more external devices 990 (e.g., keyboard, pointing device, display 991, etc.), and with one or more devices that enable a user to interact with electronic device 900, and / or with any device that enables electronic device 900 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 992. Furthermore, electronic device 900 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 993. As shown, network adapter 993 communicates with other modules of electronic device 900 via bus 930. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0094] The processor 920 performs various functional applications and data processing by running programs stored in the memory 910.
[0095] It should be noted that the implementation process and technical principles of the electronic device in this embodiment are explained in the foregoing description of the document processing method of this disclosure embodiment, and will not be repeated here.
[0096] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, which can be executed by a processor of an electronic device to perform the document processing method proposed in any of the above embodiments. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0097] In an exemplary embodiment, a computer program product is also provided, including a computer program / instructions, characterized in that the computer program / instructions, when executed by a processor, implement the document processing method proposed in any of the above embodiments.
[0098] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0099] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A document processing method, characterized in that, include: Obtain the pending requirement document associated with at least one target business; The agent is invoked to perform format conversion on the pending requirement document based on the prompt information associated with the agent, so as to obtain a structured markup document in markup language format returned by the agent; wherein, the prompt information is obtained by filling the prompt template of the agent based on the business requirement template obtained in response to the selection operation, and the prompt information is used to guide the agent to perform structured reorganization and formatted output of the content of the pending requirement document according to the structured fields and hierarchy defined in the business requirement template; Based on the structured marked document, populate the configured online structured template to generate an online structured requirements document that supports visual presentation and / or interactive editing.
2. The method according to claim 1, characterized in that, The process of filling the configured online structured template with the structured marked document to generate an online structured requirements document that supports visual presentation and / or interactive editing includes: For any chapter title in the structured markup document, semantically align the chapter title with the template field of the online structured template to obtain the mapping relationship between the chapter title and the template field; Based on the mapping relationship, the text content in the structured markup document is filled into the online structured template to generate an online structured requirement document that supports visual presentation and / or interactive editing.
3. The method according to claim 2, characterized in that, The step of filling the text content in the structured markup document into the online structured template according to the mapping relationship to generate an online structured requirement document that supports visual presentation and / or interactive editing includes: Extract the content fragment corresponding to any chapter title from the structured marked document; Based on the mapping relationship, the content fragment corresponding to any chapter title is filled into the area where the corresponding template field of the online structured template is located, so as to generate the online structured requirements document; The online structured requirements document is rendered and displayed in the client interface.
4. The method according to claim 3, characterized in that, The step of extracting the content fragment corresponding to any chapter title from the structured marked document includes: Based on the position information and document level of any chapter title in the structured markup document, determine the text extraction boundary of any chapter title; From the structured marked document, extract the text content within the text extraction boundary, and use the text content within the text extraction boundary as the content fragment corresponding to any chapter title.
5. The method according to claim 4, characterized in that, The step of determining the text extraction boundary of any chapter title based on its position information and document hierarchy in the structured markup document includes: Based on the document level and position information of any chapter title in the directory tree structure of the structured markup document, determine whether there exists a preceding chapter title and a following chapter title that are at the same level as any chapter title and are sequentially adjacent to each other; If a previous chapter title exists, determine the starting boundary of the content of any chapter title based on the ending position of the content of the previous chapter title and the ending position of the title of any chapter title; If there is no preceding chapter title, determine the starting boundary of the content of any chapter title based on the ending position of the title of any chapter title; If a subsequent chapter title exists, the starting position of the subsequent chapter title shall be used as the content end boundary of any chapter title. If there is no subsequent chapter title, then the end of the structured requirements document shall be used as the content end boundary of any chapter title. The text extraction boundary of any chapter title is determined based on the content start boundary and the content end boundary.
6. The method according to claim 1, characterized in that, The calling agent, based on the prompt information associated with it, performs format conversion on the document to be processed to obtain a structured markup document in markup language format returned by the agent, including: In response to a selection operation triggered by the business requirement template in the local template knowledge base, the template metadata of the business requirement template is obtained; Based on the template metadata, a template knowledge base index for the business requirement template is generated according to the first set naming rules; A call request is sent to the agent through the agent call interface; wherein, the call request is used to trigger the agent to perform a document format conversion task on the document to be processed; The invocation request includes the template knowledge base index, which is used to construct prompt information containing template context based on the business requirement template corresponding to the template knowledge base index and the prompt template of the agent, so as to guide the agent to perform structured reorganization and formatted output of the content of the requirement document to be processed according to the structured fields and levels defined in the business requirement template when performing the document format conversion task.
7. The method according to claim 1, characterized in that, The business requirement template is generated using the following steps: Obtain a sample requirement document associated with the at least one target business; wherein the sample requirement document includes multiple business requirement items; For any given business requirement, a business sub-template is created based on multiple basic interface components. Based on the aforementioned business requirements, multiple business sub-templates are assembled to obtain and publish the business requirement template.
8. The method according to claim 7, characterized in that, The method further includes: Upon completion of the publication of the business requirement template, the business requirement template will be downloaded to the local cache. Based on the business requirement template downloaded to the local cache, generate a template file associated with the business requirement template; According to the second set naming rules and the identification information of the business requirement template, the template file is renamed; In response to the completion of the template file renaming, a template event notification is broadcast to agents subscribing to template events via a message queue; wherein, the template events include the addition, update, deletion, enabling or disabling of templates, and the template event notification is used to trigger the agents to synchronously update their local template knowledge base based on the template file.
9. The method according to claim 1, characterized in that, Before the calling agent performs format conversion on the document to be processed based on the prompt information associated with the agent to obtain a structured markup document in markup language format returned by the agent, the method further includes: The agent is created on the agent platform, wherein the agent includes a prompt template, which is used to guide the agent to perform a document format conversion task; In response to the completion of the creation of the agent, the agent is stored in the agent repository, and an agent identifier for the agent is generated; The agent identifier is used to identify the agent so that the running instance associated with the agent can be invoked in the document format conversion task.
10. A document processing apparatus, characterized in that, include: The first acquisition module is used to acquire pending requirement documents associated with at least one target business. The invocation module is used to invoke an agent to perform format conversion on the pending requirement document based on the prompt information associated with the agent, so as to obtain a structured markup document in markup language format returned by the agent; wherein, the prompt information is obtained by filling the prompt template of the agent based on the business requirement template obtained in response to the selection operation, and the prompt information is used to guide the agent to perform structured reorganization and formatted output of the content of the pending requirement document according to the structured fields and hierarchy defined in the business requirement template; The generation module is used to populate the configured online structured template based on the structured markup document, and generate an online structured requirement document that supports visual presentation and / or interactive editing.
Citation Information
Cited By
Data processing method for unstructured table document
CN122088480A
A data processing method of an unstructured table document
CN122088480B