An inspection and supervision file generation method, device, equipment, medium and product

By constructing a knowledge graph of inspection and supervision and a hierarchical structured prompt template library, and training a pre-trained large model with a set of task adapters, a lightweight inspection and supervision business model is generated. This solves the problems of high compliance and traceability in the generation of inspection and supervision documents, and achieves low-cost and efficient document generation.

CN122491237APending Publication Date: 2026-07-31GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG POWER GRID CO LTD
Filing Date
2026-05-12
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies lack structured prompts and guidance adapted to inspection and supervision operations, as well as domain-specific knowledge support, and cannot meet the high compliance and traceability requirements for the generation of inspection and supervision documents.

Method used

By acquiring and preprocessing inspection and supervision materials, an inspection and supervision knowledge graph and vector index library are constructed. The knowledge graph is parsed to construct a hierarchical structured prompt template library and task adapter set. These templates and adapters are used to train a pre-trained large model to generate a lightweight inspection and supervision business model. The model is then combined with the vector index library for deduction to generate inspection and supervision documents.

Benefits of technology

It achieves high compliance and traceability of inspection and supervision documents, reduces computing power costs, and adapts to the low resource and low latency requirements of inspection and supervision scenarios, ensuring that the generated documents comply with the enterprise's internal control rules and the traceability of business facts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122491237A_ABST
    Figure CN122491237A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, equipment, medium, and product for generating inspection and supervision documents, relating to the field of lightweight training technology for large-scale inspection and supervision models. First, it establishes a domain knowledge foundation and semantic retrieval support specific to internal enterprise inspections based on an inspection and supervision knowledge graph and vector index library. Then, it constructs a hierarchical structured prompt template library and task adapter set by parsing the graph, forming a standardized guidance and business adaptation carrier adapted to inspection and supervision operations. This allows for the training of a structured prompt-guided lightweight inspection and supervision business model, ensuring the model accurately matches the enterprise's inspection and supervision business logic and document preparation requirements. Finally, it combines the vector index library and the lightweight model to generate actual inspection and supervision materials. This approach ensures that the generated inspection and supervision documents are compliant, standardized, and verifiable, while also reducing resource costs for practical applications through lightweight model training, effectively meeting the needs of generating and using internal enterprise inspection and supervision documents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of lightweight training technology for large-scale inspection and supervision models, and in particular to a method, apparatus, equipment, medium, and product for generating inspection and supervision documents. Background Technology

[0002] As a core and crucial link in corporate compliance governance, inspection and supervision are rapidly transforming from a traditional, experience-based, manually driven review model to a data-driven, intelligently assisted, precise, and efficient supervision model. Breakthroughs in large-scale pre-trained language models in deep understanding of natural language, complex logical reasoning, and professional text generation have provided new technological development paths for core businesses in inspection and supervision scenarios, such as policy and regulation retrieval, case clue sorting, and inspection document generation. Meanwhile, inspection and supervision work places far more stringent demands on the rigor of legal application, the accuracy of fact-finding, and the traceability of rectification supervision than in general commercial scenarios. Furthermore, the work involves multi-source heterogeneous data, including inspection and supervision corpora, policies and regulations, on-site records, evidence materials, and investigation and inquiry texts, placing extremely high standards on the model's business fit, controllability, and traceability. General-purpose large-scale models generally face core bottlenecks in vertical industry implementation, such as high computing power costs, insufficient business controllability, and weak traceability of conclusions. How to achieve accurate adaptation of general-purpose large-scale models to scenarios with strong regulatory and high compliance requirements like inspection and supervision under low computing power and limited sample conditions has become a key technical problem urgently needing to be solved in the current field of intelligent inspection and supervision construction.

[0003] Currently, the adaptation technology for general large models has become a relatively mature research direction. The industry generally uses techniques such as efficient parameter fine-tuning, hint engineering, and knowledge enhancement to optimize general large models in a targeted manner, enabling their application in specific business scenarios. Related solutions have been validated in multiple fields such as contract review, financial risk control, and government services, providing a reference for the intelligent application of large models in professional scenarios and laying a technical foundation for the development of intelligent inspection and supervision systems. However, inspection and supervision scenarios have extremely strong business specificities. Their core business logic revolves around compliance review, responsibility determination, and evidence chain verification, which differs fundamentally from the business logic, data characteristics, and compliance requirements of general commercial scenarios. Existing large model adaptation solutions for other fields cannot directly meet the specific business needs of inspection and supervision scenarios, resulting in a significant technical adaptation gap that urgently requires targeted technical solutions to fill. Summary of the Invention

[0004] This invention provides a method, apparatus, equipment, medium, and product for generating inspection and supervision documents, which solves the technical problem that the existing technology lacks structured prompts and guidance adapted to inspection and supervision business and domain-specific knowledge support, and cannot meet the high compliance and traceability requirements of inspection and supervision document generation.

[0005] The first aspect of this invention provides a method for generating inspection and patrol documents, comprising: Obtain and preprocess inspection and supervision materials, and construct an inspection and supervision knowledge graph and vector index library based on the preprocessing results; The inspection and patrol knowledge graph is analyzed, and a hierarchical structured prompt template library and task adapter set are constructed based on the analysis results; Using the hierarchical structured prompt template library, the task adapter set, and the inspection and patrol knowledge graph, the pre-trained large model is trained to obtain a lightweight inspection and patrol business large model; Obtain actual inspection materials and combine them with the vector index library and the lightweight inspection business model to generate inspection documents.

[0006] Optionally, the step of acquiring and preprocessing inspection materials, and constructing an inspection knowledge graph and vector index library based on the preprocessing results, includes: Obtain and segment the inspection and supervision materials to obtain a set of text fragments; Entities and relations are extracted from each text fragment in the text fragment set to obtain the entity set and relation set corresponding to each text fragment. The entity set and the relation set are combined, and the combination results are deduplicated, filtered and standardized to obtain the triplet knowledge unit corresponding to each text fragment; Based on the aforementioned triplet knowledge units, an inspection and patrol knowledge graph is constructed with entities as nodes and relationships as edges. The text fragment set and the triplet knowledge unit are vectorized and encoded to obtain the encoded semantic vector; The encoded semantic vectors are stored in a pre-set vector database to construct a vector index library.

[0007] Optionally, the step of parsing the inspection and patrol knowledge graph and constructing a hierarchical structured prompt template library and task adapter set based on the parsing results includes: Analyze the aforementioned inspection and supervision knowledge graph and divide it into inspection and supervision business domain sets; A hierarchical structure is adopted using entity sets and relation sets to obtain the initial hierarchical prompt templates corresponding to each inspection business domain within the inspection business domain set; The initial hierarchical prompt templates are standardized to obtain the target hierarchical prompt templates corresponding to each of the inspection business domains; The hierarchical prompt templates for each target are categorized, integrated, and encapsulated to obtain a hierarchical structured prompt template library; Construct task adapters corresponding to each of the aforementioned inspection business domains to obtain a task adapter set.

[0008] Optionally, the step of using entity sets and relation sets for hierarchical structuring to obtain initial hierarchical prompt templates corresponding to each inspection business domain within the inspection business domain set includes: Analyze the entity set and relation set to extract the core field set of each of the aforementioned inspection business domains; The core fields are mapped hierarchically into background information fields, task fields, and evidence format fields; Configure semantic tags for each layer of fields and reserve fillable placeholders to obtain background information field template fragments, task field template fragments and evidence format field template fragments; By piecing together the template fragments from each layer, an initial layered prompt template for each of the aforementioned inspection business domains is generated.

