Intelligent government document collaborative processing method and system for government affairs scenarios

CN122965511APending Publication Date: 2026-10-23HI-THINK YONDERVISION (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611367609.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-04
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0014]鉴于上述问题,本发明的目的是提供一种面向政务场景的公文智能协同处理方法及系统,以解决现有公文AI工具排版不规范、审核维度单一、政策引用易出错、查重精度低、多机关知识共享存在数据安全隐患、各功能模块相互割裂等诸多技术缺陷

Benefits of technology

1、构建自上而下四层分层协同架构,层级职责划分明确、数据流有序可控,模块解耦程度高,适配政务系统权限管理与涉密数据隔离要求;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122965511A_ABST
    Figure CN122965511A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of cross of artificial intelligence and electronic government affairs, and provides a government affair scene-oriented official document intelligent collaborative processing method and system, which receives user official document processing requirements and completes business logic distribution through a four-layer hierarchical architecture, relies on a government affair special adaptive prompt reasoning system to implement preprocessing on the requirements, dynamically matches official document writing prompt strategies, cooperatively schedules a general large model and a private large model to complete official document first draft generation, executes format standardization processing on the first draft, adopts a double-layer official document checking mechanism of program pre-scanning combined with deep analysis of the large model and is matched with sensitive word filtering to complete compliance verification, and finally obtains an official document final draft by further fusing a government affair knowledge graph and a semantic retrieval double engine to carry out policy knowledge enhancement and law article effectiveness verification. The application can solve the defects of poor adaptation of a traditional AI government affair writing scene, easy errors of law and regulation reference, and difficult guarantee of data security, and effectively improves the standardization, compliance and system operation stability of the generated official document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of interdisciplinary technology of artificial intelligence and e-government, and more specifically, to a method and system for intelligent collaborative processing of official documents for e-government scenarios. Background Technology

[0002] With the deepening of digital government and smart government construction, the workload of official document processing in government departments at all levels continues to grow. The entire process of drafting, proofreading, studying, archiving, and cross-departmental collaborative circulation of official documents relies heavily on manual operation. Traditional offline office and basic OA systems suffer from problems such as low writing efficiency, poor format standardization, single review dimensions, and inability to share knowledge across agencies. Therefore, the demand for office automation and intelligence is becoming increasingly urgent. As an important tool for the government to exercise its functions and handle official business, government documents include various types of texts such as notices, requests for instructions, letters, speeches, audit reports, work briefings, and industry business guidelines. They have strict requirements on writing standards, policy basis, layout format, and content compliance. The quality of their writing directly affects the standardization and credibility of government work. The manual processing mode is costly, time-consuming, and difficult to unify quality, highlighting the growing demand for intelligent processing tools for the entire document processing process in government scenarios.

[0003] In recent years, large language model technologies, such as DeepSeek V4 and Qwen3, have been rapidly applied in the field of natural language processing, providing a technological foundation for the intelligent transformation of government documents. However, when applying general-purpose large language models directly to government document scenarios, there are still many systemic technical obstacles that are difficult to adapt: ​​First, the native typesetting capabilities of large models are insufficient, making it impossible to stably output first-line indentation formats that conform to government regulations, and general output text is difficult to directly export into compliant Word documents; Second, general-purpose large models lack professional knowledge support in the government domain, and the generated text is prone to compliance risks such as incorrect citation of policy provisions, misuse of invalid regulations, and contradictions in policy logic; Third, a single large model cannot simultaneously meet the dual requirements of high-speed generation and local private deployment of classified data; Fourth, there is a lack of standardized, end-to-end filtering mechanisms for sensitive government content, and the generated text is prone to containing risky content such as politically sensitive expressions, illegal promises, and discriminatory statements; Fifth, the various stages of document generation, review, modification, study, and plagiarism checking are isolated from each other, failing to form a complete business loop; Sixth, the document writing experience, high-quality samples, and prompting strategies of different agencies cannot be securely shared, forming data and knowledge silos in the long term, which restricts the overall improvement of the level of intelligent document writing. Against this industry backdrop, there is an urgent need for a set of intelligent document processing technology solutions that are adapted to government-specific standards, take into account security and compliance, and support multi-entity collaboration.

[0004] Currently, the mainstream existing technologies related to intelligent processing of government documents can be mainly divided into five categories. Each type of solution has insurmountable technical shortcomings and cannot fully adapt to the intelligent needs of the entire government process: (1) Fixed template-based document generation method. This type of solution uses a preset static document template, and the user manually fills in the key fields to complete the document output. It only relies on variable substitution to generate basic text. Its shortcomings are mainly reflected in its extremely poor flexibility. It can only produce documents of the preset template type and cannot adapt to diverse writing scenarios such as speeches, work briefings, and special summaries. It has a low level of intelligence and does not have the ability to expand content or polish logic independently. The interaction is rigid. Information needs to be entered item by item in multiple forms and does not support natural dialogue-guided input.

[0005] (2) General large model independent AI writing method. This solution directly calls the general large language model API for official document writing and outputs in plain text or Markdown format. It lacks support for special formatting of government documents (such as first-line indentation). The output content is prone to problems such as document number format errors, improper use of punctuation, and non-standard structure. The generation and inspection stages are separated. The generated official documents need to be manually checked separately, which cannot realize the collaborative closed-loop process of "writing-inspection-correction".

[0006] (3) Traditional document review methods based on static rules. These methods rely on regular expressions and keyword fuzzy matching to screen documents, and can only achieve surface text verification. The shortcomings are very obvious: they can only identify explicit keyword problems and cannot identify semantic logical contradictions, policy violations, and hidden risks; the keyword matching mode has a high false alarm rate, which increases the workload of manual review; and it does not achieve the synergy between rule scanning and deep semantic analysis of large models, and has no ability to identify deep problems such as implicit policy risks and incorrect legal citations.

[0007] (4) Keyword-based document plagiarism detection method. This method mainly uses keyword-based text similarity algorithms such as TF-IDF (Term Frequency-Inverse Document Frequency) or SimHash (Similarity Hash), which only identify text overlap and cannot distinguish between similar documents with the same meaning but different expressions, resulting in insufficient accuracy in plagiarism detection; it does not support the recording of document version evolution trajectory, and cannot fully trace the modification process from the first draft to the final draft; it is difficult to uniformly complete semantic comparison of documents in multiple formats such as PDF and Word.

[0008] (5) AI document writing system deployed independently by a single agency. Currently, most government AI writing tools are deployed and operated independently by a single agency. Under this model, the local document samples, writing experience, and prompt word configurations of each unit are isolated from each other, forming knowledge silos; if the original documents are shared directly, it will bring the risk of government data leakage, while if they are not shared, the quality of AI generation will be low due to insufficient sample reserves in small agencies; the model capabilities of agencies in different regions and at different levels vary significantly, making it difficult to achieve a balanced improvement in the overall intelligence level of the industry.

[0009] Based on the shortcomings of the aforementioned existing technologies, the traditional government document processing system suffers from the following four types of systemic technical deficiencies: 1. Insufficient AI generation and interaction capabilities. Existing intelligent document processing technologies lack intelligent document reading and interaction capabilities, and cannot conduct question-and-answer information mining based on uploaded reports; the automated generation capabilities of reports and audit reports are weak, relying on manual filling and writing of conclusions; the prompt word system is rudimentary, lacking multi-strategy adaptive scheduling, dynamic sample matching, and thought chain reasoning mechanisms, and cannot automatically iterate and optimize based on user feedback; it lacks the ability to perform refined secondary editing of official documents such as expansion, abbreviation, rewriting, and continuation, and cannot form a closed loop for writing optimization.

[0010] 2. Insufficient document formatting and export capabilities. The general-purpose model does not natively support standardized formatting of government documents and cannot reliably achieve standardized first-line indentation; the generated text only supports plain text and Markdown output, lacks high-fidelity HTML to Word conversion capabilities, and the exported archived documents have distorted formats that do not conform to government document archiving standards.

[0011] 3. Insufficient compliance verification, knowledge support, and review capabilities. There is a lack of a systematic, multi-dimensional filtering mechanism for sensitive government terms, resulting in compliance risks such as politically sensitive, classified, or illegal expressions in generated content; a lack of structured government knowledge support makes it impossible to accurately match and verify current laws and policies, leading to errors in the policy basis of official documents; the review dimension is limited to plain text and does not support compliance verification of multimodal elements such as tables, seals, and signatures; the review methods are simplistic, relying solely on static keyword rule screening, failing to balance verification efficiency with the depth of semantic and policy risk identification.

[0012] 4. Insufficient capabilities in version management, personalization, and cross-agency collaboration for privacy protection. It cannot adapt document writing styles to different issuing entities; traditional keyword plagiarism detection cannot identify semantically similar text, and there is no document version evolution tracking function; independent deployment by each agency creates knowledge silos, and direct sharing of original documents poses a data leakage risk, making it difficult to achieve cross-agency collaborative knowledge accumulation in document writing while protecting data privacy.

