Contract auditing method and device

By setting identifiers in the contract template to distinguish between static and dynamic content, and using an intelligent review agent for precise review, the problem of insufficient review accuracy in automated contract generation systems has been solved, achieving efficient and accurate review of contract content and ensuring the compliance and accuracy of contracts.

CN121961447APending Publication Date: 2026-05-01北京理房通支付科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511933808.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

The accuracy of existing automated contract generation systems is insufficient, and they are easily affected by factors such as layout, font, and seal obscuring, leading to recognition errors and failing to effectively guarantee the accuracy and compliance of contract content.

Method used

By setting identifiers in the contract template to distinguish between static and dynamic content, a contract text containing the identifiers is generated for review. A pre-configured review agent is then used for precise review, including non-empty verification, consistency verification, and logical compliance verification, to ensure the accuracy and compliance of dynamic data.

Benefits of technology

It significantly improves the accuracy of contract review, ensuring that contract content complies with business logic and legal requirements before generation, reducing human error and maintenance costs, and meeting the needs of modern enterprises for efficient and accurate contract review.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121961447A_ABST
    Figure CN121961447A_ABST
Patent Text Reader

Abstract

The invention provides a contract auditing method and device, and the method comprises the steps: obtaining business data corresponding to a business request in response to the business request, filling a dynamic data field of a contract template with the business data, and generating a to-be-audited contract text containing an identifier; the contract template comprises a plurality of dynamic data fields used for filling specific business data, and static content provided with the identifier; static content corresponding to the identifier is filtered out from the contract text to be audited, and a target audit text containing dynamic data fields and related contexts is generated; and inputting the target auditing text into an auditing agent pre-configured with a business auditing rule for auditing, and generating an auditing result, thereby avoiding the problem of insufficient auditing accuracy caused by the interference of factors such as format, font and seal covering in the OCR technology, remarkably improving the contract auditing accuracy, and improving the contract auditing efficiency. Contract content is ensured to meet business logic and legal requirements before generation.
Need to check novelty before this filing date? Find Prior Art

Description

A method and apparatus for contract review Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for contract review. Background Technology

[0002] Automated contract generation systems are widely used in finance, real estate, and other fields to improve efficiency. Their core model is "template + dynamic data." Based on specific business requests, the system automatically fills in transaction-related dynamic data (such as party information, amount, date, etc.) into a preset contract template, generating a legally binding electronic contract. While this automated process improves efficiency, it also introduces the technical risk of errors in contract content due to program bugs or configuration mistakes.

[0003] To monitor the quality of automatically generated contracts, existing technologies employ an automated review method based on Optical Character Recognition (OCR). A typical implementation process is as follows: First, the system generates a final, legally binding PDF contract document according to a predetermined procedure; then, it calls the OCR engine to convert the image content of the PDF file into an editable text format; finally, it analyzes the converted text using a preset rule engine or script to check for any content errors.

[0004] However, the aforementioned existing technologies have fundamental flaws that are difficult to overcome in practical applications: limited accuracy in auditing. The recognition accuracy of OCR technology is not 100%; it is affected by various factors such as contract format, font, and seal obscuring, which can easily lead to recognition errors, resulting in false or missed reports in the audit results, and thus insufficient reliability. Summary of the Invention

[0005] This invention provides a method and apparatus for contract review, which addresses the shortcomings of insufficient reliability of review results in the prior art and improves the accuracy of contract review.

[0006] This invention provides a method for contract review in a contract review system. The method includes: responding to a business request, acquiring business data corresponding to the business request, and filling the business data into dynamic data fields of a contract template to generate a contract text to be reviewed containing an identifier; the contract template includes multiple dynamic data fields for filling specific business data, and static content with the identifier; filtering out the static content corresponding to the identifier from the contract text to be reviewed to generate a target review text containing dynamic data fields and related context; inputting the target review text into a review agent pre-configured with business review rules for review, and generating a review result.

[0007] According to the contract review method provided by the present invention, before responding to a business request, the method further includes: pre-configuring multiple contract templates corresponding to different business types, and pre-setting the identifier in the multiple contract templates for marking static content that does not require review.

[0008] According to the contract review method provided by the present invention, the business data is filled into the dynamic data field of the contract template to generate a contract text to be reviewed containing an identifier, including: determining a target contract template corresponding to the business request from the plurality of contract templates according to the business request; filling the dynamic data field of the target contract template with the business data to replace the placeholders in the dynamic data field, and retaining the identifier of the static content, thereby generating the contract text to be reviewed.

