A contract early warning method and device fusing a knowledge graph in an ERP scenario

By integrating knowledge graphs and graph attention networks into the ERP system, the problem of traditional ERP systems being unable to identify complex cascading defaults in contract risk warnings is solved. This enables in-depth analysis and risk assessment of contract terms, improving the accuracy and coverage of warnings.

CN123180769APending Publication Date: 2026-11-27SHANGHAI CHUNNAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611642971.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-22
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Traditional ERP systems are unable to deeply analyze the logical subordination and conditional triggering relationships between long text clauses in contract risk warning, resulting in an inability to effectively identify complex cascading default risks and increasing the underreporting rate.

Method used

This paper adopts a method combining knowledge graph and graph attention network to convert contract text into dynamic knowledge graph through semantic analysis. By using multi-hop semantic relationship reasoning and attention feature aggregation, it calculates the cross-restrictions and multi-dimensional risk factors between contract clauses to achieve risk assessment.

Benefits of technology

It improves the coverage and interpretability of enterprise risk control early warning, reduces the false alarm rate and false negative rate of risk identification, and can automatically discover complex long-tail cascading default paths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123180769A_ABST
    Figure CN123180769A_ABST
Patent Text Reader

Abstract

The application discloses a contract early warning method and equipment in an ERP scene combined with a knowledge graph. The method comprises the following steps: obtaining a contract file and converting the contract file into a natural language text sequence; extracting core entities and semantic relationships and mapping the core entities and the semantic relationships into nodes and directed edges; converting the nodes and the directed edges into initial vector representations through a pre-trained language model; calculating relative attention coefficients by using a graph attention network; performing aggregation iteration in combination with neighbor nodes to obtain new feature vectors; calculating a comprehensive risk probability value of default by using a classifier; and sending alarm data containing a risk transmission path when the value exceeds a threshold. The application can convert discrete natural language clauses into a continuous and computable vector space, effectively evaluate clause cross limitations, automatically mine long-tail cascading default paths, and improve the coverage and explanatory power of risk control and early warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language text processing and semantic analysis technology, and particularly to a contract early warning method and device that integrates knowledge graphs in ERP scenarios. This technical solution closely integrates natural language semantic analysis of unstructured contract texts, semantic entity relationship mapping and dynamic graph topology construction, node vector embedding and attention feature aggregation based on multi-hop semantic relationship reasoning, and a cascading rule extraction mechanism in the context of enterprise resource planning business texts. It belongs to a deep application branch of artificial intelligence in the national strategic emerging industries. Background Technology

[0002] Enterprise Resource Planning (ERP) systems handle massive amounts of contract texts, transaction logs, and supply chain data in the daily operations and management of large modern enterprises. As business models become increasingly complex, contracts between companies are no longer simple sales agreements; they often involve joint and several liability guarantees from multiple entities, equity pledges between multiple levels of parent and subsidiary companies, and hidden conditional defaults and nested subordinate relationships within lengthy clauses. When conducting risk warnings for these massive amounts of contracts circulating in digital data processing systems, enterprises urgently need an intelligent risk control method capable of penetrating the underlying data and performing efficient semantic extraction.

[0003] Traditional enterprise resource planning (ERP) contract early warning systems typically rely on pre-defined static regular expressions and keyword rule engines for risk screening. These electronic data processing mechanisms are primarily used to match contract amount thresholds or perform shallow string searches on enterprise blacklists. Since commercial contract terms are usually composed of complex natural language syntax, these rule-based risk control mechanisms have weak generalization capabilities, remaining at a superficial level of textual literal comparison and failing to deeply analyze the logical subordination and conditional triggering relationships between long text clauses. When external economic fluctuations cause a break in the capital chain at a node in the supply chain network, traditional methods based on isolated rules cannot uncover implicit cascading default paths caused by joint guarantees or equity nesting, leading to an increased underreporting rate of long-tail risks. Therefore, overcoming the underreporting problem caused by traditional systems relying on static rules and shallow string matching, and transforming discrete unstructured contract text into a continuous, computable vector space to quantitatively assess the cross-restrictions and multi-dimensional risk factors between clauses, has become a pressing technical problem in the field of electronic data processing devices and systems. Summary of the Invention

[0004] This invention provides a contract early warning method and device that integrates knowledge graphs in ERP scenarios, effectively overcoming the technical shortcomings of traditional systems that cannot identify complex cascading default risks.

