Electronic contract generation method and device, electronic equipment and computer storage medium
By adjusting the contract template, the problem of the inability to flexibly configure contract templates in the prior art is solved, and the efficiency and flexibility of electronic contract generation are improved.
Patent Information
- Application Number
- CN202411556115.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-14
AI Technical Summary
In the existing electronic contract generation methods, fixed-format contract templates cannot be flexibly configured according to actual business needs, resulting in inefficiency.
By calling the initial contract template based on the contract type, adjusting the template according to user needs, legal terms and corporate standards, generating a form that needs to be filled in by all parties, and synthesizing the filled-in content into the final electronic contract.
It improves the flexibility and efficiency of contract template configuration, and reduces the time for users to search and fill in information page by page in a large number of contract texts.
Smart Images

Figure CN119443074A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an electronic contract generation method, device, electronic equipment and computer storage medium. Background Art
[0002] An electronic contract refers to a contract concluded through electronic means. Compared with traditional paper contracts, electronic contracts have many advantages, such as improving efficiency, reducing costs and being environmentally friendly.
[0003] In the prior art, some pre-configured industry standard contract templates are mainly sent to users for filling out. However, in actual applications, due to different business needs, different corporate standards, etc., the specific requirements of each contract are different. The fixed format contract template cannot meet the actual business needs. When signing a contract, if the contract text has many pages, the user needs to fill in each page, which is inefficient. Summary of the invention
[0004] In view of this, an object of the present invention is to provide an electronic contract generation method, device, electronic device and computer storage medium to improve the flexibility and efficiency of contract configuration.
[0005] In a first aspect, a method for generating an electronic contract is provided, the method comprising:
[0006] Based on the contract type, an initial contract template corresponding to the contract type is called; the contract type includes at least one of: sales contract, labor contract, and service agreement;
[0007] In response to a user's adjustment request for the initial contract template, obtaining the adjustment requirements input by the user, and adjusting the initial contract template based on the adjustment requirements, industry-related legal terms and corporate standards;
[0008] Generate forms that need to be filled in by all parties based on the adjusted contract template;
[0009] In response to the user's filling operation, the form content filled in by the user is obtained, and the form content is added to the adjusted contract template to synthesize the final electronic contract.
[0010] Optionally, the format of the initial contract template is a word format; adjusting the initial contract template based on the adjustment requirements, industry-related legal terms and corporate standards includes:
[0011] Convert the word characters in the initial contract template into HTML strings to obtain the initial contract template consisting of HTML pages;
[0012] Render the HTML page through iframe to present the HTML page in the front-end interface;
[0013] Adjust the contentEditable property in the rendered HTML page to true to convert the initial contract template from static to editable;
[0014] Adjust the clauses, formats and input items in the editable contract according to the adjustment requirements, industry-related legal clauses and corporate standards. The adjustment operation includes at least one of the following: adding, deleting and modifying.
[0015] Optionally, the method further comprises:
[0016] When the adjustment operation is to add, the characters to be added are escaped based on the preset escape rule library.
[0017] Optionally, the method further comprises:
[0018] The adjustment operation of the editable initial contract template is subject to security verification, which at least includes input verification and abnormal operation verification, wherein the input verification is to filter the added data based on the preset HTML whitelist; the abnormal operation verification is to detect abnormal behavior in the adjustment operation.
[0019] Optionally, the forms generated based on the adjusted contract template that need to be filled in by the parties include:
[0020] Configure the attributes of each input item in the adjusted contract template; wherein each input item is represented in the form of a placeholder;
[0021] Generate html nodes based on input items and input item attributes;
[0022] Add a node identifier to the html node to bind the node identifier to the attribute of the input item;
[0023] Insert the html node after adding the node identifier into the corresponding input item;
[0024] According to the node identifier, all HTML nodes and bound input item attributes are generated into a form that needs to be filled in by all parties. The generated form includes at least one of the following: an electronic signature canvas, a corporate seal addition field, and a party information field; each field in the form corresponds to a placeholder for the input item.
[0025] Optionally, in response to the completed form, the content in the form is added to the adjusted contract template, and the final electronic contract includes:
[0026] Receive and parse the completed forms from all parties and obtain the contents of the forms;
[0027] Store the contents of the form in temporary variables;
[0028] Iterate through the placeholders in the adjusted contract template;
[0029] Replace the placeholders in the adjusted contract template with the content in the form to obtain the final electronic contract.
[0030] Optionally, the method further comprises:
[0031] For some commonly used fields in the form, the authorized third-party system database is called through the API interface to obtain relevant data and automatically fill it into the corresponding position.
[0032] In a second aspect, an electronic contract generation device is provided, the device comprising:
[0033] A calling unit, used to call an initial contract template corresponding to a contract type based on the contract type; the contract type includes at least one of: a sales contract, a labor contract, and a service agreement;
[0034] An adjustment unit, configured to respond to a user's adjustment request for the initial contract template, obtain an adjustment requirement input by the user, and adjust the initial contract template based on the adjustment requirement, industry-related legal terms and enterprise standards;
[0035] A generating unit, used for generating a form to be filled in by all parties according to the adjusted contract template;
[0036] The synthesis unit is used to respond to the user's filling operation, obtain the form content filled in by the user, and add the form content to the adjusted contract template to synthesize the final electronic contract.
[0037] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0038] Memory, used to store computer programs;
[0039] The processor is used to implement any method step described in the first aspect when executing a program stored in the memory.
[0040] According to a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.
[0041] The present invention provides an electronic contract generation method, device, electronic device and computer storage medium, which calls the initial contract template corresponding to the contract type based on the contract type; adjusts the initial contract template according to user needs, legal terms and corporate standards; generates a form that needs to be filled in by all parties based on the adjusted contract template; in response to the completed form, adds the content in the form to the adjusted contract template to synthesize the final electronic contract. The present invention can adjust the contract template according to user needs, legal terms and corporate standards, improves the flexibility and practicality of the contract template configuration; and sends the adjusted contract template to the user in the form of a form for filling, which greatly reduces the time for the user to search and fill in information page by page in a large amount of contract text, and improves the efficiency of contract generation.
[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention 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 creative work.
[0044] Figure 1 A flow chart of an electronic contract generation method provided by an embodiment of the present invention is shown;
[0045] Figure 2 A schematic diagram showing the structure of an electronic contract generation device provided by an embodiment of the present invention is shown;
[0046] Figure 3 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally 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 invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0048] Considering that most current electronic contracts use templates in fixed formats and cannot be flexibly configured according to actual needs, an embodiment of the present invention provides an electronic contract generation method and device, which will be described below through an embodiment.
[0049] An embodiment of the present invention provides an electronic contract generation method, which is applied to an electronic contract generation platform. The electronic contract generation platform can be presented in the form of a web client or a mobile client. On the contract generation platform, a user submits a contract preparation request, and a background server generates an electronic contract according to the request. The specific generation process will be described in detail through the following embodiments.
[0050] The embodiment of the present invention provides a method for generating an electronic contract, such as Figure 1 Said method comprises the following steps:
[0051] Step S101: based on the contract type, call the initial contract template corresponding to the contract type.
[0052] The contract types include at least one of the following: sales contract, employment contract, and service agreement.
[0053] The format of the initial contract template is word format.
[0054] In this step, the contract type option is set in the front-end interface of the contract generation platform. The user can select the target contract type in the front-end interface. Each contract type will be pre-bound with one or more contract templates. For example, for labor contracts, each specific industry will be configured with a specific contract template.
[0055] Therefore, in another embodiment, the corresponding initial contract template may be further selected in combination with the industry.
[0056] Similarly, industry selection items can be set in the front-end interface of the labor contract generation platform to further match the initial labor contract template according to the industry selected by the user.
[0057] Step S102: In response to the user's adjustment request for the initial contract template, the adjustment requirements input by the user are obtained, and the initial contract template is adjusted based on the adjustment requirements, industry-related legal terms and corporate standards.
[0058] Adjustment requirements include, for example, the inclusion of specific commercial terms and service details in the contract.
[0059] In addition, the contract needs to meet legal requirements, so it is necessary to update or add corresponding legal statements, disclaimers, etc. in accordance with industry-related legal requirements. Taking into account corporate standards, adjust the format and language style to match the corporate brand image and ensure compliance with internal audit standards.
[0060] In a feasible implementation, the user can input user requirements, corporate standards, and industry-related legal terms, etc. in the front-end interface of the contract generation platform.
[0061] Step S103: Generate a form that needs to be filled in by all parties according to the adjusted contract template.
[0062] A form is a user interface element used to collect input information from users. It usually consists of a series of related input fields, which can be text boxes, drop-down lists, check boxes, radio buttons, etc., allowing users to fill in or select data. Forms are widely used in websites, applications, and various software systems to enable interaction between users and systems.
[0063] In one example, the basic components of a form include the following:
[0064] Label: Text describing the purpose of each input field.
[0065] Input fields: This is where users enter information, such as text boxes, password boxes, date pickers, etc.
[0066] Submit button: Users click this button to send their filled-in information to the server for processing.
[0067] Reset button: Optional, used to clear all inputs in the form.
[0068] Validation message: The prompt message displayed when the user input does not meet the requirements.
[0069] Hidden fields: In HTML, sometimes there are fields that are not visible to the user but are useful for server-side processing.
[0070] In one feasible implementation, a form may be generated, which includes fields that all parties need to fill in, and the form may be sent to the clients of different parties, and each party may fill in the corresponding part. In another feasible implementation, a corresponding number of forms may be generated according to the number of parties, and each form may only include fields that the corresponding party needs to fill in.
[0071] In this step, the generated form is sent to the front-end interface of the contract generation platform for display, so that the user can fill in the form and click Submit after filling in.
[0072] Step S104: In response to the user's filling operation, the form content filled in by the user is obtained, and the form content is added to the adjusted contract template to synthesize the final electronic contract.
[0073] In this step, after the user submits the form, the backend server will add the content in the form to the corresponding blank area of the adjusted contract template. For example, the server will add the Party A name information in the form to the blank area of the Party A name in the contract template. For example, the electronic signature of Party A will be replaced in the signature area of Party A. After all the information to be filled in the contract template is added, a complete electronic contract will be synthesized.
[0074] In one example, the synthesized final electronic contract can be output in the format of pdf, word, jpg, etc.
[0075] Through the above embodiments, it can be understood that the present invention can adjust the contract template according to user needs, legal terms and corporate standards, thereby improving the flexibility and practicality of the contract template configuration; and sending the adjusted contract template to the user in the form of a form for filling in, which greatly reduces the time for users to search and fill in information page by page in a large amount of contract text, thereby improving the efficiency of contract generation.
[0076] Based on the above embodiment, adjusting the initial contract template based on the adjustment requirements, industry-related legal terms and enterprise standards includes the following steps:
[0077] Step S102A: Convert the word characters in the initial contract template into HTML strings to obtain an initial contract template consisting of HTML pages.
[0078] In this step, for batches of contract templates, you can use the python-docx library to read the Word document content and generate HTML using BeautifulSoup or a similar library.
[0079] HTML is a widely supported standard format that can be viewed and edited on any modern browser without installing additional software. This enables users to switch seamlessly between different devices and operating systems.
[0080] Step S102B: Render the HTML page through the iframe to present the HTML page in the front-end interface.
[0081] Iframe is a tag in HTML, which is called "inline frame". It allows another HTML document to be embedded in a web page. In the front-end page of the contract generation platform, the HTML page is rendered through iframe, so that users can adjust the HTML page.
[0082] Step S102C: Adjust the contentEditable attribute in the rendered HTML page to true, so that the initial contract template is converted from a static state to an editable state.
[0083] The contentEditable attribute is a global attribute in HTML that can be applied to any HTML element. This attribute allows elements in an HTML page to become editable. Users can edit content directly in the HTML page without going through forms or other input controls.
[0084] Step S102D: Adjust the terms, format and input items in the editable contract according to the adjustment requirements, industry-related legal terms and corporate standards. The adjustment operation includes at least one of the following: adding, deleting and modifying.
[0085] In this step, for example, some clauses may be deleted or modified according to user needs. The format and font of the contract template may be adjusted according to corporate standards.
[0086] The present invention converts the initial contract template in word format into an editable html format, renders it through an iframe, embeds it in the front-end interface, and adjusts it in a web form. The web application can automatically save each step of the user's operation, making it convenient to trace back to any version, which is particularly important for documents such as contracts that have legal significance.
[0087] In a feasible implementation, the adjusted contract template is converted into a Word format and previewed in the form of a preview interface so that the user can check the accuracy of the adjusted content.
[0088] Based on the above embodiment, the method further includes:
[0089] Step S102E: When the adjustment operation is to add, the characters to be added are escaped based on a preset escape rule library.
[0090] In an embodiment of the present invention, escape is a programming technique for converting characters that cannot be directly input or characters with special meanings in a character string. When certain characters have special uses in a specific context (for example, < and > are used to define tags in HTML), if these characters need to be displayed as ordinary text rather than performing their special functions, they need to be escaped.
[0091] In one example, the preset transfer rules are as follows:
[0092] & is escaped as &;
[0093] < is escaped as <;
[0094] > is escaped as >;
[0095] " is escaped to ";
[0096] ' can be escaped as '; or &apos.
[0097] In an embodiment of the present invention, a template engine such as Handlebars is used when adjusting the initial template contract, and the template engine provides a built-in escape mechanism.
[0098] The present invention can prevent grammatical errors and improve the correctness of contract template synthesis through escape processing, and can avoid problems such as SQL injection and XSS attack, thereby improving security.
[0099] When the initial contract template is converted from a static state to an editable state, its security will also decrease and it will be vulnerable to XSS attacks. Therefore, in order to improve the security of the contract generation process, based on the above implementation, the method also includes:
[0100] Step S102F: Perform security verification on the adjustment operation of the editable initial contract template. The security verification includes at least input verification and abnormal operation verification. The input verification is to filter the added data based on a preset html whitelist. The abnormal operation verification is to detect abnormal behavior in the adjustment operation.
[0101] Input validation is to perform security verification on the added content. In the embodiment of the present invention, a whitelist mechanism is used. Specifically, a clear whitelist of HTML tags and attributes needs to be defined first; then tools such as DOMPurify or Bleach are used to filter and clean the added data. All tags and attribute values that are not on the whitelist are removed. Additional checks are performed on the retained attribute values, such as ensuring that the URL points to a safe place.
[0102] In a feasible implementation, the whitelist may be adjusted periodically to keep pace with the latest security standards and protect against new attack types.
[0103] Verification of abnormal operations, such as monitoring the number of insertions at the same location in the contract template. If the number of insertions is frequent and exceeds the preset threshold, it can be judged that there is a security suspicion, and an early warning prompt can be issued for operations with security suspicions.
[0104] The present invention greatly improves the security in the contract generation process by performing security verification on the adjustment operation of the initial contract template in an editable state.
[0105] Based on the above embodiment, generating a form that needs to be filled in by all parties according to the adjusted contract template includes the following steps:
[0106] Step S103A: configuring the attributes of each input item in the adjusted contract template; wherein each input item is represented in the form of a placeholder.
[0107] In this step, each input item refers to the information item that needs to be filled in the contract, such as name, ID number, address, etc. The attributes of the input item include whether it is required, text type, number type, date type, etc.
[0108] Step S103B: Generate html nodes based on the input items and input item attributes.
[0109] In this step, the input item and the configured input item attributes are combined to generate an html node.
[0110] Step S103C: adding a node identifier to the html node to bind the node identifier to the attribute of the input item.
[0111] In this step, for example, a class name configuration-attribute is added to each html node, and the class name configurationAttribute is used to identify a specific element in an HTML or XML document.
[0112] Step S103D: insert the html node after adding the node identifier into the corresponding input item.
[0113] Step S103E: Generate a form that needs to be filled in by all parties according to the node identifier for all html nodes and bound input item attributes. The generated form includes at least one of the following: an electronic signature canvas, a corporate seal addition field, and a party information field; each field in the form corresponds to a placeholder for the input item.
[0114] After completing the configuration of all the above nodes, all the html nodes are collected together according to the node identifier to generate a form.
[0115] The generated form will include seal and signature fields. For example, for a B2C contract, a corporate seal is required, which can be directly uploaded to the form from the enterprise system database. If it is an individual, an electronic signature is required. A corresponding signature canvas will be generated in the form, and the user can sign directly on it.
[0116] The present invention automatically converts the contract template into an interactive HTML form, reducing the time for manually creating and formatting the form and improving the efficiency of contract preparation. By customizing the properties of the input items, the flexibility of the contract template configuration is improved. The generated HTML form can include elements such as the electronic signature canvas and the corporate seal addition field as needed, providing an intuitive and easy-to-use interface, which improves the user experience in the process of filling out the contract.
[0117] Based on the above embodiment, in response to the completed form, adding the content in the form to the adjusted contract template to synthesize the final electronic contract includes the following steps:
[0118] Step S104A: receiving and parsing the forms filled out by the parties concerned, and obtaining the contents of the forms.
[0119] On the server side, you can use scripts such as PHP, Node.js, Python, etc. to receive and parse the form data.
[0120] Step S104B: Store the content in the form in a temporary variable for subsequent processing.
[0121] Step S104C: traverse the placeholders in the adjusted contract template.
[0122] Placeholders are special symbols or text used in document templates to mark locations that will be replaced by actual content in the future. They are often used in the process of automating document generation, allowing the program to dynamically fill in data based on specific rules. Using placeholders can greatly improve the efficiency of document creation, especially when you need to batch generate similar contracts with different specific contents.
[0123] Step S104D: Replace the placeholders in the adjusted contract template with the content in the form to obtain the final electronic contract.
[0124] In a feasible implementation, the replacement operation may be implemented through string operations, regular expressions, or specific library functions such as str.format() in Python, template strings in JavaScript, and the like.
[0125] Based on the above embodiment, the method further includes:
[0126] For some commonly used fields in the form, the authorized third-party system database is called through the API interface to obtain relevant data and automatically fill it into the corresponding position.
[0127] In order to make this solution clearer, two specific application scenarios are given below, such as a B2C labor contract and a C2C labor contract.
[0128] For the B2C labor contract signing scenario, when a new employee is added, a labor contract template is selected from the contract template database, and the labor contract template is configured and adjusted according to user needs, corporate standards, etc., and a form is generated and sent to the front-end interface. Some fields that the company needs to fill in can be directly obtained from the corporate system database and automatically filled in the corresponding positions. For some fields that employees need to fill in, such as text, numbers, dates, etc., they need to be filled in and signed after filling in. The company will add the company seal to the corresponding position. After submission, the server replaces the placeholder in the corresponding position according to the form information, thereby obtaining a complete labor contract and outputting the labor contract in PDF format.
[0129] For the signing of C2C labor contracts, since it is between individuals, no signature is required, and the other processes are the same as those of B2C.
[0130] In an embodiment of the present application, for example, for some fields that an enterprise needs to fill in, some basic information of the enterprise, such as the company name, address, organization code, and other public and non-private data, can be directly obtained through an association established in advance with the enterprise side, and the obtained data can be automatically filled in the corresponding position, thereby greatly improving the efficiency of form filling.
[0131] Based on the same inventive concept, an electronic contract generation device is provided, such as Figure 2 As shown, the device comprises:
[0132] The calling unit 201 is used to call the initial contract template corresponding to the contract type based on the contract type; the contract type includes at least one of: sales contract, labor contract, and service agreement;
[0133] An adjustment unit 202 is used to respond to a user's adjustment request for the initial contract template, obtain an adjustment requirement input by the user, and adjust the initial contract template based on the adjustment requirement, industry-related legal terms and corporate standards;
[0134] A generating unit 203, configured to generate a form to be filled in by all parties according to the adjusted contract template;
[0135] The synthesis unit 204 is used to respond to the user's filling operation, obtain the form content filled in by the user, and add the form content to the adjusted contract template to synthesize the final electronic contract.
[0136] The present invention can adjust the contract template according to user needs, legal clauses and corporate standards, thereby improving the flexibility and practicality of the contract template configuration; and the adjusted contract template is sent to the user in the form of a form for filling in, which greatly reduces the time for the user to search and fill in information page by page in a large amount of contract text, thereby improving the efficiency of contract generation.
[0137] Based on the same technical concept, an embodiment of the present invention further provides an electronic device, such as Figure 3 As shown, it includes a processor 301 , a communication interface 302 , a memory 303 and a communication bus 304 , wherein the processor 301 , the communication interface 302 , and the memory 303 communicate with each other via the communication bus 304 .
[0138] Memory 303, used for storing computer programs;
[0139] The processor 301 is used to implement the steps of the electronic contract generation method when executing the program stored in the memory 303.
[0140] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0141] The communication interface is used for communication between the above electronic device and other devices.
[0142] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0143] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0144] The computer program product for performing the electronic contract generation method provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0145] The electronic contract generation device provided in the embodiment of the present invention can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, the parts not mentioned in the device embodiment can refer to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.
[0146] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only 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.
[0147] 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.
[0148] In addition, each functional unit in the embodiment provided by the present invention 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.
[0149] 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 computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. 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 methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0150] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0151] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or perform equivalent replacements on some of the technical features thereof; 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 invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for generating an electronic contract, characterized in that: The method comprises: Based on the contract type, calling an initial contract template corresponding to the contract type; the contract type includes at least one of: a sales contract, a labor contract, and a service agreement; In response to a user's adjustment request for the initial contract template, obtaining an adjustment requirement input by the user, and adjusting the initial contract template based on the adjustment requirement, industry-related legal terms and corporate standards; Generate forms that need to be filled in by all parties based on the adjusted contract template; In response to the user's filling operation, the form content filled in by the user is obtained, and the form content is added to the adjusted contract template to synthesize the final electronic contract.
2. The method according to claim 1, characterized in that The format of the initial contract template is a word format; the adjustment of the initial contract template based on the adjustment requirements, industry-related legal terms and corporate standards includes: Convert the word characters in the initial contract template into HTML strings to obtain the initial contract template consisting of HTML pages; Rendering the HTML page through an iframe to present the HTML page in a front-end interface; Adjust the contentEditable attribute in the rendered HTML page to true, so that the initial contract template is converted from a static state to an editable state; Adjust the clauses, formats and input items in the editable contract according to the adjustment requirements, industry-related legal clauses and corporate standards. The adjustment operation includes at least one of the following: adding, deleting and modifying.
3. The method according to claim 2, characterized in that The method further comprises: When the adjustment operation is addition, the characters to be added are escaped based on a preset escape rule library.
4. The method according to claim 2, characterized in that: The method further comprises: The adjustment operation of the editable initial contract template is subjected to security verification, and the security verification at least includes input verification and abnormal operation verification, wherein the input verification is to filter the added data based on a preset html whitelist; the abnormal operation verification is to detect abnormal behavior in the adjustment operation.
5. The method according to claim 2, characterized in that: The forms generated according to the adjusted contract template that need to be filled in by all parties include: Configuring the attributes of each input item in the adjusted contract template; wherein each input item is represented in the form of a placeholder; Generate an html node based on the input item and the input item attributes; Adding a node identifier to the html node to bind the node identifier to the attribute of the input item; Insert the html node after adding the node identifier into the corresponding input item; According to the node identifier, all HTML nodes and bound input item attributes are generated into a form that needs to be filled in by all parties; the form that needs to be filled in includes at least one of the following: an electronic signature canvas, a corporate seal addition field, and a party information field; each field in the form corresponds to a placeholder for the input item.
6. The method according to claim 5, characterized in that In response to the completed form, the content in the form is added to the adjusted contract template to obtain a final electronic contract including: Receive and parse the completed forms from all parties and obtain the contents of the forms; Store the contents of the form in temporary variables; Iterate through the placeholders in the adjusted contract template; The content in the form replaces the placeholder in the adjusted contract template to obtain the final electronic contract.
7. The method according to claim 1, characterized in that The method further comprises: For some commonly used fields in the form, the authorized third-party system database is called through the API interface to obtain relevant data and automatically fill it into the corresponding position.
8. An electronic contract generation device, characterized in that: The device comprises: A calling unit, configured to call an initial contract template corresponding to a contract type based on the contract type; the contract type includes at least one of: a sales contract, a labor contract, and a service agreement; An adjustment unit, configured to respond to a user's adjustment request for the initial contract template, obtain an adjustment requirement input by the user, and adjust the initial contract template based on the adjustment requirement, industry-related legal terms and enterprise standards; A generating unit, used for generating a form to be filled in by all parties according to the adjusted contract template; The synthesis unit is used to obtain the form content filled in by the user in response to the user's filling operation, and add the form content to the adjusted contract template to synthesize the final electronic contract.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.