[0009] According to the contract review method provided by the present invention, static content corresponding to the identifier is filtered out from the contract text to be reviewed, and a target review text containing dynamic data fields and related context is generated. The method includes: parsing the document structure of the contract text to be reviewed, filtering out static content corresponding to the identifier, and generating a target review text containing dynamic data fields and related context; the target review text is a string in Hypertext Markup Language format.

[0010] According to the contract review method provided by the present invention, the business review rules are configured in the review agent using prompts written in natural language.

[0011] According to the contract review method provided by the present invention, the business review rules defined in the prompt words include at least one of the following: a non-empty verification rule for the dynamic data fields, used to check whether the contracting entity, amount, and account fields are missing; a content consistency verification rule among multiple dynamic data fields, used to compare whether the payee's name and the seller's name are consistent; and a conformity verification rule between the content of the dynamic data fields and the business logic, used to determine whether the signing date is within a reasonable range or whether the amount is greater than zero.

[0012] According to the contract review method provided by the present invention, the target review text is input into a review agent pre-configured with business review rules for review, and a review result is generated. The method includes: inputting the string in Hypertext Markup Language format corresponding to the target review text into the review agent through an application programming interface to generate a structured data object as the review result; wherein, in response to the detection of review risk, the review result includes fields and content for describing the risk.

[0013] According to the contract review method provided by the present invention, after generating the review result, the method further includes: in response to the review result indicating that there is no risk, executing a process of generating a final version of the contract document; and in response to the review result indicating that there is a risk, executing a process of intercepting the generation of the final version of the contract document and outputting alarm information.

[0014] The present invention also provides a contract review apparatus for a contract review system. The apparatus includes: a filling module, configured to respond to a business request, acquire business data corresponding to the business request, and fill the business data into dynamic data fields of a contract template to generate a contract text to be reviewed containing an identifier; the contract template includes multiple dynamic data fields for filling specific business data, and static content with the identifier set; a filtering module, configured to filter out the static content corresponding to the identifier from the contract text to be reviewed, and generate a target review text containing dynamic data fields and related context; and a review module, configured to input the target review text into a review agent pre-configured with business review rules for review, and generate a review result.