[0013] Existing technical solutions can only address some of the aforementioned shortcomings to varying degrees, failing to construct a complete, integrated processing system covering document input guidance, intelligent generation, format standardization, two-layer compliance verification, knowledge enhancement, multimodal review, semantic deduplication, and cross-agency collaboration for privacy and security. This makes it difficult to meet the comprehensive demands of current digital government construction for efficient, standardized, secure, and collaborative intelligent processing of government documents. Therefore, a complete intelligent document processing solution that can balance intelligence, standardization, security, and cross-entity collaboration is urgently needed. Summary of the Invention

[0014] In view of the above problems, the purpose of this invention is to provide a method and system for intelligent collaborative processing of official documents for government affairs scenarios, so as to solve many technical defects of existing document AI tools, such as non-standard layout, single review dimension, easy error in policy citation, low accuracy of deduplication, data security risks in knowledge sharing among multiple agencies, and fragmentation of various functional modules.

[0015] On the one hand, this invention provides an intelligent collaborative processing method for official documents in government affairs scenarios, including: A four-layered collaborative processing architecture is constructed. From top to bottom, this architecture consists of a user interaction processing layer, a core business processing layer, an AI capability orchestration and prompt word collaborative management layer, and a large model collaborative access layer. The user interaction processing layer receives user document processing requests. The core business processing layer receives requests from the user interaction processing layer and distributes business logic. The AI ​​capability orchestration and prompt word collaborative management layer runs a government-specific adaptive prompt inference system, coordinating the scheduling of prompt words, example samples, inference chains, and prompt word self-optimization-related AI capabilities. The large model collaborative access layer encapsulates the collaborative invocation of general-purpose large models and private large models. The user interaction processing layer receives the user's document processing request and distributes the document processing request to the core business processing layer for business logic distribution. The AI ​​capabilities, in conjunction with the management layer, initiate a government-specific adaptive prompting and reasoning system to preprocess the document processing requirements. This system dynamically matches document writing prompting strategies, adaptively selects example samples, introduces step-by-step reasoning logic, and iteratively optimizes the prompting strategies based on user feedback. Based on the pre-processed document processing requirements, the general large model and the private large model are called through the large model collaborative access layer to collaboratively complete the generation of the first draft of the document. The first draft of the official document is processed with standard first-line indentation, and the corresponding HTML content of the first draft of the official document is converted into a Word document to form a formatted document; A two-layer document inspection mechanism combining program pre-scanning and deep analysis using a large language model, coupled with preset government sensitive word filtering rules, is used to conduct full-chain compliance verification on the formatted documents to form compliant documents; By integrating government knowledge graphs and semantic retrieval engines, the content of the compliant documents is enhanced with policy knowledge and the validity of legal provisions is verified, resulting in the final draft of the official document.

[0016] This solution establishes a top-down four-layered collaborative processing architecture. Based on the division of labor at each level, it completes document demand distribution, adaptive prompting and reasoning preprocessing, and the collaborative generation of initial drafts by two types of large models. It then sequentially carries out document formatting, two-layer compliance verification, and policy and legal provision verification using knowledge graphs combined with semantic retrieval. This effectively overcomes the shortcomings of existing government document AI processing systems, such as chaotic hierarchical division, rigid prompting strategies, single model scheduling, weak review methods, and insufficient policy basis verification. It can balance document generation efficiency with confidentiality security control, and improve the standardization, compliance, and policy matching accuracy of government documents.

[0017] On the other hand, this invention also provides an intelligent collaborative processing system for official documents in government affairs scenarios, comprising, from top to bottom, a user interaction processing layer, a core business processing layer, an AI capability orchestration and prompt word collaborative management layer, and a large model collaborative access layer; wherein, The user interaction processing layer is used to receive user document processing requests; The core business processing layer is communicatively connected to the user interaction processing layer and is used to receive document processing requests issued by the user interaction processing layer and distribute business logic. The AI ​​capability orchestration and prompt word collaboration management layer communicates with the core business processing layer to run a government-specific adaptive prompt reasoning system to preprocess the document processing requirements, dynamically match document writing prompt strategies, adaptively select example samples, introduce step-by-step reasoning logic, and iteratively optimize the prompt strategy based on user operation feedback. The large model collaborative access layer communicates with the AI ​​capability orchestration and prompt word collaborative management layer, and is used to encapsulate the collaborative invocation of the general large model and the private large model. Based on the pre-processed document processing requirements, the general large model and the private large model are collaboratively invoked to generate the first draft of the document. The system is also equipped with a document formatting module, a compliance verification module, and a policy and legal provision verification module; among which... The document formatting module is used to perform standard first-line indentation processing on the initial draft of the official document and convert the HTML content corresponding to the initial draft of the official document into a Word document to form a formatted document. The compliance verification module is used to conduct full-link compliance verification on the formatted document by adopting a two-layer document inspection mechanism that combines program pre-scanning and deep analysis of large language models, along with preset government sensitive word filtering rules, to form a compliant document. The policy and legal provision verification module is used to integrate government knowledge graph and semantic retrieval dual engines to enhance the policy knowledge and verify the validity of legal provisions in the content of the compliant document, so as to obtain the final draft of the official document.

[0018] This invention integrates multiple innovative processing mechanisms based on a multi-layered collaborative architecture to achieve integrated intelligent processing across the entire document drafting, verification, generation, review, deduplication, and cross-unit knowledge sharing chain, while taking into account the collaborative needs of document standardization, content compliance, personalization, and data security. Compared with existing technologies, it has the following beneficial effects: 1. Construct a top-down four-layer hierarchical collaborative architecture with clear division of responsibilities at each level, orderly and controllable data flow, high degree of module decoupling, and adaptability to the requirements of government system access management and confidential data isolation; 2. Introduce a government-specific adaptive prompting and reasoning system to dynamically optimize document generation strategies, overcome the limitations of traditional fixed prompt templates and improve the quality of various government documents; 3. Enable collaborative calling of general-purpose large models and private large models, and support differentiated scheduling of model resources according to the confidentiality level of official documents, balancing processing efficiency and the security of classified data; 4. The dual-layer compliance verification combines knowledge graphs and semantic retrieval policy verification to complete the document review from multiple dimensions, including language risk and policy basis, effectively reducing the risk of document irregularities and policy inaccuracies. 5. Integrates automatic document formatting function, realizes standard indentation processing and high-fidelity conversion of HTML to Word documents, and simplifies the post-formatting work of government documents; 6. Based on federated learning, a cross-unit collaborative optimization path is built to achieve model iteration without the original official document data being circulated externally, thus meeting the privacy protection requirements of multi-unit government collaboration.

[0019] To achieve the foregoing and related objectives, one or more aspects of the invention include the features which will be described in detail below and specifically pointed out in the claims. The following description and accompanying drawings illustrate certain exemplary aspects of the invention. However, these aspects indicate only a few of the various ways in which the principles of the invention can be used. Furthermore, the invention is intended to include all such aspects and their equivalents. Attached Figure Description

[0020] Other objects and results of the invention will become more apparent and readily understood with reference to the following description taken in conjunction with the accompanying drawings and the contents of the claims, and with a more complete understanding of the invention. In the drawings: Figure 1 This is a schematic diagram of the intelligent collaborative processing method for official documents in government scenarios according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the framework structure of an intelligent collaborative document processing system for government affairs scenarios according to an embodiment of the present invention. Figure 3 This is a schematic diagram of the logical structure of an electronic device for implementing an intelligent collaborative processing method for government affairs scenarios, according to an embodiment of the present invention.

[0021] In all the accompanying drawings, the same reference numerals indicate similar or corresponding features or functions. Detailed Implementation

[0022] In the following description, numerous specific details are set forth for illustrative purposes and to provide a thorough understanding of one or more embodiments. However, it will be apparent that these embodiments may also be implemented without these specific details. In other instances, well-known structures and devices are shown in block diagram form for ease of description of one or more embodiments.

[0023] To address the aforementioned issues in traditional official document processing, such as the lack of interactive reading, weak intelligent generation and secondary editing capabilities, the inability of the prompting word system to adaptively optimize, the difficulty in consistently implementing standard document formatting, the inability to balance efficiency and depth in compliance review, the lack of precise knowledge support for policy and regulatory citations, the support for only one-dimensional text review, low accuracy in document plagiarism detection and the absence of version tracking, the formation of privacy silos in document writing knowledge across different agencies, and the inability of general-purpose models to balance government security and generation performance, this invention provides an intelligent collaborative processing solution for government scenarios. This solution utilizes a four-layered collaborative architecture, a government-specific adaptive prompting and reasoning system, a standardized formatting and dual-layer compliance verification collaborative mechanism, dual-engine content enhancement using knowledge graphs and RAG, collaborative scheduling of public and private large-scale models, RLHF-driven prompting word self-optimization, multimodal document review, semantic fingerprint plagiarism detection and version management, and federated learning for privacy and security across agencies. This integrated collaborative processing chain achieves intelligent, standardized, compliant, and privacy-secure collaborative processing of the entire process of drafting, generating, optimizing, formatting, reviewing, reading, archiving, and cross-agency knowledge accumulation of government documents.

[0024] To better illustrate the technical solution of the present invention, some of the technical terms involved in the present invention will be briefly explained below.

[0025] Large Language Models (LLM): refers to artificial intelligence models with large-scale parameters and powerful natural language understanding and generation capabilities, such as DeepSeek V4 and Qwen3.

