A method and middleware system for securely providing official document materials for AI writing assistance in a secret internal network
Patent Information
- Application Number
- CN202611278233.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-10-30
AI Technical Summary
[0009]本发明旨在解决涉密内网场景下,AI 写作模型无法直接读取本地涉密公文、用户手工摘抄效率低且存在泄密风险、公文治理系统与 AI 系统强耦合无法适配多模型、脱敏素材安全边界模糊的行业共性难题
首创 "安全素材中间件" 架构,独立部署于公文治理系统与 AI 写作系统之间,实现治理与 AI 的解耦,一套中间件通过多 AI 适配接口层可同时服务多个异构 AI 写作模型,避免重复开发。
Smart Images

Figure CN123013141A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of AI-assisted office technology for classified intranets. Specifically, it relates to a middleware method and system independently deployed between a document management system and an AI writing system. This middleware securely provides structured writing materials to one or more heterogeneous AI writing models deployed on the intranet, ensuring that the original documents do not leak out of the classified terminal, and completes compliance verification and feedback of the AI-generated draft. All technical solutions in this invention strictly adhere to the Level 3 protection requirements of the "Management Measures for the Classified Protection of Classified Information Systems" and the "Basic Requirements for Network Security Level Protection of Information Security Technology" (GB / T 22239-2019). The entire process prohibits the leakage of original classified data and original documents from the classified terminal and the intranet security domain, and does not connect to external networks, public clouds, or large external network models. Background Technology
[0002] With the rapid popularization of artificial intelligence technology in government office work, using AI to assist in official document writing has become an important means to improve administrative efficiency. Currently, AI writing models deployed privately on the intranet have been piloted in some classified units. These models are all deployed within the classified intranet security domain and are not connected to the external network, meeting the basic compliance requirement that data does not leave the domain.
[0003] However, AI-powered writing on classified intranets still faces fundamental challenges in the material supply stage: First, AI models cannot directly access the original text of classified documents. According to the hierarchical protection requirements for classified information systems, no application may, without authorization, traverse or read the original documents stored locally on classified terminals. Even if the AI writing model is deployed on an intranet, it does not have the permission to directly retrieve and read the original text of documents locally on the terminal. Forcibly granting access would cause the AI model to become entangled with classified data, leading to uncontrollable risks of leakage.
[0004] Second, the reuse efficiency of existing official documents is extremely low. According to research, over 70% of users rely on historical documents from their organization as reference material when drafting official documents. Under the current operating model, users can only manually browse historical documents and manually extract usable paragraphs as reference input for AI writing. This is not only inefficient, but also poses risks of content omissions, element misalignment, and leakage due to secondary exposure to sensitive information caused by manual extraction.
[0005] Third, there is a lack of compliant data channels for human-machine collaboration. Users, as the legitimate privy to confidential data, lack a compliant and automated data transmission channel to securely provide historical documents to AI as writing references.
[0006] Fourth, the document management system and the AI writing system are tightly coupled, resulting in poor deployment flexibility. The few existing attempts at integration are all custom interfaces developed by document management system vendors for single AI models. If an organization changes or deploys multiple AI writing models simultaneously, repeated development and integration are required, making it impossible to achieve a single material supply mechanism serving multiple heterogeneous AI systems.
[0007] Fifth, the security of anonymized materials lacks an objective definition. Existing solutions lack unified anonymization standards and structured constraints for the reference materials provided to AI. Anonymized fragments are at risk of being reverse-engineered to reconstruct the original text through correlation analysis, resulting in a blurred security boundary.
[0008] In summary, the core contradiction facing AI-assisted writing on classified intranets lies in the fact that AI needs historical documents as a reference to improve writing quality, but compliance regulations prohibit AI from directly reading the original text, and existing technologies lack an independent, standardized middleware layer to solve this dilemma of human-machine data isolation. Summary of the Invention
[0009] This invention aims to solve common industry problems in classified intranet scenarios, such as the inability of AI writing models to directly read local classified documents, low efficiency and risk of leakage of information due to manual copying by users, strong coupling between document management system and AI system that cannot adapt to multiple models, and unclear security boundaries of desensitized materials.
[0010] This invention proposes a "secure material middleware" architecture—a decoupling layer independently deployed between the official document management system and the AI writing system. This middleware does not rely on any specific AI model and can simultaneously connect to one or more heterogeneous AI writing terminals through standardized interfaces, providing unified "secure material supply" and "compliant return of first drafts" services.
[0011] The overall logical closed loop is as follows: user initiates writing intent → middleware compliantly retrieves relevant materials from local de-identified index → packages in a structured manner according to standard format → supplies to AI through an encrypted channel → AI generates initial draft → middleware performs confidentiality level and element compliance verification → sends back to user terminal.
[0012] The original official documents never leave the classified terminal, the AI model never touches any original text fragments, users do not need to manually extract them, and all material transmission is anonymized and audited through middleware.
[0013] To achieve the above objectives, this invention provides a secure method for supplying official document materials using AI-assisted writing in a classified intranet. This method runs on an independently deployed middleware server or a local terminal service process, located between the official document management system and the AI writing system. The method includes the following steps: Step 1: Receiving Material Requests and Pre-Security Review The middleware receives material retrieval requests from the user-operated AI writing terminal. The request parameters include the target document type, proposed security classification, and a description of the intended use. The intended use description, after sensitive word filtering and de-identification, retains only three non-sensitive semantic features: document type, business domain, and purpose. All request parameters are encrypted throughout transmission using the national cryptographic algorithm SM2.
[0014] Step 2: Recall candidate materials based on local de-identified index The middleware retrieves the positive desensitization metadata index deployed locally on the terminal based on the document type and proposed security level in the request parameters, and filters out a set of candidate documents that meet the criteria. Then, it calculates the semantic similarity of the candidate documents according to the issuing intent, sorts them from high to low similarity, and selects the top N documents as candidate materials, where N is a preset integer between 3 and 10.
[0015] The semantic similarity calculation specifically involves: loading the document stop word list and filtering stop words; mapping the content words in the document intent description to 300-dimensional word vectors; adjusting the weights of specific words according to the target document type; calculating the cosine similarity between the document intent vector and the candidate document index keyword vectors, and sorting them from high to low similarity.
[0016] The positive desensitization metadata index is constructed as follows: The terminal local governance subsystem performs non-generative element extraction on each existing document, extracts the following fixed fields, and writes them into the local index library: Index ID: Generated by combining terminal number + the first 16 bits of the file's SM3 hash value + timestamp, and the original file path cannot be deduced in reverse. Document Classification: Classified and labeled according to the 15 statutory document types stipulated in the "Regulations on the Handling of Official Documents of Party and Government Organs"; Classification labels: These are identified by OCR from the original text's classification label area or read from structured metadata, and are divided into five levels: "Unclassified," "Internal / Work Secret," "Secret," "Confidential," and "Top Secret." Key elements: Combinations of proper nouns extracted from the document title, addressee, and first paragraph of the main text; Desensitized paragraph summaries: After dividing the main text into natural paragraphs, paragraphs containing sensitive entities such as names of people, specific times, specific place names, and specific project codes are removed. The text of paragraphs without sensitive entities is retained, and the first 200 words of each paragraph are extracted and added to the index. Random length separators are inserted between adjacent paragraph summaries. The full name of the issuing authority, the processing time limit label, and the date of issuance (only the year and month are retained, not the day).
[0017] All of the above fields constitute a complete forward-looking de-identified metadata index record. The index is physically isolated from the original official document.
[0018] Step 3: Packaging Structured Desensitization Materials For the sorted candidate documents, de-identified elements are extracted from the local index and structured and packaged according to preset standardized JSON fields. The structured materials include at least the following five fixed fields: material source index ID, security level label, element keywords, de-identified paragraph summary, and generation timestamp.
[0019] The desensitized paragraph summaries are fragmented, non-continuous segments: the total word count of the summary does not exceed 20% of the total word count of the desensitized paragraph summaries stored in the index (if the word count of the segment in the index is less than 100 words, it will not be extracted). Random placeholders of 80 to 150 words (containing no semantic content, only used to block the continuous semantic flow) are inserted between adjacent segments. The total word count of the desensitized paragraph summaries of a single official document does not exceed 500 words. All extracted segments are truncated starting from 50% of the word count of the desensitized paragraph summaries stored in the index. If the 50% position is in the middle of a sentence, the extraction continues to the end of the sentence before starting again, ensuring that the extracted segments are in complete sentences as the smallest unit, and excluding the first and last sentences of paragraphs.
[0020] Step 4: Dual-path encrypted transmission The packaged structured materials are encrypted using the national cryptographic standard SM2 asymmetric encryption and then transmitted to the target AI writing terminal via one of the following two pathways: RESTful API one-way path: suitable for intranet networking collaboration mode, the API only opens downlink permissions, and prohibits AI terminals from writing any data to the document governance domain; Local file isolation partition path: suitable for physical offline stand-alone mode, the media is transferred in the form of encrypted files through the disk isolation partition, without generating any network traffic.
[0021] When the system is configured with multiple heterogeneous AI writing terminals, the middleware distributes the same structured material in parallel to all registered AI writing terminals through a multi-AI adaptation interface layer, without the need to develop customized interfaces for different AI terminals.
[0022] Step 5: Compliance feedback and verification of the AI-generated initial draft After generating a first draft based on the received structured materials, the AI writing terminal sends the draft back to the middleware via an encrypted channel. The middleware performs the following compliance checks on the draft: (I) Security Level Consistency Verification: Implemented by linking a rule engine with a sensitive word database. (a) Construct a five-level security sensitivity word library, with each level of the word library mapped one-to-one with the corresponding security level tag; (b) Perform a full scan of the main text of the AI-generated draft, segment the main text into sentence-level granularity, and match each sentence with a sensitive word database of each level of confidentiality. (c) If a sensitive word with a higher security level than the requested parameters is matched, an alarm will be triggered and the transmission will be blocked. (d) If the security level of the matched sensitive words is lower than or equal to the proposed security level, the verification passes; (e) All matched sensitive words and their locations are recorded in the traceability ledger for manual review.
[0023] (II) Element Completeness Verification: A "Document Type - Necessary Element Mapping Table" is pre-constructed—for example, the necessary elements for a "Request for Instructions" are issuing authority, addressee, reason for the request, matters to be requested, closing remarks, date of issuance, and seal; the necessary elements for a "Notice" are issuing authority, addressee, reason for the notice, specific arrangements / requirements, and date of issuance; and the necessary elements for a "Report" are issuing authority, addressee, reason for the report, explanation of the situation, conclusion, and date of issuance. During verification, regular expressions are used to match whether the initial draft contains the corresponding keywords of the above-mentioned elements. If all match, the verification passes; if any are missing, the missing element is marked and the return is blocked, while a message indicating missing elements is pushed to the user's terminal.
[0024] After verification, the middleware associates the initial draft with the source index ID of the material used in this call, generating a complete traceability ledger.
[0025] Step 6: Source tracing, presentation, and audit evidence preservation The document management terminal displays a structured source link for materials to users (including the mapping relationship between the source document ID, the desensitized summary fragment and the corresponding paragraph of the initial draft). At the same time, the entire process log of this material call is submitted to the hash chain log storage module. In the hash chain log storage module, each log storage unit embeds the hash value of the previous log to form a chain association, so as to achieve full auditability and immutability.
[0026] Beneficial effects of this invention: It pioneered the "secure material middleware" architecture, which is independently deployed between the document governance system and the AI writing system, achieving decoupling between governance and AI. One middleware can serve multiple heterogeneous AI writing models simultaneously through multiple AI adaptation interface layers, avoiding redundant development.
[0027] Completely solve the dilemma of human-machine data isolation: AI does not directly touch any original official documents, and users do not need to manually extract them. The middleware automatically completes the secure supply of de-identified materials, and fully reuses existing official document assets under the premise of compliance.
[0028] The original official documents never leave the terminal. All material screening, desensitization, and packaging are completed locally on the terminal or within the middleware security domain. They are not connected to external network large models or public cloud services.
[0029] Standardized interfaces lower the deployment threshold: Any AI writing model deployed on an intranet can legally obtain historical document reference materials as long as it follows the standardized material format and encrypted interface of this invention, without the need for document governance system vendors to develop additional adaptations.
[0030] Closed-loop management reduces the risks of AI-generated content: Through consistency verification of security level (sentence-by-sentence matching of five-level sensitive word database) and element integrity verification (regular matching of document type-element mapping table), it prevents AI-generated content from exceeding the security level and omitting necessary document elements, forming a secure closed loop of "material supply → generation → verification → feedback".
[0031] Dual-channel encrypted transmission adapts to dual operating modes, simultaneously meeting the needs of two types of classified deployment scenarios: network collaboration and physical offline stand-alone deployment.
[0032] By employing a two-stage desensitization process (extracting the first 200 words during the indexing stage and fragmenting the text from 50% of the position during the packaging stage, coupled with a 20% excerpt ratio, 80-150 word spacers, and a 500-word limit), the risk of reverse reconstruction of the original text is objectively reduced while maintaining the semantic value of the material.
[0033] The entire process is audited and documented. The hash chain logs ensure that all materials used are traceable and tamper-proof throughout their entire lifecycle, meeting the Level 3 compliance requirements for information security protection audits. Attached Figure Description
[0034] Figure 1 is a flowchart of the overall architecture and material interaction of the present invention, showing the topological relationship between the middleware independently deployed in the document management system and the AI writing system, as well as the complete execution process of steps 1 to 6. Figure 2 is a schematic diagram of the JSON field format of structured materials, showing the definition and examples of five types of fixed fields; Figure 3 is a schematic diagram of multi-AI heterogeneous adaptation, showing the deployment method of the same middleware connecting to multiple AI writing terminals from different manufacturers at the same time through the multi-AI adaptation interface layer; Figure 4 is a diagram of the dual-path encrypted transmission architecture, illustrating the secure isolation mechanism between the RESTful API unidirectional path and the local file isolation partition path.
[0035] Explanation of reference numerals in the attached figures: 1 - Document management terminal, 2 - Middleware server / local service process, 3 - AI writing terminal (can deploy one or more heterogeneous models), 4 - Forward desensitized metadata index, 5 - Hash chain log storage module, 6 - Multi-AI adaptation interface layer, 7 - RESTful API one-way encrypted path, 8 - Local file isolation partition path, 9 - National Cryptographic SM2 encryption module, 10 - Structured material JSON package. Detailed Implementation
[0036] The specific parameters and values used in this embodiment are preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention.
[0037] Example 1: Multi-AI Heterogeneous Adaptation Deployment A municipal government agency in a sub-provincial city deployed a document management system on its intranet and planned to introduce AI-assisted writing. Through procurement, the agency deployed two AI writing models on its intranet: a semantic understanding and outline generation model from vendor A, and a full-text generation model from vendor B. Both models were deployed privately on the intranet and were not connected to the external network.
[0038] According to the present invention, the unit independently deploys a middleware server (2) between the document management system and the two AI systems. The middleware is connected to the document management terminal group and the two AI writing terminals via the network.
[0039] User A needs to draft a report on the city's government data sharing work. On the AI writing assistance interface of its governance terminal (1), A selects the document type "report", sets the confidentiality level to "internal / work secret", and enters the intention to issue the document as "deploying the annual key tasks of city government data sharing". The request is sent to the middleware (2) after being encrypted with the national cryptographic standard SM2.
[0040] Middleware execution step 1: Pre-screening of the document's intent — For example, if the document's intent description contains a specific person's name "Director Zhang," a specific classified project code name "XX-2026 Project," or a specific time point "before May 15th," then all of the above sensitive entities will be filtered or replaced with general placeholders (such as "[responsible person]", "[project]", "[time point]"), retaining only non-sensitive semantic keywords such as "government data sharing," "notification," and "task deployment" for subsequent recall.
[0041] Middleware execution step 2: Retrieve the terminal's local positive desensitized metadata index (4), and filter candidate documents by "notice" document type and "internal / work secret" security level. After semantic similarity calculation (loading the document stop word list → 300-dimensional word vector mapping → document type weight adjustment → cosine similarity calculation), select the 5 documents with the highest similarity as candidate materials.
[0042] Middleware execution step 3: Extract segments semantically related to "government data sharing" from the anonymized summaries of the 5 candidate documents and package them into standard JSON structured materials (fields include: source index ID, security level label, element keywords, anonymized paragraph summary, and generation timestamp). The anonymized paragraph summaries are fragmented: the total number of words extracted does not exceed 20% of the total number of words in the anonymized paragraph summaries stored in the index; random intervals of 80 to 150 words are inserted between adjacent segments; the total number of words extracted from a single document does not exceed 500 words; all segments are truncated starting from 50% of the number of words in the anonymized paragraph summaries stored in the index; if this position is in the middle of a sentence, the truncation continues to the end of the sentence.
[0043] Middleware execution step 4: The same structured material is encrypted using the national cryptographic standard SM2 through the multi-AI adaptation interface layer (6) and then pushed in parallel to model A (for generating the outline) and model B (for generating the full text). The two AI terminals receive the material respectively and complete the writing task independently.
[0044] Model A generates an outline and sends it back to the middleware, while Model B generates the full text and sends it back to the middleware. The middleware executes step 5: It verifies whether both drafts exceed the "Internal / Work Secret" classification level (using a five-level sensitive word database for sentence-by-sentence matching) and whether they contain necessary notification elements (using a document type-element mapping table for regular expression matching). After successful verification, the two drafts are associated with the source ID of the materials used, generating a traceability log (step 6), which is then sent back to User A's operating terminal.
[0045] On the terminal, A can simultaneously view the outline generated by model A and the full text generated by model B, and refer to the two outputs to complete the final document drafting. The entire process log is submitted to the hash chain log storage module (5). Each log storage unit embeds the hash value of the previous log to form a chain association, ensuring that the entire process is auditable and tamper-proof.
[0046] The beneficial effects of this embodiment are: one set of middleware, one set of structured materials, and one screening and recall can serve two heterogeneous AI models at the same time without the need to develop two sets of interface, and the AI model never touches any original document fragments.
[0047] Example 2: Local Middleware Deployment in a Standalone, Offline Scenario A classified terminal in a certain grassroots unit operates physically offline, without any internal network connection. User B needs to write a work report on a standalone terminal using a locally deployed lightweight AI writing assistant.
[0048] According to the present invention, the middleware runs as a local service process on the same classified terminal, and is deployed on the same machine as the document management subsystem and the AI writing terminal. It communicates through a local loopback address and does not generate any network traffic.
[0049] After B initiates the writing request, the middleware completes all processes from steps 1 to 3 locally. In step 4, due to the lack of a network environment, a local file isolation partition path is used: the middleware writes the encrypted structured material JSON to an isolated disk partition on the terminal, and the AI writing terminal reads the material from this partition. No network packets are generated throughout the entire process, fully meeting the physical isolation requirements.
[0050] After the AI-generated initial draft is returned, the middleware completes the security level verification and element verification (verification mechanism is the same as in Example 1), and displays the traceability ledger on User B's terminal interface. All logs are written to the local hash chain evidence storage module.
[0051] Example 3: Middleware scheduling in cross-departmental joint document issuance scenarios A higher-level agency, in conjunction with two peer departments, jointly drafted a guiding document. All three parties' internal AI writing terminals were connected to the same middleware. The initiating party marked "joint document" and the responsible department code in the request parameters. In step 2, the middleware simultaneously retrieved candidate documents that met the criteria from each of the three parties' positive desensitization indexes, merged and sorted them, packaged them into a unified structured document, and pushed it to the AI writing terminals associated with each of the three parties through a multi-AI adaptation interface layer. After any AI terminal generated a draft, it had to send it back to the middleware for security level verification and element verification, and compare its element consistency with the results generated by the other two parties to prevent conflicting statements in the joint document.
[0052] Comparative Example 1 (Manual Material Compilation): Users browse existing official documents and extract them as references for AI writing. The average time for a single document is 15-30 minutes. During the extraction process, the confidentiality level needs to be checked repeatedly, which poses a risk of missing elements and secondary access to sensitive information.
[0053] Comparative Example 2 (Offline Built-in Materials): The AI writing system can only call a small number of pre-set document templates on the terminal, cannot reuse the unit's historical documents, has low material matching degree, and insufficient utilization of historical data assets.
[0054] Compared to the two solutions mentioned above, this invention reduces the time for obtaining materials in a single instance to the second level through automated desensitization and recall and standardized supply. At the same time, it can reuse all existing official document assets and does not require manual contact with the original documents throughout the process, significantly reducing the risk of leakage.
Claims
1. A method for securely supplying official document materials using AI-assisted writing in a classified intranet, characterized in that: The method operates on middleware independently deployed between the document governance system and the AI writing system, and includes the following steps: Step 1: Receive material retrieval request from the AI writing terminal operated by the user. The request includes the target document type, proposed security level, and description of the document's intent. Perform pre-processing of sensitive word filtering and desensitization on the description of the document's intent, retaining only three non-sensitive semantic features: document type, business domain, and document purpose. All request parameters are encrypted and transmitted using the national cryptographic SM2 algorithm throughout the process. Step 2: Based on the received document type and proposed security classification, retrieve the local positive desensitization metadata index on the terminal and filter out a set of candidate documents that meet the criteria; calculate and sort the semantic similarity of the candidate documents according to the document's intent, and recall the N documents with the highest similarity, where N is a preset integer between 3 and 10; the semantic similarity calculation specifically involves: loading the document stop word list to filter stop words, mapping the content words in the document intent description to 300-dimensional word vectors, adjusting the weights of specific words according to the target document type, and calculating the cosine similarity between the document intent vector and the candidate document index keyword vector; Step 3: Extract material fragments related to the semantic intent of the documents from the anonymized summaries of the N recalled documents, and package them in a structured manner according to the preset standardized JSON field structure to generate structured materials. The structured materials include at least five fields: material source index, security level label, element keywords, anonymized paragraph summary, and generation timestamp. The anonymized paragraph summary is a fragmented non-continuous segment, and the total number of words in the summary does not exceed 20% of the total number of words in the anonymized paragraph summary stored in the index. Random interval placeholders of 80 to 150 words are inserted between adjacent segments. The total number of words in the anonymized paragraph summary of a single document does not exceed 500 words. All extracted segments are truncated starting from 50% of the number of words in the anonymized paragraph summary stored in the index. If the 50% position is in the middle of a sentence, the extraction continues to the end of the sentence before starting again. The first and last sentences of a paragraph are not extracted. Step 4: After encrypting the structured material using the national cryptographic standard SM2, send it to the target AI writing terminal through a preset encrypted transmission channel, so that the AI model can generate a draft of the official document based on the material; Step 5: Receive the initial draft of the official document returned by the AI writing terminal, perform a security level consistency check and an official document element integrity check on the initial draft, and generate a traceability ledger corresponding to this material call after the check passes. Step 6: The initial draft and the traceability log are sent back to the document management terminal operated by the user for display, and the full process log of this material call is submitted to the hash chain log storage module. In the hash chain log storage module, each log storage unit embeds the hash value of the previous log to form a chain association.
2. The method according to claim 1, characterized in that, The middleware is deployed independently between the document management system and one or more AI writing systems. It provides a unified, standardized structured material output interface through a multi-AI adaptation interface layer. The interface registers the address, authentication credentials, and communication protocol of one or more heterogeneous AI writing terminals through configuration files, and distributes the same structured material in parallel to all registered AI writing terminals without the need to develop customized interfaces for different AI terminals.
3. The method according to claim 1, characterized in that, The encrypted transmission path includes at least one of the following two methods: The RESTful API uses a one-way encrypted path, suitable for intranet-based collaborative modes. It only allows the middleware to transmit materials to the AI terminal and prohibits the AI terminal from writing data to the document governance domain. Local file isolation partition path, suitable for physical offline stand-alone mode. Media is transferred in encrypted form through disk isolation partition, without generating network traffic.
4. The method according to claim 1, characterized in that, The security level consistency verification described in step 5 is implemented by linking a rule engine with a sensitive word database: a five-level security level sensitive word database is constructed, with each level of database mapped one-to-one with the corresponding security level tag; the entire text of the AI-generated draft is scanned, and the text is segmented into sentence-level granularity, with each sentence matched against the security level sensitive word database; if a sensitive word with a security level higher than the proposed security level in the request parameters is matched, an alarm is triggered and the feedback is blocked; if the security level of the matched sensitive word is lower than or equal to the proposed security level, the verification passes; all matched sensitive words and their locations are recorded in the traceability ledger.
5. The method according to claim 1, characterized in that, The document element integrity verification described in step 5 pre-constructs a "document type-necessary element mapping table" and configures a corresponding necessary element checklist according to different document types. During verification, regular expressions are used to match whether the initial draft contains the corresponding keywords of various elements. If all match, the verification passes. If there are any missing elements, the missing element items are marked and the return is blocked. At the same time, a missing element prompt message is pushed to the user terminal.
6. The method according to claim 1, characterized in that, The construction method of the forward desensitized metadata index described in step 2 is as follows: For each existing document, non-generative element extraction is performed to extract five fixed fields: index ID, document type classification, security level label, element keywords, and desensitized paragraph summary, and these fields are written into the local index database. The index ID is generated by combining the terminal number, the first 16 digits of the file's SM3 hash value, and the timestamp, and the original text path cannot be reversed. The desensitized paragraph summary is obtained by dividing the main text into natural paragraphs, removing paragraphs containing names, specific times, specific place names, and specific project codes, retaining paragraph text without sensitive entities, and writing the first 200 words of each paragraph into the index.
7. The method according to claim 1, characterized in that, Also includes: When the material request is marked as a joint posting scenario, the middleware retrieves the positive desensitized metadata index of the terminals of each party to the joint posting, merges the filtering results, packages the structured materials in a unified manner, pushes them to the AI writing terminals associated with each party, and performs element consistency comparison on the AI-generated drafts of each party.
8. A secure middleware system for supplying official document materials using AI-assisted writing in a classified intranet, characterized in that: The middleware system is independently deployed between the document management system and one or more AI writing systems, including: The request receiving and review module is communicatively connected to the document management system. It is used to receive and parse material call requests from user terminals and perform pre-processing of sensitive word filtering and desensitization on the document issuance intent in the request parameters. The material recall and sorting module is communicatively connected to the request receiving and review module. It is used to filter candidate documents from the local positive desensitized metadata index of the terminal according to the parsed request parameters, and to perform semantic similarity calculation and sorting on the candidate documents, and recall the N documents with the highest similarity. The structured material packaging module is connected to the material recall and sorting module. It is used to extract de-identified elements from the N recalled documents and package them in a structured manner according to standardized JSON fields. The de-identified paragraph summaries are fragmented into non-continuous segments. The multi-AI adaptation interface layer communicates with the structured material packaging module and provides a unified and standardized structured material output interface. The interface registers the address, authentication credentials and communication protocol of one or more heterogeneous AI writing terminals through configuration files, and distributes the same structured material in parallel to all registered AI writing terminals. The encrypted transmission and channel management module is connected to the multi-AI adaptation interface layer and is used to transmit structured materials encrypted with the national cryptographic standard SM2 to the target AI writing terminal through a RESTful API one-way channel or a local file isolation partition channel. The draft verification and traceability module is connected to the encrypted transmission and channel management module. It is used to receive the draft of the official document returned by the AI writing terminal, perform the security level consistency verification and the document element integrity verification. After the verification is passed, the traceability link ledger is generated and returned to the user terminal. The log storage module is connected to the draft verification and traceability module and is used to submit the full-process operation log to the hash chain log storage unit. Each log storage unit in the hash chain log storage unit embeds the hash value of the previous log to form a chain association.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
10. A classified intranet AI writing assistance system, employing the method of any one of claims 1 to 7, and comprising the middleware system of claim 8, characterized in that, The system includes: a document management terminal, an independently deployed middleware server or local service process, and one or more heterogeneous AI writing terminals; there is no direct data path between the document management terminal and the AI writing terminal, and the transmission of all document materials and generated drafts is completed through the middleware for desensitization, encryption and auditing; the middleware can be adapted to multiple AI writing terminals from different manufacturers at the same time through a standardized structured material interface.