[0005] According to one aspect of this application, a contract early warning method integrating knowledge graphs in an ERP scenario is provided, comprising: acquiring contract documents circulating in an enterprise resource planning system and converting the contract documents into a sequence of raw natural language text; inputting the raw natural language text sequence into a semantic analysis module for extraction to obtain core entities, clause texts, and semantic relationships; mapping the core entities and the semantic relationships into nodes and directed edges of a dynamic knowledge graph; converting the core entities and the clause texts into initial vector representations of the nodes using a pre-trained language model; performing feature dimensionality reduction on the nodes using a graph attention network and calculating the relative attention coefficients between the nodes and their corresponding neighboring nodes; performing multiple aggregation iterations on the relative attention coefficients after normalization and combining them with the neighboring nodes to obtain new feature vectors of the nodes containing multi-hop relationship features; using a classifier to calculate a comprehensive risk probability value for triggering a default event based on the new feature vectors of the nodes; and sending alarm data containing the risk transmission path to the front end when the comprehensive risk probability value exceeds a preset threshold.

[0006] Furthermore, the step of mapping the core entities and semantic relationships to nodes and directed edges of the dynamic knowledge graph includes: extracting association constraints from the original natural language text sequence; classifying the association constraints into three types of logic: direct association, conditional constraint, and nested subordination; mapping the three types of logic—direct association, conditional constraint, and nested subordination—to the semantic relationships; constructing the core entities as nodes; and constructing directed edges with different weight attributes based on the semantic relationships to generate the initial topology of the dynamic knowledge graph.

[0007] Further, the step of converting the core entity and the clause text into the initial vector representation of the node using a pre-trained language model includes: performing deep semantic analysis on the clause text using a bidirectional encoder representation model; calculating the attention weight of each character in the clause text based on a self-attention mechanism; performing average pooling on the character vector corresponding to the core entity to obtain the entity feature vector; extracting the global feature vector representing the overall semantics of the clause text; concatenating the entity feature vector with the global feature vector to fuse the local features of the core entity with the global features of the clause text; and performing dimensionality unification mapping on the concatenated vector through a fully connected layer to output the initial vector representation.

[0008] Further, the step of using a graph attention network to perform feature dimensionality reduction on the node and calculating the relative attention coefficient between the node and its corresponding neighboring nodes, wherein the relative attention coefficient before normalization is represented by a non-normalized attention score, includes: linearly projecting the initial vector representation into the feature transformation matrix of the graph attention network to generate a dimensionality-reduced feature vector; concatenating the dimensionality-reduced feature vector corresponding to the node with the dimensionality-reduced feature vector corresponding to the neighboring node; inputting the concatenated joint feature vector into a single-layer feedforward neural network; and calculating the non-normalized attention score between the node and its neighboring nodes based on the output of the single-layer feedforward neural network and combined with a nonlinear activation function, using the non-normalized attention score to represent the relative attention coefficient before normalization.

[0009] Further, the step of normalizing the relative attention coefficients and then performing multiple aggregation iterations with the neighbor nodes to obtain a new node feature vector containing multi-hop relationship features includes: independently calculating multiple sets of the feature transformation matrices and the non-normalized attention scores using a multi-head attention mechanism; calculating the non-normalized attention scores using an exponential function and dividing them by the sum of the exponential function output values ​​of all the neighbor nodes to obtain the normalized relative attention coefficients; performing a weighted summation of the dimensionality-reduced feature vectors of the neighbor nodes and the corresponding relative attention coefficients to obtain a single-head aggregated feature vector; concatenating the multiple sets of independently calculated single-head aggregated feature vectors; and iteratively passing the concatenated feature vector through multiple hidden layers to output the new node feature vector.

[0010] Further, the step of using a classifier to calculate the comprehensive risk probability value of triggering a default event based on the new feature vector of the node includes: inputting the new feature vector of the node into a multilayer perceptron classifier; the multilayer perceptron classifier performing a nonlinear mapping on the new feature vector of the node through multiple cascaded linear transformation layers and a modified linear unit activation function; outputting the probability distribution corresponding to each risk level using a normalized exponential function layer; extracting the target classification probability value representing the occurrence of a cascading default event from the probability distribution; and using the target classification probability value as the comprehensive risk probability value.

[0011] Further, when the comprehensive risk probability value exceeds a preset threshold, sending alarm data containing the risk transmission path to the front end includes: triggering reverse parsing logic for the transmission path when the comprehensive risk probability value exceeds the preset threshold; reading the relative attention coefficient between the node and the neighboring node calculated during the multiple aggregation iterations; filtering out the target directed edges whose relative attention coefficient is greater than the relationship threshold; tracing the connected components connecting the high-risk core entity and the initial triggering core entity that caused the risk according to the reverse hierarchical order of feature aggregation; concatenating the target directed edges and the nodes corresponding to the connected components into chain structure data according to the hierarchy; converting the chain structure data into the risk transmission path and encapsulating it into the alarm data before sending it to the front end.