[0026] RAG (Retrieval-Augmented Generation): A technique that combines information retrieval and text generation. It first retrieves document fragments related to the user's question from an external knowledge base, and then provides the retrieval results as context to a large language model.

[0027] Prompt engineering refers to the techniques used to design and optimize prompt texts input to a large language model in order to guide the model to generate expected outputs.

[0028] CICO strategy: A structured prompting methodology that includes four parts: Context, Instruction, Input Data, and Output Indicator.

[0029] CRISPE strategy: A methodology for injecting role-related cue words, encompassing five dimensions: Capability / Role, Insight, Statement, Personality, and Experiment.

[0030] RASCEF strategy: a scripted prompting methodology that includes six parts: Role, Action, Script, Context, Example, and Format.

[0031] Few-shot Prompting: Provides a small number of example samples in the prompt words to help large language models understand task requirements and output format.

[0032] Zero-shot Prompting: No example samples are provided in the prompt words; the large language model is guided to complete the task solely through instructions and input data.

[0033] Chain-of-Thought (CoT): A cue word technique that guides large language models through step-by-step reasoning, requiring the model to show intermediate reasoning steps before giving the final answer.

[0034] Server-Sent Events (SSE): A technique for pushing real-time data from the server to the client. This method is used to push text content generated by a large model to the front end for display word by word in real time.

[0035] Braille whitespace character (U+2800): Braille whitespace character encoded as U+2800 in the Unicode character set, classified as So (Symbol, other). Visually completely blank but with a width equal to one Chinese character, it will not be pruned as a regular space by the large language model.

[0036] Dual-space execution mode: This invention features a unique document writing guidance processing mode. Space A is a parameter interception and prompt space, which returns structured prompts to complete the parameters when the user's input information is incomplete; Space B is a drafting and finalization space, which generates the main body of the document in real time when the parameters are complete.

[0037] Paragraph separator (‖‖): A custom separator consisting of two full-width vertical bar characters (U+2016) used to mark paragraph boundaries in the output of a large language model.

[0038] Program pre-scanning: Before calling the large language model for in-depth analysis, the program first uses regular expression matching and keyword fuzzy matching to quickly scan for suspected formatting and semantic problems in the text.

[0039] Jsoup: An HTML parsing library for the Java language. This method is used to parse the HTML content output by a rich text editor.

[0040] Apache POI XWPF: A Java API in the Apache POI project used for reading and writing Microsoft Word 2007 and later versions of documents.

[0041] poi-tl (Poi-Template-Language): A Word template engine based on Apache POI that supports dynamically populating data in Word templates using the {{variable name}} syntax.

[0042] SHA-256: A cryptographic hash function used to generate a unique fingerprint of a file; this method is used for file deduplication.

[0043] SM3 / SM4: Commercial cryptographic algorithms released by the State Cryptography Administration of China. This method is used for encrypted transmission of request and response data.

[0044] Document number: One of the core elements of official document format, it consists of the issuing authority code, year and document serial number, such as "Guofa

[2024] No. 1".

[0045] XWPFDocument: An object class in the Apache POI library that represents a Word document.

[0046] FreeMarker: A general-purpose text generation engine that combines templates and data. This method is used to dynamically generate cue text.

[0047] Knowledge graph: A technique for representing domain knowledge using a graph structure, consisting of entities (nodes) and relationships (edges), which can formally describe concepts and their relationships in the real world. In this method, it is used to construct a knowledge graph of regulations, policies, institutions, and matters in the government domain, collaboratively assisting a large model in generating official documents with accurate evidence.

[0048] Reinforcement Learning from Human Feedback (RLHF) is a technique that trains a reward model using human feedback signals, and then uses the reward model to optimize a large model or prompt word strategy through reinforcement learning. In this method, it is used to collaboratively and automatically optimize the selection of prompt word strategies and parameter configuration based on implicit feedback signals from users regarding the generation of official documents, such as acceptance, modification, or rejection.

[0049] Multimodal understanding refers to the ability of an artificial intelligence system to simultaneously process and understand multiple modalities of information (such as text, images, tables, seals, etc.). In this method, it is used to identify and verify non-text elements such as seals, signatures, and tabular data in official documents during document review.

[0050] Style transfer: A technique for transferring style features from source content to target content. This method is used to transfer the writing style features of a specific issuing authority or leader to AI-generated documents, achieving personalized writing.

[0051] Semantic fingerprint: A text vector representation generated based on a deep semantic model, used to measure the semantic similarity between texts. Unlike traditional character-matching-based hash fingerprints, semantic fingerprints can identify texts with different expressions but the same meaning.

[0052] Federated Learning is a distributed machine learning framework where participants train models locally, sharing only model parameters rather than the original data, thus achieving collaborative learning while protecting data privacy. In this method, multiple agencies collaborate to optimize a document writing model without uploading their individual document data.

[0053] Graph Neural Networks (GNNs) are a type of neural network specifically designed for processing graph-structured data. They learn node and graph representations through message passing mechanisms between nodes. In this method, they are used for collaborative reasoning on a government knowledge graph.

[0054] Collaborative processing: The collaborative processing described in this invention refers to the collaborative relationship between multiple processing links, multiple models, multiple types of knowledge, and multiple participants in the process of intelligent document processing, including but not limited to: collaboration between program pre-scanning and deep analysis of large language models, collaboration between general large language models and private large language models, collaboration between knowledge graph retrieval and RAG retrieval, collaboration between prompt word strategy selection and reinforcement learning feedback, collaborative review of multimodal elements, and federated collaborative sharing of knowledge among multiple agencies, etc.

[0055] In addition, the official documents involved in this invention refer to various documents involved in government office scenarios, including but not limited to government documents (notices, requests for instructions, letters, speeches, work briefings, etc.), industry reports, audit reports, business guidelines, promotional materials, etc.

[0056] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0057] The intelligent collaborative processing method for government documents provided by this invention is based on the core idea of ​​building a four-layered collaborative processing architecture to coordinate the entire business process. It deeply integrates multiple technical systems, including large-scale model prompting and reasoning, document formatting, compliance verification, government knowledge enhancement, multimodal review, and cross-agency privacy collaboration, to construct an integrated collaborative processing link covering document drafting, generation, optimization, review, reading, export, and knowledge sharing. It achieves intelligent processing of government documents across all scenarios through four core collaborative mechanisms: joint scheduling of public and private large-scale models, adaptive prompting word strategy, dual-source enhancement of knowledge graph and RAG, and federated learning privacy sharing.

[0058] Figure 1 The flowchart of an intelligent collaborative document processing method for government affairs scenarios according to an embodiment of the present invention is shown. Figure 2 This paper illustrates the framework structure of an intelligent collaborative document processing system for government affairs scenarios according to an embodiment of the present invention. (Combined with...) Figure 1 and Figure 2 As shown in the figure, the intelligent collaborative processing solution for official documents in government scenarios provided by this invention adopts a layered processing architecture, including four processing layers, from top to bottom: (1) User interaction processing layer, used to receive user document processing requests; provides six core interactive processing interfaces: document writing, document generation, document inspection, report reading, report generation, and audit report; (2) Core business processing layer, which is used to receive the requirements issued by the user interaction processing layer and distribute the business logic; handle business logic such as document writing, document generation, document inspection, report reading, report generation, and audit report; (3) AI capability orchestration and prompt word collaborative management layer, used to run the government-specific adaptive prompt reasoning system, coordinate the scheduling of prompt words, example samples, reasoning chains, and prompt word self-optimization related AI capabilities; includes core processing components such as prompt word strategy factory, dynamic sample scheduler, reasoning chain engine, sensitive word filtering standard, knowledge graph collaborative enhancement module, RLHF collaborative optimization module, style transfer module, and semantic fingerprint module. This layer is the core of the collaborative cooperation of each processing link; (4) Large model collaborative access layer, which is used to encapsulate the collaborative calls between general large models (such as DeepSeek V4 series) and private large models (such as Qwen3), and supports load balancing and circuit breaking.

[0059] Data is transferred and processes are connected between the various processing layers through collaborative interfaces, forming a complete intelligent collaborative document processing methodology. Requests flow from top to bottom layer by layer, with lower layers not actively calling upper layers in reverse.

[0060] Therefore, to implement the intelligent collaborative processing method for government affairs scenarios of this invention, it is first necessary to build a four-layer hierarchical collaborative processing architecture. This construction of the four-layer hierarchical collaborative processing architecture is an initial deployment step that only needs to be executed once; subsequent document processing requests are executed within the already constructed four-layer hierarchical collaborative processing architecture.

[0061] The intelligent collaborative processing method for government documents implemented through the above four-layer architecture mainly includes: Figure 1 The following steps are shown: S110: Receive the user's document processing request through the user interaction processing layer, and distribute the document processing request to the core business processing layer for business logic distribution. S120: The AI-powered arrangement and prompt word collaboration management system initiates a government-specific adaptive prompt reasoning system to preprocess the document processing requirements, dynamically matching document writing prompt strategies, adaptively selecting example samples, introducing step-by-step reasoning logic, and iteratively optimizing the prompt strategy based on user operation feedback. S130: Based on the pre-processed document processing requirements, the general large model and the private large model are called through the large model collaborative access layer to collaboratively complete the generation of the first draft of the document; S140: Perform standard first-line indentation processing on the initial draft of the official document, and convert the corresponding HTML content of the initial draft of the official document into a Word document to form a formatted document; S150: It adopts a two-layer document inspection mechanism that combines program pre-scanning with deep analysis of large language models, and is equipped with preset government sensitive word filtering rules to carry out full-link compliance verification of formatted documents and form compliant documents; S160: Integrating government knowledge graph and semantic retrieval engines, the content of compliant documents is enhanced with policy knowledge and the validity of legal provisions is verified to obtain the final draft of the official document.