[0009] Optionally, the step of training the pre-trained large model using the hierarchical structured prompt template library, the task adapter set, and the inspection and supervision knowledge graph to obtain a lightweight inspection and supervision business large model includes: Based on the pre-trained large model, each task adapter in the task adapter set is loaded to obtain the lightweight model to be trained. Triple knowledge units are extracted from the inspection and patrol knowledge graph as inspection annotation samples, and placeholders are filled according to the hierarchical field structure of the hierarchical structured prompt template library to generate a training dataset. The training dataset is used as input to the lightweight model to be trained for supervised fine-tuning to obtain a lightweight inspection business model.

[0010] Optionally, the step of obtaining actual inspection materials and combining them with the vector index library and the lightweight inspection business model to generate inspection documents includes: Obtain actual inspection materials and perform text preprocessing, including text cleaning and entity extraction. Based on the pre-processed actual inspection materials, the corresponding inspection business domain within the inspection business domain set is matched as the actual inspection business domain. Based on the hierarchical structured prompt template library, the target hierarchical prompt template corresponding to the actual inspection business domain is used as the actual hierarchical prompt template; The preprocessed actual inspection materials are used to fill the actual layered prompt template to obtain the inspection reasoning text; The vector index library is retrieved using the patrol reasoning text, and multiple encoded semantic vectors with semantic similarity not lower than a preset similarity threshold are matched as actual encoded semantic vectors; The actual encoded semantic vector is concatenated with the patrol reasoning text to obtain the retrieval-enhanced patrol reasoning text. The retrieval-enhanced inspection reasoning text is input into the lightweight inspection business model to perform multi-task deduction and obtain multiple task reasoning results. The reasoning results of each task are verified for consistency according to rules, and the verified reasoning results are structured to generate inspection and supervision documents.

[0011] A second aspect of the present invention provides an inspection and patrol document generation device, comprising: The acquisition module is used to acquire and preprocess inspection and supervision materials, and to build an inspection and supervision knowledge graph and vector index library based on the preprocessing results. The parsing module is used to parse the inspection and patrol knowledge graph and construct a hierarchical structured prompt template library and task adapter set based on the parsing results; The training module is used to train the pre-trained large model using the hierarchical structured prompt template library, the task adapter set, and the patrol and inspection knowledge graph to obtain a lightweight patrol and inspection business large model. The deduction module is used to obtain actual inspection materials and combine them with the vector index library and the lightweight inspection business model to generate inspection documents.

[0012] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the inspection and patrol document generation method described above.

[0013] The fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the inspection and patrol document generation method as described above.

[0014] The fifth aspect of the present invention provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer performs the inspection and patrol document generation method as described above.

[0015] As can be seen from the above technical solutions, the present invention has the following advantages: This invention provides a scheme for generating inspection documents based on a structured prompt-guided lightweight inspection business model. First, inspection materials are acquired and preprocessed. Based on the preprocessing results, an inspection knowledge graph and vector index library are built. Then, the inspection knowledge graph is parsed, and a hierarchical structured prompt template library and task adapter set are constructed. The pre-trained large-scale model is trained using the hierarchical structured prompt template library, task adapter set, and inspection knowledge graph to generate a lightweight inspection business model. Subsequently, actual inspection materials are acquired, and combined with the vector index library and the lightweight inspection business model, deduction is performed to finally generate the inspection document. This invention, through its inspection and supervision knowledge graph, solidifies the foundation of specialized business knowledge. A hierarchical, structured prompt template library forms standardized business guidance, while a task adapter set supports the targeted optimization of a pre-trained large-scale model. This ensures that the resulting lightweight inspection and supervision business model deeply aligns with the logic of inspection and supervision operations and document preparation standards. Simultaneously, by leveraging a vector index library to link original data information, the model-derived document content is verifiable and traceable throughout the process. This guarantees that the final inspection and supervision documents meet compliance standards and inspection traceability requirements, overcoming the shortcomings of previous technologies such as insufficient business adaptation, lack of supporting content, and difficulty in verification and traceability.

[0016] Furthermore, in response to the characteristics of inspection and supervision that require strong compliance, strict formatting, strong evidence, and strict processes, this invention divides the inspection business domain based on knowledge graphs and constructs a three-level hierarchical structured prompt template library consisting of a background information layer, a task layer, and an evidence format layer, along with corresponding business domain-specific task adapters. The inspection rules, evidence formats, document specifications, and judgment logic are explicitly encoded into reusable and standardized templates and adaptable components, thereby solving the problems of chaotic, non-compliant, and uncontrollable output of general large models. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of the steps in a method for generating inspection and patrol documents according to Embodiment 1 of the present invention; Figure 2 This is a flowchart illustrating the steps of a method for generating inspection and patrol documents according to Embodiment 2 of the present invention.

[0019] Figure 3 This is a structural block diagram of an inspection and patrol document generation device provided in Embodiment 3 of the present invention; Figure 4This is a structural block diagram of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation

[0020] This invention provides a method, apparatus, equipment, medium, and product for generating inspection and supervision documents, which addresses the technical problem that existing technologies lack structured prompts and guidance adapted to inspection and supervision operations and support from domain-specific knowledge, thus failing to meet the high compliance and traceability requirements for generating inspection and supervision documents.

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] The inspection and audit materials are archived business documents covering the entire process of internal compliance audits and internal control verifications. These include internal risk control supervision ledgers, on-site business visit and verification records, problem verification drafts, original financial vouchers, project establishment and filing documents, supply chain procurement and bidding archives, personnel appointment and dismissal and salary assessment files, job performance self-inspection reports, archived materials of previous internal verification and rectification, industry operation compliance rules and regulations, written materials of business supervision and verification, and supporting documents for verification of operational risk clues, as well as all other written materials that can be used for fact verification, definition of operational issues, and archiving of responsibility.

[0023] The inspection business domain is an independent professional business segment divided according to the core dimensions of internal compliance audit and risk control verification. It is used to match exclusive prompt templates and adaptation modules. Specifically, it includes: job performance compliance audit business domain, financial internal control risk verification business domain, supply chain procurement and bidding management business domain, engineering project construction compliance verification business domain, human resources and salary standard management business domain, corporate asset and capital risk control management business domain, job performance process management business domain, and operational problem rectification closed-loop verification business domain. Each business domain has an independent hierarchical structured prompt template and dedicated adaptation components to achieve precise modeling and intelligent reasoning in different domains.

[0024] This solution is applied to intelligent office scenarios for enterprise internal compliance audits, internal control verifications, and operational risk control. Its core functions include the intelligent compilation of routine internal inspection documents, automatic generation of operational risk special inspection identification reports and clue verification reports, standardized output of financial and engineering business special inspection working papers, intelligent drafting of operational problem rectification and acceptance supervision documents, compilation of cross-business segment comprehensive inspection summary reports, and automated generation of internal verification evidence collection materials. It relies on a structured, prompt-guided, lightweight inspection business model to train core capabilities, and is supported by an inspection knowledge graph and a hierarchical structured prompt template library. This ensures that generated documents conform to the enterprise's internal control rules, that operational facts are traceable, and that the verification content is verifiable. It meets the management requirements of rigor, confidentiality, and full traceability in enterprise internal risk control verification work, replacing the inefficient traditional work mode of manually compiling business data, manually sorting supporting information, and compiling verification documents one by one.

[0025] This invention proposes a lightweight, large-scale model training and device scheme with structured prompts and guidance for inspection and patrol scenarios. It primarily addresses the challenges of multi-source heterogeneous evidence, rule-driven judgment, and high traceability requirements in inspection and patrol work. The innovation and advancement of this invention are reflected in the following aspects: First, a domain-specific structured prompt template library is proposed, which explicitly encodes the rules for determining responsibilities, investigation procedures, and evidence citation formats into the prompts. This ensures that the model reasoning process conforms to the business logic of the inspection and outputs a verifiable format, thereby enhancing compliance and consistency.