[0012] According to one aspect of this application, a contract early warning device integrating knowledge graph in an ERP scenario is provided, comprising: a data access module configured to acquire contract documents circulating in an enterprise resource planning system and convert the contract documents into a raw natural language text sequence; a graph construction module connected to the data access module, configured to input the raw natural language text sequence into a semantic analysis module for extraction to obtain core entities, clause texts, and semantic relations, and map the core entities and the semantic relations into nodes and directed edges of a dynamic knowledge graph; and a vector conversion module connected to the graph construction module, configured to convert the core entities and the clause texts into nodes and directed edges of a dynamic knowledge graph using a pre-trained language model. The text is converted into an initial vector representation of the node; a multi-hop inference module, connected to the vector conversion module, is configured to use a graph attention network to perform feature dimensionality reduction on the node, calculate the relative attention coefficient between the node and its corresponding neighbor nodes, normalize the relative attention coefficient, and perform multiple aggregation iterations with the neighbor nodes to obtain a new feature vector of the node containing multi-hop relationship features; a discrimination alarm module, connected to the multi-hop inference module, is configured to use a classifier to calculate the comprehensive risk probability value of triggering a default event based on the new feature vector of the node, and when the comprehensive risk probability value exceeds a preset threshold, send alarm data containing the risk transmission path to the front end.

[0013] According to one aspect of this application, a computer device is provided, comprising: a memory configured to store computer program instructions; and a processor connected to the memory and configured to execute the computer program instructions to implement the aforementioned contract early warning method integrating knowledge graphs in an ERP scenario.

[0014] According to one aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing computer program instructions; when executed, the computer program instructions are used to implement the aforementioned contract early warning method integrating knowledge graphs in an ERP scenario.

[0015] The technical solution provided in this application delivers objective synergistic effects: through the interlocking and synergistic interaction of an underlying dynamic knowledge graph and a graph attention network, discrete natural language clauses are transformed into a continuous and computable vector space, effectively assessing the cross-restrictions and multi-dimensional risk factors between clauses. Compared to traditional static rule matching, the system overcomes the spatial limitations of single-text analysis, dynamically measuring the degree of cross-influence between different contract clauses through attention weights. It can automatically uncover complex long-tail cascading default paths using the logical reasoning of graph networks, improving the coverage and interpretability of enterprise risk control early warnings, and reducing the false positive and false negative rates of risk identification. Attached Figure Description

[0016] Figure 1 This is a flowchart of the contract early warning method provided in an embodiment of the present invention;

[0017] Figure 2 This is a structural block diagram of the contract early warning device provided in an embodiment of the present invention. Detailed Implementation

[0018] To make the technical features and effects of this application clearer and more explicit, this application will be described below in conjunction with the accompanying drawings and specific embodiments.

[0019] It should be emphasized that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of protection of this application. Those skilled in the art should understand that the algorithms, neural network models, and data flow mechanisms in this application all rely on the underlying computing hardware and communication networks for operation.

[0020] Specifically, the underlying physical computing nodes supporting the semantic model and graph operation reasoning of this application include, but are not limited to, server clusters configured with graphics processors, tensor processing units, or high-performance central processing units. This hardware base is equipped with volatile and non-volatile storage media for caching weight parameters required for large-scale matrix operations, and has a network communication interface module that interfaces with the underlying data bus of an enterprise resource planning system, such as a transmission control protocol or Internet Protocol stack and a high-speed fiber optic bus, thereby ensuring that the conversion from unstructured contract text to a quantifiable risk network has a feasible physical carrier and signal connectivity domain.

[0021] In one embodiment of this application, combined with Figure 1 As shown, a contract early warning method integrating knowledge graphs is provided for ERP scenarios. This method relies on the underlying data bus of the enterprise resource planning system, and the overall algorithm flow architecture of the system is divided into four interconnected stages according to the data time sequence: data access, semantic parsing, graph reasoning, and early warning output.

[0022] Step S101: Obtain the contract documents circulating in the Enterprise Resource Planning system and convert the contract documents into a sequence of raw natural language text.

