Design document compliance detection method, apparatus, device, medium, and product
By combining large language models with structured compliance rules, and selecting specific detection methods based on different clause types in the design document, the issues of accuracy and comprehensiveness in design document compliance detection are resolved, achieving more efficient compliance detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2026-02-12
- Publication Date
- 2026-06-02
AI Technical Summary
Existing design document compliance testing methods cannot guarantee the accuracy and comprehensiveness of compliance testing results, resulting in a high rate of false positives and false negatives.
By combining large language models and structured compliance rules, specific detection methods are selected based on the type of clauses in the design document, including detection methods for numerical, categorical, logical relational, composite, and fuzzy expression clauses.
It improved the accuracy and comprehensiveness of design document compliance testing, and reduced the false positive and false negative rates.
Smart Images

Figure CN122133644A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology and can be applied to the financial technology field, particularly to a method, apparatus, device, medium, and product for compliance testing of design documents. Background Technology
[0002] In technology-intensive fields such as engineering design and software development, project design documents must comply with multiple requirements, including industry standards, technical specifications, and safety regulations. To ensure the project functions properly after launch, compliance checks on the design documents are necessary before deployment.
[0003] Currently, compliance checks on design documents typically rely on detection tools to scan for specific words or patterns in the documents. However, this method cannot guarantee the accuracy and comprehensiveness of the compliance check results, resulting in a high rate of false positives and false negatives. Summary of the Invention
[0004] This invention provides a method, apparatus, device, medium, and product for compliance testing of design documents, in order to solve the problem that existing compliance testing methods for design documents cannot guarantee the accuracy and comprehensiveness of compliance testing results, and have a high false detection rate and false negative rate.
[0005] According to one aspect of the present invention, a compliance detection method for design documents is provided, the method comprising: Obtain the target design document to be inspected, and determine at least one clause item to be inspected contained in the target design document and the target clause item type corresponding to the clause item to be inspected; When the target clause type is a first clause type, a target compliance rule is determined based on the target clause type, and compliance testing is performed on the clause to be tested based on the target compliance rule; wherein, the first clause type is a numerical clause or a categorized clause. When the target clause type is the second clause type, the target large language model is used to perform compliance detection on the clause to be detected; wherein, the second clause type is a logical relation clause, a compound clause, or a fuzzy expression clause.
[0006] According to another aspect of the present invention, a compliance testing device for design documents is provided, the device comprising: The design document acquisition module is used to acquire the target design document to be inspected, and to determine at least one clause item to be inspected contained in the target design document and the target clause item type corresponding to the clause item to be inspected. The first compliance detection module is used to determine the target compliance rule according to the target clause type when the target clause type is a first clause type, and to perform compliance detection on the clause to be detected according to the target compliance rule; wherein, the first clause type is a numerical clause or a categorized clause. The second compliance detection module is used to perform compliance detection on the clause to be detected using a target large language model when the target clause type is the second clause type; wherein the second clause type is a logical relation clause, a composite clause, or a fuzzy expression clause.
[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the compliance detection method for design documents according to any one of the present invention.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the compliance detection method for design documents according to any one of the present invention.
[0009] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the compliance detection method for design documents according to any one of the present invention.
[0010] This invention obtains the target design document to be tested and determines at least one clause item to be tested contained in the target design document and the target clause item type corresponding to the clause item. When the target clause item type is a first clause item type, target compliance rules are determined based on the target clause item type, and compliance testing is performed on the clause item to be tested according to the target compliance rules. The first clause item type is a numerical clause item or a categorical clause item. When the target clause item type is a second clause item type, a target large language model is used to perform compliance testing on the clause item to be tested. The second clause item type is a logical relational clause item, a composite clause item, or a fuzzy expression clause item. The beneficial effects are: By combining the deep semantic understanding capabilities of large language models with the precision of structured compliance rules, this approach achieves the effect of selecting specific detection methods for compliance testing based on different clause types. This avoids the rigidity of simple structured compliance rule testing while improving the accuracy of pure language model testing, thereby comprehensively enhancing the accuracy and comprehensiveness of design document compliance testing and reducing the false positive and false negative rates.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0013] Figure 1 A flowchart illustrating a compliance detection method for design documents provided in Embodiment 1 of the present invention; Figure 2 A flowchart of a compliance detection method for design documents provided in Embodiment 2 of the present invention; Figure 3 A flowchart illustrating a compliance detection method for design documents provided in Embodiment 3 of the present invention; Figure 4 This is a schematic diagram of a design document compliance testing device provided in Embodiment 4 of the present invention; Figure 5 This is a schematic diagram of the structure of an electronic device that implements the compliance testing method for design documents according to embodiments of the present invention. Detailed Implementation
[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0015] It should be noted that the terms "candidate," "applicable," "target," "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0016] Example 1 Figure 1 This is a flowchart illustrating a compliance detection method for design documents according to Embodiment 1 of the present invention. This embodiment is applicable to situations where compliance rules and large language models are combined to perform compliance detection on design documents. This method can be executed by a compliance detection device for design documents, which can be implemented in hardware and / or software. Figure 1 As shown, the method includes: S101. Obtain the target design document to be tested, and determine at least one clause item to be tested contained in the target design document and the target clause item type corresponding to the clause item to be tested.
[0017] The target design document to be tested refers to the structured design document that needs to undergo compliance review. A design document is a normative document describing the core architecture and implementation logic of a technical system, product, or solution. As a legally mandated technical blueprint for R&D, acceptance, and compliance review, it carries a complete mapping chain from business requirements to technology implementation. The clauses to be tested refer to the specific clauses, items, or normative requirements in the target design document that need to be subject to compliance review. These are the smallest independent units in the target design document with legal force, technical constraints, or business rules, and their compliance must be determined through compliance testing to determine whether they meet preset standards. The target clause type refers to the type or category by which the clauses to be tested are classified in the compliance testing process. It defines the essential attributes of the clauses to be tested and is used to guide the selection and application of subsequent compliance testing methods.
[0018] In one implementation, the target design document is obtained through a system interface, and its plain text content is extracted using a document parsing tool and subjected to basic cleaning. Further, natural language processing technology is employed, combined with a predefined keyword library for clause items, to locate all statements in the document that could potentially constitute clause items, thereby identifying at least one clause item to be checked within the target design document. For the identified clause items to be checked, reviewers are allowed to supplement or correct them through a visual interface to ensure that no clause items are omitted.
[0019] Furthermore, the constructed classification rule engine is used to classify each clause item to be detected, and to determine the target clause item type corresponding to each clause item. For example, if a clause item contains numerical comparison operators or enumeration words, it is marked as the first clause item type; if a clause item contains conditional logic words, compound conjunctions, or fuzzy descriptions, it is marked as the second clause item type.
[0020] Furthermore, a list of clauses to be tested is generated, with each item including the original text, its location in the document, and the target clause type label, which serves as the input for subsequent compliance testing.
[0021] In another implementation, information is exchanged with the user through an intelligent dialogue interface to obtain project type description information, and the target project type is determined based on the project type description information. Furthermore, a target design document template is determined based on the target project type. Information is exchanged with the user through the intelligent dialogue interface to respond to the user's editing operations on the clauses of the target design document template, generating the target design document. Further, based on the preset template position identifiers of the clauses in the target design document template, each clause to be tested is obtained, and based on the preset clause type tags of the clauses in the target design document template, the target clause type corresponding to each clause to be tested is determined.
[0022] S102. When the target clause type is the first clause type, determine the target compliance rules according to the target clause type, and conduct compliance testing on the clause to be tested according to the target compliance rules.
[0023] Among them, target compliance rules refer to the structured testing standards pre-defined for the first clause item type, which usually exist in the form of numerical ranges or enumeration sets. Target compliance rules can be a quantifiable rule library generated based on industry regulations, enterprise standards, or contract templates.
[0024] The first type of clause is either a numerical clause or a categorical clause. A numerical clause refers to a clause whose content contains quantifiable numerical values (such as amount, time, percentage, etc.) and must satisfy specific mathematical relationships (such as range, comparison, and calculation, etc.) to be monitored. For example, "Service timeout should be set within 1 second" is a numerical clause. A categorical clause refers to a clause whose content requires options to belong to a predefined set of discrete categories (such as standard names, status labels, and enumerated values, etc.) and must match a specified category to be compliant. For example, "Service status processing should be within the range of success, failure, and unknown" is a categorical clause.
[0025] In one implementation, a compliance rule base is pre-established, where numerical rules are stored as threshold ranges and categorical rules are stored as enumeration sets. The compliance rule base is dynamically updated based on industry standards to ensure that the rules cover common scenarios.
[0026] Furthermore, when a clause is categorized as numerical or categorical, the system automatically parses its keywords and queries the rule base to match the corresponding target compliance rule. Then, it applies the matched target compliance rule for a binary judgment: numerical clauses are verified by calculation to see if they meet the numerical range, while categorical clauses are verified by set comparison to see if they are included in the permitted category. The detection result is output as "compliant" or "non-compliant," along with deviation details.
[0027] S103. When the target clause type is the second clause type, the target large language model is used to perform compliance testing on the clause to be tested.
[0028] Among them, the target large language model refers to a pre-trained artificial intelligence model specifically designed to handle semantically complex clauses. It analyzes the compliance risks implied in the clauses through its understanding and reasoning abilities of natural language. The second type of clause is either a logical relational clause, a compound clause, or a vaguely expressed clause.
[0029] Logical relationship clauses are those that contain conditional judgments, causal chains, or relationships between rights and obligations, and their logical integrity must be analyzed to ensure compliance. For example, "If Party A fails to make payment on time, Party B has the right to terminate the contract" is a logical relationship clause.
[0030] Composite clauses are clauses composed of multiple sub-clauses or elements, such as parallel, alternative, or nested relationships, and require disassembly and verification of the compliance consistency of each part. For example, "proof of identity and proof of residence are required" is a composite clause.
[0031] Vaguely worded clauses are those containing subjective, unquantifiable, or open-ended descriptions, such as "reasonable," "timely," or "significant impact," requiring the scope of their reasonableness to be inferred from the context. For example, "Party A shall rectify the problem as soon as possible" is a vaguely worded clause.
[0032] In one implementation, the clause to be tested, along with its original context (such as the chapter and related clauses) and compliance rule base (such as relevant laws, regulations, and industry standards), is packaged into a structured input and fed into the target large language model. The target large language model then performs compliance checks on the clause to be tested based on the original context and the compliance rule base. For complex reasoning, a thought chain technique is used to guide the target large language model to analyze step by step and provide the basis for judgment.
[0033] In another implementation, if the target clause type of the clause to be tested is a logical relationship clause, a directed acyclic graph (DAG) is constructed based on the clause to be tested, generating the corresponding DAG for the clause to be tested. Further, the relationships between nodes and edges are verified based on the DAG, and the compliance test result for the clause to be tested is determined based on the verification results. For example, if the DAG is missing edge relationships, or if there are anomalies in the edge relationships between different nodes, then the clause to be tested is determined to be non-compliant.
[0034] This invention embodiment obtains the target design document to be tested and determines at least one clause item to be tested contained in the target design document and the target clause item type corresponding to the clause item to be tested; when the target clause item type is a first clause item type, target compliance rules are determined according to the target clause item type, and compliance testing is performed on the clause item to be tested according to the target compliance rules; wherein, the first clause item type is a numerical clause item or a categorical clause item; when the target clause item type is a second clause item type, a target large language model is used to perform compliance testing on the clause item to be tested; wherein, the second clause item type is a logical relation clause item, a composite clause item, or a fuzzy expression clause item. The beneficial effects are: By combining the deep semantic understanding capabilities of large language models with the precision of structured compliance rules, this approach achieves the effect of selecting specific detection methods for compliance testing based on different clause types. This avoids the rigidity of simple structured compliance rule testing while improving the accuracy of pure language model testing, thereby comprehensively enhancing the accuracy and comprehensiveness of design document compliance testing and reducing the false positive and false negative rates.
[0035] Example 2 Figure 2 This is a flowchart of a compliance detection method for design documents provided in Embodiment 2 of the present invention. This embodiment further optimizes and expands upon the above embodiments and can be combined with the various optional implementation methods described above. For example... Figure 2 As shown, the method includes: S201. Determine the target project type based on the project type description information sent by the user, and determine the target design document template from the candidate design document templates based on the target project type; generate the target design document in response to the user's clause item editing operation on the clause item editing field.
[0036] The project type description information consists of unstructured text or structured form data submitted by the user, describing the project's core attributes. The target project type is a project category label automatically categorized based on the project type description information, determining the framework and specifications of the target design document. For example, the target project type could be "online accounting transactions" or "batch reconciliation processing," etc.
[0037] The candidate design document template is a pre-stored collection of all available templates, indexed by project type. The target design document template is a specific template selected based on the target project type. Each target design document template contains at least one clause editing field, which is an interactive area within the target design document template that the user needs to fill in or modify. Each field corresponds to one clause item. For example, a numeric editing field only allows editing numeric clause items; a categorized editing field only allows editing categorized clause items, and so on.
[0038] The term editing operation refers to the specific action performed by the user in the term editing field, which triggers the dynamic generation of the document term content. The types of term editing operations include, but are not limited to, fill operations, selection operations, or nested editing operations.
[0039] In one implementation, information is exchanged with the user through an intelligent dialogue interface to obtain project type description information, and the project type description information is parsed to determine the target project type. Further, the target project type is matched with the project types adapted to each candidate design document template, and the target design document template is determined from the candidate design document templates based on the matching results. Further, information is exchanged with the user through the intelligent dialogue interface, and in response to the user's editing operations on the clause items in the editing fields of the target design document template, the target design document is generated.
[0040] By determining the target project type based on the project type description information sent by the user, and then selecting the target design document template from the candidate design document templates based on the target project type; and by generating the target design document in response to the user's editing operation on the clause item editing field, the beneficial effects are: Firstly, based on the project type description information, the target project type is automatically identified, and the target design document template is quickly matched from the candidate design document templates, reducing manual retrieval time and avoiding the risk of template misuse.
[0041] Secondly, by using the target design document template to generate the target design document, users only need to edit the clause items in the clause editing field, without having to write the complete design document. This improves the efficiency of design document generation and reduces the human resource cost required for design document generation.
[0042] S202. Obtain the template location identifier corresponding to the clause editing field in the target design document template, and extract information from the target design document according to the template location identifier to obtain the clause to be detected; obtain the clause type label corresponding to the clause editing field, and determine the target clause type according to the clause type label.
[0043] The template location identifier is a structured path marker assigned to each clause editing field in the target design document template. It is used to accurately locate the physical location and logical hierarchy of the clause to be tested in the generated target design document.
[0044] Extracting information from the target design document based on the template location identifier refers to the process of automatically extracting and structuring the content of the clauses to be tested from the generated target design document based on the template location identifier.
[0045] The clause type label corresponding to the clause editing field refers to the pre-set classification mark in the clause editing field, which declares the essential type of the clause and directly determines the subsequent compliance detection strategy.
[0046] In one implementation, the template location identifier corresponding to the clause editing field in the target design document template is obtained. Based on the template location identifier, the document parsing engine locates the precise text paragraph in the target design document, extracts the original text of the clause within that paragraph, and encapsulates it as the clause to be detected. Further, the clause type tag in the clause to be detected is read and directly mapped to the target clause type. For example, if the clause type tag is numeric, the target clause type is determined to be a numeric clause; or, for example, if the clause type tag is fuzzy expression, the target clause type is determined to be a fuzzy expression clause.
[0047] By obtaining the template location identifier corresponding to the clause editing field in the target design document template, and extracting information from the target design document based on the template location identifier, the clause to be detected is obtained; by obtaining the clause type label corresponding to the clause editing field, and determining the target clause type based on the clause type label, the beneficial effects are: Firstly, the coordinate mapping based on template location identifiers ensures that the physical location and logical relationship of clause items are traceable during document iteration, eliminating missed / false detections caused by clause renaming or position shifts in traditional keyword retrieval, and improving the accuracy of extracting clause items to be detected.
[0048] Secondly, by using pre-bound clause type tags to directly determine the target clause type, the efficiency of determining the target clause type is improved, further accelerating the detection speed of the entire compliance testing process.
[0049] S203. When the target clause type is the first clause type, determine the applicable clause type corresponding to each candidate compliance rule, and determine the first screening compliance rule from each candidate compliance rule based on the matching result between the applicable clause type and the target clause type.
[0050] Among them, candidate compliance rules are a pre-stored set of all potential compliance standards, stored in the form of structured rules. Applicable clause type refers to the category of clause types that the candidate compliance rule can detect; it is a compatibility label between the rule and the clause. The first-stage screening compliance rules are a subset of rules initially selected from the candidate compliance rules based on the matching results between the target clause type and the applicable clause type.
[0051] For example, assuming the target clause type is "numerical clause" and the applicable clause type corresponding to candidate compliance rule 1 is "numerical clause", then candidate compliance rule 1 is determined as the first screening compliance rule.
[0052] S204. Determine the target keywords based on the clauses to be tested, perform keyword matching on the first screening compliance rules based on the target keywords, and determine the second screening compliance rules from the first screening compliance rules based on the keyword matching results.
[0053] Here, target keywords refer to the core semantic terms extracted from the clauses to be tested, used for precise rule matching. Keyword matching of the first screening compliance rules based on target keywords involves comparing the similarity between the target keywords and the textual descriptions of the first screening compliance rules, selecting rules with strong semantic relevance. The second screening compliance rules refer to the rule range further narrowed down from the first screening compliance rules through keyword matching, ensuring the semantic relevance of the rules to the clauses.
[0054] For example, assuming the clause to be tested is "data encryption adopts agreed encryption algorithm", the target keywords are determined to be "encryption" and "agreed encryption algorithm". Then, by performing keyword matching on the first screening compliance rule, only the first screening compliance rule containing "encryption" and "agreed encryption algorithm" is used as the second screening compliance rule.
[0055] S205. Use the target large language model to determine the fit score between the clause to be tested and the second screening compliance rule, and determine the target compliance rule from the second screening compliance rule based on the fit score.
[0056] The fit score is a numerical value generated by the target large language model, quantifying the compliance fit between the clause to be tested and each second-screen compliance rule. Based on the fit score, the second-screen compliance rule with the highest score is finally determined as the target compliance rule.
[0057] In one implementation, the clause to be tested and the second-screen compliance rules are input into the target large language model. Predefined prompts guide the target large language model to perform a suitability assessment between the clause to be tested and each of the second-screen compliance rules, determining a suitability score between the clause to be tested and the second-screen compliance rules. Further, the second-screen compliance rule with the highest suitability score with the clause to be tested is selected as the target compliance rule.
[0058] By determining the applicable clause types corresponding to each candidate compliance rule, and based on the matching results between the applicable clause types and the target clause types, a first-selection compliance rule is determined from the candidate compliance rules; target keywords are determined based on the clauses to be tested, and keyword matching is performed on the first-selection compliance rules based on the target keywords, and a second-selection compliance rule is determined from the first-selection compliance rules based on the keyword matching results; a target large language model is used to determine the fit score between the clauses to be tested and the second-selection compliance rules, and the target compliance rule is determined from the second-selection compliance rules based on the fit score. The beneficial effects are: Firstly, the initial screening is conducted based on the matching results between the applicable clause type and the target clause type, eliminating irrelevant rules, thereby narrowing the detection scope and reducing invalid computational load.
[0059] Secondly, by extracting target keywords from the clauses to be detected, keyword matching is performed on the first screening compliance rules to further eliminate weakly related rules and generate highly relevant second screening compliance rules, thus avoiding semantic bias in traditional full-text retrieval.
[0060] Thirdly, the target large language model is used to perform multi-dimensional semantic analysis on the second screening compliance rules to generate an adaptability score. Based on this, the target compliance rule with the highest score is selected as the detection benchmark, which solves the implicit contradictions between rules and clauses in complex scenarios and reduces the false detection rate.
[0061] S206. If the target clause type is a numerical clause, execute S207; if the target clause type is a categorized clause, execute S208.
[0062] S207. Obtain the values to be tested contained in the clause items to be tested, and perform compliance testing on the clause items to be tested based on the values to be tested and the range of compliance values defined by the target compliance rules.
[0063] The value to be tested refers to the specific quantitative value that needs to be verified extracted from the numerical clause. The compliant numerical range refers to the legal numerical boundary defined for a specific clause in the target compliance rule, stored in the form of a mathematical interval, equation, or inequality.
[0064] For example, suppose the value to be tested for the clause item is "120 seconds", and the compliance value range defined by the target compliance rule is "server response standard [0,60] seconds". Since the value to be tested "120 seconds" does not fall within the compliance value range "[0,60] seconds", the compliance test result for the clause item to be tested is determined to be non-compliant.
[0065] S208. Obtain the types to be tested contained in the clause items to be tested, and perform compliance testing on the clause items to be tested based on the types to be tested and the list of compliance types defined by the target compliance rules.
[0066] The type to be detected refers to the specific category label extracted from the subcategories and requiring verification; it is a discrete value within a predefined set of options. The compliance type list refers to the set of legal categories defined for a specific subcategorie in the target compliance rule, stored as an enumerated list, serving as the baseline for the permissible scope of detection.
[0067] For example, suppose the type to be detected for the clause item is "HTTP / 2" and the list of compliance types is "{HTTPS, SFTP, AS2}". Since the type to be detected "HTTP / 2" does not belong to the list of compliance types, the compliance detection result of the clause item to be detected is determined to be non-compliant.
[0068] When the target clause type is a numerical clause, the system obtains the numerical values to be tested contained in the clause to be tested, and performs compliance testing on the clause to be tested based on the numerical values and the compliance value range defined by the target compliance rules. When the target clause type is a categorized clause, the system obtains the types to be tested contained in the clause to be tested, and performs compliance testing on the clause to be tested based on the types to be tested and the compliance type list defined by the target compliance rules. The advantages are: Firstly, for numerical clauses, the system extracts the value to be detected and compares it mathematically with the range of compliant values to directly output quantitative results, thus completely eliminating subjective misjudgments and ensuring the accuracy of identifying numerical violations.
[0069] Secondly, for categorized clauses, illegal options are quickly intercepted by matching the type to be detected with the list of compliant types, eliminating categorization compliance loopholes and ensuring the accuracy of categorization violation identification.
[0070] Thirdly, when standards are updated or added, only the range of compliance values or the list of compliance types in the rule base need to be adjusted, without modifying the core system code, allowing for quick adaptation to compliance requirements in different fields.
[0071] Example 3 Figure 3 This is a flowchart of a compliance detection method for design documents provided in Embodiment 3 of the present invention. This embodiment further optimizes and expands upon the above embodiments and can be combined with the various optional implementation methods described above. For example... Figure 3 As shown, the method includes: S301. Obtain the target design document to be tested, and determine at least one clause item to be tested contained in the target design document and the target clause item type corresponding to the clause item to be tested.
[0072] S302. When the target clause type is the second clause type, determine the target compliance detection prompt from the candidate compliance detection prompts according to the target clause type, and input the target compliance detection prompt and the clause to be detected into the target large language model.
[0073] Among them, the candidate compliance detection prompts are a pre-stored set of standardized instruction templates used to guide the target large language model to perform compliance analysis on specific types of clauses. Each type of candidate compliance detection prompt corresponds to a clause type, such as logical relation prompts, compound prompts, and fuzzy expression prompts.
[0074] The target compliance check prompt is the final compliance check prompt selected from the candidate compliance check prompts based on the target clause type.
[0075] In one implementation, when the target clause type is a second clause type, candidate compliance detection prompts associated with the target clause type are determined as target compliance detection prompts based on the target clause type and the association between the clause type and candidate compliance detection prompts. Further, the target compliance detection prompts and the clause to be detected are jointly input into the target large language model.
[0076] S303. Perform compliance checks on the clauses to be checked based on the target compliance detection prompts using the target large language model.
[0077] In one implementation, the target large language model performs compliance checks on the clauses to be checked based on the target compliance detection prompts, and outputs compliance detection results, including three types of detection results: compliant, non-compliant, and ambiguous.
[0078] By determining the target compliance detection prompts from candidate compliance detection prompts based on the target clause type, and inputting the target compliance detection prompts and the clauses to be detected into the target large language model; and by using the target large language model to perform compliance detection on the clauses to be detected based on the target compliance detection prompts, the beneficial effects are: Firstly, by determining the target compliance detection prompts from the candidate compliance detection prompts based on the type of the target clause, the target large language model can be effectively guided to focus on specific compliance dimensions, thereby reducing false detections and false negatives and improving the reliability and relevance of the detection results.
[0079] Secondly, automated processes reduce the need for manual filtering of prompts and manual review, shorten processing time and reduce operating costs, and are especially suitable for large-scale batch processing of terms.
[0080] Optionally, the method also includes: A. Determine the test results for compliance testing of the clauses to be tested.
[0081] B. If the test result is non-compliant, the target compliance rule used by the clause to be tested is taken as the reference compliance rule, and the target large language model is used to modify the clause to be tested according to the target design document and the reference compliance rule to obtain the modified clause.
[0082] In this context, "non-compliance detection" refers to the outcome during compliance testing where the clause being tested is deemed to be inconsistent with established rules or standards. Specifically, it indicates that a violation is found in the clause being tested after review based on the target compliance rules. "Reference compliance rules" refers to the set of compliance rules used as a benchmark or basis for correction in the event of non-compliance detection. These rules are typically derived from the target compliance rules used in the testing process itself. Conceptually, it represents a set of authoritative standards that guide the target broad language model during the correction phase on how to adjust the clause being tested to ensure compliance.
[0083] A revised clause item refers to a revised version generated by modifying non-compliant clause items to be detected using the target large language model based on the target design document and reference compliance rules. Conceptually, it represents an optimized clause item designed to eliminate detected non-compliance issues, thereby achieving compliance objectives. In the process, the revised clause item is a direct output of automated correction, its role being to provide feasible solutions and reduce the cost of manual intervention.
[0084] C. Based on the test results, referencing compliance rules and amended clauses, generate a compliance inspection report for the clauses to be tested.
[0085] Among them, the compliance inspection report refers to a formal summary document generated based on the test results, reference to compliance rules and amended clauses, which is used to systematically record the entire process and conclusions of compliance testing.
[0086] By determining the compliance test results for the clause to be tested; in cases where the test results indicate non-compliance, the target compliance rules used in the test of the clause to be tested are used as reference compliance rules, and the clause to be tested is modified using the target large language model based on the target design document and the reference compliance rules to obtain the modified clause; based on the test results, the reference compliance rules, and the modified clause, a compliance inspection report for the clause to be tested is generated. The beneficial effects are: Firstly, when non-compliance is detected, the system automatically locks the reference compliance rule to ensure that the root cause of the problem can be traced.
[0087] Secondly, based on the reference compliance rules and target design documents, the target large language model is driven to generate revised clauses, thereby blocking risk vulnerabilities at the source.
[0088] Thirdly, the test results and reference compliance rules are presented in a clear and easy-to-understand manner, which greatly reduces the threshold for use and the learning cost, making it easier for R&D personnel to accept and adopt automated compliance testing tools.
[0089] Example 4 Figure 4 This is a schematic diagram of a compliance detection device for design documents provided in Embodiment 4 of the present invention. It is applicable to situations where compliance rules and large language models are combined to perform compliance detection on design documents, such as... Figure 4 As shown, the device includes: Design document acquisition module 41 is used to acquire the target design document to be detected, and determine at least one clause item to be detected contained in the target design document and the target clause item type corresponding to the clause item to be detected; The first compliance detection module 42 is used to determine the target compliance rule according to the target clause type when the target clause type is a first clause type, and to perform compliance detection on the clause to be detected according to the target compliance rule; wherein, the first clause type is a numerical clause or a categorized clause. The second compliance detection module 43 is used to perform compliance detection on the clause to be detected using a target large language model when the target clause type is the second clause type; wherein the second clause type is a logical relation clause, a composite clause, or a fuzzy expression clause.
[0090] Optionally, the design document acquisition module 41 is specifically used for: The target project type is determined based on the project type description information sent by the user, and the target design document template is determined from the candidate design document templates based on the target project type; wherein, the target design document template contains at least one clause item editing field; In response to the user's editing operation on the clause item in the clause item editing field, the target design document is generated.
[0091] Optionally, the design document acquisition module 41 is specifically used for: Obtain the template position identifier corresponding to the editing field of the clause item in the target design document template, and extract information from the target design document based on the template position identifier to obtain the clause item to be detected; Obtain the clause item type tag corresponding to the clause item editing field, and determine the target clause item type based on the clause item type tag.
[0092] Optionally, the first compliance detection module 42 is specifically used for: Determine the applicable clause type corresponding to each candidate compliance rule, and determine the first screening compliance rule from each candidate compliance rule based on the matching result between the applicable clause type and the target clause type; The target keywords are determined based on the terms to be detected, and the first screening compliance rule is matched with the target keywords. The second screening compliance rule is determined from the first screening compliance rule based on the keyword matching results. The target large language model is used to determine the fit score between the clause to be detected and the second screening compliance rule, and the target compliance rule is determined from the second screening compliance rule based on the fit score.
[0093] Optionally, the first compliance detection module 42 is further used for: When the target clause type is the numerical clause, obtain the value to be detected contained in the clause to be detected, and perform compliance detection on the clause to be detected according to the value to be detected and the compliance value range defined by the target compliance rule; When the target clause type is the sub-category clause, obtain the types to be detected contained in the clause to be detected, and perform compliance detection on the clause to be detected according to the types to be detected and the list of compliance types defined by the target compliance rule.
[0094] Optionally, the second compliance testing module 43 is specifically used for: Based on the type of the target clause, a target compliance detection prompt is determined from the candidate compliance detection prompts, and the target compliance detection prompt and the clause to be detected are input into the target large language model; The target large language model performs compliance checks on the clauses to be checked based on the target compliance detection prompts.
[0095] Optionally, the device further includes a compliance inspection report generation module, specifically used for: Determine the results of the compliance testing performed on the aforementioned clause / item to be tested; If the detection result is non-compliant, the target compliance rule used by the detection of the clause item to be detected is taken as the reference compliance rule, and the target big language model is used to modify the clause item to be detected according to the target design document and the reference compliance rule to obtain the modified clause item; Based on the test results, the reference compliance rules, and the amended clauses, a compliance check report is generated for the clauses to be tested.
[0096] The compliance testing device for design documents provided in this embodiment of the invention can execute the compliance testing method for design documents provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0097] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0098] Example 5 Figure 5 A schematic diagram of an electronic device 50 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0099] like Figure 5As shown, the electronic device 50 includes at least one processor 51 and a memory, such as a read-only memory (ROM) 52 and a random access memory (RAM) 53, communicatively connected to the at least one processor 51. The memory stores computer programs executable by the at least one processor. The processor 51 can perform various appropriate actions and processes based on the computer program stored in the ROM 52 or loaded from storage unit 58 into the RAM 53. The RAM 53 can also store various programs and data required for the operation of the electronic device 50. The processor 51, ROM 52, and RAM 53 are interconnected via a bus 54. An input / output (I / O) interface 55 is also connected to the bus 54.
[0100] Multiple components in electronic device 50 are connected to I / O interface 55, including: input unit 56, such as keyboard, mouse, etc.; output unit 57, such as various types of monitors, speakers, etc.; storage unit 58, such as disk, optical disk, etc.; and communication unit 59, such as network card, modem, wireless transceiver, etc. Communication unit 59 allows electronic device 50 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0101] Processor 51 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 51 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 51 performs the various methods and processes described above, such as compliance testing methods for design documents.
[0102] In some embodiments, the design document compliance detection method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 58. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 50 via ROM 52 and / or communication unit 59. When the computer program is loaded into RAM 53 and executed by processor 51, one or more steps of the design document compliance detection method described above may be performed. Alternatively, in other embodiments, processor 51 may be configured to perform the design document compliance detection method by any other suitable means (e.g., by means of firmware).
[0103] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0104] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0105] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0106] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0107] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0108] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product within the cloud computing service system to address the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.
[0109] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0110] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A compliance detection method for design documents, characterized in that, The method includes: Obtain the target design document to be inspected, and determine at least one clause item to be inspected contained in the target design document and the target clause item type corresponding to the clause item to be inspected; When the target clause type is a first clause type, a target compliance rule is determined based on the target clause type, and compliance testing is performed on the clause to be tested based on the target compliance rule; wherein, the first clause type is a numerical clause or a categorized clause. When the target clause type is the second clause type, the target large language model is used to perform compliance detection on the clause to be detected; wherein, the second clause type is a logical relation clause, a compound clause, or a fuzzy expression clause.
2. The method according to claim 1, characterized in that, The acquisition of the target design document to be detected includes: The target project type is determined based on the project type description information sent by the user, and the target design document template is determined from the candidate design document templates based on the target project type; wherein, the target design document template contains at least one clause item editing field; In response to the user's editing operation on the clause item in the clause item editing field, the target design document is generated.
3. The method according to claim 2, characterized in that, The step of determining at least one clause item to be detected contained in the target design document includes: Obtain the template position identifier corresponding to the editing field of the clause item in the target design document template, and extract information from the target design document based on the template position identifier to obtain the clause item to be detected; Determining the target clause type corresponding to the clause to be detected includes: Obtain the clause item type tag corresponding to the clause item editing field, and determine the target clause item type based on the clause item type tag.
4. The method according to claim 1, characterized in that, The determination of the target compliance rule based on the target clause type includes: Determine the applicable clause type corresponding to each candidate compliance rule, and determine the first screening compliance rule from each candidate compliance rule based on the matching result between the applicable clause type and the target clause type; The target keywords are determined based on the terms to be detected, and the first screening compliance rule is matched with the target keywords. The second screening compliance rule is determined from the first screening compliance rule based on the keyword matching results. The target large language model is used to determine the fit score between the clause to be detected and the second screening compliance rule, and the target compliance rule is determined from the second screening compliance rule based on the fit score.
5. The method according to claim 1, characterized in that, The compliance testing of the clause item to be tested according to the target compliance rules includes: When the target clause type is the numerical clause, obtain the value to be detected contained in the clause to be detected, and perform compliance detection on the clause to be detected according to the value to be detected and the compliance value range defined by the target compliance rule; When the target clause type is the sub-category clause, obtain the types to be detected contained in the clause to be detected, and perform compliance detection on the clause to be detected according to the types to be detected and the list of compliance types defined by the target compliance rule.
6. The method according to claim 1, characterized in that, The compliance check of the clauses to be checked using the target large language model includes: Based on the type of the target clause, a target compliance detection prompt is determined from the candidate compliance detection prompts, and the target compliance detection prompt and the clause to be detected are input into the target large language model; The target large language model performs compliance checks on the clauses to be checked based on the target compliance detection prompts.
7. The method according to claim 1, characterized in that, The method further includes: Determine the results of the compliance testing performed on the aforementioned clause / item to be tested; If the detection result is non-compliant, the target compliance rule used by the detection of the clause item to be detected is taken as the reference compliance rule, and the target big language model is used to modify the clause item to be detected according to the target design document and the reference compliance rule to obtain the modified clause item; Based on the test results, the reference compliance rules, and the amended clauses, a compliance check report is generated for the clauses to be tested.
8. A compliance detection device for design documents, characterized in that, The device includes: The design document acquisition module is used to acquire the target design document to be inspected, and to determine at least one clause item to be inspected contained in the target design document and the target clause item type corresponding to the clause item to be inspected. The first compliance detection module is used to determine the target compliance rule according to the target clause type when the target clause type is a first clause type, and to perform compliance detection on the clause to be detected according to the target compliance rule; wherein, the first clause type is a numerical clause or a categorized clause. The second compliance detection module is used to perform compliance detection on the clause to be detected using a target large language model when the target clause type is the second clause type; wherein the second clause type is a logical relation clause, a composite clause, or a fuzzy expression clause.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the compliance testing method for the design document according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to execute the compliance testing method for the design document according to any one of claims 1-7.
11. A computer program product comprising a computer program that, when executed by a processor, implements a compliance detection method for a design document according to any one of claims 1-7.