[0026] Secondly, a hybrid training strategy combining lightweight adapters and prompt-guided training is adopted. By combining LoRA / Adapter with prompt fine-tuning, efficient adaptation with few samples is achieved, significantly reducing computing power and deployment costs, and facilitating on-site deployment on intranets or mobile devices. Compared with offline training processes that rely solely on large-scale generation-reinforcement learning iterations, the method of this invention is more suitable for low-resource, low-latency inspection scenarios. Thirdly, a chain-based verifiable reasoning and evidence tracing mechanism is introduced. At each step of the reasoning chain, structured intermediate products are output and the original text location and evidence confidence level are marked, reducing the risk of model illusion and facilitating manual review. Existing contract retrieval schemes focus on retrieval recall and formatted answers, failing to fully guarantee the line-by-line mapping relationship between conclusions and original evidence.

[0027] In summary, this patent has significant advantages over existing technologies in terms of scenario adaptability, traceability, lightweight deployment, and anti-hallucination mechanisms, and is especially suitable for inspection and supervision operations that have strict compliance requirements for the chain of evidence and the judgment process.

[0028] Please see Figure 1 , Figure 1 This is a flowchart illustrating the steps of a method for generating inspection and patrol documents according to Embodiment 1 of the present invention.

[0029] This invention provides a method for generating inspection and supervision documents, comprising: Step 101: Obtain and preprocess the inspection and supervision materials, and construct an inspection and supervision knowledge graph and vector index library based on the preprocessing results.

[0030] In this embodiment of the invention, inspection and supervision materials related to internal enterprise inspections and internal control checks are collected. The materials are preprocessed by text cleaning and format standardization to remove invalid and redundant information. Based on the preprocessed valid business data, business entities and related relationships are extracted to build an inspection and supervision knowledge graph. The preprocessed text and graph knowledge units are vectorized and encoded. The encoded vectors are stored in a preset vector database to complete the construction of the vector index library.

[0031] Step 102: Analyze the inspection and patrol knowledge graph, and build a hierarchical structured prompt template library and task adapter set based on the analysis results.

[0032] In this embodiment of the invention, the completed inspection and supervision knowledge graph is analyzed for business logic, and multiple inspection business domains adapted to internal enterprise audits are divided. The core business fields and relationships corresponding to each inspection business domain are extracted. Based on the extracted core fields and relationships, initial hierarchical prompt templates corresponding to each inspection business domain are built. After standardization, they are integrated and encapsulated to form a hierarchical structured prompt template library. At the same time, for each inspection business domain, a task adapter adapted to its business logic is built, and all task adapters are aggregated to obtain a task adapter set.

[0033] Step 103: Using the hierarchical structured prompt template library, task adapter set and inspection and patrol knowledge graph, train the pre-trained large model to obtain a lightweight inspection and patrol business large model.

[0034] In this embodiment of the invention, a pre-trained large model is used as the base model. Various prompt templates in the hierarchical structured prompt template library are used as the training guide. The training process is adapted to business and standardized through a task adapter set. Combined with the business relationships and core data in the inspection and supervision knowledge graph, the training process of the pre-trained large model is constrained and guided, the model training parameters are optimized, the model size is controlled, and a lightweight and highly adaptable inspection and supervision business large model is obtained after training is completed.

[0035] Step 104: Obtain actual inspection materials and combine them with the vector index library and the lightweight inspection business model to generate inspection documents.

[0036] In this embodiment of the invention, actual inspection materials generated during the actual inspection are collected, vectorized, and then semantically matched with a vector index library to obtain relevant related business information. The actual inspection materials and the retrieved related information are then input into a lightweight inspection business model, which performs deduction and text generation according to business logic, and finally outputs a standardized inspection document.

[0037] Inspection and audit materials refer to a collection of business documents related to internal compliance audits and internal control verification, such as risk control ledgers, verification records, inspection vouchers, project materials, and rectification files, which can be used for fact-checking and accountability tracing. Preprocessing involves standardized processing operations on inspection and audit materials, including text cleaning, format standardization, redundancy removal, and text fragmentation. The inspection and audit knowledge graph is a structured knowledge network in the enterprise inspection domain, constructed using business entities as nodes and business relationships between entities as edges, through triples. The vector index library is a semantic retrieval library formed by vectorizing text fragments and knowledge graph triples and storing them in a vector database. The hierarchical structured prompt template library is divided according to the inspection business domain and includes background information, tasks, and evidence formats. The system includes: a standardized set of prompt templates for hierarchical fields; a set of task adapters adapted to various inspection business domains, used for model business adaptation, format conversion, and logical constraints; a pre-trained large-scale model, a general-purpose large-scale language model with basic natural language understanding and generation capabilities; a lightweight inspection business model, a dedicated model adapted to enterprise inspection business after loading task adapters and undergoing targeted lightweight fine-tuning; actual inspection materials, real-time verification data generated during this specific compliance audit; inference, the process by which the model combines business data and retrieval knowledge to conduct semantic understanding, logical reasoning, and content generation; and inspection documents, formal inspection documents such as verification reports and problem identification letters that conform to enterprise internal control standards, generated based on the inference results.

[0038] In this invention, a domain knowledge foundation and semantic retrieval support specifically for internal enterprise inspections are first built based on the inspection and supervision knowledge graph and vector index library. Then, a hierarchical structured prompt template library and task adapter set are constructed by parsing the graph, forming a standardized guidance and business adaptation carrier adapted to inspection and supervision business. This is then used to complete the training of a structured prompt-guided lightweight inspection and supervision business model, allowing the model to accurately fit the enterprise's inspection and supervision business logic and document preparation requirements. Finally, the vector index library and lightweight model are combined to generate actual inspection and supervision materials, effectively making up for the deficiencies of existing technologies that lack structured prompt guidance and domain knowledge support adapted to inspection and supervision business. This ensures that the generated inspection and supervision documents are compliant, standardized, and verifiable, while reducing the resource costs of actual applications through lightweight model training, effectively meeting the needs of generating and using internal enterprise inspection and supervision documents.

[0039] Please see Figure 2 , Figure 2This is a flowchart illustrating the steps of a method for generating inspection and patrol documents according to Embodiment 2 of the present invention.

[0040] This invention provides a method for generating inspection and supervision documents, comprising: Step 201: Obtain and preprocess the inspection and supervision materials, and construct an inspection and supervision knowledge graph and vector index library based on the preprocessing results.

[0041] Further, step 201 may include the following sub-steps: S11. Obtain the inspection and patrol materials and divide them into segments to obtain a set of text fragments.

[0042] In this embodiment of the invention, inspection and audit materials related to internal compliance audits and internal control checks are collected. These materials include heterogeneous business documents from multiple sources, such as business audit records, financial vouchers, rules and regulations documents, and project archives. The document set corresponding to the inspection and audit materials to be processed is defined as follows:

[0043] In the formula, This is a collection of documents corresponding to the inspection and supervision materials to be processed. For the set of the first A separate document for inspection and supervision operations.

[0044] First, a document parsing algorithm is used to process the collection. The document is formatted and its content extracted, and non-textual redundant information such as images, format marks, headers and footers is removed. All documents are then converted into plain text content. The plain text content is then segmented according to a preset semantic window (e.g., 512 characters per segment to ensure semantic integrity) to obtain a set of text segments, thus completing the standardized preprocessing of the original material.

[0045] S12. Extract entities and relations from each text fragment in the text fragment set to obtain the entity set and relation set corresponding to each text fragment.

[0046] In this embodiment of the invention, for each text fragment in the text fragment set, entities related to the inspection and supervision business (such as business projects, responsible positions, violations, rules and regulations, etc.) are extracted from the text fragment to obtain the entity set of the corresponding text fragment:

[0047] In the formula, A set of entities extracted from a text fragment. For the set of the first Each business entity This represents the total number of entities extracted from the text fragment.