[0023] Specifically, the system monitors the file transfer interface of the Enterprise Resource Planning (ERP) system, intercepting unstructured contract documents, such as sales contracts, guarantee agreements, and equity transfer documents circulating in the ERP system in real time. Subsequently, the system calls an optical character recognition (OCR) engine to extract the text content and performs preprocessing operations such as removing special symbols, correcting formatting misalignments, and eliminating garbled characters. The preprocessed plain text data is uniformly encoded into a universal character encoding format to generate the original natural language text sequence. By employing OCR combined with a cleaning and filtering mechanism, parsing interference caused by differences in file formats and formatting from different sources can be eliminated, thus providing downstream large-scale models with uniformly formatted and clean underlying data input.

[0024] Step S102: Input the original natural language text sequence into the semantic analysis module for extraction to obtain core entities, clause texts and semantic relations, and map the core entities and semantic relations into nodes and directed edges of a dynamic knowledge graph.

[0025] In this step, the system performs entity boundary identification and relation extraction on lengthy contract texts. The system extracts association constraints from the original natural language text sequence and categorizes these constraints into three types: direct association (e.g., Company A and Company B directly signing a supply agreement), conditional constraints (e.g., Company D repaying debts owed by Company C), and nested subordination (e.g., Company E being controlled by the parent company in terms of asset ownership). The system maps these three types of logic to semantic relationships and constructs the core entities, specifically including the parent company, the transaction target, and collateral, as nodes in a graph network. Next, the system constructs directed edges with different weight attributes based on the semantic relationships to generate the initial topology of the dynamic knowledge graph. Specifically, the system assigns differentiated initial prior edge weight attributes to the corresponding directed edges based on the tightness of risk transmission in commercial contract performance according to different semantic relationships: the weight attribute of directed edges corresponding to direct association logic that directly establishes a creditor-debtor relationship is assigned a value of 1.0; the weight attribute of directed edges corresponding to conditional constraint logic with pre-trigger conditions is assigned a value of 0.8; and the weight attribute of directed edges corresponding to nested subordinate logic that indirectly affects through multi-layer equity or asset control is assigned a value of 0.6. This weight attribute of the directed edges serves as a prior association strength representation of the graph topology. In the subsequent graph attention network calculations in steps S104 and S105, it acts as a prior modulation factor coupled with the attention features output by the single-layer feedforward neural network, or it is mapped as an edge feature vector that directly participates in the calculation of the relative attention coefficient between nodes and their neighbors, as well as the weighted aggregation of neighbor features. Through this mapping mechanism, complex commercial constraint clauses can be structured and spatialized, breaking the limitations of traditional table storage in expressing tree-like or network-like transmission relationships.

[0026] Step S103: Convert the core entity and the clause text into the initial vector representation of the node using a pre-trained language model.

[0027] According to one embodiment, in order to overcome the shortcomings of traditional early warning systems that rely on shallow keyword matching and cannot identify synonyms or complex syntax, this application introduces a deep learning architecture. Step S103 further includes the following steps: performing deep semantic analysis on the clause text using a bidirectional encoder representation model; calculating the attention weight of each character in the clause text based on a self-attention mechanism to mine long-distance semantic dependencies; then, performing average pooling on the character vectors corresponding to the core entity to obtain entity feature vectors; and extracting global feature vectors representing the overall semantics of the clause text, such as extracting the classification flag vector of the sequence start position; then, concatenating the entity feature vector with the global feature vector, fusing the local features of the core entity with the global features of the clause text, and performing dimensional unification mapping on the concatenated vector through a fully connected layer to output the initial vector representation.

[0028] In this embodiment, the node set of the dynamic knowledge graph is defined as follows: The edge set is .node The initial feature vectors are dimensionality-reduced and mapped to a continuous vector space of fixed dimensions. Specifically, the nodes... initial feature vector The mathematical expression for a 768-dimensional real number space is:

[0029]

[0030] in, Indicates the first in the figure Each node represents the initial feature vector obtained after model transformation via a bidirectional encoder, with its unit being dimensionless floating-point feature values; subscripts For node indexes, representing specific core entities in the graph; This indicates that the vector resides in a 768-dimensional real space, where 768 is the fundamental hidden layer dimension parameter of the bidirectional encoder representation model. This model architecture not only integrates literal meaning but also encodes business context and legal attributes into a high-dimensional space, thus providing subsequent node operations with sufficient semantic basis.

[0031] Step S104: Use a graph attention network to perform feature dimensionality reduction on the node and calculate the relative attention coefficient between the node and its corresponding neighboring nodes.

