Intelligent contract template generation method and device and medium
By collecting data from multiple sources and constructing a cross-domain knowledge graph using graph neural networks, clauses are dynamically matched and verified in real time. This solves the problems of low template reuse rate and low scenario adaptability in existing technologies, and realizes efficient and compliant intelligent contract template generation.
Patent Information
- Application Number
- CN202511060494.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-11-11
AI Technical Summary
Existing contract template generation technologies suffer from low template reuse rates and poor scenario adaptability. They are unable to automatically adjust terms based on parameters such as transaction amount, risk rating of participating parties, and regional regulations, resulting in low efficiency and a high susceptibility to errors.
Multi-source structured data units are constructed using multi-source data acquisition technology. A cross-domain knowledge graph is generated using graph neural networks. A DRL clause combination optimization algorithm is used to dynamically match clauses. The legality is verified through the cross-domain knowledge graph, and a smart contract template is generated.
It improved template reuse rate, enhanced scenario adaptability, ensured that the generated contract templates were 100% compliant, and improved data integration efficiency and compliance.
Smart Images

Figure CN120930623A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and in particular to a method, device and medium for generating smart contract templates. Background Technology
[0002] In the process of enterprise digital transformation, contract management, as a core module of ERP system, is a key link in enterprise compliance operation and risk control.
[0003] Existing contract template generation technologies have long relied on human experience and static rule bases, resulting in a single source of template data. Key information such as legal texts, historical corporate contracts, and industry standards are scattered and independent, forming data silos. Furthermore, updates require manual modification of each template, leading to inefficiency, a high risk of omissions, and insufficient template reuse. In terms of scenario adaptation, existing solutions rely on predefined rules. When facing complex business scenarios (such as cross-border transactions and high-risk collaborations), they cannot automatically adjust terms based on parameters such as transaction amount, risk ratings of participating parties, and regional regulations. This process is time-consuming and error-prone, resulting in low scenario adaptability. Summary of the Invention
[0004] This application provides a method, device, and medium for generating smart contract templates, which addresses the problems of low template reuse rate and low scenario adaptability in existing template generation technologies.
[0005] The embodiments of this application adopt the following technical solutions:
[0006] On one hand, embodiments of this application provide a method for generating intelligent contract templates. This method includes: collecting data from a legal text database, a corporate historical contract database, an industry standard database, and real-time external data streams using multi-source data acquisition technology to obtain multi-source structured data units; mapping nodes and semantically associating the multi-source structured data units using a graph neural network to generate a cross-domain knowledge graph; converting input template scenario parameters into template feature vectors using a scenario parameter parser; determining template-suitable clauses in a candidate clause pool based on the cross-domain knowledge graph and the template feature vectors to obtain an initial contract template; and verifying the legality of the initial contract template using the cross-domain knowledge graph to determine the final contract template.
[0007] In one example, multi-source data acquisition technology is used to collect data from legal text databases, enterprise historical contract databases, industry standard databases, and real-time external data streams to obtain multi-source structured data units. Specifically, this includes: collecting legal entities and legal relationships from the legal text database through targeted web crawling to identify them as legal structured data; extracting high-frequency clause structures and risk tags from the enterprise historical contract database using NLP technology to identify them as enterprise structured data; collecting industry standard templates from the industry standard database through API interfaces and parsing the industry standard templates into industry characteristic data; and integrating the legal structured data, enterprise structured data, industry characteristic data, and external data streams to obtain multi-source structured data units.
[0008] In one example, a cross-domain knowledge graph is generated by mapping nodes and semantically associating them with the multi-source structured data units using a graph neural network. Specifically, this includes: mapping legal structured data, enterprise structured data, and industry feature data from the multi-source structured data units to graph nodes using a graph neural network; calculating the node weights of the graph nodes using an attention mechanism; constructing node subgraphs for legal structured data, enterprise structured data, and industry feature data respectively using a hierarchical graph attention network based on the node weights; and semantically associating the node subgraphs with preset legal-enterprise and enterprise-industry association edges to generate the cross-domain knowledge graph.
[0009] In one example, based on the cross-domain knowledge graph and the template feature vector, template-fitting clauses are determined from the candidate clause pool to obtain an initial contract template. Specifically, this includes: extracting scene tags and quantification parameters from the template feature vector using a clause injector; iteratively optimizing clause combinations in the candidate clause pool using a pre-defined DRL clause combination optimization algorithm based on the scene tags, quantification parameters, and node weights in the knowledge graph to determine template-fitting clauses; wherein the DRL clause combination optimization algorithm uses scene tags and quantification parameters as the state space, clause selection actions as the policy space, and compliance scores and user satisfaction as reward functions, and iteratively optimizes using Q-learning; and converting the template-fitting clauses according to a pre-defined contract logic structure to obtain the initial contract template.
[0010] In one example, the initial contract template is validated for legality using the cross-domain knowledge graph to determine the final contract template. Specifically, this includes: validating the initial contract template based on the legal layer nodes in the cross-domain knowledge graph; if no clause conflict is detected, the initial contract template is determined as the final contract template; if a clause conflict is detected, it is checked whether multiple alternative adaptable clauses exist in the cross-domain knowledge graph; if only a single alternative adaptable clause exists, the conflicting clause is replaced with the adaptable clause, and the replaced initial contract template is determined as the final contract template; if multiple alternative adaptable clauses exist, based on the clause reuse rate in conflict clause scenarios in historical contracts, the conflicting clause is replaced with the adaptable clause with the highest reuse rate, and the replaced initial contract template is determined as the final contract template.
[0011] In one example, the method also includes: if no template-fitting clause can be matched from the candidate clause pool, generating a no-match clause instruction and sending it to the client; recording the scenario label and quantization parameters corresponding to the unmatched situation to update the training set and candidate clause pool of the DRL clause combination optimization algorithm.
[0012] In one example, after determining template-fitting clauses in the candidate clause pool based on the cross-domain knowledge graph and the template feature vector to obtain an initial contract template, the method further includes: converting drag-and-drop interaction into a flowchart interface using visualization technology; converting the flowchart interface into clause dependencies based on preset contract execution logic; and injecting the clause dependencies into the initial contract template.
[0013] In one example, after verifying the legality of the initial contract template through the cross-domain knowledge graph to determine the final contract template, the method further includes: storing the scenario parameters, clause selection logic, and compliance verification record data from the final contract template generation process on the blockchain through a preset smart contract.
[0014] On the other hand, embodiments of this application provide a smart contract template generation device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the above-mentioned smart contract template generation methods.
[0015] On the other hand, embodiments of this application provide a non-volatile computer storage medium for generating smart contract templates, which stores computer-executable instructions that can execute any of the above-mentioned smart contract template generation methods.
[0016] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:
[0017] This application constructs a three-layer data source—legal, enterprise, and industry—and employs a graph neural network to build a cross-domain knowledge graph. This enables semantic fusion of legal clauses, historical contracts, and industry standards, eliminating data silos in existing technologies, improving data integration efficiency, and significantly increasing template reusability. Secondly, based on user-input parameters such as contract type, transaction amount, and participating method domain, this application dynamically generates an engine that automatically matches the clause pool and injects suitable clauses, greatly improving the template's adaptability to different scenarios. Finally, by calling the legal knowledge graph in real time to verify template clauses, automatic correction is triggered if conflicts are detected, ensuring that the generated template is 100% compliant. This guarantees the compliance of the contract templates generated by this application. Attached Figure Description
[0018] To more clearly illustrate the technical solution of this application, some embodiments of this application will be described in detail below with reference to the accompanying drawings, in which:
[0019] Figure 1 A flowchart illustrating a smart contract template generation method provided in this application embodiment;
[0020] Figure 2 A schematic diagram of the execution structure of a smart contract template generation method provided in an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of the structure of an intelligent contract template generation device provided in an embodiment of this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] Some embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0024] Figure 1 This is a flowchart illustrating a smart contract template generation method provided in this application. This method can be applied to different business domains. Certain input parameters or intermediate results in this process can be manually adjusted to help improve accuracy.
[0025] The analysis method involved in the embodiments of this application can be implemented by a terminal device or a server, and this application does not impose any special limitations on it. For ease of understanding and description, the following embodiments are all described in detail using a controller as an example.
[0026] Based on this Figure 1 The process may include the following steps:
[0027] S101: Collect data from legal text databases, enterprise historical contract databases, industry standard databases, and real-time external data streams to obtain multi-source structured data units.
[0028] In some embodiments of this application, the data sources for generating smart contract templates consist of a legal text library, an enterprise historical contract library, an industry standard library, and real-time external data streams (such as public opinion monitoring).
[0029] First, this application employs multi-source data acquisition technology to collect data from legal text libraries, enterprise historical contract libraries, industry standard libraries, and real-time external data streams. Specifically, it uses targeted web crawling to collect legal entities (such as maximum penalties for breach of contract and cross-border data requirements) and legal relationships from the legal text library, identifying them as structured legal data. Simultaneously, it uses NLP technology to deconstruct enterprise historical contracts, extracting high-frequency clause structures (such as payment method-installment ratio-breach liability chain relationships) and risk tags (such as highly controversial clauses) from the enterprise historical contract library, identifying them as structured enterprise data. Furthermore, it collects industry standard templates from the industry standard library through API interfaces and parses these templates into industry-specific data. During the real-time external data stream acquisition process, dynamic data updates are achieved through scheduled tasks, with the update frequency pre-set according to the data type.
[0030] Furthermore, legal structured data, enterprise structured data, industry characteristic data, and external data streams are integrated to obtain multi-source structured data units.
[0031] S102: Node mapping and semantic association are performed on the multi-source structured data units using a graph neural network to generate a cross-domain knowledge graph.
[0032] In some embodiments of this application, after integrating data from various data sources to determine multi-source structured data units, a graph neural network is used to map legal structured data, enterprise structured data, and industry feature data from these units into graph nodes. Then, an attention mechanism is used to calculate node weights (such as legal clause node weights and enterprise practice node weights). Further, based on these node weights, a hierarchical graph attention network is used to construct node subgraphs for legal structured data, enterprise structured data, and industry feature data, respectively. These subgraphs interact through pre-defined legal-enterprise and enterprise-industry association edges, generating a cross-domain knowledge graph. Node embedding is initialized using a BERT pre-trained model.
[0033] It should be noted that when calculating node weights through the attention mechanism, for special scenarios such as cross-border contracts and high-risk transactions, the weights of legal layer nodes are weighted and increased, with the weighting factor being a custom multiple (such as 1.2-1.5 times).
[0034] By constructing a three-layer data source consisting of legal, enterprise, and industry layers, and using graph neural networks to build a cross-domain knowledge graph, the semantic integration of legal clauses, historical contracts, and industry standards is achieved. This eliminates the data silos of existing technologies, improves data integration efficiency, and greatly enhances template reuse rate.
[0035] S103: The template scene parameters uploaded by the client are converted into template feature vectors through the scene parameter parser; the template scene parameters include contract type, transaction amount, participation method domain and business scenario.
[0036] In some embodiments of this application, the system receives parameters such as contract type, transaction amount, participation method domain, and business scenario (e.g., cross-border transaction, high-risk transaction) from the user via the client. Each template scenario parameter is then parsed into a machine-recognizable feature vector by a scenario parameter parser. This feature vector includes scenario type labels (e.g., cross-border label, high-risk label) and quantitative parameters (e.g., transaction amount value). This feature vector is used to drive the dynamic selection of subsequent terms.
[0037] It should be noted that scene parameter parsing also includes receiving unstructured requirements input by users through voice and images, and converting these unstructured requirements into structured metadata through voice recognition (ASR) and semantic understanding (NLU) technologies.
[0038] S104: Based on the cross-domain knowledge graph and the template feature vector, determine the template-matching clauses in the candidate clause pool to obtain the initial contract template.
[0039] In some embodiments of this application, in order to obtain an initial contract template, firstly, the clause injector, based on the scenario labels and quantification parameters in the feature vector and combined with the node weights in the knowledge graph (such as prioritizing the activation of GDPR compliance clause nodes in cross-border scenarios), iteratively optimizes the clause combination in the candidate clause pool through a preset DRL clause combination optimization algorithm, so as to dynamically determine the appropriate clauses from the candidate clause pool (such as automatically matching the performance bond clause when the transaction amount is > 10 million yuan). Then, according to the preset contract logic structure, the template-adaptive clauses are formatted to obtain the initial contract template.
[0040] It should be noted that, in order to improve the scenario adaptability of the template, the preset DRL clause combination optimization algorithm uses scenario labels and quantitative parameters as the state space, clause selection actions as the strategy space, and compliance scores and user satisfaction as reward functions, and iteratively optimizes through Q-learning; for example, in the scenario of "high-risk supply chain contract", the algorithm prioritizes clauses such as "double quality inspection" and "tiered penalty for breach of contract", which reduces the template risk score by 35%.
[0041] It should also be noted that if no template-matching clause can be found from the candidate clause pool, a no-match clause instruction will be generated and sent to the client to notify the client to review it.
[0042] Furthermore, the scene labels and quantization parameters of the unmatched cases are recorded, and the recorded scene labels and quantization parameters are sent to the DRL clause combination optimization algorithm training set to update the DRL clause combination optimization algorithm training set and the candidate clause pool.
[0043] Furthermore, after obtaining the initial contract template, this application also uses visualization technology to transform the drag-and-drop interaction into a flowchart interface, and automatically converts the flowchart interface into clause dependencies and injects the clause dependencies into the initial contract template according to the preset contract execution logic.
[0044] By dynamically generating the engine based on parameters such as contract type, transaction amount, and participation method domain input by the user, the engine automatically matches the clause pool and injects suitable clauses, greatly improving the template's adaptability to different scenarios.
[0045] S105: The initial contract template is validated using the cross-domain knowledge graph to determine the final contract template.
[0046] In some embodiments of this application, after obtaining the initial contract template, it is necessary to verify the legality of the initial contract template based on the legal layer nodes in the cross-domain knowledge graph.
[0047] During the verification process, if no clause conflict is detected, the initial contract template will be directly determined as the final contract template. If a clause conflict is detected, the system will further check whether there are multiple alternative and adaptable clauses in the cross-domain knowledge graph.
[0048] If only a single alternative adaptable clause is detected, the conflicting clause is replaced with the adaptable clause, and the replaced initial contract template is determined as the final contract template. If multiple alternative adaptable clauses exist, based on the clause reuse rate in conflicting clause scenarios in historical contracts, the conflicting clause is replaced with the adaptable clause with the highest reuse rate, and the replaced initial contract template is determined as the final contract template.
[0049] Furthermore, the scenario parameters, clause selection logic, and compliance verification record data generated during the process of generating the final contract template are stored on the blockchain via a pre-set smart contract. This ensures that the operation is tamper-proof and supports tracing historical version differences and one-click rollback.
[0050] By calling a legal knowledge graph to verify the template clauses in real time, automatic correction is triggered if a conflict is detected, ensuring that the generated template is 100% compliant. This guarantees the compliance of the contract template generated in this application.
[0051] It should be noted that, although the embodiments in this application are based on... Figure 1 Steps S101 to S105 will be described sequentially, but this does not mean that steps S101 and S105 must be performed in a strict order. The reason this embodiment follows this order is... Figure 1 The order in which steps S101 to S105 are described is provided to facilitate understanding of the technical solutions of the embodiments of this application by those skilled in the art. In other words, in the embodiments of this application, the order of steps S101 to S105 can be appropriately adjusted according to actual needs.
[0052] pass Figure 1 This application employs a three-layer data source structure—legal, enterprise, and industry—and utilizes a graph neural network to establish a cross-domain knowledge graph. This enables semantic fusion of legal clauses, historical contracts, and industry standards, eliminating data silos found in existing technologies, improving data integration efficiency, and significantly increasing template reusability. Secondly, based on user-input parameters such as contract type, transaction amount, and participating method domain, the application dynamically generates an engine that automatically matches the clause pool and injects suitable clauses, greatly enhancing the template's adaptability to different scenarios. Finally, by calling the legal knowledge graph in real-time to verify template clauses, automatic correction is triggered if conflicts are detected, ensuring that the generated template is 100% compliant. This guarantees the compliance of the contract templates generated by this application.
[0053] Figure 2This is a schematic diagram of the execution structure of a smart contract template generation method provided in an embodiment of this application.
[0054] exist Figure 2 The document showcases the entire execution structure of this application, including the legal layer, enterprise layer, industry layer data source, data fusion and processing engine, and dynamic generation engine; the dynamic generation engine further includes a scenario parameter parser, a clause dynamic injector, a compliance real-time validator, and a template output module.
[0055] Figure 3 A schematic diagram of a smart contract template generation device provided in this application embodiment includes:
[0056] At least one processor; and,
[0057] A memory that is communicatively connected to at least one processor; wherein,
[0058] A method for generating a smart contract template, wherein the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable at least one processor to perform any of the above.
[0059] Some embodiments of this application provide a non-volatile computer storage medium for generating smart contract templates, which stores computer-executable instructions capable of executing any of the above-described smart contract template generation methods.
[0060] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0061] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0062] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0063] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0064] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0065] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0066] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0067] Memory may include non-persistent storage in computer-readable media, random access memory (RAM), and non-volatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0068] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0069] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0070] The above are merely embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the technical principles of this application should fall within the protection scope of this application.
Claims
1. A method for generating smart contract templates, characterized in that, The method includes: Multi-source data collection is performed from legal text databases, enterprise historical contract databases, industry standard databases, and real-time external data streams to obtain multi-source structured data units; A cross-domain knowledge graph is generated by mapping nodes and semantically associating them with the multi-source structured data units using a graph neural network. The scene parameter parser converts the template scene parameters uploaded by the client into a template feature vector; the template scene parameters include contract type, transaction amount, participation method domain, and business scenario. Based on the cross-domain knowledge graph and the template feature vector, template-fitting clauses are determined from the candidate clause pool to obtain an initial contract template; The initial contract template is validated using the cross-domain knowledge graph to determine the final contract template.
2. The method according to claim 1, characterized in that, The process of collecting data from multiple sources, including legal text databases, enterprise historical contract databases, industry standard databases, and real-time external data streams, yields multi-source structured data units, specifically including: Legal entities and legal relationships are collected from a legal text database through targeted web crawling and identified as structured legal data. The structure of high-frequency clauses and risk tags in the enterprise's historical contract database are extracted using NLP technology and identified as the enterprise's structured data. The industry standard templates in the industry standard library are collected through the API interface, and the industry standard templates are parsed into industry characteristic data. The legal structured data, enterprise structured data, industry characteristic data, and external data streams are integrated to obtain multi-source structured data units.
3. The method according to claim 1, characterized in that, The step of generating a cross-domain knowledge graph by mapping nodes and semantically associating them with graph neural networks from the multi-source structured data units specifically includes: Graph neural networks are used to map legal structured data, enterprise structured data, and industry characteristic data from multi-source structured data units into graph nodes. The node weights of the graph nodes are calculated using an attention mechanism; Based on the node weights, node subgraphs for legal structured data, enterprise structured data, and industry characteristic data are constructed respectively using a hierarchical graph attention network. By semantically associating the node subgraphs with preset law-enterprise association edges and enterprise-industry association edges, a cross-domain knowledge graph is generated.
4. The method according to claim 1, characterized in that, The step of determining template-suitable clauses from the candidate clause pool based on the cross-domain knowledge graph and the template feature vector to obtain an initial contract template specifically includes: The scene label and quantization parameters are extracted from the template feature vector using the clause injector. Based on the scenario tags, quantitative parameters, and node weights in the knowledge graph, a preset DRL clause combination optimization algorithm iteratively optimizes clause combinations in the candidate clause pool to determine template-suitable clauses. The DRL clause combination optimization algorithm uses scenario tags and quantitative parameters as the state space, clause selection actions as the strategy space, compliance scores and user satisfaction as reward functions, and iteratively optimizes through Q-learning. Based on the preset contract logic structure, the template adaptation clauses are formatted to obtain the initial contract template.
5. The method according to claim 1, characterized in that, The step of verifying the legality of the initial contract template using the cross-domain knowledge graph to determine the final contract template specifically includes: The initial contract template is validated for legality based on the legal layer nodes in the cross-domain knowledge graph. If no clause conflicts are detected, the initial contract template is determined as the final contract template. If a clause conflict is detected, it is checked whether there are multiple alternative and adaptable clauses in the cross-domain knowledge graph; If there is only a single alternative adaptable clause, replace the conflicting clause with the adaptable clause, and determine the replaced initial contract template as the final contract template; If multiple alternative adaptable clauses exist, the conflicting clauses are replaced with the adaptable clauses with the highest reuse rate in conflicting clause scenarios in historical contracts, and the initial contract template after replacement is determined as the final contract template.
6. The method according to claim 4, characterized in that, The method further includes: If no template-matching clause can be found from the candidate clause pool, a no-match clause instruction is generated and sent to the client. Record the scene labels and quantization parameters corresponding to the unmatched cases to update the training set and candidate clause pool of the DRL clause combination optimization algorithm.
7. The method according to claim 1, characterized in that, After determining template-fitting clauses from the candidate clause pool based on the cross-domain knowledge graph and the template feature vector to obtain an initial contract template, the method further includes: Visualization technology is used to transform drag-and-drop interactions into flowchart interfaces; Based on the preset contract execution logic, the flowchart interface is converted into a clause dependency relationship, and the clause dependency relationship is injected into the initial contract template.
8. The method according to claim 1, characterized in that, After verifying the legality of the initial contract template using the cross-domain knowledge graph to determine the final contract template, the method further includes: The scenario parameters, clause selection logic, and compliance verification record data generated during the final contract template generation process are stored on the blockchain through a preset smart contract.
9. A smart contract template generation device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a smart contract template generation method according to any one of claims 1-8.
10. A smart contract template generation and storage medium, storing computer-executable instructions, characterized in that, The computer-executable instructions are capable of executing the smart contract template generation method according to any one of claims 1-8.