[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the contract review method as described above.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the contract review method as described above.

[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the contract review method as described above.

[0018] The contract review method provided by this invention generates the contract text to be reviewed by filling business data into the dynamic data fields of the contract template and filtering out static content to focus on reviewing dynamic data and related context. This effectively solves the technical risk of contract content errors caused by program bugs or configuration mistakes in traditional automated contract generation systems. At the same time, it uses an intelligent agent with pre-configured business review rules for accurate review, avoiding the problem of insufficient review accuracy caused by OCR technology due to factors such as layout, font, and seal obscuring. This significantly improves the accuracy of contract review and ensures that the contract content complies with business logic and legal requirements before it is generated. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this 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 some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1 is a flowchart illustrating the contract review method provided by the present invention.

[0021] Figure 2 is an example diagram of the contract review process provided by the present invention.

[0022] Figure 3 is a schematic diagram of the structure of the contract review device provided by the present invention.

[0023] Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

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

[0025] To achieve quality monitoring of automatically generated contracts, in addition to using OCR technology as described in the background, existing technologies also employ the following methods: Solution 1: Manual sampling or full review. This is the most traditional risk control method, where after a contract is generated, operations or legal personnel manually review each contract (or conduct a proportional sampling) to verify the accuracy of key information. The drawbacks of this solution are significant: First, it is costly and inefficient, unsuitable for high-volume, high-frequency business scenarios; second, manual review relies on the reviewer's sense of responsibility and mental state, making it difficult to completely avoid human errors caused by fatigue or negligence; finally, it is a delayed "post-event remedy," unable to prevent the generation and circulation of problematic contracts in the first instance.

[0026] Option 2: Traditional software testing (unit testing / integration testing) involves the development team writing test cases for the contract generation module to verify the correctness of the code logic. However, this approach struggles to cover all complex business scenarios and data combinations. It can verify that the program works correctly under "ideal configurations," but it's difficult to detect problems caused by "misconfigurations by business personnel" or "abnormal data provided by upstream systems." Furthermore, the maintenance cost of test cases is quite high when business rules change frequently.

[0027] Option 3: General AI Contract Review Tools While some AI-powered contract review services exist, most focus on the compliance and risk analysis of legal clauses, such as identifying unfair terms or legal loopholes. These tools are often disconnected from specific business data and generation processes, unable to determine whether the name "Zhang San" entered into the contract is accurate for "this transaction," or whether the amount of "1 million yuan" reflects the true nature of "this business." Therefore, they fail to address our core issues—the accuracy of dynamic data entry and the consistency of business logic.

[0028] As can be seen from the above, the shortcomings of existing technologies in the field of contract review are obvious. Although manual review can detect errors, its high labor costs and low efficiency make it difficult to meet the massive and high-frequency business needs of modern enterprises. For example, large e-commerce companies need to review thousands of contracts every month, which is simply impossible to handle manually.

[0029] While traditional software testing can verify code logic, it often falls short when faced with complex and ever-changing business scenarios and data combinations. For example, car-sharing platforms frequently adjust their billing rules, making it difficult for traditional test cases to fully cover them. Furthermore, traditional test cases are costly to maintain and struggle to detect issues caused by misconfigurations by business personnel or abnormal data provided by upstream systems.

[0030] In post-contract verification, OCR technology is limited by its recognition accuracy. For contracts with complex formats, such as real estate transactions with a large number of annotations and special symbols, OCR is prone to recognition errors, leading to the omission or error of key information. Moreover, its lag makes it impossible to intercept risks in real time during the contract generation process.

[0031] While general AI contract review tools can analyze the compliance of legal clauses, they are disconnected from specific business data and cannot accurately verify the accuracy of dynamic data, such as the matching degree between transaction amount and contracting party information in corporate merger and acquisition contracts.

[0032] The contract review method proposed in this invention is designed to address these shortcomings of existing technologies. It embeds itself into the contract generation process in real time, dynamically adapting to changes in business rules using natural language prompts, thus reducing maintenance costs and the risk of omissions. By embedding an intelligent agent into the contract generation process, it verifies the accuracy of dynamic data in real time, ensuring the precision and compliance of contract content. This method not only improves review efficiency but also reduces human error, meeting the needs of modern enterprises for efficient and accurate contract review.

[0033] Before introducing the embodiments of the present invention, the terms involved in the present invention will be explained illustratively.

[0034] Business data refers to a series of specific data related to contracts generated in commercial activities. This data is highly dynamic and diverse, changing according to different business scenarios, transaction types, and customer circumstances. For example, in a house sale contract, the address, area, price, and personal information of both the buyer and seller are all business data. This data forms the basis for contract generation, making a generic contract template concrete, legally binding, and practically applicable. The accuracy and completeness of business data are crucial during contract review, as even minor errors can lead to disputes during contract performance.

[0035] Contract templates are pre-designed, formatted documents tailored to specific contract types. They act as a framework, defining the contract's basic structure, clauses, and the placement of various fixed information. Contract templates are typically developed by legal professionals or business experts to ensure legal rigor and validity, and compliance with company business practices and industry standards. For example, a lease agreement template might include a framework of basic information for both parties, a description of the leased property, the lease term, rent and payment methods, and liability for breach of contract. In practice, simply filling in the specific business data into the template quickly generates a complete contract, significantly improving the efficiency and accuracy of contract creation.

[0036] Identifiers: In contract templates, identifiers act like special "markers" or "labels" used to precisely locate and distinguish different parts of the template, especially static content that does not require review. Their existence allows the system to quickly identify and filter out these pre-defined, unmodified, and unreviewable contents when processing contract text, thereby improving review efficiency and avoiding repetitive and meaningless review operations on non-critical parts such as fixed clauses. For example, in a contract template, specific combinations of symbols or annotations can be used, such as "[static]The party required to pay liquidated damages shall pay liquidated damages at a rate of 1% of the unfulfilled portion[ / static]". Here, "[static]" and "[ / static]" are identifiers used to indicate that the text content in between is static and not within the scope of review.

[0037] Dynamic data fields are "blank areas" or "placeholders" reserved in the contract template for business data. These fields are dynamic and can be flexibly filled according to different business situations. The setting of dynamic data fields allows the contract to adapt to various business scenarios and data changes, enhancing the versatility and flexibility of the contract template. For example, in a procurement contract template, "purchase quantity," "purchase unit price," and "delivery date" are all dynamic data fields. Their specific values ​​are retrieved from the business system or other data sources and filled into the corresponding positions in the contract each time an actual procurement transaction occurs. During the contract review process, the content of dynamic data fields is a key focus, as they directly relate to the business accuracy and enforceability of the contract.

[0038] Static content refers to the pre-defined elements in the contract template that typically do not require modification or review during contract generation and approval. This content generally includes general terms, legal statements, and formatted text descriptions, exhibiting relative stability and fixedness. For example, clauses such as "Party A's Rights and Obligations," "Dispute Resolution Methods," and "Contract Effective Conditions" often remain consistent across different instances of the same type of contract, unless adjustments are needed due to special business circumstances or changes in the legal environment. The existence of static content provides a basic legal framework and general rules for the contract, ensuring its structural and legal integrity while reducing the workload of repetitive editing.

[0039] The auditing agent is an intelligent system component integrating advanced artificial intelligence technology and business auditing rules, capable of automatically performing in-depth analysis and verification of contract texts. The auditing agent is pre-configured with a rich variety of business auditing rules, which are prompts written in natural language, covering aspects such as non-empty verification of dynamic data fields, content consistency verification, and business logic compliance verification. For example, it can check whether the contracting parties are complete, whether the amount is greater than zero, and whether the payee's name matches the seller's name. During the contract auditing process, the auditing agent receives the target audit text as input, processes it through complex algorithms and models, quickly and accurately identifies risk points in the contract, and generates detailed audit results, providing crucial quality assurance for the final generation and signing of the contract.

[0040] The target review text is the text content used in the actual review process, obtained from the contract text to be reviewed after a series of processing steps. Specifically, the system first populates the dynamic data fields of the contract template with business data, generating the contract text to be reviewed containing identifiers. Then, through specific parsing and filtering operations, the static content in the contract text to be reviewed is removed based on the identifiers. What remains is mainly the content surrounding the dynamic data fields and their related context; this part constitutes the target review text. It highlights the parts that need to be reviewed in detail, so that the review agent can review them efficiently and accurately, improving review efficiency and quality, and avoiding repetitive and meaningless processing of a large amount of static content.

[0041] Hypertext Markup Language (HTML) is a standard markup language used to create hypertext documents such as web pages. In contract generation and review systems, HTML plays a crucial role. After the system populates business data into a contract template and generates the contract text to be reviewed, it converts this text into a HTML-formatted string. This format allows the contract text to be correctly displayed and rendered on HTML-enabled clients such as web browsers, facilitating user viewing and editing. Furthermore, during the subsequent review process, the target review text in HTML format can be more efficiently parsed and processed by the review agent. For example, the review agent can quickly locate dynamic data fields and their related context by recognizing specific tag structures in HTML, thereby performing precise review operations. HTML acts as a universal "language," enabling contract text to be smoothly transmitted and displayed between different system components and user interfaces, serving as a vital technological foundation for the digitization and networking of the entire contract generation and review process.

[0042] A Programming Interface (API) is a bridge connecting different software systems or components, allowing them to exchange data and call functions. In contract generation and review systems, the API plays a crucial communication role. For example, when a service needs to send target review text to a review agent for review, it sends a request to the agent via the API. This request includes the target review text and relevant review parameters. Upon receiving the request, the review agent processes the text according to its internal review rules and returns the review result to the service via the API. The API defines a standardized set of communication protocols and data formats, making interaction between different systems simpler, more efficient, and more reliable. It ensures that various system components can work collaboratively according to predetermined rules to complete complex contract generation and review tasks, while also facilitating system expansion and integration, allowing the system to easily connect to other external services or functional modules to meet ever-changing business needs.

[0043] The contract review method of this invention is generally built on a typical distributed computing architecture, encompassing core components such as user terminals, application servers, review agent servers, and database servers. User terminals interact with the service through browsers or mobile applications, inputting contract data and viewing review results; their performance requirements are moderate, meeting basic interactive functions. Application servers utilize physical servers with multi-core CPUs, large-capacity memory, and high-speed SSD storage to ensure efficient data processing and contract generation. The review agent server runs the review agent, requiring high-performance CPUs and GPUs to accelerate model inference, and large-capacity memory to handle large-scale text data. The database server stores business data, contract templates, and review rules, employing highly reliable storage devices and RAID technology to ensure data security, and high-performance storage devices to ensure efficient data read and write operations. Network devices such as switches and routers construct a high-speed, stable local area network to ensure data transmission between components. The overall hardware environment can be flexibly expanded according to business load to meet the ever-growing contract review needs of enterprises.

[0044] The method for contract review according to an embodiment of the present invention is described below with reference to Figures 1 and 2.

[0045] Figure 1 is a flowchart of one of the contract review methods provided by the present invention. The method includes the following steps: Step 101: In response to a business request, obtain business data corresponding to the business request, and fill the business data into the dynamic data field of the contract template to generate a contract text to be reviewed containing an identifier; the contract template includes multiple dynamic data fields for filling specific business data, and static content with the identifier set.

[0046] In step 101, in response to a business request, the system first obtains the business data corresponding to the request. For example, in a real estate transaction contract, this includes the personal information of the buyer and seller, the property address, and the transaction amount. Then, this business data is populated into the dynamic data fields of the contract template. For instance, the buyer's name "Zhang San" is populated into the "{Buyer's Name}" field, and the transaction amount "1 million yuan" is populated into the "{Transaction Amount}" field. The contract template also contains static content with set identifiers, such as... The general terms are marked with an identifier. After completion, a draft contract text containing the identifier is generated, presented in HTML format for easy display to the user on the front-end interface for confirmation and further processing. The entire process ensures that the contract content is highly accurate and standardized from the initial generation stage.

[0047] Step 102: Filter out the static content corresponding to the identifier from the contract text to be reviewed, and generate the target review text containing dynamic data fields and related context.

[0048] In step 102, to filter out static content from the contract text to be reviewed and generate the target review text, the following method can be used: First, regular expressions are used to quickly locate the start and end positions of the static content. Then, for these matching areas, an HTML parsing library (such as BeautifulSoup) is used for partial parsing and removal, rather than processing the entire text, thereby improving efficiency and avoiding accidental deletion of dynamic data fields and their context. This method strikes a balance between performance and accuracy, effectively reducing the amount of data passed to the review model while ensuring the integrity of dynamic data. Finally, this process is integrated into the review system's service, and its filtering effect under different scenarios is verified through a series of test cases to ensure the reliability and accuracy of the filtering process.

[0049] Step 103: Input the target review text into the review agent that has been pre-configured with business review rules for review and generate the review result.

[0050] In step 103, the system inputs the target review text into the review agent for review. The review agent is pre-configured with business review rules, which are written in natural language and cover various verification rules, such as non-empty verification, consistency verification, and logical compliance verification. For example, non-empty verification ensures that key fields such as the contracting entity, amount, and account number are not empty; consistency verification compares whether the payee's name matches the seller's name; logical compliance verification determines whether the signing date is reasonable and whether the amount is greater than zero. The review agent uses these rules to comprehensively check the target review text and identify potential risks. If a risk is found, the review result will include a risk description; if no risk is found, an empty result is returned. Finally, the review result is generated in the form of a structured data object for service parsing to determine whether to generate a final contract or to perform risk interception and alerts.

[0051] The contract review method provided in this invention generates the contract text to be reviewed by filling business data into the dynamic data fields of the contract template and filtering out static content to focus on reviewing dynamic data and related context. This effectively solves the technical risk of contract content errors caused by program bugs or configuration mistakes in traditional automated contract generation systems. At the same time, it uses an intelligent agent with pre-configured business review rules for accurate review, avoiding the problem of insufficient review accuracy caused by OCR technology due to factors such as layout, font, and seal obscuring. This significantly improves the accuracy of contract review and ensures that the contract content complies with business logic and legal requirements before it is generated.

[0052] Before the contract review system formally responds to and processes real-time business requests, the initial configuration of contract templates is completed in advance through the protocol configuration module. Based on actual business operation needs, the system predefines and configures multiple contract templates corresponding to different business types. For example, for different business product lines such as "Fund Custody of Bank A," "Fund Custody of Bank B," and "Fund Custody of Bank C," the system creates independent contract template files for each and establishes a one-to-one mapping relationship between business type identifiers and contract template IDs in the database. This means that when the system receives a specific business request subsequently, it can immediately index the uniquely determined target contract template based on the business type, thereby ensuring a strict match between the contract structure and the business scenario.

[0053] Building upon this foundation, to achieve efficient and intelligent subsequent review, administrators pre-define identifiers within the contract template to mark static content that does not require review when configuring the template. Specifically, the contract template contains numerous general legal clauses, disclaimers, or fixed-format texts that remain unchanged across different transactions and do not require repeated AI validation. Therefore, administrators utilize HTML tag technology to wrap or mark this static content with specific identifiers; while for sections requiring specific business data, placeholders are reserved for dynamic data fields. This configured contract template clearly distinguishes between variable areas and static areas locked by identifiers, providing a data foundation for quickly filtering out distracting information and focusing on core business data during subsequent review processes.

[0054] Furthermore, in the process of filling the dynamic data fields of the contract template with business data and generating the contract text to be reviewed, the specific implementation is as follows: First, the system determines the target contract template corresponding to the business request from the multiple contract templates according to the business request.

[0055] The system then validates the business data to ensure its completeness and accuracy. The system invokes the target contract template, which contains multiple dynamic data fields and static content, where the static content is identified by specific identifiers.<divclass="special-marker" data-marker-ai="true"> mark.

[0056] Next, the system maps business data to the dynamic data fields of the template, replacing the placeholders in the dynamic data fields while retaining the identifiers of the static content, thus generating the contract text to be reviewed. For example, dynamic fields in the template might include {Customer Name}, {Transaction Amount}, {Service Period}, etc. The system will then populate these fields with the actual business data, while retaining the identifiers of the static content.

[0057] During the data population process, the system may perform necessary data format conversions. For example, if the date field in the template requires a YYYY-MM-DD format, while the date format in the business data is DD / MM / YYYY, the system will automatically convert the date format to the format required by the template.

[0058] Once completed, the dynamic parts of the contract template will be replaced with specific business data, while the static content will remain unchanged, generating a contract text containing identifiers for review. This text is presented in HTML format for easy display to the user for confirmation on the front-end interface.

[0059] The entire process ensured that the contract content was highly accurate and standardized from the initial stage of generation, laying a solid foundation for subsequent review stages.

[0060] Furthermore, the system inputs the target review text into the review agent for review. The specific process is as follows: First, the system parses the HTML document structure of the contract text to be reviewed. This is done by finding and removing text containing specific identifiers (such as...). The static content of the document is used to extract dynamic data fields and their context, generating the target audit text. This text is an HTML string containing key business information and related context.

[0061] For example, if the contract text under review contains a dynamic section that reads "Buyer's Name: Zhang San Seller's name: Li Si Transaction amount: 1 million yuan If the target review text contains these dynamic fields and their context information, such as "Buyer's name: Zhang San, Seller's name: Li Si, Transaction amount: 1 million yuan".

[0062] After receiving the target review text, the review agent reviews it according to preset rules. If a risk is found, such as an empty transaction amount or an incorrect contract date format, the review result will include a risk description, such as {"legal_risks":[{"field":"Transaction Amount","risk_description":"Transaction Amount is Empty"},{"field":"Contract Date","risk_description":"Contract Date Format Incorrect"}]}. If there is no risk, an empty result {} is returned.

[0063] The system analyzes the review results. If there are no risks, it continues to generate the final contract document; if there are risks, it intercepts contract generation and outputs an alarm message to remind relevant personnel to make corrections. This process ensures that the contract content complies with business logic and legal requirements, effectively improving the accuracy and efficiency of contract review.

[0064] Furthermore, for the auditing agent, business audit rules are pre-configured. These rules are written in natural language and cover various verification rules, such as non-empty verification, consistency verification, and logical compliance verification. The business audit rules defined in the prompt words include at least one of the following, for example: non-empty verification rules for dynamic data fields, used to check whether the contracting entity, amount, and account fields are missing; content consistency verification rules between multiple dynamic data fields, used to compare whether the payee's name matches the seller's name; and compliance verification rules between the content of dynamic data fields and business logic, used to determine whether the signing date is within a reasonable range or whether the amount is greater than zero.

[0065] For example, for non-empty validation rules, the prompt message is: Please check whether the fields "Contracting Entity", "Transaction Amount", and "Payee Account" in the contract are filled in completely.

[0066] Example: In a sales contract, the system checks if fields such as "Buyer's Name," "Seller's Name," "Total Contract Amount," and "Receiving Bank Account" contain data. If the "Buyer's Name" field is found to be empty, the system will mark it as a risk and prompt the user to add the buyer's name.

[0067] For example, for content consistency verification rules, the prompt message is: Please confirm whether the "payee's name" and "seller's name" in the contract are consistent.

[0068] Example: In a real estate transaction contract, the system compares the "Seller's Name" and "Payee's Name" fields. If the "Seller's Name" in the contract is Zhang San, but the "Payee's Name" is Li Si, the system will identify the discrepancy, mark it as a risk, and indicate that there may be information errors or a case of payment being collected on behalf of another party, requiring further verification.

[0069] For example, for business logic compliance verification rules, the prompt is: Please determine whether the "signing date" in the contract is within a reasonable range and whether the "transaction amount" is greater than zero.

[0070] Example: In a service contract, the system checks whether the "Service Start Date" and "Service End Date" are logically consistent. If the "Service Start Date" is 2024-12-01 and the "Service End Date" is 2024-11-30, the system will mark it as risky, indicating that the service end date is earlier than the start date, which does not conform to business logic. Simultaneously, the system will also check whether the "Service Fee" field is greater than zero. If the fee is negative or zero, it will also be marked as risky, indicating that the fee setting is abnormal.

[0071] In the contract review process, the system inputs the target review text into the review agent for review and generates a review result. Specifically, the system sends the HTML format string corresponding to the target review text to the review agent via an API request. For example, the target review text may contain dynamic data fields such as "Buyer's Name: Zhang San, Seller's Name: Li Si, Transaction Amount: 1 million yuan, Signing Date: 2025-12-01". The review agent checks according to preset business review rules. If risks such as an empty transaction amount field or an incorrect signing date format are found, the review result will include a risk description, such as {"legal_risks":[{"field":"Transaction Amount","risk_description":"Transaction Amount is Empty"},{"field":"Signing Date","risk_description":"Signing Date Format Incorrect"}]}. If there is no risk, an empty result {} is returned.

[0072] After the review results are generated, the system takes different actions based on the results. If there is no risk, the system continues the process of generating the final version of the contract document, converting the contract text to PDF format and saving it. If there is a risk, the system intercepts the generation of the final version of the contract document and outputs an alarm message to remind relevant personnel to make corrections. For example, if the review results contain risk descriptions, the system will send alarm information to the operations staff's email address and display the alarm details on the management interface to address risks promptly and ensure the accuracy and compliance of the contract content.

[0073] To facilitate understanding of the solutions in the embodiments of the present invention, the following description, in conjunction with FIG2, will provide a specific example to further illustrate the solutions in the embodiments of the present invention.

[0074] (1) Business data preparation.

[0075] The contract review process begins with preparing relevant business data. Taking a real estate sales contract as an example, this data includes key information such as the property address, buyer and seller information, transaction amount, and signing date. This data is typically entered by business personnel through the system's front-end interface, such as via a web form or API.

[0076] (2) Contract template selection and filling.

[0077] The system selects a predefined contract template based on the business type. This template contains dynamic data fields (such as "{property address}", "{buyer's name}", etc.) and static content (such as contract terms, legal notices, etc.). Specific identifiers are embedded in the static content, such as... This is used to mark sections such as general terms and conditions that do not require review.

[0078] The system populates business data into dynamic fields of the template. For example, it populates "Buyer's Name: Zhang San" into the "{Buyer's Name}" field and "Transaction Amount: 1 million yuan" into the "{Transaction Amount}" field. After the population is complete, it generates a contract text containing identifiers to be reviewed.

[0079] (3) Processing of contract texts pending review.

[0080] The system parses the HTML document structure of the contract text to be reviewed and filters out static content. For example, it identifies and removes content containing... The general terms section of the identifier retains dynamic data fields and their contextual content to generate the target review text.

[0081] (4) AI intelligent agent review.

[0082] The target review text is sent to the review agent via an API request. The system is configured with multiple AI review agents, each responsible for different review tasks: Review Agent 1: responsible for non-empty validation, checking whether key fields (such as the contracting entity, amount, and account number) are filled in completely.

[0083] Audit Agent 2: Responsible for consistency verification, comparing whether the payee's name matches the seller's name.

[0084] Audit Agent 3: Responsible for logic compliance verification, determining whether the signing date is within a reasonable range, whether the amount is greater than zero, etc.

[0085] Audit Agent 4: Responsible for format validation, checking whether the format of fields such as date and amount is correct.

[0086] For example, agent 1 finds that the "buyer's name" field is empty, agent 2 finds that the "payee's name" is inconsistent with the "seller's name", agent 3 determines that the "contract date" is earlier than the current date, and agent 4 identifies that the "transaction amount" is in the wrong format (such as containing non-numeric characters).

[0087] (5) Summarizing and Decision-Making the Audit Results: The audit results of each agent are summarized to generate a structured data object. If there is a risk, the audit result includes a risk description; if there is no risk, an empty result is returned.

[0088] Different actions will be taken depending on the audit results: No risk: Continue to generate the final version of the contract document, convert the contract text to PDF format and save it.

[0089] Risk: Intercepting the generation of the final contract document and outputting alert information. For example, sending alert emails to operations staff and displaying alert details in the management interface to facilitate timely error correction.

[0090] Through the above steps, the contract review method of the present invention achieves the following effects: improved review efficiency: automated filling of business data and intelligent review reduce manual operations, speed up the contract review process, and are suitable for the rapid processing of a large number of contracts.

[0091] Enhance audit accuracy: Multiple AI agents conduct multi-dimensional audits, including non-empty checks and consistency checks, effectively identifying potential risks in contracts and improving the accuracy of audits.

[0092] Reduce legal risks: Through precise dynamic data and business logic checks, ensure the legality and compliance of contract content, and reduce legal issues caused by contract errors.

[0093] Real-time risk interception: Real-time review during contract generation to promptly identify and intercept risky contracts, preventing the generation and circulation of problematic contracts and reducing correction costs.

[0094] The contract review apparatus provided in the embodiments of the present invention will be described below. The contract review apparatus described below and the contract review method described above can be referred to in correspondence.

[0095] This invention provides a contract review apparatus, as shown in Figure 3, for use in a contract review system. The apparatus includes: a filling module 310, used to respond to a business request, obtain business data corresponding to the business request, and fill the business data into dynamic data fields of a contract template to generate a contract text to be reviewed containing an identifier; the contract template includes multiple dynamic data fields for filling specific business data, and static content with the identifier set; a filtering module 320, used to filter out the static content corresponding to the identifier from the contract text to be reviewed, and generate a target review text containing dynamic data fields and related context; and a review module 330, used to input the target review text into a review agent pre-configured with business review rules for review, and generate a review result.

[0096] Figure 4 illustrates a schematic diagram of the physical structure of an electronic device. As shown in Figure 4, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communication bus 440. The processor 410, communications interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a contract review method. This method includes: responding to a business request, acquiring business data corresponding to the business request, and filling the business data into dynamic data fields of a contract template to generate a contract text to be reviewed containing an identifier; the contract template includes multiple dynamic data fields for filling specific business data, and static content with the identifier; filtering out the static content corresponding to the identifier from the contract text to be reviewed to generate a target review text containing dynamic data fields and related context; inputting the target review text into a review agent pre-configured with business review rules for review, and generating a review result.

[0097] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a 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 described in 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.

[0098] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the contract review method provided by the above methods. The method includes: responding to a business request, obtaining business data corresponding to the business request, and filling the business data into dynamic data fields of a contract template to generate a contract text to be reviewed containing an identifier; the contract template includes multiple dynamic data fields for filling specific business data, and static content with the identifier set; filtering out the static content corresponding to the identifier from the contract text to be reviewed to generate a target review text containing dynamic data fields and related context; inputting the target review text into a review agent pre-configured with business review rules for review, and generating a review result.

[0099] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a contract review method provided by the above-described methods. The method includes: in response to a business request, acquiring business data corresponding to the business request, and filling the business data into dynamic data fields of a contract template to generate a contract text to be reviewed containing an identifier; the contract template includes multiple dynamic data fields for filling specific business data, and static content with the identifier set; filtering out the static content corresponding to the identifier from the contract text to be reviewed to generate a target review text containing dynamic data fields and related context; inputting the target review text into a review agent pre-configured with business review rules for review, and generating a review result.

[0100] The device embodiments described above are merely illustrative. 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0101] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; 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; and these 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 contract review, characterized in that, For a contract review system, the method includes: responding to a business request, obtaining business data corresponding to the business request, and filling the business data into dynamic data fields of a contract template to generate a contract text to be reviewed containing an identifier; the contract template includes multiple dynamic data fields for filling specific business data, and static content with the identifier set; filtering out the static content corresponding to the identifier from the contract text to be reviewed to generate a target review text containing dynamic data fields and related context; inputting the target review text into a review agent pre-configured with business review rules for review, and generating a review result.

