Enterprise contract management optimization method and system
By introducing dual archive mechanism, multi-factor dynamic authentication and TF-IDF-based feature extraction and comparison technology, the problems of low storage security, identity verification reliability and content consistency detection efficiency in existing electronic contract management technologies are solved, and efficient, secure and intelligent management of electronic contracts are achieved.
Patent Information
- Application Number
- CN202411670572.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-11
AI Technical Summary
The existing electronic contract management technology has shortcomings in storage security, user identity verification reliability and contract content consistency detection efficiency, making it difficult to effectively detect and restore contract content tampering, and the identity verification mechanism is vulnerable to attacks and cannot meet the efficient and reliable needs of modern enterprises for contract change management.
The dual archive mechanism is used for hierarchical storage and verification of electronic contracts, combined with multi-factor dynamic identity verification technology, identity verification is performed through the user's private key and the device public key, and multi-level feature extraction and comparison of contract content is used using the TF-IDF feature extraction method optimized based on task-related thesaurus.
It significantly improves the security of electronic contract storage, improves the reliability of user identity verification, improves the efficiency of contract content consistency detection, and accurately locates the specific content of contract changes, meeting the enterprise's efficient, safe and intelligent needs for contract management.
Smart Images

Figure CN119599192A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of contract management, in particular to the technical field of storage and content comparison of enterprise electronic contracts. Background Art
[0002] With the deepening of enterprise informatization, electronic contracts, as important legal documents in enterprise management, have gradually replaced traditional paper contracts. However, existing electronic contract management technologies still have many shortcomings in handling contract storage, user identity authentication, and contract content consistency detection. Traditional electronic contract storage methods usually adopt a single storage mechanism. Once the stored contract content is tampered with, it is difficult for the system to effectively detect and restore it, resulting in the loss of integrity and authenticity of the contract content. In addition, in terms of user identity authentication, most existing systems rely on static passwords or simple single-factor authentication mechanisms, which are vulnerable to security threats such as password leakage and identity fraud, and cannot fully guarantee the security and legality of electronic contract operations. At the same time, for the consistency detection of contract content, existing technologies generally adopt word-by-word comparison or simple verification, which is inefficient and difficult to accurately capture the changes in key terms in contract terms, and cannot meet the efficient and reliable needs of modern enterprises for contract change management.
[0003] Based on the deficiencies of the above-mentioned background technology, the present invention proposes an enterprise contract management optimization method and system. This method realizes hierarchical storage and verification of electronic contracts by introducing a dual archiving mechanism, ensuring that even if the contract is tampered with, the original state can be restored through a copy; through multi-factor dynamic identity authentication technology combined with the user's private key and device public key, the security and reliability of user identity authentication are significantly improved; at the same time, the TF-IDF feature extraction method based on task-related vocabulary optimization is adopted to extract feature vectors for the key content of the contract text, supporting multi-level content comparison at the page level, paragraph level and line level, which not only improves the efficiency of contract content consistency detection, but also can accurately locate the specific content of contract changes. The introduction of this technology makes up for the deficiencies of existing electronic contract management systems in storage security, identity authentication reliability and content consistency detection efficiency, and provides an efficient, secure and intelligent solution for enterprise contract management. Summary of the invention
[0004] The technical problem to be solved by the embodiments of the present invention is to provide a method and system for optimizing enterprise contract management, which solves the problems of insufficient storage security, low reliability of user identity authentication and low efficiency of content consistency detection in electronic contract management through dual archiving mechanism, dynamic identity authentication, multi-level feature extraction and comparison technology, and realizes efficient, secure and intelligent management of electronic contracts.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides an enterprise contract management optimization method and system, the method comprising the following steps:
[0006] S100 receives the electronic contract submitted by the user, parses the contract content, extracts structured information such as the contract title, clause number, and text content, and generates a first-level archive; a copy of the contract content in the first-level archive is generated and stored as a second-level archive. The checksum of the first-level archive and the second-level archive is calculated using the hash algorithm SHA-256. The calculation formula of the checksum is:
[0007] H(x)=SHA-256(x)
[0008] Among them, x represents the text data of the contract content, H(x) is the hash value generated by the SHA-256 algorithm, with a fixed length of 256 bits, which is used to uniquely identify the contract content.
[0009] S200 When a user initiates a contract viewing request, the user's private key and device public key are obtained, and the user's identity is verified through a dynamic verification code. The dynamic verification code is sent to the user's device through a secure encrypted channel (such as SMS or email), and a unique session identifier is generated in combination with the device public key to verify the validity of the session identifier. The session identifier calculation formula is:
[0010] Session-ID = Hash(PK||R)
[0011] Among them, PK is the device public key, R is a randomly generated number, and || represents a series operation.
[0012] S300 extracts the features of the electronic contract text in the primary and secondary archives and generates a multi-level feature matrix, including page-level, paragraph-level, and row-level feature vectors. Feature extraction is based on the TF-IDF method optimized for task-related vocabulary, and the calculation formula for the optimization weight is:
[0013] MW-TF-IDF=φ·TF-IDF
[0014] Among them, the calculation formula of the weight adjustment coefficient φ is:
[0015]
[0016] n1 and n2 represent the frequency of task-related and non-task-related words, respectively. c1=2.0 and c2=0.5 are weight adjustment coefficients used to increase the feature weights of key terms.
[0017] S400 compares the multi-level feature matrices of the first-level archive and the second-level archive, and determines whether the contents are consistent by calculating the cosine similarity. The formula for calculating the cosine similarity is:
[0018]
[0019] Among them, A and B are feature vectors, and n represents the feature dimension. If the page-level feature similarity is lower than the threshold, the changed page is recorded; the paragraph-level and line-level features are further compared to accurately locate the specific changed parts of the contract content.
[0020] If the content comparison results of the first-level archive and the second-level archive are consistent, S500 allows the user to view the contract and records the contract viewing time and user information; if they are inconsistent, a difference report is generated, which includes the specific content of the changed pages, paragraphs and lines, as well as statistical information on the changes in the weights of task-related terms. The difference report is used to trace the change history of the contract content and remind the contract that there may be tampering.
[0021] On the other hand, an embodiment of the present invention provides an enterprise contract management optimization system, including a user module, a verification module, a storage module, a processing module and a result module; the user module is used to receive an electronic contract operation request submitted by a user, and obtain a private key and a device public key input by the user; the verification module is used to verify the user identity through a dynamic verification code, and complete the legitimacy verification in combination with the private key and the public key; the storage module includes a primary archive module and a secondary archive module, the primary archive module is used to store the original text of the electronic contract, the secondary archive module is used to store a copy of the electronic contract, and generate a checksum through a hash algorithm; the processing module is used to extract a multi-level feature matrix of the electronic contract based on an optimized TF-IDF method, the feature matrix includes page-level, paragraph-level and row-level feature vectors, and performs a consistency comparison between the primary archive and the secondary archive content; the result module is used to generate a difference report, the difference report includes specific information on the pages, paragraphs and rows with changed content, and statistical information on changes in the weights of task-related terms, and records user viewing time and user information, indicating that the contract content may be tampered with.
[0022] Implementing the embodiments of the present invention has the following beneficial effects:
[0023] Enhance the security of electronic contract storage: Through the dual archiving mechanism, the contract content is archived at the primary and secondary levels respectively, and the hash algorithm is used to generate a verification code for the archived content to ensure the integrity of the contract content. Even if the contract is tampered with, the original state can be restored through the copy, which significantly improves storage security.
[0024] Improve the reliability of user identity authentication: Combine dynamic verification codes with private key and public key multi-factor authentication technology to achieve accurate verification of user identity, effectively prevent risks such as password leakage or device misuse, and ensure the legality and security of electronic contract operations.
[0025] Improve the efficiency of contract content consistency detection: Based on the TF-IDF method optimized with task-related vocabulary, a multi-level feature matrix is constructed, including page-level, paragraph-level, and row-level features. Through precise cosine similarity calculation, rapid comparison of electronic contract content is achieved, which not only improves detection efficiency, but also accurately captures the details of changes in contract content.
[0026] Support contract content traceability and change analysis: Generate a difference report through the result module, including the specific information of the changed pages, paragraphs, and lines, and the weight change statistics of task-related terms, to help users quickly understand the change history of the contract content and provide a complete traceability basis.
[0027] Make enterprise contract management more intelligent and efficient: The system can automatically store contracts, verify identities, detect content changes and generate difference reports. Through the collaborative operation of multiple modules, it can reduce manual operation costs and improve the overall efficiency and intelligence level of enterprise contract management. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A method flow chart of an enterprise contract management optimization method provided in an embodiment of the present application;
[0029] Figure 2 A verification flow chart of an enterprise contract management optimization method provided in an embodiment of the present application;
[0030] Figure 3 A flow chart of a method for comparing features of an electronic contract copy and an electronic contract text in an enterprise contract management method provided in an embodiment of the present application;
[0031] Figure 4 This is a flow chart of the method for comparing differences in electronic contract texts based on TF-IDF in an embodiment of the present application;
[0032] Figure 5 This is a flow chart of the electronic contract feature extraction method based on optimizing TF-IDF in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0034] The terms first, second, etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by the first, second, etc. are generally a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, the character / in the specification and claims generally indicates that the objects connected are a kind of or relationship.
[0035] like Figure 1 As shown, the method includes: receiving an electronic contract submitted by a user, the system performs text parsing on the electronic contract, extracting structured information such as the title, clause number and body content of the contract, and generating a primary archive; generating a copy of the contract based on the primary archive and storing it as a secondary archive, using the hash algorithm SHA-256 to generate verification codes for the primary archive and the secondary archive respectively, for subsequent content consistency verification; when the user initiates a contract operation request, obtaining the private key and device public key input by the user, and performing multi-factor identity authentication in combination with a dynamic verification code, the dynamic verification code is sent to the user device through a secure channel, and a unique session identifier is generated to ensure the authenticity of the user's identity.
[0036] After the user is verified, the system extracts the multi-level feature matrix of the electronic contract from the primary and secondary archives. The multi-level features include page-level, paragraph-level, and line-level features. Feature extraction uses the TF-IDF method based on task-related vocabulary optimization, giving higher weights to key terms in the contract while reducing the impact of formatting words to further improve the accuracy of feature extraction; in addition, the feature extraction process can also use other methods, such as word embedding models (Word2Vec) or pre-trained language models (BERT), to enhance the recognition of changes in contract content by learning semantic associations. These alternative methods have advantages in semantic understanding and context analysis, but compared with the TF-IDF model, their computational complexity is higher and they are more suitable for scenarios that require in-depth analysis.
[0037] The system compares the multi-level feature matrices of the primary archive and the secondary archive through cosine similarity. If the feature matrix similarity is higher than the set threshold, the system determines that the contract content is consistent, allows the user to view the contract, and records the viewing time and user information; if the feature matrix similarity is lower than the threshold, a difference report is generated, which includes specific information about the pages, paragraphs, and lines with changed content, as well as statistics on the weight changes of key terms, to further help users locate specific terms of contract changes. In addition, the difference detection process can also be achieved through a quick comparison of hash values. Hash comparison calculations are simple but difficult to identify changes in semantic levels, and are suitable for scenarios where physical changes to contract texts are simply detected.
[0038] Based on the comparison results, the system supports restoring the original state of the contract through the secondary archive copy, while recording the time and user information of all operations to achieve integrity traceability of the contract content; combined with multi-factor verification, feature extraction and difference comparison functions, this method can comprehensively improve the security, reliability and efficiency of enterprise contract management.
[0039] The following, in conjunction with the accompanying drawings, describes in detail an enterprise contract management optimization method and system provided by the embodiments of the present application through specific embodiments and application scenarios.
[0040] like Figure 1 As shown, the present application provides an enterprise contract management optimization method, which includes steps S100 to S500.
[0041] Step S100 receives the electronic contract submitted by the user. The system parses the text of the contract content, extracts structured information such as the title, clause number, and body content, and stores the extracted contract content as a primary archive. At the same time, a copy of the contract is generated and stored as a secondary archive. The primary archive is used to save the original state of the contract and ensure the integrity of the content. The secondary archive is used for subsequent consistency verification and content recovery. Specifically, during the storage process, the system uses the hash algorithm SHA-256 to generate a verification code for the primary archive and the secondary archive. The verification code is used to uniquely identify the contract content. The calculation formula is: H(x) = SHA-256(x)
[0042] Where x represents the content of the contract text, and H(x) represents the generated hash value with a fixed length of 256 bits.
[0043] Preferably, in order to further improve storage efficiency and consistency check accuracy, the system can use a segmented storage mechanism when storing, divide the contract content into multiple sub-blocks according to logical paragraphs, and generate a hash value for each paragraph separately to form a hash chain structure. This structure enables the system to quickly locate the specific paragraph that has been modified when performing consistency checks. For example, the hash value of paragraph xi of the contract is calculated by the formula:
[0044] Hi=SHA-256(xi)
[0045] The hash values of all paragraphs are calculated and connected in series to form a complete hash chain, which can significantly improve the efficiency of content comparison.
[0046] Furthermore, for electronic contracts containing sensitive clauses, such as breach of contract liability or compensation amount, the system supports encrypted storage of these specific clauses, using the symmetric encryption algorithm AES to generate ciphertext. The encryption process generates a random key K and encrypts the sensitive clause content xs:
[0047] E(xs)=AES(xs,K)
[0048] The encrypted content is stored in ciphertext form, and the security of the key K is guaranteed by the key management module.
[0049] In addition, in order to meet the needs of large-scale contract storage, the system can perform redundancy checks and optimize compression during the storage process. For example, the system can reduce storage space usage through deduplication technology, retain only one version of the same clause or attachment and generate a reference pointer to avoid storing redundant content.
[0050] Through the above mechanism, the system significantly improves the security and integrity of electronic contracts while ensuring storage efficiency. It can effectively respond to contract operation needs in daily enterprise management and provide a solid foundation for subsequent steps.
[0051] Step S200 ensures the legitimacy of the user's identity and the security of the operation through multi-factor verification of dynamic verification code, device public key and user private key. It specifically includes the following sub-steps:
[0052] Specifically, it also includes steps S201 to S205:
[0053] S201 generates a device public key:
[0054] The system obtains the identification code and location data from the user's device and generates the public key of the device through a digital algorithm. The formula for generating the device public key is:
[0055] PK=Hash(Di||Li)
[0056] Among them, Di represents the device identification code, and Li represents the current geographical location data of the device. The generated public key PK is used to uniquely identify the user device and is bound to the current session.
[0057] S202 generates and sends a dynamic verification code:
[0058] The system randomly generates a one-time dynamic verification code Cv and sends it to the user's device through a secure channel (such as SMS, email, or internal corporate communication tools). The dynamic verification code is generated based on the timestamp T and the random number R, and the calculation formula is:
[0059] Cv=Hash(T||R)
[0060] Among them, || represents a concatenation operation, T represents the timestamp of verification code generation, and R represents a secure random number randomly generated by the system. The generated verification code is time-effective and unique, ensuring that it cannot be reused within the validity period.
[0061] S203 dynamic verification code verification:
[0062] The user enters the received dynamic verification code Cv, and the system checks the verification code entered by the user with the verification code of the current session to verify its validity and timeliness. If the verification code matches successfully, the next step of verification will be entered; if the match fails, the system prompts the user to re-enter or re-obtain the verification code.
[0063] S204 generates user private key:
[0064] After the user passes the dynamic verification code verification, the system generates the user's private key SK based on the user's personal identity information Iu and the device public key PK. The formula for generating the private key is:
[0065] SK=Hash(Iu||PK)
[0066] Among them, Iu represents the user's identity information (such as user name or enterprise number), and PPK represents the device public key. The generated private key SK serves as the core credential for user identity authentication, and the system will associate the private key with the user's subsequent operations.
[0067] S205 private key and device public key verification:
[0068] The system compares the private key SK and the device public key PK provided by the user to see if they match the historical data recorded by the system. The verification process includes the following steps:
[0069] The system queries the stored historical sessions for the SK and PK that match the current user;
[0070] Calculate the hash value of the current session:
[0071] Hashcurrent=Hash(SK∣∣PK)
[0072] Compare the current session hash value with the historical record hash value. If they match, the verification is considered successful; otherwise, the system denies user access and records a log of the verification failure.
[0073] S206 Allow access or deny access:
[0074] If all verification steps (dynamic verification code, device public key and user private key) are passed, the system allows the user to access subsequent content and records the verification time, device information and user operation log; if the verification fails, the system denies access and prompts the user to try again or contact support.
[0075] Through the above steps S201 to S206, the system completes multi-factor verification of the dynamic verification code, the device public key and the user private key.
[0076] Preferably, in order to improve the security and flexibility of user authentication, the system supports the configuration of different authentication strategies. For example, high-authority users (such as administrators or legal personnel) need to complete three-factor authentication of dynamic verification code, device public key and biometrics, while ordinary users only need two-factor authentication of dynamic verification code and device public key.
[0077] Furthermore, the system supports risk assessment based on historical data of user operation behavior. When the user's device information, login time or geographical location is abnormal, the system will automatically increase the verification strength, such as adding biometrics or manual review steps, to reduce security risks.
[0078] Through the above-mentioned multi-level user identity authentication mechanism, the system effectively ensures the legality of contract operations and provides a reliable security foundation for subsequent contract operations.
[0079] Step S300 extracts contract text features from the primary archive and the secondary archive and performs feature vector comparison to detect the consistency of the electronic contract content. Specifically, it includes the following sub-steps:
[0080] Step S301: Obtain the electronic contract content in the primary archive and the secondary archive:
[0081] The system extracts the original text of the electronic contract from the primary archive and the content of the contract copy from the secondary archive for subsequent comparison. To improve processing efficiency, the system supports parallel data loading, dividing the archive content into multiple logical sections and extracting them simultaneously.
[0082] Preferably, when extracting the contract content, the system can divide it into blocks according to the logical levels of pages, paragraphs and lines, and generate extraction marks for each block separately, so as to quickly locate the difference content in the subsequent feature comparison process.
[0083] Step S302: Text preprocessing:
[0084] The extracted contract text is standardized, including word segmentation, stop word filtering, symbol cleaning and format conversion. During the word segmentation process, the system uses the company's exclusive vocabulary (such as legal terminology and industry terminology) to enhance the recognition of key terms and ensure the accuracy of feature extraction.
[0085] Furthermore, the system supports selecting different preprocessing strategies based on the contract type. For example, for standardized contracts, the system prioritizes filtering the fixed format content in the contract template; for custom contracts, the system pays more attention to the clause changes to ensure that the preprocessing process is highly targeted.
[0086] Step S303: feature extraction:
[0087] The system extracts contract text features based on the TF-IDF method optimized by task-related vocabulary, and generates page-level, paragraph-level, and line-level feature vectors respectively. The weight optimization formula is:
[0088] MW-TF-IDF=φ·TF-IDF
[0089] The calculation formula of φ is:
[0090]
[0091] n1 represents the frequency of task-related words, n2 represents the frequency of non-task-related words, c1=2.0, c2=0.5 represent the weight adjustment coefficients. The result of feature extraction is used to represent the semantic and logical distribution of contract content.
[0092] Preferably, the feature extraction process can use a word embedding model (such as Word2Vec or BERT) instead of the TF-IDF method to capture the semantic associations of the contract content through deep learning, which is suitable for scenarios where semantic changes need to be analyzed.
[0093] Step S304: Feature vector comparison:
[0094] By calculating the cosine similarity of the corresponding feature vectors of the first-level archive and the second-level archive, the consistency of the two archive contents is evaluated. The formula for calculating cosine similarity is:
[0095]
[0096] Among them, A and B are feature vectors, and n is the feature dimension. The comparison starts from page-level features, gradually goes deeper into paragraph level and line level, and records the difference features and similarity scores.
[0097] Furthermore, for semantically complex scenarios, the system can introduce semantic matching algorithms (such as ESim or matching networks) and combine contextual information to improve the matching accuracy; for simple scenarios, the hash value matching method is preferentially used to quickly detect physical content changes.
[0098] Step S305 outputs the comparison result:
[0099] The system generates a difference report, which includes the specific content of the changed pages, paragraphs and lines, similarity score statistics, and analysis results of changes in task-related term weights. The difference report also provides historical version records and modification suggestions for the changed terms to help users quickly understand the content changes.
[0100] Preferably, the difference report supports automatic generation of contract revision suggestions, including restoring the primary archive content or updating the secondary archive copy, further reducing the manual operation burden.
[0101] Through the above steps, the system can efficiently and accurately detect the consistency of contract content and provide detailed change analysis reports, which significantly improves the intelligence level and operational efficiency of enterprise contract management.
[0102] Step S400 extracts the contract text content from the primary archive and the secondary archive, performs feature comparison layer by layer, and finally generates a detailed difference report to ensure that the changes in the contract content can be accurately captured and presented to the user. It specifically includes the following sub-steps:
[0103] Step 401: Obtain the content of the electronic contract:
[0104] The system extracts the original electronic contract text from the primary archive and the electronic contract copy text from the secondary archive for subsequent feature comparison. To ensure the integrity and accuracy of the data, the system generates a checksum for the extracted content and verifies it with the hash value in the archive record to ensure that the comparison content has not been tampered with.
[0105] Preferably, when extracting the content of the contract text, the system can store the content in layers according to the logical structure of the contract (such as chapters and clause numbers), ensuring that specific clauses or paragraphs can be quickly located during comparison.
[0106] Step 402 Text preprocessing:
[0107] The extracted contract text is preprocessed in a standardized manner, including word segmentation, stop word filtering, symbol cleaning, and format normalization. During the stop word filtering process, the system gives priority to retaining contract-specific symbols (such as ¥, %, etc.) to support subsequent feature extraction.
[0108] Furthermore, the system supports the selection of specific preprocessing rules based on different contract types. For example, for legal contracts, priority is given to retaining professional terms and specific formats; while for technical agreements, the focus is on retaining technical terms and parameter symbols to ensure that the preprocessed text can accurately reflect the characteristics of the contract content.
[0109] Step 403 calculates the TF-IDF feature weight:
[0110] Based on the task-related vocabulary and non-task-related vocabulary, the system calculates the TF-IDF feature weights at the page level, paragraph level, and line level for the extracted vocabulary, and generates a multi-level feature matrix. The TF-IDF feature weight calculation formula is:
[0111]
[0112] Where TF(w) represents the frequency of word w in the contract text, N represents the total number of contract documents, and DF(w) represents the number of documents containing word w.
[0113] Preferably, when calculating feature weights, the system can adjust the weight distribution through word library optimization. For example, higher weights are given to task-related terms such as compensation amount and breach of contract liability, while lower weights are given to non-task-related terms such as attachments and notes, further improving the distinguishing ability of the feature matrix.
[0114] Furthermore, the feature weight calculation process can introduce a semantic vector model (such as Word2Vec or BERT) as a supplement to generate a feature vector with more semantic expression capabilities by capturing the contextual relationship of words, which is suitable for analyzing scenarios of semantic changes.
[0115] Step 404: Multi-level feature comparison:
[0116] The cosine similarity of the page-level features, paragraph-level features, and line-level features of the first-level archive and the second-level archive is calculated layer by layer to determine the scope of the change and record the feature differences. The comparison formula is:
[0117]
[0118] Among them, A and B are feature vectors, and n represents the feature dimension. The system gradually starts from page-level features to determine whether there is an overall change; then it goes deeper into paragraph and line-level features to accurately locate the specific change location and record the similarities and differences of the changed terms.
[0119] Preferably, for large-scale contract comparison scenarios, the system can combine the hash value fast comparison method for preliminary screening to quickly detect whether there are any changes; for content where changes are detected, in-depth analysis is performed through multi-level cosine similarity calculations to improve comparison efficiency.
[0120] Step 405 generates a difference report:
[0121] The system will summarize the comparison results and generate a difference report, which includes the changed page number, paragraph number, line number, and the weight change and semantic similarity analysis results of the task-related terms. The report also shows the historical version record of the changed terms and modification suggestions, such as whether it is necessary to restore the first-level archive content or update the second-level archive copy.
[0122] Furthermore, the difference report supports multiple output formats, including tables, charts or natural language summaries, so that users can quickly understand the content of the contract changes. For example, for important changes to terms, the system can generate risk warnings to help corporate managers quickly assess the impact of the changes and take corresponding measures.
[0123] Through multi-level feature comparison and generation of difference reports, the system can efficiently and accurately capture changes in contract content, provide detailed change analysis and revision suggestions, and significantly improve the efficiency and security of enterprises in contract management.
[0124] Step S500 constructs task-related and non-task-related word libraries and generates a multi-level feature matrix of the electronic contract based on the optimized TF-IDF algorithm to provide accurate feature representation for consistency detection and difference analysis of the contract content. It specifically includes the following sub-steps:
[0125] Step 501 builds task-related and non-task-related word libraries:
[0126] According to the needs of enterprise contract management, the system builds a vocabulary of task-related terms (such as breach of contract, compensation, liability) and a vocabulary of non-task-related terms (such as attachments, instructions, notes). Task-related terms mainly cover the core terms in the contract, while non-task-related terms include common format words or modifiers.
[0127] Preferably, the word library construction process can combine manual annotation and machine learning methods. Specifically, manual annotation is used to quickly generate an initial word library, while machine learning methods (such as semantic-based word vector clustering) can automatically expand the word library range and enhance the coverage of unlabeled terms.
[0128] Furthermore, the system supports dynamic adjustment of the vocabulary content according to the contract type. For example, in a service contract, the task-related vocabulary prioritizes terms such as service scope and service level agreement; while in a procurement contract, it focuses more on terms such as delivery period and acceptance criteria to ensure the pertinence of feature extraction.
[0129] Step 502 calculates the basic TF-IDF weight:
[0130] After word segmentation of the electronic contract text, the system counts the term frequency (TF) and inverse document frequency (IDF) of each term to generate the initial TF-IDF weight vector. The calculation formula is:
[0131]
[0132] Where TF(w) represents the frequency of term w in the current contract, N is the total number of documents, and DF(w) represents the number of documents containing term w.
[0133] Preferably, when counting word frequency and document frequency, the system assigns different weights to different contract sections. For example, the weight of terms in the section containing clauses such as liability for compensation is increased, while the weight of the content in the section containing additional instructions is reduced to ensure that feature extraction is concentrated on the core clauses.
[0134] Step 503 introduces the weight optimization formula:
[0135] Based on the basic TF-IDF weight, the system adjusts the weights of task-related and non-task-related terms through the following weight optimization formula: MW-TF-IDF = φ TF-IDF
[0136] The calculation formula of φ is:
[0137]
[0138] n1 represents the frequency of task-related words, n2 represents the frequency of non-task-related words, c1=2.0 (task-related terms), c2=0.5 (non-task-related terms) represent the weight adjustment coefficients.
[0139] Furthermore, the weight optimization process can combine the semantic vector model to calculate the similarity between the term and the task-related vocabulary, and dynamically adjust the value of φ. For example, when the semantic similarity between the term and the task-related vocabulary is high, its weight coefficient c1 is appropriately increased, and vice versa, the weight coefficient c2 is reduced to improve the flexibility and accuracy of weight optimization.
[0140] Step 504 generates a hierarchical feature vector:
[0141] The system calculates the optimized TF-IDF feature vectors at the page level, paragraph level, and row level to generate a hierarchical feature matrix. Specifically:
[0142] Page-level features: Count the optimization weights of all terms in each page to generate a page-level feature vector; Paragraph-level features: Generate a paragraph feature vector based on the logical structure of the segmentation;
[0143] Row-level features: Extract feature weights for each line of text and generate row-level feature vectors.
[0144] Preferably, the generation of the hierarchical feature matrix can be combined with the knowledge graph of a specific field, for example, by associating the term weights with the semantic nodes in the knowledge graph to further enhance the expressive power of the features.
[0145] Step 505 outputs the optimized feature results:
[0146] The system uses the generated hierarchical feature matrix as the final feature representation of the electronic contract and outputs it to the subsequent comparison and analysis module. The optimized feature results not only include the weight distribution of task-related terms, but also record the position and change trend of the terms in the multi-level feature vector to support contract modification analysis and difference report generation.
[0147] Furthermore, the system supports outputting the optimized feature results as a visual report, such as displaying the weight distribution and semantic change trends of task-related terms in the contract terms through charts, to help users quickly understand the core content of the contract features.
[0148] Through the feature extraction method based on optimized TF-IDF, the system can efficiently generate a multi-level feature matrix of electronic contracts, accurately capture the key terms in the contract and their changing trends, and provide a solid technical foundation for subsequent content consistency detection and difference analysis.
Claims
1. A method for optimizing enterprise contract management, characterized in that: The enterprise contract management optimization method comprises: S100: receiving an electronic contract submitted by a user, archiving the electronic contract in a primary archive to preserve the original state, and generating a copy to store in a secondary archive; S200: When the user requests to view the electronic contract, the user's private key and the device public key are obtained, and the user's identity is verified by the key; S300: extracting text features of the electronic contract in the primary archive and the secondary archive based on the TF-IDF method optimized for task-related vocabulary, and generating a multi-level feature matrix; S400: Compare the multi-level feature matrix of the first-level archive and the second-level archive to determine whether the content of the electronic contract is consistent; S500: If the comparison results are consistent, the user is allowed to view the electronic contract; if the comparison results are inconsistent, it is prompted that the electronic contract has been tampered with, and the different contents in the first-level archive and the second-level archive are displayed.
2. The enterprise contract management optimization method according to claim 1, characterized in that: The step S100 further includes: receiving the electronic contract submitted by the user, parsing the content of the electronic contract, extracting structured information such as the title, clause number, and text content of the contract, and generating a primary archive; generating a copy of the contract content in the primary archive and storing it as a secondary archive, and calculating the checksum of the primary archive and the secondary archive by using the hash algorithm SHA-256. The calculation formula of the checksum is: H(x)=SHA-256(x) Among them, x represents the text data of the contract content, SHA-256 is a secure hash algorithm that can generate a hash value with a fixed length of 256 bits for the input contract content; the hash value is used to uniquely identify the contract content, and any change in the content will cause the hash value to change, thereby realizing the verification of the integrity and consistency of the primary and secondary archive contents; the complete content of the electronic contract, SHA-256 is a secure hash algorithm used to generate a fixed length of 256 bits for the input data to verify the integrity of the electronic contract content.
3. The enterprise contract management optimization method according to claim 1 is characterized in that: The step S200 specifically includes: obtaining the device public key and private key of the user, and generating a dynamic verification code in combination with the user's personal identity information; sending the dynamic verification code to the user's device through a secure encrypted channel; after the user enters the dynamic verification code, the system verifies the consistency between the dynamic verification code and the current session identifier; the session identifier is generated by calculating the device public key PK and the randomly generated tert-R, and the generation formula is: Session-ID = Hash(PK||R) Here, || represents a concatenation operation.
4. The enterprise contract management optimization method according to claim 1 is characterized in that: The step S300 further includes: Performing text segmentation on the contract contents in the primary archive and the secondary archive respectively to generate a standardized vocabulary; The TF-IDF method optimized by the task-related vocabulary and the non-task-related vocabulary is used to extract text features, and the optimized weight calculation formula is: MW-TF-IDF=φ·TF-IDF The calculation formula of φ is: n1 represents the frequency of task-related words, n2 represents the frequency of non-task-related words, c1=2.0, c2=0.5 represent the weight adjustment coefficients.
5. The enterprise contract management optimization method according to claim 4 is characterized in that: The task-related vocabulary includes but is not limited to the terms in the contract terms: compensation, breach of contract, payment period; the non-task-related vocabulary includes but is not limited to descriptive words: attachment, description, reference; the task-related terms are given a higher weight c1=2.0, and the non-task-related terms are given a lower weight c2=0.5; at the same time, the word frequency is smoothed during the feature extraction process, using the formula: Among them, TF′(t,d) is the smoothed word frequency, and TF(t,d) is the original word frequency.
6. The enterprise contract management optimization method according to claim 1, characterized in that: The step S400 further includes: Compare the page-level feature vectors of the first-level archive and the second-level archive, and calculate the page-level cosine similarity; Compare the paragraph-level features of the modified pages and calculate the paragraph-level cosine similarity. The formula is: If the paragraph-level feature similarity is lower than the threshold, the line-level features are further compared to record the modified lines and content.
7. The enterprise contract management optimization method according to claim 6, characterized in that: The row-level feature comparison includes: calculating the difference between the feature rows in the first-level archive and the second-level archive, and if the difference in the number of words between the two rows exceeds 10%, or the cosine similarity is lower than 0.7, it is determined that the content of the row has been changed; and generating a difference record at the same time, recording the row number and the changed content of the changed row.
8. The enterprise contract management optimization method according to claim 1, characterized in that: The step S500 also includes: when the comparison results are consistent, recording the user viewing time, user information and operating device information; if the comparison results are inconsistent, generating a difference report, the difference report includes: the changes in the task-related terms, and the specific contents of the changed pages, paragraphs, and rows in the first-level archive and the second-level archive.
9. The enterprise contract management optimization method according to claim 8, characterized in that: The term changes in the difference report are generated by optimizing the change calculation of the TF-IDF weight, specifically including the following steps: Calculate optimized weights W1 and W2 for the weights of the task-related terms in the first-level archive and the second-level archive respectively; Calculate the change in term weight ΔW using the formula: Among them, ΔW>30% was determined as a significantly modified term; The significantly modified terms are marked, and a statistical report on weight changes is generated to display the changes in the task-related terms and the potential impact of the changes on the contract terms.
10. An enterprise contract management optimization system, the enterprise contract management optimization system includes a user module, a verification module, a storage module, a processing module and a result module, the specific module functions of the system are: the user module is used to receive the electronic contract operation request submitted by the user, and obtain the private key and device public key input by the user; the verification module is used to verify the identity of the user through a dynamic verification code, and to verify the legitimacy of the private key and device public key of the user; the storage module includes a primary archive module and a secondary archive module, the primary archive module is used to store the original text of the electronic contract, the secondary archive module is used to store the copy of the electronic contract, and generates the verification code of the primary archive and the secondary archive through a hash algorithm The processing module is used to extract the features of the electronic contract text in the first-level archive and the second-level archive, generate a multi-level feature matrix including page level, paragraph level and line level, and optimize the weight of the feature matrix through the TF-IDF method optimized by the task-related vocabulary; the result module is used to compare the multi-level feature matrix of the first-level archive and the second-level archive, and generate a difference report; the difference report includes the specific information of the page, paragraph and line of the changed content, and the statistical information of the weight change of task-related terms; when the comparison results are consistent, the result module records the contract viewing time and user information; when the comparison results are inconsistent, the difference report displays the specific changed content and prompts that the contract may be tampered with.