[0032] After acquiring the initial features, the system constructs a graph attention network to update the graph structure features. This network is used for each semantic relation edge in the dynamic topology. The system linearly projects the initial vector representation into the feature transformation matrix of the graph attention network to generate a dimensionality-reduced feature vector, thereby reducing the number of parameters in subsequent matrix operations. In this embodiment, the feature transformation matrix is ​​configured with a dimension of 128×768, which is used to linearly project the 768-dimensional initial vector representation to a 128-dimensional low-dimensional feature space, generating a 128-dimensional dimensionality-reduced feature vector. Then, the 128-dimensional dimensionality-reduced feature vector corresponding to the node is concatenated with the 128-dimensional dimensionality-reduced feature vector corresponding to the neighbor node to generate a 256-dimensional joint feature vector, which is then input into a single-layer feedforward neural network. Based on the output of the single-layer feedforward neural network and combined with a nonlinear activation function, the non-normalized attention score between the node and the neighbor node is calculated. This non-normalized attention score is used to characterize the relative attention coefficient before normalization processing. Specifically, by... and nodes After the characteristic transformation matrix The dimensionality-reduced feature vectors are concatenated and then transposed with the 256-dimensional attention weight vector matrix of the feedforward neural network. Dot product is performed, and finally, a leaky rectified linear unit activation function with a negative half-axis slope hyperparameter configured to 0.2 is applied. Perform nonlinear activation to calculate the nodes. With nodes The nonnormalized attention scores between In engineering implementation, the directed edge weight attributes constructed in step S102 (such as 1.0 for direct association, 0.8 for conditional constraints, and 0.6 for nested subordination) serve as prior edge modulation coefficients. These coefficients can be multiplied into the non-normalized attention score after the output of the single-layer feedforward neural network, or fused into the relative attention coefficients as prior weighting factors of the exponential function during subsequent normalization calculations. This allows the graph attention network to adaptively learn semantic associations while also considering the prior legal constraint strength of contractual terms. The specific calculation formula for the non-normalized attention score is as follows:

[0033]

[0034] in, Represents a node Features of nodes Importance score; It is a rectified linear unit with leakage, used to maintain a small gradient when the input is negative, to prevent neurons from dying during training; This is the transpose of the attention weight vector matrix of a single-layer feedforward neural network; This represents the concatenation operation of vectors; The linear feature transformation matrix is ​​shared by all nodes; and These are the input feature vectors for the corresponding nodes.

[0035] Step S105: After normalizing the relative attention coefficients, perform multiple aggregation iterations with the neighbor nodes to obtain a new node feature vector containing multi-hop relationship features.

[0036] To ensure the numerical stability of the attention coefficient across different node structures and to eliminate dimensional distortion caused by local dense connections, the system normalizes the coefficients to obtain the normalized relative attention coefficients. This processing is performed through compute nodes. For nodes Nonnormalized attention score The exponential value, divided by the node With all its directly connected neighbor nodes The sum of the exponential values ​​of the nonnormalized attention scores between them is mathematically expressed as:

[0037]

[0038] in, This indicates that after normalization, the node... For nodes The actual semantic impact weight is limited to a value between 0 and 1; Represented by natural constant An exponential function with base 0; Representing nodes in a graph structure The set of all directly connected neighbor nodes; This is the index variable for traversing the set of neighbor nodes. It should be noted that this refers to the denominator in the formula. Since the range of the exponential function is always greater than zero, and the set of neighboring nodes contains at least the node itself, the denominator is always greater than zero in objective mathematical logic, ensuring that the division operation will not overflow or divide-by-zero exception, thus guaranteeing the robustness of the algorithm.

[0039] After obtaining stable weights, the system performs an aggregation operation. Specifically, it aggregates all neighboring nodes. After the characteristic transformation matrix The dimensionality-reduced vector and its corresponding relative attention coefficient Perform a weighted summation, then input it into a nonlinear activation function. Activation is performed, and the new feature vector of the node after a single aggregation is calculated. The feature transfer logic formula for a single-head aggregated feature vector is as follows:

[0040]

[0041] in, For nodes updated after aggregation The new feature vector; The activation function is nonlinear, used to introduce nonlinear expressive power. Further, to enhance the stability of feature extraction, the system employs a multi-head attention mechanism to independently calculate multiple sets of the feature transformation matrices and the non-normalized attention scores, obtaining multiple independently calculated single-head aggregated feature vectors, which are then concatenated. Finally, the concatenated feature vectors are iteratively passed through multiple hidden layers. Each iteration represents exploring one hop outward in the graph. By performing multiple aggregation iterations, the system can transmit the risk features of indirect neighbors, such as the guarantee company at the far end of the supply chain, to the core node, completing the high-dimensional fusion of multi-hop relationship features.