[0048] Simultaneously, business relationships between entities (such as "responsible for", "violate", "belong to", "related to", etc.) are extracted from the text fragments to obtain the relationship set of the corresponding text fragments:

[0049] In the formula, A set of relations extracted from a text fragment. For the set of the first Each business relationship This represents the total number of relations extracted from the text fragment.

[0050] S13. Combine entity sets and relation sets, and perform deduplication, filtering and standardization on the combination results to obtain the triplet knowledge units corresponding to each text fragment.

[0051] In this embodiment of the invention, for each text fragment, the entity set and relation set are combined according to the business association logic of "entity-relation-entity" to construct an initial set of relation triples:

[0052] In the formula, For the initial set of relation triples, For entity set The two business entities within, For relation sets Internal business relationships Representing entities and There is a business relationship .

[0053] Subsequently, the initial set of triples was... The process involves deduplication to remove duplicate triple entries; then, by combining this with internal compliance audit rules, invalid triples without business significance are removed; finally, the descriptions of entities and relationships are standardized (e.g., standardized business terminology and naming formats) to obtain the standardized triple knowledge unit corresponding to the text fragment.

[0054] S14. Based on each triplet knowledge unit, construct a knowledge graph of inspection and supervision with entities as nodes and relations as edges.

[0055] In this embodiment of the invention, triplet knowledge units of all text fragments are aggregated, and the entities in the triplets are used as graph nodes and the relationships between entities are used as graph edges to construct a patrol and inspection knowledge graph, the structure of which is represented as follows:

[0056] In the formula, To construct a complete knowledge graph of inspection and supervision, For the node set of the knowledge graph, and (That is, the node set is equal to the set of all extracted entities). This represents the edge set of a knowledge graph. Each edge By triplet Make a decision and indicate the corresponding business relationship. This forms a complete and structured knowledge network for internal enterprise compliance auditing, enabling the parsing of input documents, entity extraction, triple construction, and knowledge graph generation.

[0057] S15. Vectorize the text fragment set and triplet knowledge units to obtain the encoded semantic vector.

[0058] In this embodiment of the invention, vectorization encoding is performed on all plain text fragments and entity and relation descriptions in triplet knowledge units in the text fragment set, respectively, to convert unstructured text information and structured knowledge units into low-dimensional dense semantic vectors, thereby obtaining a set of encoded semantic vectors corresponding to all text fragments and knowledge units, and realizing the numerical representation of business content.

[0059] S16. Encode semantic vectors and store them in a pre-set vector database to build a vector index library.

[0060] In this embodiment of the invention, all the encoded semantic vectors generated in step S15 are associated with the identification information of their original text fragments and triplet knowledge units, and are stored in batches into a preset vector database (such as FAISS or Milvus vector database). A vector index is constructed based on vector similarity algorithms such as cosine similarity to complete the construction of the vector index library. This index library can support subsequent rapid retrieval based on semantics, and realize accurate matching between actual inspection materials and historical business data and knowledge units.

[0061] The text fragment set is a collection of basic processing units formed after the inspection and supervision materials are segmented according to a preset semantic window; the entity set is a collection of core business concepts such as the verification objects, responsible positions, violations, and institutional clauses extracted from the text fragments; the relation set is a collection of business relationships such as responsibility, violation, and association between entities in the text; the triple knowledge unit is a structured knowledge unit formed by combining entities and relations in the "entity-relationship-entity" manner after deduplication, screening, and standardization; and the vectorization encoding is the process of converting text and triples into low-dimensional dense semantic vectors using a text vectorization model.

[0062] Step 202: Analyze the inspection and supervision knowledge graph, and build a hierarchical structured prompt template library and task adapter set based on the analysis results.

[0063] Furthermore, step 202 may include the following sub-steps: S21. Analyze the knowledge graph of inspection and supervision and divide it into inspection and supervision business domain sets.

[0064] In this embodiment of the invention, the constructed inspection and supervision knowledge graph is traversed. Based on the business attributes of entities in the knowledge graph and the business relationship logic between entities, the entities and relationships in the knowledge graph are divided into different independent business scenarios according to the core business dimensions of enterprise internal compliance audit and internal control audit (such as financial internal control audit, procurement bidding control, job performance audit, etc.), thus obtaining the inspection and supervision business domain set:

[0065] In the formula, For the inspection of business domains, For the set of the first An independent inspection business domain To determine the total number of inspection business domains obtained from the division, we completed the business dimension analysis and scenario division of the knowledge graph.

[0066] S22. Using entity sets and relation sets for hierarchical structuring, the initial hierarchical prompt templates corresponding to each inspection business domain within the inspection business domain set are obtained.

[0067] Furthermore, S22 may include the following sub-steps: S221. Parse the entity set and relation set to extract the core field set of each inspection business domain.

[0068] In this embodiment of the invention, for each inspection business domain in the inspection business domain set... Extract the dedicated entity set corresponding to this business domain from the inspection and supervision knowledge graph. With relation set Based on the enterprise compliance audit business rules, the core business fields required for the generation of inspection documents in this business domain (such as inspection topic, responsible entity, violation, and institutional basis) are extracted to obtain the core field set of the corresponding inspection business domain:

[0069] In the formula, For the first The core field set of each inspection business domain For the set of the first One core business field, This represents the total number of core fields extracted from this business domain.

[0070] S222. Map the core fields hierarchically to background information fields, task fields, and evidence format fields.

[0071] In this embodiment of the invention, the core field set is configured according to the design requirements of hierarchical and structured prompts. The core fields are mapped into three hierarchical fields based on business logic and inspection document generation requirements: the top layer is the background information field (corresponding to the basic background information of the business domain, such as the inspection topic, time range, responsible entity, etc.), the middle layer is the task field (corresponding to the inspection task requirements and problem judgment logic of the business domain, etc.), and the bottom layer is the evidence format field (corresponding to the evidence chain sorting and fact verification format of the business domain, etc.). This completes the hierarchical classification of the core fields and builds a hierarchical framework for the layered prompt template.

[0072] S223. Configure semantic tags for each layer of fields and reserve fillable placeholders to obtain background information field template fragments, task field template fragments and evidence format field template fragments.

[0073] In this embodiment of the invention, for each type of hierarchical field, a corresponding semantic label is configured for each field (clarifying the business meaning and input requirements of the field). Among them, fixed business rule fields are set as fixed prompt text, and fields that need to be dynamically filled with business information reserve fillable placeholders (such as {verification topic}, {violation item}, etc.). Background information field template fragments, task field template fragments, and evidence format field template fragments are generated respectively. Each template fragment corresponds to an independent level of the structured prompt template to ensure that the field semantics are clear and the filling rules are explicit.

[0074] S224. Combine the template fragments of each layer to generate the initial layered prompt template for each inspection business domain.

[0075] In this embodiment of the invention, the background information field template fragment, the task field template fragment, and the evidence format field template fragment are concatenated and spliced ​​in hierarchical order (background layer → task layer → evidence layer) to generate an initial hierarchical prompt template for the corresponding inspection business domain. This template adopts a hierarchical structured representation. Let the initial hierarchical prompt template contain L layers, and its set form is as follows:

[0076] In the formula, This is the initial layered prompt template. The first template Layer field set, This represents the total number of levels in the template. Among them, the first The layer field set can be represented as:

[0077] In the formula, For the first The first layer field set One field, For the first The total number of fields contained in the layer; each field These are fixed prompt texts or populated placeholder variables used to guide the model to focus on the corresponding business information.

[0078] The initial hierarchical prompt template is uniformly represented using mathematical symbols as follows:

[0079] In the formula, The mathematical representation of the initial hierarchical prompt template. The template's hierarchical number ( (Corresponding to the top-level background information layer, with the layer number increasing to correspond to the lower-level template). This refers to the field sequence number within the corresponding level. For the first Layer Each business field This represents the total number of levels in the template. For the first The total number of fields in each layer. This hierarchical and structured representation clarifies the semantic role and organizational order of each field in the prompt, improving the consistency and controllability of the model input and fully covering the design requirements of the structured prompt template.

[0080] S23. Standardize each initial hierarchical prompt template to obtain the target hierarchical prompt template corresponding to each inspection business domain.

[0081] In this embodiment of the invention, for the initial hierarchical prompt templates of each inspection business domain, the fixed prompt text in the templates is standardized and unified (such as standardizing business terminology and unifying expression formats) in combination with the business specifications of internal compliance audits and the specifications for compiling inspection documents. The naming and filling rules of placeholders are also standardized and defined. At the same time, the hierarchical logic and business adaptability of the templates are verified, and invalid or redundant fields are corrected to obtain the target hierarchical prompt templates corresponding to each inspection business domain, ensuring that the templates fully comply with the enterprise's business rules and document generation requirements.

[0082] S24. Classify, integrate, and encapsulate the hierarchical prompt templates for each target to obtain a hierarchical structured prompt template library.

[0083] In this embodiment of the invention, target hierarchical prompt templates for all inspection business domains are aggregated, classified and managed according to business domain categories, and each template is encapsulated into a standardized template unit that can be called independently, and integrated to form a hierarchical structured prompt template library. This template library stores hierarchical prompt templates for all business domains, supports quick calling in the subsequent model training and inference process, and provides a standardized guidance carrier for structured prompt-guided lightweight model training.

[0084] S25. Construct task adapters corresponding to each inspection business domain to obtain a task adapter set.

[0085] In this embodiment of the invention, for each inspection business domain, a task adapter adapted to its business scenario is constructed based on the target hierarchical prompt template and business logic of that business domain. This adapter is used to complete the dynamic filling of prompt templates, the adaptation constraints of business logic, and the standardized conversion of input and output formats during model training and inference. The task adapters of all inspection business domains are summarized to obtain a task adapter set, which provides business adaptation support for the lightweight training of subsequent pre-trained large models, ensuring that the model training and inference process conforms to the actual needs of the corresponding business domain.

[0086] The inspection business domain set is a collection of independent inspection business scenarios such as job performance, financial internal control, and procurement control, divided according to the business logic of the knowledge graph; the initial hierarchical prompt template is a prototype of an unstandardized prompt template generated hierarchically based on the core fields of the business domain; the target hierarchical prompt template is a compliance template obtained by standardizing the initial hierarchical prompt template through terminology standardization, logic verification, and other processes.

[0087] The core field set is a collection of key information supporting reasoning and document generation in various inspection business domains, including business background, task requirements, and evidence specifications. The background information field is a hierarchical field in the template that describes basic information such as the verification topic, time range, and responsible party. The task field is a business execution field that clarifies the verification task requirements and judgment rules. The evidence format field is a presentation field that standardizes the format of evidence chain sorting and fact verification. The semantic tag is a business meaning and input requirement identifier configured for the hierarchical field. The fillable placeholder is an identifier reserved in the template for dynamically filling business information. The template fragment is an independent template unit composed of a single type of hierarchical field.

[0088] Step 203: Load each task adapter in the task adapter set based on the pre-trained large model to obtain the lightweight model to be trained.

[0089] In this embodiment of the invention, a general pre-trained large model is selected as the base model, and the original weight matrix of the pre-trained large model is set as follows: For each task adapter within the task adapter set, a low-rank adaptation (LoRA) or parameter adapter mechanism is used to insert small trainable modules of the corresponding task adapter into each network layer of the pre-trained large model, introducing a low-rank increment matrix. The updated model weights are:

[0090] In the formula, This is the model weight matrix after loading the task adapter. The original weight matrix for pre-training a large model. It is a low-rank increment matrix. It is a low-rank matrix. It is a low-rank number and satisfies This significantly reduces the number of trainable parameters; after loading, the original weights of the pre-trained large model are frozen. Only retain the low-rank matrix corresponding to the task adapter. The trainable parameters are used to obtain a lightweight model to be trained. Furthermore, depending on the actual deployment requirements, the LoRA / parameter adapter can be replaced with other efficient parameter fine-tuning techniques such as prefix-tuning, prompt-tuning, BitFit, or QLoRA. All of these techniques achieve task adaptation to the base model by training only a small number of parameters, thus completing the construction of the lightweight model to be trained.

[0091] Step 204: Extract triplet knowledge units from the inspection and patrol knowledge graph as inspection annotation samples, and fill them with placeholders according to the hierarchical field structure of the hierarchical structured prompt template library to generate a training dataset.

[0092] In this embodiment of the invention, all triplet knowledge units are extracted from the inspection and patrol knowledge graph constructed in step 201. (in For business entities, To establish business relationships between entities, and in conjunction with the business rules of internal compliance audits and internal control checks, the triplet knowledge units are associated with the verification facts, institutional basis, and responsible entities of the corresponding business scenarios to form inspection annotation samples. For each inspection annotation sample, a target hierarchical prompt template for the corresponding inspection business domain is matched from the hierarchical structured prompt template library. According to the hierarchical field structure of the template (background information field, task field, evidence format field), the entity, relationship, and business information in the inspection annotation sample are filled into the corresponding placeholders of the template to generate standardized structured prompt input samples. All structured prompt input samples are summarized, and training and validation sets are divided to complete the construction of the training dataset, providing annotation data support that conforms to business logic for subsequent model fine-tuning. At the same time, semi-supervised / weakly supervised data programming (Snorkel-like methods) and synthetic data augmentation can be used to replace large-scale manual annotation, expanding the training dataset under conditions of few samples and ensuring model training performance.

[0093] It is worth mentioning that this invention uses the inspection and patrol knowledge graph triples to automatically generate training samples, and performs lightweight fine-tuning of the pre-trained large model based on the task adapter (LoRA / Adapter), freezing the weights of the backbone model and training only a small number of adaptation parameters; thus achieving model training with few samples, low computing power, and deployment on the intranet, completely solving the industry pain points of high computing power cost, large demand for labeled data, and inability to adapt to the enterprise intranet environment for general full-scale fine-tuning.

[0094] Step 205: Input the training dataset into the lightweight model to be trained for supervised fine-tuning to obtain the lightweight inspection business model.

[0095] In this embodiment of the invention, the training dataset is input into the lightweight model to be trained, and supervised fine-tuning training is performed; the model's forward output is:

[0096] In the formula, This is the forward output of the model. This is the model weight matrix after loading the task adapter. The original weight matrix for pre-training a large model. It is a low-rank increment matrix. The training samples are structured prompts for the input; where For input Perform dimensionality reduction mapping. Then it is mapped back to the original space to achieve incremental correction of the original output.

[0097] The fine-tuning process uses a supervised loss function for optimization, given a training sample set. Cross-entropy loss is used as the basic loss function:

[0098] In the formula, Let cross-entropy be the loss function. For the fine-tuning parameters to be optimized (such as low-rank matrices) wait), For the model to sample The predicted probability, For the first One input training sample, These are the labels for the corresponding samples.

[0099] To prevent overfitting, a regularization term is introduced into the loss function, using weighted norm regularization. The total loss function is:

[0100] In the formula, For the total loss function, For the basic loss of cross-entropy, The regularization coefficient is... It is the Frobenius norm (used to measure the magnitude of a matrix). Low-rank matrices The squared Frobenius norm. By minimizing the total loss function. Iteratively update the fine-tuning parameters to be optimized. The supervised fine-tuning of the lightweight model to be trained is completed; after training, a lightweight inspection business model that is deeply adapted to the inspection and supervision business logic and document preparation standards is obtained.