2. The method for contract review according to claim 1, characterized in that, Before responding to a business request, the method further includes: pre-configuring multiple contract templates corresponding to different business types, and pre-setting the identifier in the multiple contract templates for marking static content that does not require review.

3. The method for contract review according to claim 2, characterized in that, The process of filling the business data into the dynamic data field of the contract template to generate a contract text to be reviewed containing an identifier includes: determining a target contract template corresponding to the business request from the plurality of contract templates according to the business request; filling the business data into the dynamic data field of the target contract template to replace the placeholders in the dynamic data field, and retaining the identifier of the static content to generate the contract text to be reviewed.

4. The method for contract review according to claim 1, characterized in that, The process of filtering out the static content corresponding to the identifier from the contract text to be reviewed, and generating target review text containing dynamic data fields and related context, includes: parsing the document structure of the contract text to be reviewed, filtering out the static content corresponding to the identifier, and generating target review text containing dynamic data fields and related context; the target review text is a string in Hypertext Markup Language format.

5. The method for contract review according to claim 1, characterized in that, The business review rules are configured in the review agent using prompts written in natural language.

6. The method for contract review according to claim 5, characterized in that, The business review rules defined in the prompt include at least one of the following: a non-empty verification rule for the dynamic data fields, used to check whether the contracting entity, amount, and account fields are missing; a content consistency verification rule between multiple dynamic data fields, used to compare whether the payee's name and the seller's name are consistent; and a conformity verification rule between the content of the dynamic data fields and the business logic, used to determine whether the contract signing date is within a reasonable range or whether the amount is greater than zero.

7. The method for contract review according to claim 1, characterized in that, The process of inputting the target review text into a review agent pre-configured with business review rules and generating a review result includes: inputting the string in Hypertext Markup Language format corresponding to the target review text into the review agent via an application programming interface to generate a structured data object as the review result; wherein, in response to the detection of a review risk, the review result includes fields and content for describing the risk.

8. The method for contract review according to claim 1, characterized in that, After generating the audit result, the method further includes: in response to the audit result indicating that there is no risk, executing the process of generating the final version of the contract document; in response to the audit result indicating that there is a risk, executing the process of intercepting the generation of the final version of the contract document and outputting alarm information.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the contract review method as described in any one of claims 1 to 8.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the contract review method as described in any one of claims 1 to 8.