Intelligent contract generation method and device, electronic equipment and storage medium
Through user-defined contract templates and dynamically adjusting content, combined with blockchain storage and natural language processing, the problem of insufficient static and compliance inspection of contract templates in the existing technology is solved, and the intelligent generation and security of contracts are achieved.
Patent Information
- Application Number
- CN202510010518.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-05-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing contract template system operates in a static way, cannot meet the needs of various contract formulation, and lacks real-time compliance check functions, making it difficult to achieve intelligent contract generation.
By selecting and sorting contract modules in the contract template management interface of the user, a custom contract template is generated, and dynamically adjusts them using dynamic variable placeholders and contract parameter information, matching preset contract risk rules are corrected, and finally the hash value of the contract content is stored on the blockchain.
It realizes rapid generation, personalized customization, real-time risk warning and compliance inspection of contract templates, and improves the intelligence level and security of contract management.
Smart Images

Figure CN119940328A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a method, device, electronic device and storage medium for intelligently generating a contract. Background Art
[0002] In daily life, everyone may need to sign different contracts, such as lease contracts, sales contracts, gift contracts, technical contracts and other types of contracts. Contracts are formulated to ensure the legitimate rights and interests of both parties to the contract and are protected by law. In the prior art, contract formulation is usually mainly manual. During the formulation process, the current contract template system mostly operates in a static manner and is mainly managed through predefined templates (such as PDF or Word files). These templates are usually created by professionals, and users can only fill in the content within the fixed structure provided by the template. However, due to the wide range of application scenarios of contracts, the preset contract templates cannot meet all contract formulation needs, and the real-time compliance check function is not integrated into the contract template, so how to quickly and intelligently generate contracts has become a technical issue that cannot be underestimated. Summary of the invention
[0003] In view of this, the purpose of this application is to provide an intelligent contract generation method, device, electronic device and storage medium, which realizes the rapid generation, personalized customization, real-time risk warning and compliance inspection of contract templates, and improves the intelligence level and security of contract management.
[0004] The embodiment of the present application provides a method for intelligently generating a contract, wherein the intelligent generation includes:
[0005] Based on the multiple contract modules selected by the first user in the contract template management interface, sequentially sorting and splicing are performed to generate a contract template customized by the first user;
[0006] Dynamically adjusting the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate contract content;
[0007] Based on the key element information in the contract content, the preset contract risk rules are matched, and the key element information that triggers the contract risk rules is modified to determine the final contract content;
[0008] The hash value of the final contract content is calculated, and the final contract content and the first hash value of the final contract content are stored in the blockchain.
[0009] In a possible implementation manner, after calculating the hash value of the final contract content and storing the final contract content and the first hash value of the final contract content in the blockchain, the intelligent generation method further includes:
[0010] After receiving the request from the first user to verify the final contract content, recalculate the second hash value of the final contract content;
[0011] Detecting whether the second hash value is consistent with the first hash value in the blockchain;
[0012] If yes, the final contract content is not modified; if no, the final contract content is modified.
[0013] In a possible implementation manner, the step of sequentially sorting and splicing multiple contract modules selected by the first user in the contract template management interface to generate a contract template customized by the first user includes:
[0014] The contract modules are spliced together in real time based on the arrangement order, and the spliced contract modules are previewed in the display area, so that the contract template is generated according to the spliced contract template.
[0015] Based on the arrangement order, each of the contract modules is spliced together in real time, and the spliced contract modules are previewed in the display area;
[0016] A dynamic condition check is performed on the usage condition field corresponding to the spliced contract module. If the usage condition field does not meet the dynamic condition check, the additional information module in the contract module is hidden to generate the contract template based on the spliced contract template.
[0017] In a possible implementation manner, dynamically adjusting the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate contract content includes:
[0018] Determining a dynamic variable parameter configuration table corresponding to the dynamic variable placeholder in a database;
[0019] For the dynamic variable placeholder, detect whether the contract parameter information contains parameter information of the dynamic variable placeholder, if yes, replace the dynamic variable placeholder based on the parameter information, if no, replace the dynamic variable placeholder based on the default value of the dynamic variable placeholder in the dynamic variable parameter configuration table, and generate the initial contract content;
[0020] Detecting whether the contract parameter value in the initial contract content triggers a preset rule condition;
[0021] If so, add the clauses corresponding to the rules and conditions to the initial contract content to obtain the final contract content.
[0022] In a possible implementation manner, the matching of preset contract risk rules based on key element information in the contract content and modifying the key element information that triggers the contract risk rules to determine the final contract content includes:
[0023] Parsing the contract content based on natural language processing technology to determine key element information related to the risk rules in the contract content;
[0024] Matching the key element information with the risk rules one by one to determine whether the key element information triggers the risk rule;
[0025] If so, the key element information that triggers the risk rule will be highlighted in the contract display interface, and the risk level and correction suggestions of the key element information triggering the risk rule will be displayed, so that the key element information that triggers the risk rule can be corrected based on the correction suggestions until the corrected key element information meets the risk rule, and the final contract content can be determined.
[0026] In a possible implementation manner, after calculating the hash value of the final contract content and storing the final contract content and the first hash value of the final contract content in the blockchain, the intelligent generation method further includes:
[0027] After receiving a request from the second user to modify the final contract content, detecting whether the second user has the authority to modify the final contract content based on a preset user authority table;
[0028] If yes, the second user is allowed to modify the final contract content, and after the second user completes the operation, the log data related to the operation is uploaded to the blockchain;
[0029] If not, the second user's modification of the final contract content will be rejected.
[0030] In a possible implementation manner, after sequentially performing sorting processing, splicing processing, and dynamic condition verification processing on the multiple contract modules selected by the first user in the contract template management interface to generate the first user-defined contract template, the intelligent generation method further includes:
[0031] The contract module in the contract template is updated, the contract content is generated based on the updated contract template, and the update record of the contract template is stored.
[0032] The embodiment of the present application also provides an intelligent generation device for a contract, the intelligent generation device comprising:
[0033] A template setting module, used to perform sorting processing, splicing processing and dynamic condition verification processing in sequence based on multiple contract modules selected by the first user in the contract template management interface, so as to generate a contract template customized by the first user;
[0034] A contract parameter configuration module, configured to sequentially sort and splice multiple contract modules selected by a first user in a contract template management interface to generate a contract template customized by the first user;
[0035] A compliance checking module, which is used to match preset contract risk rules based on key element information in the contract content, and to modify the key element information that triggers the contract risk rules to determine the final contract content;
[0036] The blockchain storage module is used to calculate the hash value of the final contract content and store the final contract content and the first hash value of the final contract content in the blockchain.
[0037] An embodiment of the present application also provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the intelligent contract generation method as described above are performed.
[0038] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the intelligent contract generation method as described above are executed.
[0039] The embodiment of the present application provides a method, device, electronic device and storage medium for intelligently generating a contract, wherein the intelligent generation includes: sorting and splicing multiple contract modules selected by the first user in the contract template management interface in sequence to generate a contract template customized by the first user; dynamically adjusting the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate the contract content; matching the preset contract risk rules based on the key element information in the contract content, and correcting the key element information that triggers the contract risk rules to determine the final contract content; calculating the hash value of the final contract content, and storing the final contract content and the first hash value of the final contract content in the blockchain. Rapid generation, personalized customization, real-time risk warnings and compliance checks of contract templates are realized, and the intelligent level and security of contract management are improved.
[0040] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 One of the flow charts of an intelligent contract generation method provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of an intelligent contract generation method provided in an embodiment of the present application;
[0044] Figure 3 One of the structural schematic diagrams of an intelligent contract generation device provided in an embodiment of the present application;
[0045] Figure 4 The second structural diagram of an intelligent contract generation device provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0048] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied in the field of cloud computing technology.
[0049] Research has found that in daily life, everyone may need to sign different contracts, such as lease contracts, sales contracts, gift contracts, technical contracts and other types of contracts. Contracts are formulated to ensure the legitimate rights and interests of both parties to the contract and are protected by law. In the prior art, contract formulation is usually mainly manual. During the formulation process, the current contract template system mostly operates in a static manner and is mainly managed through predefined templates (such as PDF or Word files). These templates are usually created by professionals, and users can only fill in the content within the fixed structure provided by the template. However, due to the wide range of application scenarios of contracts, the preset contract templates cannot meet all contract formulation needs, and the real-time compliance check function is not integrated into the contract template, so how to quickly and intelligently generate contracts has become a technical issue that cannot be underestimated.
[0050] Based on this, the embodiment of the present application provides an intelligent contract generation method, which realizes the rapid generation, personalized customization, real-time risk warning and compliance checking of contract templates, and improves the intelligence level and security of contract management.
[0051] See also Figure 1 , Figure 1 This is one of the flow charts of a method for intelligently generating a contract provided in an embodiment of the present application. Figure 1 As shown in , the intelligent generation method provided by the embodiment of the present application includes:
[0052] S101: Based on multiple contract modules selected by a first user in a contract template management interface, sorting processing, splicing processing and dynamic condition verification processing are performed in sequence to generate a contract template customized by the first user.
[0053] In this step, the first user selects multiple contract modules in the contract template management interface, sorts, splices, and dynamically checks the multiple contract modules to generate a customized contract template.
[0054] Here, in order to manage the contract module, a database table modules needs to be designed, which contains the following fields: module_id: the unique identifier of the module, used for quick module retrieval. The type is integer, automatically incremented. module_name: the module name, easy for users to identify. The type is string, with a maximum length of 255. module_content: the main content of the module, including detailed information on the contract terms, the type is text, and supports the storage of large sections of content. category: the category of the module (such as procurement terms, payment terms, etc.), which is easy to classify and filter. The type is string. conditions: the use conditions of the module, storing logical expressions (such as "amount>1000000" means that the amount exceeds 1 million). The type is string, created_at and updated_at record the timestamps of module creation and last update respectively, and the type is date and time.
[0055] The contract template management interface also provides a module creation function: users can enter the basic information of the contract module (name, content, category, etc.). Set the use conditions (for example, enable when the contract amount is greater than a certain value), and save it through the interface module after submitting the form. The interface module is used to provide a set of interface support modules to add, delete, modify and query functions: for example, create new modules, update module information, query module information, delete specified modules and other functions.
[0056] Here, by analyzing historical contract data, a machine learning collaborative filtering algorithm is used to recommend contract modules to users. For example, if a user's historical contract contains "purchase terms" and "payment terms", the system will give priority to recommending these two contract modules.
[0057] In a possible implementation manner, the step of sequentially performing sorting processing, splicing processing, and dynamic condition verification processing on a plurality of contract modules selected by the first user in the contract template management interface to generate a contract template customized by the first user includes:
[0058] A: In response to the first user dragging multiple contract modules in the contract template management interface, the arrangement order of each of the contract modules is stored in the front-end state.
[0059] Here, you can use Vue.js and vuedraggable components to implement module dragging. For example, the user can drag the terms module from the module list on the left to the contract generation area on the right. During the dragging process, the content and effects of the module are previewed in real time to enhance the interactive experience. After the dragging is completed, the system records the order of the modules and stores it in the front-end state management tool (such as the Vuex tool).
[0060] B: Based on the arrangement order, each of the contract modules is spliced in real time, and the spliced contract modules are previewed in the display area, so that the contract template is generated according to the spliced contract template.
[0061] Here, the selected contract modules are spliced in real time according to the arrangement order after dragging and dropping, and the contract is previewed in the display area, so that the contract template is generated according to the spliced contract template. The contract content is split into modules, and users can select, drag and combine modules according to actual needs. The parametric design enables the key fields in the template (such as amount, term, terms, etc.) to be dynamically configured, supporting rapid adaptation of different scenarios.
[0062] Among them, the contract preview area supports chaptered structure display, uses titles and numbers to distinguish modules, and stores contract templates.
[0063] In a possible implementation manner, after sequentially performing sorting processing, splicing processing, and dynamic condition verification processing on the multiple contract modules selected by the first user in the contract template management interface to generate the first user-defined contract template, the intelligent generation method further includes:
[0064] The contract module in the contract template is updated, the contract content is generated based on the updated contract template, and the update record of the contract template is stored.
[0065] Here, when the content of the contract module is updated, the system stores the old content as a historical version, and the new content is used to generate the contract later. The implementation method is: add a module_versions table to record the update history of each module. The fields include: version_id: version number; module_id: module ID; module_content: module content and created_at: timestamp.
[0066] In a specific embodiment, after the user accesses the management interface, the administrator adds modules, fills in the module name and content, and sets the applicable conditions. The module information is saved in the background. The user selects and combines modules in the drag-and-drop interface to display the contract preview in real time and dynamically adjust the modules. After the user confirms and saves the contract template, it also supports module updates and version control, as well as intelligent recommendation of modules and templates.
[0067] S102: Dynamically adjust the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate contract content.
[0068] In this step, the contract template is dynamically adjusted according to the dynamic variable placeholders and contract parameter information in the contract template to generate the contract content. It supports the definition and filling of dynamic variables in contract terms, automatically adjusts the contract content based on business rules, and improves flexibility and intelligence.
[0069] In a possible implementation manner, dynamically adjusting the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate contract content includes:
[0070] a: Determine the dynamic variable parameter configuration table corresponding to the dynamic variable placeholder in the database.
[0071] Here, regular expressions are used to traverse the contract template to extract dynamic variable placeholders.
[0072] Among them, the dynamic variable parameter configuration table in the database is used to store the dynamic variable information (such as amount, delivery date, customer name) in the contract template. The table fields include: parameter unique identifier (param_id): the primary key that identifies each dynamic variable; parameter name (param_name): the placeholder name of the dynamic variable (such as `{amount}`); parameter type (param_type): restricts the type of variable, including text, number, date, etc.; default value (default_value): the default fill value provided for the variable; creation and update time: used to record the management history of the parameter. For example, the database table data example: if `{amount}` is required to represent the amount in the contract, the storage rule can be: parameter name: `{amount}`, parameter type: number, default value: `1000000`, and the records in the database include: contract template ID, parameter name, parameter type and default value.
[0073] b: For the dynamic variable placeholder, detect whether the parameter information of the dynamic variable placeholder exists in the contract parameter information. If so, replace the dynamic variable placeholder based on the parameter information; otherwise, replace the dynamic variable placeholder based on the default value of the dynamic variable placeholder in the dynamic variable parameter configuration table to generate the initial contract content.
[0074] Here, for each dynamic variable placeholder, it is detected whether the parameter information of the dynamic variable placeholder exists in the contract parameter information. If so, the dynamic variable placeholder is replaced according to the parameter information. If not, the dynamic variable placeholder is replaced according to the default value of the dynamic variable placeholder in the dynamic variable parameter configuration table to generate the initial contract content. If the parameter information of the dynamic variable placeholder does not exist in both the contract parameter information and the dynamic parameter configuration table, the dynamic variable placeholder is marked as requiring user supplementation.
[0075] Among them, all placeholders in the contract template are extracted, the corresponding parameter value is queried for each placeholder, and the placeholder is replaced with the parameter value to generate a complete initial contract content.
[0076] Here, the contract parameter information entered by the user takes precedence over the default value of the dynamic variable placeholder.
[0077] For example, the contract template is: This contract stipulates that the purchase amount is {amount} yuan and the delivery date is {delivery_date}. The relevant guarantee is provided by {client_name}. The user input is: `{amount}`: 500000, `{delivery_date}`: 2024-12-01, `{client_name}`: ABC Company, and the system output is: This contract stipulates that the purchase amount is 500000 yuan, the delivery date is 2024-12-01, and the relevant guarantee is provided by ABC Company.
[0078] c: Detect whether the contract parameter value in the initial contract content triggers the preset rule conditions; if so, add the clause content corresponding to the rule conditions to the initial contract content to obtain the final contract content.
[0079] Here, it is detected whether the contract parameter values in the initial contract content trigger the preset rule conditions; if so, the clause content corresponding to the rule conditions is added to the initial contract content to obtain the final contract content.
[0080] Among them, the rule condition is to perform dynamic condition verification on the usage condition field corresponding to the contract module, and the usage condition field is the conditions field (such as "amount>1000000", the amount is greater than 1 million). Here, the dynamic condition verification is that if the amount is greater than 1 million, the guarantee clause content needs to be added. If the delivery date is earlier than the current date, the early delivery clause content needs to be added. If it is not satisfied, the clause content will not be added.
[0081] In a specific embodiment, the dynamic variable placeholders in the contract template are extracted, and the dynamic variable placeholders are replaced according to the determined parameter information to generate the initial contract content. The dynamic adjustment conditions are executed according to the Drools rule engine. The rule engine executes the dynamic adjustment conditions to check whether the contract parameter values meet the specific logic, and dynamically adjusts the contract content or adds clauses according to the conditions. Rule example: If the contract amount exceeds 1 million yuan, add a guarantee clause. If the delivery date is earlier than the current date, add an early delivery clause. The system initializes the rule engine and loads the rule file. Import the contract content and parameter values to match the rule conditions. If a rule is triggered, execute the corresponding action (such as adding clauses to the contract). The rules can dynamically modify the contract content to ensure that the content conforms to the business logic. For example, input conditions: the amount is 1.5 million yuan and the delivery date is December 2023. Trigger rule: the amount exceeds 1 million yuan, and the system adds a guarantee clause. The contract content is: This contract stipulates that the purchase amount is 1,500,000 yuan, the delivery date is 2023-12-01, and the guarantee clause: a guarantee is required when the contract amount exceeds 1 million yuan. It is understandable that the rule file can be relevant laws, regulations or corporate standards added by the user.
[0082] S103: Matching preset contract risk rules based on key element information in the contract content, and modifying the key element information that triggers the contract risk rules to determine the final contract content.
[0083] In this step, the preset contract risk rules are matched according to the key elements in the contract content, and the key elements that trigger the contract risk rules are corrected to determine the final contract content. This enables real-time detection of potential risk points in the contract. Correction suggestions are provided to ensure compliance of the contract text and improve users' real-time perception of contract risks and compliance.
[0084] Among them, the contract risk rules include the amount over-limit detection rule. The trigger condition is `amount>1000000`, which means that the amount exceeds 1 million yuan. It also provides users with specific risk correction measures (such as "Please add a guarantee clause to ensure transaction security").
[0085] In a possible implementation manner, the matching of preset contract risk rules based on key element information in the contract content and modifying the key element information that triggers the contract risk rules to determine the final contract content includes:
[0086] (1): The contract content is parsed based on natural language processing technology to determine key element information in the contract content that is related to the risk rules.
[0087] Here, natural language processing (NLP) technology is used to parse the contract content and identify key elements related to the rules from the text. Key element information includes amount, date, and customer name, and the extracted elements are mapped to specific fields (such as `amount` corresponding to the amount).
[0088] (2): Match the key element information with the risk rules one by one to determine whether the key element information triggers the risk rule.
[0089] Here, the key element information is matched with the risk rules one by one to determine whether the key element information triggers the risk rules. For example, if the amount exceeds 1 million yuan, the "amount limit detection rule" is triggered. If the delivery date is earlier than today, the "delivery date conflict rule" is triggered. If the customer name is empty, the "unspecified customer name detection rule" is triggered.
[0090] (3): If so, the key element information that triggers the risk rule is highlighted in the contract display interface, and the risk level of the key element information triggering the risk rule and the correction suggestions are displayed, so that the key element information that triggers the risk rule is corrected based on the correction suggestions until the corrected key element information meets the risk rule, and the final contract content is determined.
[0091] Here, the user modifies the contract content on the front end. After each modification, the latest contract text is submitted to the back end for re-analysis. The back end repeatedly extracts elements and matches rules until all risks are corrected and the final contract content is determined.
[0092] In the specific implementation example, the user uploads the contract content, extracts the key elements of the contract text, matches the risk rules in the contract, and determines whether the risk rules are triggered. If there is a risk, the risk level and correction suggestions are recorded. If there is no risk, it returns to normal status, passes the risk points and suggestions to the front end and highlights them. The user modifies the contract content and resubmits it, repeating the risk detection.
[0093] S104: Calculate the hash value of the final contract content, and store the final contract content and the first hash value of the final contract content in the blockchain.
[0094] In this step, the final contract content (such as text files, PDFs, etc.) and the hash value of the contract content are uploaded to the blockchain to ensure that the contract content cannot be tampered with.
[0095] Among them, when the contract content is uploaded and the hash value is generated, the hash value and the metadata of the contract content (such as contract ID, name, status) are sent to the blockchain network and stored through the smart contract. After successful storage, the transaction ID is returned as an operation certificate to ensure that each operation can be traced.
[0096] In a possible implementation manner, after calculating the hash value of the final contract content and storing the final contract content and the first hash value of the final contract content in the blockchain, the intelligent generation method further includes:
[0097] i: After receiving a request from the second user to modify the final contract content, it is detected based on a preset user authority table whether the second user has the authority to modify the final contract content.
[0098] Here, create a user_roles table to store user roles and their permission scopes. Each role contains a unique identifier (role_id), a role name (role_name), and the corresponding permission scope (permission_scope). The permission scope can use a text field to store multiple permission identifiers, such as JSON or comma-separated string format. The table also includes creation time and update time fields to record data changes. After the user logs in, the system loads their role and permission information from the database and stores this data in a cache (such as Redis) to reduce frequent database queries. Each time a user initiates an operation request, the system reads the user's permission information from the cache and verifies whether the requested operation is within its permission scope.
[0099] ii: If yes, the second user is allowed to modify the final contract content, and after the second user completes the operation, the operation-related log data is uploaded to the blockchain; if no, the second user is denied modification of the final contract content.
[0100] Here, if yes, the second user is allowed to modify the final contract content, and after the second user completes the operation, the log data related to the operation is uploaded to the blockchain; if no, the second user is denied modification of the final contract content.
[0101] Among them, after each user completes an operation, the system records the operation-related log data on the blockchain to ensure immutability and transparency. The log data includes user ID, operation type, timestamp, operation status (success or failure), and operation details (such as contract ID, etc.). The system writes the log to the blockchain network by calling the blockchain's smart contract. Specifically, the system calls the interface provided by the blockchain SDK, such as the Java SDK of Hyperledger Fabric. Through the smart contract, the log data is packaged into transactions and submitted to the blockchain. Each log data generates a unique transaction ID on the blockchain to facilitate subsequent audits or inquiries.
[0102] In this solution, when a user attempts to perform a sensitive operation (such as deleting a contract), the system does not perform the operation immediately, but instead generates an approval request. Approval requests are stored in an approval_requests table, which records information such as the initiator of the request, the type of operation, and the approval status (pending approval, approved, rejected). The system notifies the approver (or approval group) to process the request. Only after approval is passed will the system allow the sensitive operation to continue. The approval rules can be configured dynamically, for example: different approvers are set for different user roles or operation types. If the operation involves a large amount of money, multiple levels of approval are required. After the approval is completed, the system updates the status of the corresponding record in the approval_requests table.
[0103] In a possible implementation manner, after calculating the hash value of the final contract content and storing the final contract content and the first hash value of the final contract content in the blockchain, the intelligent generation method further includes:
[0104] After receiving the request from the first user to verify the final contract content, the second hash value of the final contract content is recalculated. It is detected whether the second hash value is consistent with the first hash value in the blockchain; if so, the final contract content is not modified, otherwise, the final contract content is modified.
[0105] Here, when the contract content needs to be verified, the hash value of the contract content is recalculated and compared with the hash value stored in the blockchain. If the two are consistent, it means that the contract has not been tampered with; otherwise, it means that the contract may have been tampered with.
[0106] Among them, when the contract is signed, the status of the contract in the blockchain is updated to "signed". After the contract is archived, the status of the contract in the blockchain is updated and all historical operations can be traced.
[0107] In a specific embodiment, the user uploads the final contract content, calculates the hash value of the final contract content, stores the contract content and hash value in the database, stores the hash value and metadata of the contract in the blockchain, and verifies whether the new hash value of the contract is consistent with the hash value stored in the blockchain data. If they are consistent, the contract has not been tampered with. If they are inconsistent, the contract has been tampered with. When the user signs the contract, the status of the contract in the blockchain is updated to "signed". When the contract is archived, the status of the contract in the blockchain is updated to "archived". It can be understood that each modification, signing and archiving operation of the contract will generate a blockchain transaction, which is stored in the blockchain ledger. These transaction records are immutable, so the history of any contract operation can be traced back.
[0108] For further information, see Figure 2 , Figure 2 A schematic diagram of an intelligent contract generation method provided in an embodiment of the present application. Figure 2 As shown in the figure, step 1: construct a contract template; step 2: parameterize the contract template based on the contract parameter information to generate the contract content; step 3: perform intelligent risk warning and compliance check on the contract content to determine the final contract content; step 4: store and verify the final contract content and the corresponding hash value on the blockchain; step 5: after receiving the user's request to modify the final contract content, verify whether the user has the authority.
[0109] This application has the following beneficial effects: 1. Strong flexibility: The contract template is split according to functional modules, and users can freely combine and replace modules to meet the changing business scenario requirements without programming. Support dynamic adjustment of template fields (such as amount, date, terms, etc.), adapt to personalized needs, and reduce duplication of work. 2. Improve efficiency and reduce costs: Through the graphical interface, non-technical personnel can complete the creation, modification and release of templates, greatly shortening the template development cycle. Compliance verification is completed automatically, without the need to manually compare the terms one by one, improving review efficiency and reducing labor costs. 3. Intelligent support: Based on NLP and rule engines, the system can identify potential legal and commercial risks in contracts, provide modification suggestions, and reduce risk hazards. Combined with data analysis and machine learning, the system can optimize template design based on historical contracts and user preferences to improve the professionalism and practicality of templates. 4. Compliance guarantee: The system's built-in regulatory library automatically verifies whether the contract terms meet the latest legal requirements to avoid non-compliance risks. Dynamically update the rule library to flexibly respond to changes in industry and regional regulations. 5. High data security: Contract templates and operation records are stored in the blockchain to ensure data tamper-proof and high credibility. Strict hierarchical permission control ensures the security of template editing, review, and publishing, and prevents sensitive data leakage.
[0110] The embodiment of the present application provides a method for intelligently generating a contract, the intelligent generation comprising: sorting and splicing multiple contract modules selected by the first user in the contract template management interface in sequence to generate a contract template customized by the first user; dynamically adjusting the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate the contract content; matching the preset contract risk rules based on the key element information in the contract content, and correcting the key element information that triggers the contract risk rules to determine the final contract content; calculating the hash value of the final contract content, and storing the final contract content and the first hash value of the final contract content in the blockchain. Rapid generation, personalized customization, real-time risk warnings and compliance checks of contract templates are realized, and the intelligent level and security of contract management are improved.
[0111] See also Figure 3 , Figure 4 , Figure 3 One of the structural schematic diagrams of an intelligent contract generation device provided in an embodiment of the present application; Figure 4 This is a second structural diagram of an intelligent contract generation device provided in an embodiment of the present application. Figure 3 As shown in , the intelligent generation device 300 includes:
[0112] The template setting module 310 is used to sequentially sort and splice multiple contract modules selected by the first user in the contract template management interface to generate a contract template customized by the first user;
[0113] A contract parameter configuration module 320, configured to dynamically adjust the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate contract content;
[0114] A compliance checking module 330 is used to match preset contract risk rules based on key element information in the contract content, and to modify the key element information that triggers the contract risk rule to determine the final contract content;
[0115] The blockchain storage module 340 is used to calculate the hash value of the final contract content and store the final contract content and the first hash value of the final contract content in the blockchain.
[0116] Further, such as Figure 4 As shown, the blockchain storage module 340 is also used for:
[0117] After receiving the request from the first user to verify the final contract content, recalculate the second hash value of the final contract content;
[0118] Detecting whether the second hash value is consistent with the first hash value in the blockchain;
[0119] If yes, the final contract content is not modified; if no, the final contract content is modified.
[0120] Furthermore, the template setting module 310 is used to sequentially sort and splice the multiple contract modules selected by the first user in the contract template management interface to generate a contract template customized by the first user:
[0121] In response to the first user dragging a plurality of contract modules on the contract template management interface, storing the arrangement order of each of the contract modules in a front-end state;
[0122] The contract modules are spliced together in real time based on the arrangement order, and the spliced contract modules are previewed in the display area, so that the contract template is generated according to the spliced contract template.
[0123] Furthermore, the contract parameter configuration module 320 is used to dynamically adjust the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate contract content:
[0124] Determining a dynamic variable parameter configuration table corresponding to the dynamic variable placeholder in a database;
[0125] For the dynamic variable placeholder, detect whether the contract parameter information contains parameter information of the dynamic variable placeholder, if yes, replace the dynamic variable placeholder based on the parameter information, if no, replace the dynamic variable placeholder based on the default value of the dynamic variable placeholder in the dynamic variable parameter configuration table, and generate the initial contract content;
[0126] Detecting whether the contract parameter value in the initial contract content triggers a preset rule condition;
[0127] If so, add the clauses corresponding to the rules and conditions to the initial contract content to obtain the final contract content.
[0128] Furthermore, the compliance checking module 330 is used to match the preset contract risk rules based on the key element information in the contract content, and to modify the key element information that triggers the contract risk rules to determine the final contract content:
[0129] Parsing the contract content based on natural language processing technology to determine key element information related to the risk rules in the contract content;
[0130] Matching the key element information with the risk rules one by one to determine whether the key element information triggers the risk rule;
[0131] If so, the key element information that triggers the risk rule will be highlighted in the contract display interface, and the risk level and correction suggestions of the key element information triggering the risk rule will be displayed, so that the key element information that triggers the risk rule can be corrected based on the correction suggestions until the corrected key element information meets the risk rule, and the final contract content can be determined.
[0132] Further, such as Figure 4 As shown, the intelligent generation device 300 further includes an authority verification module 350, and the authority verification module 350 is used to:
[0133] After receiving a request from the second user to modify the final contract content, detecting whether the second user has the authority to modify the final contract content based on a preset user authority table;
[0134] If yes, the second user is allowed to modify the final contract content, and after the second user completes the operation, the log data related to the operation is uploaded to the blockchain;
[0135] If not, the second user's modification of the final contract content will be rejected.
[0136] Furthermore, the template setting module 310 is also used for:
[0137] The contract module in the contract template is updated, the contract content is generated based on the updated contract template, and the update record of the contract template is stored.
[0138] The embodiment of the present application provides an intelligent generation device for a contract, the intelligent generation device includes: a template setting module, which is used to sort and splice multiple contract modules selected by a first user in a contract template management interface in sequence to generate a contract template customized by the first user; a contract parameter configuration module, which is used to dynamically adjust the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate the contract content; a compliance check module, which is used to match the preset contract risk rules based on the key element information in the contract content, and to correct the key element information that triggers the contract risk rules to determine the final contract content; a blockchain storage module, which is used to calculate the hash value of the final contract content, and store the final contract content and the first hash value of the final contract content in the blockchain. Rapid generation, personalized customization, real-time risk warnings and compliance checks of contract templates are realized, and the intelligence level and security of contract management are improved.
[0139] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .
[0140] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the above-mentioned Figure 1 as well as Figure 2 The specific implementation of the steps of intelligently generating the contract in the method embodiment shown can be found in the method embodiment, and will not be repeated here.
[0141] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 as well as Figure 2 The specific implementation of the steps of intelligently generating the contract in the method embodiment shown can be found in the method embodiment, and will not be repeated here.
[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0143] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0145] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0146] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0147] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A smart contract generation method, characterized in that: The intelligent generation method comprises: Based on the multiple contract modules selected by the first user in the contract template management interface, sequentially sorting and splicing are performed to generate a contract template customized by the first user; Dynamically adjusting the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate contract content; Based on the key element information in the contract content, the preset contract risk rules are matched, and the key element information that triggers the contract risk rules is modified to determine the final contract content; The hash value of the final contract content is calculated, and the final contract content and the first hash value of the final contract content are stored in the blockchain.
2. The intelligent generation method according to claim 1, characterized in that: After calculating the hash value of the final contract content and storing the final contract content and the first hash value of the final contract content in the blockchain, the intelligent generation method further includes: After receiving the request from the first user to verify the final contract content, recalculate the second hash value of the final contract content; Detecting whether the second hash value is consistent with the first hash value in the blockchain; If yes, the final contract content is not modified; if no, the final contract content is modified.
3. The intelligent generation method according to claim 1, characterized in that: The step of sequentially sorting and splicing the multiple contract modules selected by the first user in the contract template management interface to generate a contract template customized by the first user includes: In response to the first user dragging a plurality of contract modules on the contract template management interface, storing the arrangement order of each of the contract modules in a front-end state; The contract modules are spliced together in real time based on the arrangement order, and the spliced contract modules are previewed in the display area, so that the contract template is generated according to the spliced contract template.
4. The intelligent generation method according to claim 1, characterized in that: The dynamically adjusting the contract template based on the dynamic variable placeholders and the contract parameter information in the contract template to generate the contract content includes: Determining a dynamic variable parameter configuration table corresponding to the dynamic variable placeholder in a database; For the dynamic variable placeholder, detect whether the contract parameter information contains parameter information of the dynamic variable placeholder, if yes, replace the dynamic variable placeholder based on the parameter information, if no, replace the dynamic variable placeholder based on the default value of the dynamic variable placeholder in the dynamic variable parameter configuration table, and generate the initial contract content; Detecting whether the contract parameter value in the initial contract content triggers a preset rule condition; If so, add the clauses corresponding to the rules and conditions to the initial contract content to obtain the final contract content.
5. The intelligent generation method according to claim 1, characterized in that: The key element information in the contract content is matched with the preset contract risk rules, and the key element information that triggers the contract risk rules is modified to determine the final contract content, including: Parsing the contract content based on natural language processing technology to determine key element information related to the risk rules in the contract content; Matching the key element information with the risk rules one by one to determine whether the key element information triggers the risk rule; If so, the key element information that triggers the risk rule will be highlighted in the contract display interface, and the risk level and correction suggestions of the key element information triggering the risk rule will be displayed, so that the key element information that triggers the risk rule can be corrected based on the correction suggestions until the corrected key element information meets the risk rule, and the final contract content can be determined.
6. The intelligent generation method according to claim 1, characterized in that: After calculating the hash value of the final contract content and storing the final contract content and the first hash value of the final contract content in the blockchain, the intelligent generation method further includes: After receiving a request from the second user to modify the final contract content, detecting whether the second user has the authority to modify the final contract content based on a preset user authority table; If yes, the second user is allowed to modify the final contract content, and after the second user completes the operation, the log data related to the operation is uploaded to the blockchain; If not, the second user's modification of the final contract content will be rejected.
7. The intelligent generation method according to claim 1, characterized in that: After sequentially performing sorting, splicing, and dynamic condition verification processing on the multiple contract modules selected by the first user in the contract template management interface to generate the first user-defined contract template, the intelligent generation method further includes: The contract module in the contract template is updated, the contract content is generated based on the updated contract template, and the update record of the contract template is stored.
8. An intelligent contract generation device, characterized in that: The intelligent generation device comprises: A template setting module, used to sequentially sort and splice multiple contract modules selected by a first user in a contract template management interface to generate a contract template customized by the first user; A contract parameter configuration module, used to dynamically adjust the contract template based on the dynamic variable placeholders and contract parameter information in the contract template to generate contract content; A compliance checking module, which is used to match preset contract risk rules based on key element information in the contract content, and to modify the key element information that triggers the contract risk rules to determine the final contract content; The blockchain storage module is used to calculate the hash value of the final contract content and store the final contract content and the first hash value of the final contract content in the blockchain.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the intelligent contract generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the intelligent contract generation method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Blockchain-based electronic contract evidence storage method
CN110287732A
Contract text automatic generation method and device
CN112115107A
Electronic contract generation method and system based on dynamic matching
CN113379306A
Dynamic contract signing method and device, equipment and medium
CN113705185A
Contract agreement generation system and method
CN117574870A