[0101] Meanwhile, in terms of training objective design, contrastive learning, meta-learning, or reinforcement learning (including rule-based first-order rewards) can be used to replace or enhance rule consistency loss, thereby strengthening the model's compliance with rules in different mathematical forms. Alternatively, a task decomposition architecture can be adopted, breaking down the overall task into several specialized small models such as entity recognition models, relation extraction models, qualitative judgment models, and document generation models, which can be combined in a pipeline or cascade manner as an engineering alternative to a single adapter solution. Furthermore, knowledge distillation technology can be combined to generate pseudo-labels with rule annotations from a large model enhanced by retrieval, enabling supervised training of small student models and achieving similar judgment performance and traceable output in edge environments.

[0102] The lightweight model to be trained is a basic fine-tuned model that retains only a small number of trainable parameters after loading the task adapter and freezing the original weights; the patrol annotation samples are standardized training samples formed by extracting triples from the knowledge graph and supplementing them with business information; the training dataset is a set of structured training samples formed by filling the annotation samples according to the prompt template hierarchy; supervised fine-tuning is a training process that uses the training dataset as input to optimize the model parameters to adapt them to the patrol business.

[0103] Step 206: Obtain actual inspection materials and combine them with the vector index library and the lightweight inspection business model to generate inspection documents.

[0104] Furthermore, step 206 may include the following sub-steps: S31. Obtain actual inspection materials and perform text preprocessing, including text cleaning and entity extraction.

[0105] In this embodiment of the invention, actual inspection materials from the internal compliance audit and internal control verification of the enterprise are collected. These materials include multiple source documents such as on-site inspection records, financial ledgers, business documents, and rectification reports. First, text cleaning is performed to remove format marks, redundant spaces, invalid characters, and irrelevant image information from the materials, and to unify the text encoding format. Then, business entities are extracted from the cleaned text, including the verification object, issue, responsible position, system clauses, evidence number, etc., to obtain the entity set of the actual inspection materials, thus completing the text preprocessing.

[0106] S32. Based on the preprocessed actual inspection materials, match the corresponding inspection business domain within the inspection business domain set as the actual inspection business domain.

[0107] In this embodiment of the invention, the core entities and semantic features of the actual inspection materials after preprocessing in S31 are extracted and compared with the inspection business domain set divided in step 202. The system performs semantic matching on the business characteristics of each inspection business domain. By calculating the cosine similarity between entity features and features of each business domain, the inspection business domain with the highest similarity is selected as the actual inspection business domain, thereby achieving accurate positioning of the actual inspection business scenario.

[0108] S33. Based on the hierarchical structured prompt template library, the target hierarchical prompt template corresponding to the actual inspection business domain is used as the actual hierarchical prompt template.

[0109] In this embodiment of the invention, a target hierarchical prompt template corresponding to the actual inspection business domain determined in S32 is retrieved from the hierarchical structured prompt template library constructed in step 204. This template is a standardized hierarchical structured template, which includes hierarchical fields and placeholders for background information layer, task layer, and evidence format layer. It is used as the actual hierarchical prompt template for this inspection task to provide standardized guidance for subsequent reasoning.

[0110] S34. Fill the actual layered prompt template with pre-processed actual inspection materials to obtain the inspection reasoning text.

[0111] In this embodiment of the invention, the actual inspection material entities and key information extracted in step S31 are filled layer by layer according to the hierarchical field structure (background information field, task field, evidence format field) and placeholder requirements of the actual hierarchical prompt template determined in step S33, generating a structured inspection reasoning text. This inspection reasoning text has fully integrated the background information, verification task requirements, and evidence presentation specifications of this inspection operation, providing standardized model input for subsequent retrieval and reasoning.

[0112] S35. Using the patrol reasoning text retrieval vector index library, multiple encoded semantic vectors with semantic similarity not lower than the preset similarity threshold are matched as the actual encoded semantic vectors.

[0113] In this embodiment of the invention, the patrol reasoning text generated in step S34 is first vectorized and encoded to obtain a query vector. Then The vector index library constructed in step S16 is input, and the similarity between the query vector and each encoded semantic vector in the library is calculated using a vector similarity function, combined with a temperature coefficient. Calculate the retrieval probability distribution. The retrieval probability distribution can be expressed as:

[0114] In the formula, For the first in the index The retrieval probability of a document corresponding to each encoded semantic vector; For vector similarity functions (e.g., cosine similarity); This is a temperature coefficient used to adjust the sharpness of the probability distribution. The smaller the value, the more concentrated the distribution is in highly similar documents; The larger the size, the more evenly distributed the evidence, and the more supporting evidence can be integrated. For the first in the index One encoded semantic vector; This represents the total number of vectors in the index. Then, a preset similarity threshold (e.g., 0.75~0.85) is set to filter vectors with semantic similarity not lower than this threshold and a high retrieval probability. The top-K encoded semantic vectors are used as the actual encoded semantic vectors to achieve accurate retrieval and weighted fusion of external knowledge.

[0115] It is worth mentioning that the retrieval probability distribution transforms semantic similarity into continuously adjustable retrieval weights through an exponential function. Combined with a temperature coefficient, it can dynamically control the degree of retrieval focus. This not only strengthens the weight ratio of highly relevant inspection knowledge and filters out irrelevant information interference, but also combines preset similarity thresholds and Top-K screening to flexibly balance retrieval accuracy and recall. This provides a standardized weight basis for model knowledge fusion, significantly improving the reliability of inspection reasoning and the rigor of conclusions. At the same time, it can adapt to the differentiated retrieval needs of different inspection business scenarios, ensuring the compliance and traceability of generated inspection documents.

[0116] S36. The actual encoded semantic vector is concatenated with the patrol reasoning text to obtain the retrieval-enhanced patrol reasoning text.

[0117] In this embodiment of the invention, the original text fragments corresponding to the Top-K actual encoded semantic vectors obtained in step S35 are sequentially concatenated with the patrol reasoning text generated in step S34 to construct retrieval-enhanced patrol reasoning text. This retrieval-enhanced patrol reasoning text can be represented as:

[0118] In the formula, This is a text concatenation operation. To enhance the retrieval of patrol reasoning texts, The encoded semantic vectors are Top-K.

[0119] By using a retrieval enhancement mechanism, the original inspection business information is integrated with highly relevant historical knowledge units in the vector index library, providing sufficient and reliable external knowledge support for the subsequent multi-task simulation of the lightweight inspection business model.

[0120] S37. Using a lightweight inspection business model with enhanced retrieval and text input, multi-task deduction is performed to obtain multiple task deduction results.

[0121] In this embodiment of the invention, the retrieval-enhanced inspection reasoning text generated in S36 is input into a lightweight inspection business model. The model performs multi-task inference based on the retrieval-enhanced generation (RAG) mechanism, including tasks such as entity relationship determination, qualitative analysis of problems, evidence chain construction, and document content generation. The model's final output is... The conditional probability can be expressed as:

[0122] In the formula, Generate target inference results for the model The conditional probability, The number of actual encoded semantic vectors retrieved. For the first The weighted probability of each retrieved document. The model is based on the first Each retrieved document generates inference results. The conditional probability; simultaneously, the model employs an attention mechanism to fuse the retrieved text and prompt features, and achieves feature integration through weighted fusion of the decoder's hidden state. The fused hidden state can be represented as:

[0123] In the formula, This represents the hidden state of the fused decoder. This refers to the hidden state of the decoder in the original patrol reasoning text. These are the feature weight coefficients of the original text. For the first Weight coefficients of features of each retrieved document. For the first The decoder hidden state of each retrieved document; the model is based on the updated hidden state. The system performs decoding and generates multiple task reasoning results, including entity relationship determination results, problem qualitative conclusions, and evidence chain descriptions.