[0062] The above method flow will be explained step by step below with specific implementation examples.

[0063] Step S110 is the requirement receiving and distribution step. The user interaction processing layer receives user document processing requirements, parses, validates, and standardizes the original requirements to obtain structured document processing requirements; then, the structured document processing requirements are distributed to the core business processing layer for business logic distribution.

[0064] Specifically, as an example, users submit document processing requests to the user interaction processing layer through the front-end interactive interface. The request formats include various methods such as text entry, attachment upload, and template selection. The user interaction processing layer first performs basic verification: verifying user operation permissions, document confidentiality level identifiers, and the completeness of required parameters. Then, it parses the original request, extracts key information such as document type, applicable field, document length, target audience, policy requirements, and confidentiality level, generates standardized tags, and completes the structured encapsulation of the original request to form a structured document processing request.

[0065] When determining the integrity of parameters, a large language model can be used to intelligently determine the integrity of parameters. Alternatively, front-end form forced validation and fixed parameter templates can be used as alternative solutions.

[0066] In addition, upon receiving a user's document processing request, a file storage and SHA-256 deduplication method are employed. Both local and remote distributed storage modes are supported. Local storage is organized by date, compatible with various document formats, has a token limit, and supports soft deletion. Remote storage is implemented through a distributed file sharing platform interface. Both storage modes integrate SHA-256 hash deduplication logic: during the file upload phase, the SHA-256 hash value corresponding to the file content is calculated. If a file with the same hash value already exists in the database, the access address of the existing file is directly returned, avoiding duplicate storage and saving storage resources.

[0067] The user interaction processing layer pushes structured document processing requirements from top to bottom to the core business processing layer. Based on the tag information carried by the structured requirements, the core business processing layer matches the corresponding business branches, completes task routing and business logic distribution, and forwards the tasks to the AI ​​capability orchestration and prompt word collaboration management layer for subsequent preprocessing.

[0068] Step S120 is the requirement preprocessing step. Essentially, this step relies on a government-specific adaptive prompting and reasoning system to generate an input reasoning paradigm adapted to the large model for structured document processing requirements. This enables dynamic configuration of prompting strategies, example samples, and reasoning logic, while simultaneously forming a user feedback loop to continuously optimize the reasoning configuration rules. The core business processing layer distributes structured document processing requirements to the AI ​​capability orchestration and prompting word collaboration management layer; the AI ​​capability orchestration and prompting word collaboration management layer then initiates the government-specific adaptive prompting and reasoning system to perform requirement preprocessing.

[0069] The AI-powered orchestration and prompt word collaboration management layer receives document processing requests from the core business processing layer and initiates a government-specific adaptive prompt reasoning system for preprocessing. In one specific embodiment of this invention, the government-specific adaptive prompt reasoning system includes a prompt word strategy factory, a dynamic sample scheduler, a thought chain engine, and a prompt word automatic optimization module based on implicit user feedback. The prompt word strategy factory stores various structured prompt templates and, combined with information such as document type, writing requirements, policy domain, and security classification tags carried by the structured requirements, retrieves suitable structured prompt templates to dynamically match document writing prompt strategies. Specifically, as an example, corresponding prompt strategies are selected for different types of documents. Business guide documents use the RASCEF strategy to construct scripted prompt words, clearly defining roles, actions, scripts, context, examples, and formats; promotional documents use the CICO strategy to construct structured prompt words, adapting to diverse writing styles and length requirements. Relevant business parameters are uniformly encapsulated in ReportExtraParamsDTO to complete the dynamic matching of prompt strategies. The generated results are streamed via SSE, supporting subsequent expansion, abbreviation, continuation, and rewriting.

[0070] This invention also provides a collaborative selection scheme for a prompt strategy factory. This scheme designs a `PromptStrategy` interface to encapsulate various prompt methodologies, enabling automatic collaborative matching of the optimal prompt strategy based on the document task type: the CICO strategy adapts to basic document writing tasks, consisting of four elements: context, instructions, input data, and output specifications; the CRISPE strategy adapts to in-depth analysis tasks requiring role definition, covering five dimensions: capabilities and roles, key insights, expression requirements, style characteristics, and deduction examples; the RASCEF strategy adapts to complex, multi-step document generation tasks, including six parts: roles, actions, scripts, context, instances, and formats. The prompt strategy factory constructs the overall prompt framework and collaborates with dynamic sample scheduling processing methods and an inference chain engine to complete the assembly of complete prompts.

[0071] The dynamic sample scheduler adaptively selects corresponding government example samples based on the complexity of the current document task, intelligently switching between zero-sample and few-sample inference modes. The dynamic sample scheduling processing method enables adaptive switching between Few-shot and Zero-shot modes. Based on user-configured writing style and length parameters, it retrieves the Top-K document samples with the highest matching degree from the sample database. When the sample matching degree is higher than a preset threshold, Few-shot mode is activated, embedding the matching sample into the prompt words; when the sample matching degree is not higher than the threshold, Zero-shot mode is used, without inserting example samples into the prompt words. The strategy factory and the dynamic sample scheduler collaborate: the strategy factory builds the main framework of the prompt words, and the dynamic sample scheduler is responsible for filling in the appropriate document example samples, ultimately generating complete prompt information adapted to the current document task.

[0072] The Chain-of-Thought (CoT) engine breaks down complex document writing tasks into multi-layered reasoning steps, introducing step-by-step reasoning logic into the large model to guide orderly writing and complete document drafting step by step. In one specific embodiment of this invention, a Chain-of-Thought reasoning engine processing method is configured. This engine can automatically determine whether to enable the CoT step-by-step reasoning mode based on the document type. For example, when the writing scenario is identified as an end-of-year summary document, the CoT mode is automatically enabled. Three layers of reasoning guidance instructions—"Achievement Review - Problem Analysis - Future Plan"—are added to the prompt words, driving the model to first output intermediate thinking and reasoning content before generating the formal document text. This CoT reasoning chain works in conjunction with the prompt word strategy factory, overlaying structured reasoning step guidance on top of the basic prompt word framework selected by the strategy factory, thus improving the prompt information for complex document writing tasks.

[0073] After the initial draft of the official document is generated and delivered to the user, based on the user's implicit feedback on the document, such as retention, modification, and rejection, the prompt word automatic optimization module based on the user's implicit feedback continuously collects user behavior data on the adoption, modification, and rejection of the initial draft, and iterates in reverse the prompt strategy selection logic to achieve adaptive continuous optimization of the prompt reasoning system.

[0074] Step S130 is the requirement model invocation step. Essentially, this step takes the pre-processed document processing requirements as input, relies on the large model collaborative access layer to uniformly schedule two types of heterogeneous large models, and divides the work to carry out document drafting. It integrates the advantages of the dual model outputs to form a draft, while relying on the model layered deployment mechanism to balance efficiency and government data security.

[0075] The large-scale model collaborative access layer receives document processing requests preprocessed by the AI-powered orchestration and prompt-word collaborative management layer, and determines the model scheduling scheme based on the document's security classification label carried in the request. For non-classified document tasks, it collaboratively calls upon both the general-purpose large-scale model deployed on the public cloud and the private large-scale model. For classified document tasks, it only enables the private large-scale model to execute the writing task in the intranet environment. During collaborative generation, one model builds the overall framework of the document and organizes the writing logic, while the other model is responsible for calibrating government terminology and polishing policy expressions. The large-scale model collaborative access layer summarizes and integrates the outputs of both parties, eliminates expression conflicts, integrates and generates a unified initial draft of the document, and pushes it to the downstream document formatting module.

[0076] Specifically, as an example, in the process of generating initial drafts of official documents, a collaborative architecture of a general-purpose large language model and a private large language model is adopted. The general-purpose large language model is deployed on the public cloud and can be remotely invoked by non-classified document tasks via the public cloud API, enabling adaptive selection between the Flash ultra-fast version and the Pro high-precision version. The private large language model (e.g., deployed on the internal network, such as on the government intranet server cluster) is connected to the Qwen3 series large model (e.g., Qwen3-30B), which can be invoked by classified document tasks to support the transparent transmission of inference content and the control of inference on / off, ensuring that document data does not leak out of the government intranet throughout the process. The large model collaborative access layer automatically switches and invokes the corresponding model according to the document's security level label, taking into account both the document generation response speed and the government's classified data security control requirements. The model is scheduled according to task requirements: the Flash ultra-fast version is used for real-time priority tasks, the Pro high-precision version is used for accuracy priority tasks, and the private Qwen model is used for classified and high-data-security scenarios. The architecture has built-in load balancing and circuit breaking mechanisms, continuously monitoring the response time and call success rate of each model's interface; when a model malfunctions, it automatically breaks the circuit and switches business traffic to other available models, and automatically restores traffic allocation after the model recovers.