[0042] Step S106: Calculate the comprehensive risk probability value of triggering the default event using a classifier based on the new feature vector of the node.

[0043] The system inputs the new feature vector of the node into a pre-trained multilayer perceptron classifier. The multilayer perceptron classifier performs a nonlinear mapping on the new feature vector of the node through multiple cascaded linear transformation layers and a modified linear unit activation function, further extracting risk factors. Then, a normalized exponential function layer is connected to the end of the multilayer perceptron, outputting the probability distribution corresponding to each risk level. The system extracts the target classification probability value representing the occurrence of a cascading default event from the probability distribution and uses this target classification probability value as the comprehensive risk probability value, which ranges from 0 to 1. During the model pre-training phase, the system acquires historical contract archive data and actual performance audit records from the Enterprise Resource Planning (ERP) system to construct a training sample set. For each historical core entity node in the training sample set, the system uses one-hot encoding to label the true risk level based on whether it actually triggered normal performance, general overdue, or cascading default events within the performance period. The system inputs the historical contract graph into the graph attention network and multilayer perceptron classifier to perform forward propagation, outputs the predicted probability distribution, and uses a multi-class cross-entropy loss function to calculate the negative log-likelihood loss value between the predicted probability distribution and the true risk level label for each training sample. When the risk judgment is simplified to a binary classification scenario of whether cascading defaults have occurred, the corresponding binary cross-entropy loss function is used to calculate the cross-entropy deviation between the true binary label and the target classification probability value. Subsequently, the system uses a backpropagation algorithm combined with an adaptive moment estimation optimizer to synchronously and iteratively update the linear transformation layer weights of the multilayer perceptron classifier, the feature transformation matrix of the graph attention network, and the attention weight parameters of the single-layer feedforward neural network according to the gradient of the loss function, until the cross-entropy loss value converges to the preset error range. After the model training converges and is put into online inference, in order to accurately intercept cascading default risks in step S107 while taking into account the alarm accuracy, the preset threshold value range built into the system is set between 0.70 and 0.85, and in this embodiment, it is preferably configured as 0.75 or 0.80; at the same time, when the reverse parsing logic of the transmission path is triggered, the relation threshold value range used to filter the target directed edges is set between 0.20 and 0.45, and it is preferably configured as 0.3, so as to ensure that the extracted risk transmission path fully covers the main default contribution links and removes weakly related noise edges.

[0044] Step S107: When the comprehensive risk probability value exceeds a preset threshold, alarm data containing the risk transmission path is sent to the front end.

[0045] The system periodically or in real-time compares the comprehensive risk probability value with a pre-set risk threshold. When the comprehensive risk probability value exceeds the pre-set threshold, the reverse analysis logic of the transmission path is triggered. The system backtracks and reads the relative attention coefficient between the node and its neighboring nodes calculated during the multiple aggregation iterations. The system sets a relationship threshold, for example, 0.3, and filters out target directed edges whose relative attention coefficient is greater than the relationship threshold. These edges represent the transmission links that contribute the most to the default risk. Subsequently, following the reverse hierarchical order of feature aggregation, the system traces the connected components between the high-risk core entities and the initial triggering core entities that caused the risk. The system hierarchically concatenates the target directed edges and nodes corresponding to the connected components into chain-structured data, converts it into the visualized or textualized risk transmission path, encapsulates it into the alarm data, and sends it to the front end for risk control personnel to view via the data bus.

[0046] In another embodiment of this application, combined with Figure 2 As shown, a contract early warning device integrating knowledge graph is provided in an ERP scenario. It is deployed on a server or cloud computing node as a virtualized functional architecture. The device includes a data access module 201, a knowledge graph construction module 202, a vector conversion module 203, a multi-hop reasoning module 204, and a discrimination alarm module 205.

[0047] The data access module 201 is configured to acquire contract documents circulating in the enterprise resource planning system and convert the contract documents into a sequence of raw natural language text.

[0048] The graph construction module 202 is connected to the data access module 201 via an internal data bus. It is configured to input the original natural language text sequence into the semantic analysis module for extraction to obtain core entities, clause texts and semantic relationships. The core entities and semantic relationships are then mapped to nodes and directed edges of a dynamic knowledge graph.