[0124] S38. Verify the consistency of the reasoning results for each task according to the rules, and structure the reasoning results of the tasks that have passed the verification to generate inspection and supervision documents.

[0125] In this embodiment of the invention, the chain-like reasoning process is first used to verify the reasoning results of each task output by S37. The multi-task deduction process is decomposed into multiple interpretable sub-task steps, and the intermediate state of the reasoning process is defined as... ,in For the original input, For the final output, each step of reasoning can be viewed as a rule function. The mapping and reasoning process can be represented as:

[0126] In the formula, For the first The intermediate state of step-by-step reasoning For the first The reasoning rule function of the step, For the first The intermediate state of the step, To enhance the retrieval of patrol reasoning text; for each intermediate state A verification mechanism is introduced to check rule consistency, and a verification indicator variable is set. The verification indicator variable can be represented as:

[0127] In the formula, For the first Verification indicator variables for step-by-step reasoning, when This indicates that the result of this step complies with the company's compliance audit rules. A timeout indicates that the result violates the rules and needs to be regenerated or manually reviewed. For the reasoning results that pass verification, they are structured according to the company's internal inspection document preparation standards, integrating the reasoning results into a set of triplets containing rule explanations, evidence citations, and conclusion confidence levels. The structured inspection result can be represented as:

[0128] In the formula, This is a structured collection of inspection results. For the first The rules corresponding to the reasoning, Evidence supporting this conclusion includes documents, knowledge graph triples, etc. The confidence level of this conclusion is... The total number of reasoning conclusions is used to sort the structured results according to the hierarchical logic of rules, evidence, and confidence level, and encapsulate them into complete inspection and supervision documents to achieve interpretable, verifiable, and compliant output of the documents.

[0129] Text cleaning is a preprocessing operation that removes redundant content such as format marks and invalid characters from actual inspection materials; entity extraction is the processing operation that extracts business entities from actual inspection materials; actual inspection business domain is the corresponding special inspection business scenario matched based on the actual inspection materials; actual hierarchical prompt template is the target hierarchical prompt template retrieved by matching the actual inspection business domain; inspection reasoning text is the structured model input text formed after the actual inspection materials are filled into the actual hierarchical prompt template; semantic similarity is a numerical indicator that measures the degree of semantic association between texts; preset similarity threshold is a judgment value for filtering highly relevant retrieval vectors; retrieval-enhanced inspection reasoning text is the extended input text after splicing and fusing the original reasoning text with retrieval knowledge; multi-task inference is the process of the model performing multiple reasoning tasks such as relationship determination, problem characterization, evidence construction, and document generation; rule consistency verification is the operation of comparing and verifying the model reasoning results with business rules; structuring is the processing process of organizing the verified reasoning results into a standard document format according to the inspection specifications.

[0130] It is worth mentioning that this invention integrates vector index library retrieval enhancement with chain rule consistency verification into the generation of inspection documents, and performs step-by-step verification of the entire model reasoning process, ultimately outputting structured inspection results with rule basis, evidence source and confidence level; it suppresses model illusion from the root, and realizes that the inspection documents are verifiable, traceable and verifiable throughout the entire process, fully matching the compliance and accountability requirements of inspection work.

[0131] This invention centers on training a large-scale, lightweight inspection business model guided by structured prompts. Through a collaborative end-to-end solution combining hierarchical structured prompts, lightweight adapters, knowledge graphs, enhanced retrieval, and chained verifiable reasoning, it addresses the intelligent needs of enterprise internal compliance audits and internal control checks, achieving multi-dimensional technological gains and possessing the following advantages: 1. Hierarchical structured prompt templates ensure standardized documents and precise business focus. This invention designs a hierarchical, standardized, and structured prompt template. The hierarchical fields clearly define business semantics and fillable placeholder rules. On the one hand, it strictly limits the model to focus on the core business domain of enterprise compliance audit, avoids interference from irrelevant information, and improves the consistency and controllability of model input. On the other hand, it unifies the output format of inspection and supervision documents, ensuring that documents generated in different business scenarios fully comply with the enterprise's internal control specifications, significantly reducing the cost of manual format verification, and improving the standardization and efficiency of document preparation.

[0132] 2. The integration of knowledge graphs and vector retrieval improves reasoning accuracy and knowledge coverage.

[0133] This invention constructs a knowledge graph for inspection and supervision based on entity-relationship triples. It adopts a hybrid retrieval strategy with vector retrieval as the main method, and calculates semantic similarity weight and retrieval probability in a mixed manner. This not only accurately matches related business knowledge through semantic retrieval, effectively improving the accuracy and knowledge coverage of retrieval results, but also enhances the model input by integrating the retrieved knowledge with the original input, providing comprehensive and reliable external knowledge support for subsequent reasoning, and fundamentally avoiding the generation of unfounded and factual content by the model.

[0134] 3. Low-rank lightweight fine-tuning achieves both computing power savings and enhanced rule compliance.

[0135] This invention employs a low-rank incremental matrix LoRA / Adapter lightweight fine-tuning mechanism. Under the premise of freezing the original weights of the pre-trained large model, only a small number of adaptive parameters are trained, significantly reducing the number of trainable parameters and greatly reducing the computational resources consumed and the requirements for labeled data during model training. At the same time, rule consistency loss and decision consistency constraints are introduced into the fine-tuning objective to enhance the model's compliance with enterprise compliance and audit rules. While achieving model lightweighting, this invention ensures the model's adaptability and generalization ability to business scenarios, and is suitable for training scenarios with few samples.

[0136] 4. A chain-based verifiable inference pipeline enables end-to-end explainability and backtrackability.

[0137] This invention utilizes a chain-based verifiable reasoning pipeline to decompose the multi-task deduction process into multiple interpretable sub-tasks, generate auditable intermediate products, and set verification indicator variables. It performs rule consistency checks on the reasoning results at each step. If the check fails, it triggers regeneration or manual review. This not only achieves end-to-end interpretability of the reasoning process and supports manual review and problem backtracking, but also fundamentally avoids reasoning results from violating compliance rules, significantly improving the reliability and credibility of inspection conclusions.

[0138] 5. Structured and traceable outputs ensure the traceability and compliance verification of conclusions.

[0139] This invention encapsulates the final reasoning result into a structured set of triples, explicitly recording the rule ID, supporting evidence information, and conclusion confidence level corresponding to each reasoning conclusion. This ensures that the generated inspection and supervision documents not only contain the final conclusion but also retain the rule source, evidence traceability information, and confidence level score that underpin the conclusion. This meets the requirements of full verification and traceability for internal corporate inspections, facilitates manual review and compliance verification, and enables interpretable and verifiable output of inspection and supervision documents.

[0140] 6. Version management and closed-loop optimization enable continuous system iteration.

[0141] This invention supports rapid switching of templates / adapters, canary releases, and rapid rollback of issues for different business scenarios through version management of hierarchical structured prompt templates and task adapters, as well as a closed-loop mechanism for canary releases and manual feedback. At the same time, it forms a closed loop of feedback training by combining manual review and feedback, realizing continuous optimization of models, templates, and adapters, adapting to the dynamic update and iteration requirements of enterprise business rules, and ensuring the long-term availability and adaptability of the system.

[0142] 7. Lightweight edge deployment strategy reduces system resource consumption.

[0143] This invention adopts an edge deployment strategy that only loads the task adapter and the prompt parser, without the need to fully deploy the full parameters of the large model. This significantly reduces the hardware resource consumption and operating costs of the system deployment, enabling the system to run stably in the enterprise edge environment. At the same time, it ensures the performance of inspection inference and traceable output, adapts to the lightweight and low-cost deployment needs of enterprises, and improves the engineering feasibility of the system.