[0077] The core functionality of the large-scale model collaborative access layer is to provide two types of large models and switch between them based on the document security level. The aforementioned implementation methods of using a public cloud general model and an intranet private model, as well as the traffic splitting based on classified / unclassified information, are just one approach. Several alternative architectures exist, such as: (1) Deploy all privately, distinguishing between lightweight / high-precision sub-models Based on this implementation method, two local private large models can be uniformly deployed on the intranet of the organization, without connecting to any public cloud. The lightweight and high-speed sub-model is used for generating ordinary public and low-class documents; the high-precision and complex reasoning sub-model is used for classified documents, audit reports, and high-requirement documents such as policy interpretations. Different sub-models within the intranet can be selected for collaborative invocation based on the document's security level and task complexity, which can also achieve the core functions of dual-model collaboration and hierarchical scheduling.

[0078] (2) Hybrid private domain hierarchical deployment (government-dedicated private cloud hierarchical)

[0079] Based on this implementation method, a shared model and a private optimization model can be deployed in layers on the unified government private cloud platform, without a public network external model. The general government shared private cloud model is used by various units for ordinary public documents; the unit's local isolated private model is deployed on each agency's independent intranet and only processes classified materials within that unit. The model can be switched between the government private cloud cluster and the unit's local isolated node based on the document's classification level.

[0080] (3) Deployment scheme combining offline local model and large-scale model within the government dedicated line domain

[0081] This implementation method utilizes a local, offline, lightweight model for use in offline environments and for documents with extremely high security levels; it also utilizes a large-scale model cluster within the domain connected via a government dedicated line for use on ordinary documents. By relying on these two models—document security level and network isolation level—the entire process is conducted without access to the public internet or third-party public cloud APIs.

[0082] (4) Third-party dedicated hosting private large model (government and enterprise dedicated hosting, non-public cloud)

[0083] In this implementation, a vendor-dedicated isolated hosting model can be purchased. The hosting server is only open to the dedicated line of this government unit and does not belong to the public cloud. Then, it is combined with the local self-built private model of the government agency to form two sets of models for hierarchical calling.

[0084] In other words, as long as the large model collaborative access layer can provide two types of large model switching calls according to the document security level requirements, it is not limited to the above-mentioned implementation schemes of cloud general model and intranet private model.

[0085] This invention effectively solves the problem of poor output quality caused by incomplete input in traditional AI writing by configuring judgment and switching logic in the large model collaborative access layer and adopting a dual-space execution mode. Specifically, as an example, Space A is the parameter interception and prompt space: when the user's input information is incomplete, the large language model intelligently judges the missing necessary parameters (such as writing scenario, target audience, writing style, article length, etc.) and returns structured parameter completion prompts to guide the user to complete the input. Space B is the drafting and finalization space: when the user's input information is complete, it directly enters the streaming document generation process, and pushes the document content generated by the large model to the front end for display word by word in real time through SSE technology. The switching between the two spaces is automatically determined by the method, without manual operation by the user.

[0086] After receiving the pre-processed document processing request from the large model collaborative access layer, it first assesses the completeness of the request information and automatically selects to enter the parameter interception prompt space or the drafting space based on the assessment results. In the drafting space, the general large model and the private large model are coordinated to complete the generation of the first draft of the document by relying on the mutually isolated public execution space and intranet execution space. The confidentiality control rules are followed to restrict classified tasks to run only in the intranet execution space, taking into account the interactive experience of document generation, output quality and government data security.

[0087] Step S140 is the document standardization and formatting step. Essentially, this step is to uniformly process the original draft of the official document according to the government document format standard, complete the paragraph format correction and document format conversion, eliminate the problem of chaotic text format in the model output, and output a standardized document that meets the requirements of government office work.

[0088] The system acquires the collaboratively generated draft of the official document. First, it applies standard first-line indentation to the text paragraphs in the draft, uniformly adjusting the indentation size of each level of paragraph to match the writing style specifications of government official documents. The draft of the official document contains HTML structured content. Relying on parsing tools, it reads the text, list, and heading style information within the HTML tags, preserving the original layout hierarchy, paragraph structure, and table format. It then uses Jsoup to parse the HTML and Apache POI to build the document, generating a Word document without loss of quality. During the conversion process, it simultaneously verifies the heading hierarchy, line spacing, and paragraph spacing, cleans up invalid tags and redundant styles, and finally obtains a well-formatted document, which is then pushed to the compliance verification module for risk review.

[0089] Specifically, as an example, this invention utilizes the Unicode Braille whitespace character (U+2800) to solve the technical problem of large language models being unable to reliably output first-line indentation whitespace characters. The U+2800 character is classified as So (Symbol, other), is not a space, and will not be pruned as a regular space by the large language model; visually, it is completely blank, with a width equal to one Chinese character. This standard first-line indentation processing scheme requires the large model to output two U+2800 characters at the beginning of each paragraph in the prompt, thereby simulating a first-line indentation effect equivalent to two Chinese characters. Simultaneously, this method uses paragraph separators (‖‖, two full-width vertical lines U+2016) to mark paragraph boundaries in the large language model output, facilitating subsequent paragraph-level processing and first-line indentation completion.

[0090] It should be noted that, in addition to using the Braille whitespace character U+2800, alternative solutions for first-line indentation include post-processing to insert ordinary spaces (a complex and error-prone process), using full-width spaces (some models will trim full-width spaces), and using CSS style control (only effective in HTML preview, not when exporting to Word).

[0091] The HTML to Word conversion of this invention can be implemented by OfficeHtmlDocxServiceImpl, employing a two-stage processing architecture of Jsoup parsing HTML and Apache POI XWPF writing to Word. First, the original HTML is cleaned using `cleanHtml`. Then, the `Jsoup.parse` method is used to parse the cleaned HTML into a DOM tree, extracting the `body` element and processing its child elements one by one. The `processElement` method distributes different processing logic based on the HTML tag type: `addHeading` is used for `h1` to `h6` headings; `addParagraph` is used for `p` paragraphs and `div` containers (automatically detecting internal `table` tags); `ul` / `ol` lists are used for `processList`; `table` tables are used for `addTable`; and `img` / `figure` images are used for `addImageBlock` (maximum width 500 pixels). The `processInlineElements` method recursively processes inline elements within paragraphs, passing formatting attributes down to child nodes.

[0092] Step S150 is the full-chain compliance verification step for the document. Essentially, this step combines the rule engine's rapid screening with the large model's semantic depth analysis to form a two-layer verification chain. Relying on preset government sensitive word filtering rules, it identifies document risks from both surface language and deep semantic dimensions, completes the compliance review of the formatted document, and outputs a compliant document with risky content removed.

[0093] After obtaining the formatted document, two parallel inspection units (the program pre-scanning processing layer and the large language model deep analysis layer) conduct collaborative verification. In this embodiment's two-layer document inspection mechanism, the program pre-scanning prioritizes keyword matching, format standardization, and rapid screening of prohibited terms, using preset government sensitive word filtering rules to mark suspicious statements and quickly locate explicit risk paragraphs. The large language model deep analysis performs contextual semantic analysis on the risk paragraphs marked by the program pre-scanning, discerning the true meaning of the statements, distinguishing between literal similarities but semantically compliant expressions, and avoiding false alarms caused by simple keyword matching. After the two levels of verification are completed, the risk points are summarized, generating graded risk warnings, supporting automatic correction or manual intervention to remove non-compliant expressions, and finally forming a compliant document and pushing it to the policy and legal provision verification stage. Through the collaborative cooperation of program pre-scanning and large language model deep analysis, both inspection efficiency and inspection depth are balanced.

[0094] Specifically, as an example, the pre-scanning processing layer is implemented by the DocPreCheckScanner utility class, which uses the static method `scan` to perform the scan. For format rules, Java regular expressions (Pattern.compile and Matcher.find) are used for matching. When the entire text does not match the correct format regular expression pattern, a suspected issue is recorded. For semantic rules, a keyword list is matched one by one (String.indexOf). When an ambiguous word is detected, the context fragments of 20 characters before and after it are extracted, and suspected issues are recorded. For policy rules, no program-level scanning is performed; the analysis is entirely handled by a large language model. The pre-scanning results are returned as a list of PreCheckIssueVO.

[0095] The deep analysis layer of the large language model receives the pre-scan results as context, constructing the prompt words from the text to be checked, the content of reference documents, the list of formatting rules, the list of policy rules, the list of semantic rules, and the list of pre-scanned issues. This layer converts rule entities into a list of Maps (using the `convertRulesToMaps` method), ensuring that FreeMarker templates can correctly access nested attributes while being compatible with camelCase and underscore naming. The JSON results returned by the large language model are parsed by `CheckResultParser`, which supports extracting JSON from Markdown code blocks and parsing out the conclusion and issues.

[0096] The pre-scanning processing layer provides accurate context for suspected problems to the deep analysis layer, while the large language model deep analysis layer performs semantic verification and in-depth reasoning based on the pre-scanning results. The collaboration between the two layers ensures both inspection efficiency (rapid filtering by pre-scanning) and comprehensive coverage of the three dimensions of format, semantics, and policy (deep analysis by the large language model).