[0049] The vector conversion module 203 is connected to the graph construction module 202 and is configured to call a pre-trained language model base that includes model parameter fine-tuning, knowledge distillation and operator fusion techniques to convert the core entity and the clause text into the initial vector representation of the node through the pre-trained language model.

[0050] The multi-hop inference module 204 is connected to the vector transformation module 203 and is configured to use a graph attention network to perform feature dimensionality reduction on the node, calculate the relative attention coefficient between the node and its corresponding neighbor nodes, and perform multiple aggregation iterations on the relative attention coefficients after normalization and in combination with the neighbor nodes to obtain a new feature vector of the node containing multi-hop relationship features.

[0051] The discrimination alarm module 205 is connected to the multi-hop inference module 204 and is configured to use a classifier to calculate the comprehensive risk probability value of triggering a default event based on the new feature vector of the node. When the comprehensive risk probability value exceeds a preset threshold, an alarm command is generated and alarm data containing the risk transmission path is sent to the front end.

[0052] Furthermore, this application also provides a computer device that provides underlying computing power and storage support for the aforementioned contract early warning method and apparatus. The computer device includes: a memory configured to store computer program instructions; and a processor connected to the memory via a physical bus, configured to execute the computer program instructions to implement the method described in any of the preceding claims of this application. Specifically, the processor can be a general-purpose central processing unit, microprocessor, digital signal processor, application-specific integrated circuit, or a field-programmable gate array (FPGA) and graphics processing unit (GPU) configured to accelerate large-scale model inference. The memory can include random access memory (RAM) or non-volatile storage media, such as disk storage, flash memory, or read-only memory (ROM).

[0053] Furthermore, embodiments of this application also provide a computer-readable storage medium in which computer program instructions are stored non-volatilely; when the computer program instructions are invoked and executed by a processor, they are used to implement the contract early warning method integrating knowledge graphs in the ERP scenario described in any of the above embodiments of this application. This storage medium includes, but is not limited to, various media carriers capable of storing digital program code, such as universal serial bus flash drives, portable hard drives, optical discs, magnetic disks, or solid-state storage arrays partitioned within cloud servers.

[0054] It should be noted that the various model parameters, network layers, feature vector dimensions, and hardware structure combinations in the above embodiments are merely examples. Those skilled in the art can achieve the intended technical objectives of this application by employing conventional alternative algorithms, similar natural language large-scale model bases, equivalent activation functions, or equivalent hardware components, without departing from the core inventive concept of this application. The scope of protection of this application is not limited to the specific parameters and implementation environment described above, but should be determined by the scope defined in the claims.

Claims

1. A contract early warning method integrating knowledge graph in an ERP scenario, characterized in that, include: Obtain the contract documents circulating in the Enterprise Resource Planning (ERP) system and convert the contract documents into a raw natural language text sequence; The original natural language text sequence is input into the semantic analysis module for extraction to obtain core entities, clause texts and semantic relations, and the core entities and semantic relations are mapped to nodes and directed edges of a dynamic knowledge graph. The core entities and the clause text are converted into initial vector representations of the nodes using a pre-trained language model; A graph attention network is used to reduce the dimensionality of the node's features, and the relative attention coefficient between the node and its corresponding neighboring nodes is calculated. After normalizing the relative attention coefficients, multiple aggregation iterations are performed on the neighbor nodes to obtain a new node feature vector containing multi-hop relationship features; The classifier is used to calculate the comprehensive risk probability value that triggers the default event based on the new feature vector of the node; When the overall risk probability value exceeds a preset threshold, alarm data containing the risk transmission path is sent to the front end.

2. The method as described in claim 1, characterized in that, The process of mapping the core entities and semantic relationships to nodes and directed edges in a dynamic knowledge graph includes: Extract the association constraints from the original natural language text sequence; The aforementioned association constraints are classified into three categories: direct association, conditional constraint, and nested subordination. The three types of logical relationships—direct association, conditional constraint, and nested subordination—are mapped to semantic relationships. The core entity is constructed as the node; Based on the semantic relationships, directed edges with different weight attributes are constructed to generate the initial topology of the dynamic knowledge graph.

3. The method as described in claim 1, characterized in that, The step of converting the core entity and the clause text into the initial vector representation of the node using a pre-trained language model includes: A bidirectional encoder representation model is used to perform deep semantic analysis on the clause text; The attention weight of each character in the clause text is calculated based on the self-attention mechanism; The character vectors corresponding to the core entities are subjected to average pooling to obtain entity feature vectors; Extract the global feature vector representing the overall semantics of the clause text; The entity feature vector is concatenated with the global feature vector to fuse the local features of the core entity with the global features of the clause text; The concatenated vectors are then mapped to a unified dimension through a fully connected layer to output the initial vector representation.