[0144] Please see Figure 3 , Figure 3 This is a structural block diagram of an inspection and patrol document generation device provided in Embodiment 3 of the present invention.

[0145] The present invention provides an inspection and patrol document generation device, comprising: The acquisition module 301 is used to acquire inspection and supervision materials and preprocess them, and to build an inspection and supervision knowledge graph and vector index library based on the preprocessing results. The parsing module 302 is used to parse the inspection and patrol knowledge graph and build a hierarchical structured prompt template library and task adapter set based on the parsing results; Training module 303 is used to train the pre-trained large model using a hierarchical structured prompt template library, task adapter set and inspection and patrol knowledge graph to obtain a lightweight inspection and patrol business large model. The deduction module 304 is used to obtain actual inspection materials and combine them with the vector index library and the lightweight inspection business model to generate inspection documents.

[0146] Since the above is a device corresponding to a method for generating inspection and supervision documents, and its implementation principle is the same as that of a method for generating inspection and supervision documents, for the sake of convenience and brevity, those skilled in the art can clearly understand that the specific working process of the device and module described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0147] Please see Figure 4 , Figure 4 This is a structural block diagram of an electronic device provided in Embodiment 4 of the present invention.

[0148] An electronic device according to an embodiment of the present invention includes: a memory 401 and a processor 402. The memory 401 stores a computer program. When the computer program is executed by the processor 402, the processor 402 performs the inspection and patrol document generation method as described in the above embodiment.

[0149] Memory 401 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Memory 401 has storage space 403 for program code 413 for performing any of the method steps described above. For example, storage space 403 for program code may include individual program codes 413 for implementing the various steps in the methods described above. This program code may be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, CDs, memory cards, or floppy disks. The program code may be compressed, for example, in a suitable form. When run by a computing processing device, this code causes the computing processing device to perform the various steps in the methods described above. This program code may be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, CDs, memory cards, or floppy disks. The program code may be compressed, for example, in a suitable form. When this code is run by a computing device, it causes the computing device to perform the various steps in the inspection and patrol document generation method described above.

[0150] Embodiment 5 of the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the inspection and patrol document generation method as described in the above embodiments.

[0151] Embodiment 6 of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, wherein when the program instructions are executed by a computer, the computer performs the inspection and patrol document generation method as described in the above embodiments.

[0152] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0153] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0154] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0155] Furthermore, the functional units 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 as a software functional unit.

[0156] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0157] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating a patrol inspection file, characterized by, include: Obtain and preprocess inspection and supervision materials, and construct an inspection and supervision knowledge graph and vector index library based on the preprocessing results; The inspection and patrol knowledge graph is analyzed, and a hierarchical structured prompt template library and task adapter set are constructed based on the analysis results; Using the hierarchical structured prompt template library, the task adapter set, and the inspection and patrol knowledge graph, the pre-trained large model is trained to obtain a lightweight inspection and patrol business large model; Obtain actual inspection materials and combine them with the vector index library and the lightweight inspection business model to generate inspection documents.

2. The method according to claim 1, wherein, The process of acquiring and preprocessing inspection and supervision materials, and constructing an inspection and supervision knowledge graph and vector index library based on the preprocessing results, includes: Obtain and segment the inspection and supervision materials to obtain a set of text fragments; Entities and relations are extracted from each text fragment in the text fragment set to obtain the entity set and relation set corresponding to each text fragment. The entity set and the relation set are combined, and the combination results are deduplicated, filtered and standardized to obtain the triplet knowledge unit corresponding to each text fragment; Based on the aforementioned triplet knowledge units, an inspection and patrol knowledge graph is constructed with entities as nodes and relationships as edges. The text fragment set and the triplet knowledge unit are vectorized and encoded to obtain the encoded semantic vector; The encoded semantic vectors are stored in a pre-set vector database to construct a vector index library.

3. The method according to claim 1, wherein, The process involves parsing the inspection and patrol knowledge graph and constructing a hierarchical structured prompt template library and task adapter set based on the parsing results, including: Analyze the aforementioned inspection and supervision knowledge graph and divide it into inspection and supervision business domain sets; A hierarchical structure is adopted using entity sets and relation sets to obtain the initial hierarchical prompt templates corresponding to each inspection business domain within the inspection business domain set; The initial hierarchical prompt templates are standardized to obtain the target hierarchical prompt templates corresponding to each of the inspection business domains; The hierarchical prompt templates for each target are categorized, integrated, and encapsulated to obtain a hierarchical structured prompt template library; Construct task adapters corresponding to each of the aforementioned inspection business domains to obtain a task adapter set.

4. The method according to claim 3, wherein, The hierarchical structuring using entity sets and relation sets yields initial hierarchical prompt templates for each inspection business domain within the inspection business domain set, including: Analyze the entity set and relation set to extract the core field set of each of the aforementioned inspection business domains; The core fields are mapped hierarchically into background information fields, task fields, and evidence format fields; Configure semantic tags for each layer of fields and reserve fillable placeholders to obtain background information field template fragments, task field template fragments and evidence format field template fragments; By piecing together the template fragments from each layer, an initial layered prompt template for each of the aforementioned inspection business domains is generated.

5. The method according to claim 1, wherein, The process of training a pre-trained large model using the hierarchical structured prompt template library, the task adapter set, and the inspection and patrol knowledge graph yields a lightweight inspection and patrol business large model, including: Based on the pre-trained large model, each task adapter in the task adapter set is loaded to obtain the lightweight model to be trained. Triple knowledge units are extracted from the inspection and patrol knowledge graph as inspection annotation samples, and placeholders are filled according to the hierarchical field structure of the hierarchical structured prompt template library to generate a training dataset. The training dataset is used as input to the lightweight model to be trained for supervised fine-tuning to obtain a lightweight inspection business model.

6. The method according to any one of claims 1-5, wherein, The process of obtaining actual inspection materials and combining them with the vector index library and the lightweight inspection business model to generate inspection documents includes: Obtain actual inspection materials and perform text preprocessing, including text cleaning and entity extraction. Based on the pre-processed actual inspection materials, the corresponding inspection business domain within the inspection business domain set is matched as the actual inspection business domain. Based on the hierarchical structured prompt template library, the target hierarchical prompt template corresponding to the actual inspection business domain is used as the actual hierarchical prompt template; The preprocessed actual inspection materials are used to fill the actual layered prompt template to obtain the inspection reasoning text; The vector index library is retrieved using the patrol reasoning text, and multiple encoded semantic vectors with semantic similarity not lower than a preset similarity threshold are matched as actual encoded semantic vectors; The actual encoded semantic vector is concatenated with the patrol reasoning text to obtain the retrieval-enhanced patrol reasoning text. The retrieval-enhanced inspection reasoning text is input into the lightweight inspection business model to perform multi-task deduction and obtain multiple task reasoning results. The reasoning results of each task are verified for consistency according to rules, and the verified reasoning results are structured to generate inspection and supervision documents.

7. An inspection file generation device characterized by comprising: include: The acquisition module is used to acquire and preprocess inspection and supervision materials, and to build an inspection and supervision knowledge graph and vector index library based on the preprocessing results. The parsing module is used to parse the inspection and patrol knowledge graph and construct a hierarchical structured prompt template library and task adapter set based on the parsing results; The training module is used to train the pre-trained large model using the hierarchical structured prompt template library, the task adapter set, and the patrol and inspection knowledge graph to obtain a lightweight patrol and inspection business large model. The deduction module is used to obtain actual inspection materials and combine them with the vector index library and the lightweight inspection business model to generate inspection documents.

8. An electronic device, characterized in that, The system includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the inspection and patrol document generation method as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the inspection and patrol document generation method as described in any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, wherein when the program instructions are executed by a computer, the computer performs the inspection and patrol document generation method as described in any one of claims 1-6.