[0097] In one specific embodiment of the present invention, the preset government sensitive word filtering rules include a six-dimensional government sensitive word filtering specification; the six dimensions are politically sensitive categories, illegal promises and expressions exceeding authority categories, discriminatory and inappropriate expressions, classified and out-of-scope information categories, false and exaggerated expressions, and illegal term replacement reference categories. This six-dimensional government sensitive word filtering specification can be automatically assembled by the FreeMarker template engine before being sent to a large model, requiring the model to complete self-checks and replacements before output. This filtering process works in conjunction with all generation processing stages to ensure the compliance of the content generated at each stage.

[0098] It should be noted that, in addition to the collaboration between program pre-scanning and deep analysis of large language models, the following can also be used: pure large language model checking (low efficiency and high cost), pure rule checking (unable to handle semantic-level problems), and cross-checking of multiple large language models (extremely high cost). The two-layer collaborative scheme of program pre-scanning and deep analysis of large language models provided in this embodiment can achieve the optimal balance between efficiency, cost, and checking depth.

[0099] Step S160 is the policy and regulation verification step. Essentially, this step involves linking the government knowledge graph and semantic retrieval dual engines to conduct policy matching and legality verification on compliant documents from multiple dimensions, including similar policy recall, legal provision association deduction, and timeliness verification. This process corrects omissions in policy expression and outdated legal provisions in the documents, and outputs a final draft of the official document with sufficient policy basis and effective application of legal provisions.

[0100] Upon receiving the compliance document, the text is first vectorized using a semantic retrieval engine. Matching policy texts and legal provisions are then retrieved from the policy and regulation database based on semantic similarity. Next, a government knowledge graph is used to mine the hierarchical relationships and replacement relationships between policy items and legal provisions, verifying the timeliness of legal provisions and identifying repealed or invalid regulations. The retrieved fragments are combined with the graph's association information to enhance the document's policy knowledge, supplementing missing policy bases and correcting inappropriate legal citations. After completing all verifications and content optimization, the final draft of the official document is obtained.

[0101] Specifically, as an example, the above policy and regulation verification steps include: S161: Retrieve relevant policy and regulatory text fragments through semantic retrieval; S162: Based on the aforementioned government knowledge graph, mine the relationships between laws and regulations and between policy matters to complete the policy gap filling and legal timeliness verification of official document content.

[0102] The aforementioned semantic retrieval can be vector semantic retrieval, including segmenting government policy documents into blocks, vectorizing and storing them, and recalling relevant policy and regulatory fragments based on semantic similarity. In this embodiment, semantic retrieval reuses the report reading and processing method based on RAG retrieval enhancement to achieve policy text retrieval. Its exemplary processing flow includes: S1611: Report Upload and Parsing (Supports doc / docx / pdf / txt formats, extracts text via OfficeFileParseService); S1612: Text segmentation and vectorization (segmenting text according to semantic integrity and converting it to vectors using the Embedding Model). S1613: Vector storage (storing data in a vector database to create a semantic index); S1614: User Questions and Top-K Search (vectorizing questions and then searching for the most relevant text blocks). S1615: Context building and CRISPE strategy prompt generation; S1616: Large model generates answers; S1617: SSE streaming return.

[0103] In the aforementioned policy document retrieval process, policy and regulatory documents are pre-parsed and semantically segmented. Text vectorization is performed using an Embedding Model, and the vectors are stored in a vector database to build a semantic index. Compliance document texts are converted into query vectors, and a Top-K search is performed to retrieve semantically matching policy and legal text blocks. Context is constructed based on the retrieved reference texts to complete policy material screening. On this basis, a government knowledge graph is used to mine the hierarchical relationships and replacement relationships between policy items and legal provisions, verifying the timeliness of legal provisions and identifying repealed and invalid regulations. The system combines the retrieved policy materials with the knowledge graph's deduction results to enhance the policy knowledge of the documents, supplementing missing policy basis and correcting inappropriate legal citations. After completing all verifications and content optimization, the final draft of the official document is generated and output.

[0104] This RAG-based report reading and processing method supports multi-turn dialogues, manages sessions through OfficeConversation and OfficeMessage tables, pre-saves system messages for updates after the large language model is generated, and can include an independent English translation processing module that supports both reference-based and source-based translation modes.

[0105] To address the shortcomings of traditional AI writing methods, such as the lack of structured representation of knowledge in the government affairs domain and the difficulty in citing accurate legal bases in generated content, a specific embodiment of this invention employs a collaborative enhancement generation processing scheme for official document content based on a government affairs knowledge graph. This scheme enhances the knowledge of the document content during the document generation stage and verifies the validity of legal provisions after the document is finalized. By constructing a government affairs domain knowledge graph, five core entities and six core relationships are defined. The five entities include legal provisions, policy documents, institutions, matters, and document samples. The six relationships include citation, basis, affiliation, application, association, and example relationships. The knowledge graph is stored in a graph database and uses a graph neural network to complete node message passing and relational reasoning. This method adds a knowledge graph reasoning step to the traditional RAG retrieval enhancement process, enabling collaborative cooperation between knowledge graph retrieval and RAG retrieval. When receiving a document writing request, it retrieves relevant laws, policies, and examples from the knowledge graph, using graph neural networks to perform multi-hop reasoning to mine indirectly related knowledge nodes. Simultaneously, it uploads relevant document content via RAG retrieval, providing both types of search results as enhanced context to the large model. After the document is generated, the method extracts the legal provisions cited in the document, verifies their existence, current validity, and accuracy in the knowledge graph. If erroneous or invalid regulations are identified, the method automatically marks them and prompts the user to correct them.

[0106] It should be noted that, in addition to vectorized retrieval, full-text keyword matching retrieval, knowledge graph structured representation, and traditional search engine full-text retrieval can also be used.

[0107] Besides knowledge graph and RAG collaboration, document content enhancement can also be achieved through: direct full-text retrieval of the legal database, rule-based legal citation templates, and using large models to directly memorize legal content. However, the knowledge graph collaboration scheme adopted in this embodiment is superior to these alternatives in terms of associative reasoning capabilities and the assurance of legal accuracy.

[0108] In addition, after the initial draft is generated (step S130) and before policy and regulation verification (step S160), intelligent optimization and collaborative processing of official documents can be performed. The intelligent optimization and collaborative processing method of this invention provides six optimization modes: expansion, abbreviation, continuation, rewriting, citation, and interactive consultation. The system automatically identifies the operation mode based on the optimization type identifier and the selected text, queries historical messages from the database to construct the context, and retrieves reference document content based on the session ID. User messages are saved first, and system messages are pre-saved. The system message content is updated after the large language model is generated in a streaming manner. This optimization processing is collaboratively integrated with document writing processing and compliance inspection processing, forming a collaborative closed loop of "writing-optimization-inspection."

[0109] For audit report-specific scenarios, it can also perform collaborative processing of audit report template rendering and intelligent optimization, and realize automated processing of audit reports by relying on document tools and large models. The system loads the audit report document template, calls the large model to intelligently optimize each field in the template, judges the severity of the problem based on the list of problem items and automatically generates audit conclusions, completes content rendering and configures response information through the template engine, and triggers Word document download, realizing the collaborative cooperation between intelligent text optimization of the large model and document rendering of the template engine.

[0110] Furthermore, to address the issue that traditional prompt word strategy factories employ fixed rules for strategy selection and cannot continuously optimize based on actual usage results, a specific embodiment of this invention introduces a prompt word collaborative automatic optimization method based on reinforcement learning human feedback (RLHF). Specifically, this includes: (1) Implicit feedback signal acquisition Without requiring additional user actions, implicit feedback signals regarding the generated official documents are collected, including four categories: acceptance signals, modification signals, rejection signals, and acceptance time signals. Each feedback signal is associated with and recorded in context, such as the prompt word strategy type used at the time, model parameters, and writing scenario.

[0111] (2) Reward Model Training

[0112] The reward model is trained periodically using accumulated feedback data, employing a pairwise ranking loss function. The reward model combines the encoding layer of a pre-trained language model with a linear output head, and is fine-tuned on government document data.

[0113] (3) Reinforcement learning collaborative optimization for strategy selection

[0114] The prompt word policy selection problem is modeled as a Markov Decision Process (MDP), and a policy network is trained using the Proximal Policy Optimization (PPO) algorithm. The policy network and reward model work together: the reward model evaluates policy quality, and the policy network optimizes policy selection based on the evaluation results. With the continuous accumulation of feedback data, the policy network continuously optimizes, achieving adaptive evolution in prompt word policy selection.

[0115] (4) Online exploration and utilization in a coordinated balance

[0116] The Upper Confidence Bound (UCB) algorithm is used to achieve a collaborative balance between exploration and exploitation. The optimal strategy recommended by the policy network is selected with a probability of 1-epsilon (exploitation), while other strategies are randomly selected with a probability of epsilon (exploration). The epsilon value decays over time.

[0117] To address the limitations of traditional document review methods, which only support text-level analysis and cannot understand non-text elements such as tabular data, seals, and signatures, a multimodal collaborative document review method is introduced in a specific embodiment of this invention. Specifically, this includes: (1) Analysis and classification of official document elements This method parses uploaded official documents into multiple modal elements: text paragraphs, table data, embedded images, seal areas, and handwritten signature areas. Each modal element is labeled with its position information, and an element position index is established.