4. The method as described in claim 1, characterized in that, The graph attention network is used to perform feature dimensionality reduction on the nodes, and the relative attention coefficients between the nodes and their corresponding neighboring nodes are calculated. The relative attention coefficients before normalization are represented by non-normalized attention scores, including: The initial vector representation is linearly projected onto the feature transformation matrix input to the graph attention network to generate a dimension-reduced feature vector. The dimensionality-reduced feature vector corresponding to the node is concatenated with the dimensionality-reduced feature vector corresponding to the neighbor node; The concatenated joint feature vector is input into a single-layer feedforward neural network; Based on the output of the single-layer feedforward neural network and combined with the nonlinear activation function, the nonnormalized attention score between the node and its neighboring nodes is calculated.

5. The method as described in claim 4, characterized in that, The relative attention coefficients, after being normalized, are combined with neighboring nodes to perform multiple aggregation iterations, resulting in a new node feature vector containing multi-hop relationship features, including: A multi-head attention mechanism is used to independently calculate multiple sets of the feature transformation matrices and the non-normalized attention scores; The unnormalized attention score is calculated using an exponential function and divided by the sum of the exponential function outputs of all the neighboring nodes to obtain the normalized relative attention coefficient. The dimensionality-reduced feature vectors of the neighboring nodes are weighted and summed with the corresponding relative attention coefficients to obtain a single-head aggregated feature vector; The single-head aggregated feature vectors obtained from multiple independent calculations are concatenated. The concatenated feature vector is passed through multiple hidden layers iteratively to output the new feature vector of the node.

6. The method as described in claim 1, characterized in that, The step of using a classifier to calculate the comprehensive risk probability value of triggering a default event based on the new feature vector of the node includes: The new feature vector of the node is input into the multilayer perceptron classifier; The multilayer perceptron classifier performs nonlinear mapping on the new feature vector of the node through multiple cascaded linear transformation layers and a modified linear unit activation function; The probability distribution corresponding to each risk level is output using a normalized exponential function layer. Extract the target classification probability value representing the occurrence of a cascading default event from the probability distribution; The target classification probability value is used as the comprehensive risk probability value.

7. The method as described in claim 1, characterized in that, When the overall risk probability value exceeds a preset threshold, alarm data containing the risk transmission path is sent to the front end, including: When the overall risk probability value exceeds a preset threshold, the reverse analysis logic of the transmission path is triggered; Read the relative attention coefficients between the node and its neighboring nodes, calculated during the multiple aggregation iterations; Filter out the target directed edges whose relative attention coefficient is greater than the relation threshold; Following the reverse hierarchical order of feature aggregation, trace the connected components between the core entity in a high-risk state and the core entity that initially triggered the risk; The target directed edges and nodes corresponding to the connected components are concatenated hierarchically to form a chain structure data; The chain structure data is converted into the risk transmission path and encapsulated into the alarm data before being sent to the front end.

8. A contract early warning device integrating knowledge graph in an ERP scenario, characterized in that, include: The data access module is configured to acquire contract documents circulating in the enterprise resource planning system and convert the contract documents into a raw natural language text sequence; The graph construction module is connected to the data access module and is configured to input the original natural language text sequence into the semantic analysis module for extraction to obtain core entities, clause texts and semantic relations, and map the core entities and semantic relations into nodes and directed edges of the dynamic knowledge graph; The vector conversion module, connected to the graph construction module, is configured to convert the core entity and the clause text into the initial vector representation of the node through a pre-trained language model; The multi-hop inference module, connected to the vector transformation module, is configured to use a graph attention network to perform feature dimensionality reduction on the node, calculate the relative attention coefficient between the node and its corresponding neighboring nodes, and perform multiple aggregation iterations on the relative attention coefficients after normalization, in combination with the neighboring nodes, to obtain a new feature vector of the node containing multi-hop relationship features. The alarm discrimination module is connected to the multi-hop inference module and is configured to use a classifier to calculate the comprehensive risk probability value of triggering a default event based on the new feature vector of the node. When the comprehensive risk probability value exceeds a preset threshold, alarm data containing the risk transmission path is sent to the front end.

9. A computer device, characterized in that, include: Memory, configured to store computer program instructions; A processor, connected to the memory, configured to execute the computer program instructions to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions; When the computer program instructions are executed, they are used to implement the method as described in any one of claims 1 to 7.