[0118] (2) Modal Co-validation

[0119] Each modal element undergoes collaborative verification: seal compliance verification (completeness, ambiguity, location, consistency), table data logical consistency verification (row and column summaries, cross-table references, data range, formula calculations), and signature validity verification. Data items that fail verification are marked as potential issues and submitted to the large language model for deep semantic confirmation, achieving collaboration between multimodal parsing and large language model analysis.

[0120] To address the problem that traditional AI-generated documents exhibit a uniform style and fail to adapt to the writing styles of different issuing authorities and individual leaders, a specific embodiment of this invention introduces a document style transfer and personalized collaborative writing processing method. Specifically, this includes: (1) Extraction of official document style features and construction of style database This method extracts five-dimensional style features—vocabulary, syntax, discourse, tone, and format preference—from historical documents uploaded by users, constructs document style feature vectors, and maintains a style feature library to store style feature vectors of different issuing agencies and leaders.

[0121] (2) Style conditions co-guided generation

[0122] When a user selects a specific style profile, the method converts the style feature vector into a natural language style description, embeds it into the Output Indicator part of the prompt word, and works in conjunction with the prompt word strategy factory to align the style of the generated content with the target style.

[0123] (3) Collaborative assessment of style matching

[0124] After generation, the method extracts style feature vectors from the generated content and calculates their cosine similarity with the target style feature vector. When the style matching degree is lower than the threshold, it automatically strengthens style constraints in the prompt words, regenerates or rewrites them locally, and achieves collaborative iterative optimization of style guidance and style evaluation.

[0125] To address the issues of low accuracy and inability to track document version evolution in traditional keyword-based document deduplication methods, a semantic fingerprint-based method for document deduplication and version evolution tracking is introduced in a specific embodiment of this invention. Specifically, it includes: (1) Semantic fingerprint generation This method generates a semantic fingerprint for each document. First, the document is divided into paragraphs. For each paragraph, a pre-trained deep semantic model (such as SimCSE) is used to generate a paragraph-level semantic vector. Then, a document-level semantic fingerprint vector is generated by combining average pooling and max pooling.

[0126] (2) Semantic-level document plagiarism detection

[0127] During the plagiarism check, the semantic fingerprint cosine similarity between the document to be checked and each document in the database is calculated. When the similarity exceeds the threshold, it is marked as a suspected duplicate document. The optimal paragraph matching scheme is then solved using the Hungarian algorithm to calculate the content duplication rate and generate a plagiarism check report.

[0128] (3) Version evolution tracking

[0129] When a user modifies and re-saves a saved document, the method automatically creates a new version, calculates the paragraph-level semantic differences between adjacent versions, marks each paragraph as "unmodified," "minor adjustment," "substantial modification," "added," or "deleted," constructs a version evolution tree, and records the complete modification trajectory from the first draft to the final draft.

[0130] To address the issues of knowledge silos arising from the inability to share official document writing knowledge among various government agencies, and the risk of data leakage from directly sharing original documents, a specific embodiment of this invention introduces a multi-agency collaborative document knowledge sharing strategy under a federated learning framework. Based on this framework, document writing-related parameters are trained locally within each agency. Each agency only synchronizes model gradients, achieving collaborative sharing of document writing knowledge across multiple agencies while protecting the privacy of the original document data, and iteratively optimizing the government-specific adaptive prompting reasoning system.

[0131] Specifically, as an example, the multi-agency collaborative document knowledge sharing processing strategies under the aforementioned federated learning framework include: (1) Federated Learning Collaborative Architecture This method employs a horizontal federated learning architecture, comprising a central coordination server and multiple local nodes within each agency. Each agency node maintains its own document sample database, prompt word policy parameters, and reward model parameters locally. The central coordination server is responsible for aggregating the model parameters from all nodes and distributing global model parameters, without accessing any agency's original document data.

[0132] (2) Local training and security aggregation collaboration

[0133] Each node performs training locally, uploading the model parameter gradients (not the raw data) to the central coordination server. The central coordination server uses a secure aggregation protocol to aggregate the gradients uploaded by each node, ensuring that the server can only obtain the sum of the aggregated gradients and cannot obtain the gradient information of any individual node. The aggregation uses the Federated Average (FedAvg) algorithm, which is a weighted average based on the number of samples from each node.

[0134] (3) Differential privacy protection

[0135] Before uploading the gradient, each node applies differential privacy noise (such as a Gaussian mechanism) to the gradient to ensure that even if an attacker obtains the gradient information, they cannot accurately infer the content of any single document.

[0136] (4) Balancing Personalization and Globalization

[0137] After receiving the global model parameters, each agency node adopts a personalized federated learning strategy: it mixes the local model parameters with the global model parameters according to the alpha weight, so that the local model can absorb the global shared knowledge while retaining the personalized characteristics of its own agency, thus achieving a synergistic balance between global knowledge and local characteristics.

[0138] In addition, it should be noted that besides federated learning collaboration, multi-agency knowledge sharing can also adopt centralized data aggregation and sharing (high data security risks), independent training by each agency without sharing (the problem of knowledge silos cannot be solved), and sharing after data anonymization (anonymization may be incomplete and information may be lost). The federated learning collaboration solution is superior to these alternatives in terms of data security and knowledge sharing effectiveness.

[0139] Corresponding to the aforementioned intelligent collaborative processing method for government affairs scenarios, this invention also provides an intelligent collaborative processing system for government affairs scenarios, used to implement the steps in the aforementioned intelligent collaborative processing method for government affairs scenarios. For example... Figure 2 As shown, the intelligent collaborative processing system 200 for government affairs scenarios in this embodiment includes, from top to bottom, a user interaction processing layer 210, a core business processing layer 220, an AI capability orchestration and prompt word collaborative management layer 230, and a large model collaborative access layer 240.

[0140] The user interaction processing layer 210 is used to receive user document processing requests; The core business processing layer 220 is communicatively connected to the user interaction processing layer 210, and is used to receive the document processing requirements issued by the user interaction processing layer and distribute the business logic. The AI ​​capability orchestration and prompt word collaboration management layer 230 is connected to the core business processing layer communication layer 220 to run a government-specific adaptive prompt reasoning system to preprocess the document processing requirements, so as to dynamically match the document writing prompt strategy, adaptively select example samples, introduce step-by-step reasoning logic, and iteratively optimize the prompt strategy based on user operation feedback. The large model collaborative access layer 240 communicates with the AI ​​capability orchestration and prompt word collaborative management layer 230, which is used to encapsulate the collaborative invocation of the general large model and the private large model. Based on the pre-processed document processing requirements, the general large model and the private large model are collaboratively invoked to generate the first draft of the document. In addition, the intelligent collaborative document processing system 200 for government affairs scenarios is also equipped with a document formatting module 250, a compliance verification module 260, and a policy and legal provision verification module 270; among them, The document formatting module 250 is used to perform standard first-line indentation processing on the initial draft of the official document and convert the HTML content corresponding to the initial draft of the official document into a Word document to form a formatted document. The compliance verification module 260 is used to conduct full-chain compliance verification of formatted documents by adopting a two-layer document inspection mechanism that combines program pre-scanning and deep analysis of large language models, along with preset government sensitive word filtering rules, to form compliant documents. The policy and legal provision verification module 270 is used to integrate government knowledge graph and semantic retrieval dual engines to enhance the policy knowledge and verify the validity of legal provisions in compliant documents, resulting in the final draft of the official document.

[0141] The module of this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and are stored in the memory of the electronic device.

[0142] The aforementioned intelligent collaborative processing system for government affairs scenarios is an implementation device corresponding to the aforementioned intelligent collaborative processing method for government affairs scenarios. Its specific execution steps can be referred to the specific embodiments of the aforementioned intelligent collaborative processing method for government affairs scenarios, and will not be described in detail here.

[0143] Compared with existing technologies, the intelligent collaborative processing method and system for government affairs scenarios provided by this invention achieves dynamic adaptation of prompting strategies by building a government-specific adaptive prompting and reasoning system, constructing a collaborative calling architecture between a general large model and a private large model, intelligently scheduling models according to task requirements and equipped with load balancing and circuit breaker fault tolerance mechanisms, thus balancing document generation efficiency, output accuracy, and government data security; and through a document content collaborative enhancement generation scheme based on government knowledge graphs, it integrates multi-hop reasoning of knowledge graphs and RAG retrieval to carry out knowledge enhancement, and automatically completes the validity verification of legal provisions, overcoming the shortcomings of traditional AI writing, such as lack of structured government knowledge support and easy errors in legal citation. It is sufficient; at the same time, it forms a closed-loop collaborative process for the entire document processing chain, including "draft generation - intelligent iterative optimization - format conversion - two-layer compliance verification - policy and legal provision verification". It integrates multiple intelligent document optimization modes, relies on a two-layer inspection mechanism that combines program pre-scanning with deep analysis of large language models, and uses sensitive word filtering rules to achieve document risk screening. It distinguishes between general document processing and special template rendering scenarios for audit reports, and also supports multi-mode file storage and SHA-256 hash deduplication. While broadening the scope of application of government document business, it ensures the compliance of documents at multiple levels, saves system storage resources, and improves the standardization, stability and reliability of intelligent processing of government documents.

[0144] like Figure 3 As shown, the present invention also provides an electronic device 1 for implementing an intelligent collaborative processing method for official documents in government affairs scenarios.

[0145] The electronic device 1 may include a processor 10, a memory 11, and a bus. It may also include a computer program stored in the memory 11 and executable on the processor 10, such as an intelligent collaborative document processing program 12 for government scenarios. The memory 11 may include both internal storage units for the intelligent collaborative document processing system for government scenarios and external storage devices. The memory 11 can be used not only to store application software and various types of data, such as the code for the intelligent collaborative document processing program for government scenarios, but also to temporarily store data that has been output or will be output.

[0146] Figure 3 Only electronic devices with components are shown; those skilled in the art will understand that... Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0147] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0148] The intelligent collaborative processing program 12 for government affairs scenarios stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When it runs in the processor 10, it can implement the steps in the intelligent collaborative processing method for government affairs scenarios as described above.

[0149] Specifically, the processor 10's implementation method for the above instructions can be found in [reference needed]. Figure 1 The descriptions of the relevant steps in the corresponding embodiments are not repeated here. Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable medium may include: any entity or system capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory.

[0150] This invention also provides a computer-readable storage medium, which may be non-volatile or volatile, and stores a computer program. When the computer program is executed by a processor, it performs the steps of the intelligent collaborative processing method for official documents in a government affairs scenario as described above.

[0151] Specifically, the specific implementation method when the computer program is executed by the processor can be referred to the description of relevant steps in the embodiment of the intelligent collaborative processing method for official documents in government affairs scenarios, and will not be repeated here. In the several embodiments provided by the present invention, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for example, the division of modules is merely a logical functional division, and there may be other division methods in actual implementation.

[0152] The modules described as separate components may or may not be physically separate. The components shown as modules 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 the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0153] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0154] The intelligent collaborative processing method and system for official documents in government scenarios according to the present invention have been described above with reference to the figures as examples. However, those skilled in the art should understand that various improvements can be made to the intelligent collaborative processing method and system for official documents in government scenarios proposed by the present invention without departing from the content of the present invention. Any changes, modifications, substitutions, integrations, and parameter changes to these embodiments within the spirit and principles of the present invention, through conventional substitutions or by achieving the same function without departing from the principles and spirit of the present invention, fall within the protection scope of the present invention.

Claims

1. A method for intelligent collaborative processing of official documents in government affairs scenarios, characterized in that, include: A four-layered collaborative processing architecture is constructed. From top to bottom, this architecture consists of a user interaction processing layer, a core business processing layer, an AI capability orchestration and prompt word collaborative management layer, and a large model collaborative access layer. The user interaction processing layer receives user document processing requests. The core business processing layer receives requests from the user interaction processing layer and distributes business logic. The AI ​​capability orchestration and prompt word collaborative management layer runs a government-specific adaptive prompt inference system, coordinating the scheduling of prompt words, example samples, inference chains, and prompt word self-optimization-related AI capabilities. The large model collaborative access layer encapsulates the collaborative invocation of general-purpose large models and private large models. The user interaction processing layer receives the user's document processing request and distributes the document processing request to the core business processing layer for business logic distribution. The AI ​​capabilities, in conjunction with the management layer, initiate a government-specific adaptive prompting and reasoning system to preprocess the document processing requirements. This system dynamically matches document writing prompting strategies, adaptively selects example samples, introduces step-by-step reasoning logic, and iteratively optimizes the prompting strategies based on user feedback. Based on the pre-processed document processing requirements, the general large model and the private large model are called through the large model collaborative access layer to collaboratively complete the generation of the first draft of the document. The first draft of the official document is processed with standard first-line indentation, and the corresponding HTML content of the first draft of the official document is converted into a Word document to form a formatted document; A two-layer document inspection mechanism combining program pre-scanning and deep analysis using a large language model, coupled with preset government sensitive word filtering rules, is used to conduct full-chain compliance verification on the formatted documents to form compliant documents; By integrating government knowledge graphs and semantic retrieval engines, the content of the compliant documents is enhanced with policy knowledge and the validity of legal provisions is verified, resulting in the final draft of the official document.

2. The intelligent collaborative processing method for official documents in government scenarios as described in claim 1, characterized in that, The general-purpose large model is deployed on the public cloud for use by non-classified document tasks, while the private large model is deployed locally on the intranet for use by classified document tasks.

3. The intelligent collaborative processing method for official documents in government affairs scenarios as described in claim 1, characterized in that, The government-specific adaptive prompting reasoning system includes a prompt word strategy factory, a dynamic sample scheduler, a thought chain engine, and a prompt word automatic optimization module based on implicit user feedback; among which, The prompt word strategy factory is used to store various structured prompt templates and output appropriate prompt strategies according to document type and writing requirements; The dynamic sample scheduler is used to adaptively select example samples based on task complexity and switch between zero-sample or few-sample inference modes. The thought chain engine is used to break down complex official document tasks into reasoning steps, guiding the large model to complete the official document writing step by step. The automatic optimization module for prompt words based on implicit user feedback is used to collect user behavior data on the acceptance, modification, and rejection of the initial draft, and to continuously iterate the prompt strategy selection logic.

4. The intelligent collaborative processing method for official documents in government affairs scenarios as described in claim 1, characterized in that, The standard first-line indentation is achieved by filling the beginning of paragraphs with the Unicode Braille whitespace character U+2800; the HTML content conversion is achieved by parsing HTML with Jsoup and building Word documents with Apache POI to achieve high-fidelity export.

5. The intelligent collaborative processing method for official documents in government affairs scenarios as described in claim 1, characterized in that, In the aforementioned two-tier document inspection mechanism, The program's pre-scan prioritizes keyword matching, format specification checks, and rapid screening for prohibited terms. The deep analysis of the large language model performs semantic judgment on the risky segments marked by the program's pre-scanning. The two-level screening results, combining the pre-scanning results of the program and the deep analysis results of the large language model, are used to generate graded risk warnings and form the compliance document.

6. The intelligent collaborative processing method for official documents in government affairs scenarios as described in claim 5, characterized in that, The preset government sensitive word filtering rules include a six-dimensional government sensitive word filtering specification; the six dimensions are politically sensitive category, illegal promises and over-authority statements category, discriminatory and inappropriate statements category, classified and over-scope information category, false and exaggerated statements category, and illegal term replacement reference category.

7. The intelligent collaborative processing method for official documents in government affairs scenarios as described in claim 1, characterized in that, The integrated government knowledge graph and semantic retrieval dual-engine approach enhances the policy knowledge and verifies the validity of legal provisions in the compliance documents, including: Retrieve relevant policy and regulatory text fragments through semantic retrieval; By leveraging the aforementioned government knowledge graph, the relationships between laws and regulations and between policy matters are explored, enabling the supplementation of policy gaps in official documents and the verification of the timeliness of legal provisions.

8. The intelligent collaborative processing method for official documents in government affairs scenarios as described in claim 7, characterized in that, The semantic retrieval is a vector semantic retrieval, which includes segmenting government policy documents into blocks, storing them in vector form, and recalling relevant policy and regulatory fragments based on semantic similarity.

9. The intelligent collaborative processing method for official documents in government affairs scenarios as described in any one of claims 1 to 8, characterized in that, The method further includes: Based on the federated learning framework, the relevant parameters for official document writing are trained locally in each agency. Among them, each agency only synchronizes the model gradient, so as to achieve collaborative sharing of official document writing knowledge among multiple agencies while protecting the privacy of the original official document data, and iteratively optimize the government-specific adaptive prompting reasoning system.

10. A smart collaborative document processing system for government affairs scenarios, characterized in that: This includes, from top to bottom, a user interaction processing layer, a core business processing layer, an AI capability orchestration and prompt word collaboration management layer, and a large model collaboration access layer; among which, The user interaction processing layer is used to receive user document processing requests; The core business processing layer is communicatively connected to the user interaction processing layer and is used to receive document processing requests issued by the user interaction processing layer and distribute business logic. The AI ​​capability orchestration and prompt word collaboration management layer communicates with the core business processing layer to run a government-specific adaptive prompt reasoning system to preprocess the document processing requirements, dynamically match document writing prompt strategies, adaptively select example samples, introduce step-by-step reasoning logic, and iteratively optimize the prompt strategy based on user operation feedback. The large model collaborative access layer communicates with the AI ​​capability orchestration and prompt word collaborative management layer, and is used to encapsulate the collaborative invocation of the general large model and the private large model. Based on the pre-processed document processing requirements, the general large model and the private large model are collaboratively invoked to generate the first draft of the document. The system is also equipped with a document formatting module, a compliance verification module, and a policy and legal provision verification module; among which... The document formatting module is used to perform standard first-line indentation processing on the initial draft of the official document and convert the HTML content corresponding to the initial draft of the official document into a Word document to form a formatted document. The compliance verification module is used to conduct full-link compliance verification on the formatted document by adopting a two-layer document inspection mechanism that combines program pre-scanning and deep analysis of large language models, along with preset government sensitive word filtering rules, to form a compliant document. The policy and legal provision verification module is used to integrate government knowledge graph and semantic retrieval dual engines to enhance the policy knowledge and verify the validity of legal provisions in the content of the compliant document, so as to obtain the final draft of the official document.