Multi-tenant law knowledge base cloud service system
By using a multi-tenant legal knowledge base cloud service system, federated learning technology is employed to generate an appearance graph on the tenant's end and update the weight matrix in the cloud. This solves the problems of data privacy and logical reasoning, and enables personalized and secure updates and responses to the legal knowledge base.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-03
AI Technical Summary
Existing legal knowledge base systems have data privacy and security issues in multi-tenant application scenarios. They cannot effectively integrate private data from different tenants, and the generated conclusions lack verifiable logical reasoning paths, making it difficult to meet the needs of professional legal scenarios.
The system employs a multi-tenant legal knowledge base cloud service system, including a core knowledge base module, a tenant knowledge processing module, a federated learning engine, and a reasoning and response module. By generating an appearance graph on the tenant side and performing federated learning in the cloud, the system dynamically updates the gene regulation network weight matrix, ensuring data privacy and security while enabling personalized reasoning and logically rigorous responses.
It enables the dynamic evolution of the knowledge base while protecting tenant data privacy, providing personalized, traceable, and logically rigorous reasoning processes and answers to meet the in-depth needs of professional legal scenarios.
Smart Images

Figure CN121787534A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, specifically to a multi-tenant legal knowledge base cloud service system. Background Technology
[0002] With the development of information technology, the legal services industry is increasingly leveraging digital tools and artificial intelligence to improve work efficiency and decision-making quality. Currently, legal professionals widely rely on various electronic legal databases, case retrieval systems, and emerging legal AI models to obtain information and conduct auxiliary analysis. The application of these technologies has significantly reduced the time required for legal retrieval and information processing.
[0003] However, existing technological solutions have revealed inherent limitations in in-depth applications. On the one hand, traditional legal knowledge base systems typically adopt a centralized deployment model, resulting in generic and static knowledge content that cannot effectively integrate the large amounts of highly confidential case data, contract templates, and unique business knowledge accumulated within different legal entities (such as law firms and corporate legal departments). Requiring these entities to upload their sensitive data to the cloud for centralized processing would raise serious data security and privacy compliance risks, which is generally unacceptable in the industry. Consequently, the valuable knowledge of each organization forms data silos, failing to contribute to the evolution and intelligentization of the entire legal knowledge system while protecting privacy, thus preventing the knowledge base from maximizing its value.
[0004] On the other hand, while artificial intelligence technologies, represented by large language models, have shown remarkable performance in text understanding and generation in recent years, their application in the highly specialized legal field faces a black-box dilemma. The conclusions generated by these models often lack clear and verifiable logical reasoning paths, making it difficult for users to trace whether their judgments are based on accurate legal provisions or logical relationships, and even leading to factual errors or illusions. For legal work, the process of arriving at a conclusion is as important as the conclusion itself. A system that cannot provide a rigorous causal chain and legal basis will have significantly reduced reliability and will be difficult to use as the final reference for serious legal decisions.
[0005] Therefore, there is an urgent need for a new technical solution that can achieve the collaborative evolution and continuous optimization of knowledge models while absolutely guaranteeing the privacy and security of legal data for all parties, and can also provide users with personalized, traceable and logically rigorous reasoning processes and answers for specific queries, thereby truly meeting the deep-seated needs in professional legal scenarios. Summary of the Invention
[0006] Existing legal knowledge base systems often suffer from outdated knowledge updates and an inability to reflect dynamic legal practices. Furthermore, in multi-tenant applications, utilizing each tenant's private knowledge to optimize the central model typically requires uploading raw private data, posing technical challenges to data security and privacy protection. Simultaneously, a unified knowledge base struggles to meet the personalized reasoning needs of different tenants in specific legal domains.
[0007] Therefore, there is an urgent need in this field to provide a new technical solution to achieve dynamic evolution and personalized reasoning of knowledge bases while ensuring tenant data privacy.
[0008] To address the aforementioned technical problems, this invention provides a multi-tenant legal knowledge base cloud service system, which includes: a core knowledge base module, a tenant knowledge processing module, a federated learning engine, and a reasoning and response module.
[0009] The core knowledge base module stores a standardized core digital legal genome. This core digital legal genome includes: multiple legal concept gene nodes, each representing an atomized legal concept unit; edges defining the legal logical relationships between the legal concept gene nodes, specifically including constitutive, citation, modification, or repeal relationships; and a gene regulatory network weight matrix, which characterizes the influence strength of the legal logical relationships.
[0010] The tenant knowledge processing module is configured on the tenant's end. This module generates a tenant knowledge appearance graph for each tenant's private legal knowledge (e.g., internal legal insights, case data, or contract templates) and establishes a link mapping between private knowledge nodes in the tenant knowledge appearance graph and legal concept gene nodes in the core digital legal genome. A key technical feature is that the tenant knowledge processing module performs association operations without altering the structure and content of the core digital legal genome.
[0011] The federated learning engine is used to dynamically update the gene regulation network weight matrix in the core knowledge base module. This engine includes multiple local gradient calculation units deployed on each tenant's end, and a global weight aggregation unit deployed on a cloud server.
[0012] Each local gradient computation unit is configured to compute a local gradient information within a tenant's private environment, based on the tenant's tenant knowledge epigenetic graph and core digital legal genome. This computation process aims to optimize the gene regulatory network weight matrix to fit local knowledge, and the unit only uploads the computed local gradient information, without uploading any original private legal knowledge.
[0013] Specifically, for the k-th tenant, its local gradient information g k It can be calculated using the following formula:
[0014]
[0015] Where W is the current global gene regulatory network weight matrix, and D k For the private legal knowledge of the k-th tenant, L k For the private knowledge D of tenant k k The loss function defined above, This is the gradient operator.
[0016] The global weight aggregation unit is configured to receive and aggregate local gradient information from multiple local gradient calculation units without accessing the original private legal knowledge of each tenant, in order to calculate the global update gradient used to update the gene regulation network weight matrix. The aggregation process can be represented by the following formula: W new =W old -η * Σ(n k / n*g k );
[0017] Among them, W new The updated gene regulatory network weight matrix W old The matrix before the update is given, where η is the learning rate and g is the matrix before the update. k For the local gradient information received from the k-th tenant, n k Let n be the local training sample size of the k-th tenant, and n be the total sample size of all tenants participating in the computation. The federated learning engine is configured to periodically execute the above federated learning task.
[0018] The inference response module is used to respond to user query requests. This module first forms a temporary fusion graph by fusing the core digital legal genome and the current tenant's tenant knowledge appearance graph. Subsequently, on this fusion graph, a weighted path search algorithm is executed using the gene regulatory network weight matrix, which has been dynamically updated by the federated learning engine, to identify and output high-weight logical paths as the basis for inference.
[0019] The module further includes a causal chain verification engine and a natural language generation unit. The causal chain verification engine is configured to verify the high-weight logical path before generating the final response. The verification content includes at least the logical consistency and timeliness of the legal concept gene nodes involved in the path. The natural language generation unit is configured to receive the high-weight logical path verified by the causal chain verification engine as context, and generate a response in natural language form based on this context.
[0020] In addition, the system also includes a user isolation and permission management module to ensure that each tenant's tenant knowledge appearance graph and its link mapping relationship are only visible and available to that tenant.
[0021] This invention provides a multi-tenant legal knowledge base cloud service system. It has the following beneficial effects:
[0022] 1. This invention sets up a federated learning engine and deploys the local gradient calculation unit in the tenant's private environment. It only uploads gradient information that does not contain the original data, while the global weight aggregation unit in the cloud completes the model update without touching the tenant's original private legal knowledge. While using knowledge from multiple parties for collective optimization, it ensures that the tenant's private legal knowledge does not leave the local environment, thus effectively solving the privacy protection problem of sensitive data in a multi-tenant environment.
[0023] 2. This invention uses a federated learning engine configured to periodically perform learning tasks, which can continuously aggregate local gradient information from the collective legal practices of multiple tenants and dynamically update the gene regulation network weight matrix in the core knowledge base. This enables the core knowledge model of the system to evolve adaptively and reflect the latest legal insights and changes in the strength of logical relationships in a timely manner, thus solving the technical pain points of traditional static knowledge bases being slow to update and unable to reflect dynamic practices.
[0024] 3. This invention generates a private tenant knowledge appearance graph for each tenant, and the reasoning response module merges this graph with a standardized core digital legal genome when responding to a request. The reasoning process is carried out on a temporary fusion graph containing tenant-specific knowledge context. The generated response result is not only based on general legal knowledge, but also combined with the current tenant's internal insights or case data, thereby significantly improving the personalization level and business relevance of the response. Attached Figure Description
[0025] Figure 1 This is a functional module architecture diagram of a multi-tenant legal knowledge base cloud service system according to an embodiment of the present invention;
[0026] Figure 2 This is a flowchart of a federated learning update process according to an embodiment of the present invention;
[0027] Figure 3 This is a flowchart illustrating the reasoning and response process according to an embodiment of the present invention. Detailed Implementation
[0028] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] See attached document Figure 1 , Figure 1 This is a functional module architecture diagram of a multi-tenant legal knowledge base cloud service system according to an embodiment of the present invention.
[0030] This invention provides a multi-tenant legal knowledge base cloud service system, which physically includes a cloud server and multiple isolated tenant servers. Logically, the system includes a core knowledge base module, a tenant knowledge processing module, a federated learning engine, and a reasoning and response module.
[0031] The cloud server deploys a core knowledge base module, an inference and response module, a user isolation and permission management module, and a global weight aggregation unit in the federated learning engine. The tenant deploys a tenant knowledge processing module and a local gradient calculation unit in the federated learning engine.
[0032] The core knowledge base module is used to store a standardized core digital legal genome, which includes legal concept gene nodes, edges defining the legal logical relationships between legal concept gene nodes, and a gene regulatory network weight matrix.
[0033] The tenant knowledge processing module is configured on the tenant's end to process the tenant's private legal knowledge and generate a tenant knowledge appearance graph. The tenant knowledge processing module also establishes a link mapping relationship between the private knowledge nodes in the tenant knowledge appearance graph and the legal concept gene nodes in the core knowledge base module.
[0034] The federated learning engine performs distributed computation to update the gene regulation network weight matrix in the core knowledge base module. The global weight aggregation unit in the federated learning engine distributes the current gene regulation network weight matrix from the cloud server to local gradient computation units on multiple tenants. After completing computation in their private environments, the local gradient computation units upload their local gradient information to the global weight aggregation unit on the cloud server. Based on the received local gradient information, the global weight aggregation unit updates the gene regulation network weight matrix.
[0035] The reasoning and response module is deployed on the cloud server and is used to receive and process user query requests from the tenant. When processing a request, the reasoning and response module calls the core digital legal genome stored in the core knowledge base module and combines it with the tenant knowledge appearance graph of the current tenant that initiated the request to generate a response and return it to the tenant.
[0036] The user isolation and access control module ensures that each tenant's tenant knowledge graph and corresponding link mappings are only visible and usable to that tenant, achieving data isolation between different tenants. The cloud server and each tenant's client interact with data via a secure network communication protocol.
[0037] The data flow and connection relationships between the core functional modules in the multi-tenant legal knowledge base cloud service system are as follows: The core knowledge base module, as the storage center of standard knowledge, provides the core digital legal genome to the reasoning and response module of the cloud server for query reasoning, and provides the gene regulation network weight matrix to the global weight aggregation unit of the federated learning engine for updating.
[0038] The tenant knowledge processing module, deployed on the tenant's end, generates a tenant knowledge appearance graph and link mapping relationships after receiving the tenant's private legal knowledge. This tenant knowledge appearance graph and link mapping relationships are provided, on the one hand, to the local gradient computing unit on the same tenant's end as the data foundation for performing local computations; on the other hand, when a user initiates a query, they are provided to the cloud server's inference and response module for integration with the core digital legal genome.
[0039] The federated learning engine executes a closed-loop distributed update process. The global weight aggregation unit distributes the latest gene regulation network weight matrix to the local gradient calculation units on each tenant's end. The local gradient calculation units calculate local gradient information based on the received matrix and the tenant's knowledge appearance graph, and then upload it. The global weight aggregation unit receives and aggregates multiple local gradient information, calculates the global update gradient, and uses this global update gradient to update the gene regulation network weight matrix in the core knowledge base module, completing one update cycle.
[0040] Upon receiving a query request from a specific tenant, the reasoning and response module retrieves the core digital legal genome from the core knowledge base module and, based on the verification results from the user isolation and permission management module, obtains the tenant knowledge appearance graph corresponding to that specific tenant. The reasoning and response module integrates the above knowledge, performs reasoning calculations, and returns the generated response result to the tenant that initiated the request.
[0041] The user isolation and permission management module authenticates all requests to access tenant private data, ensuring that the inference response module can only call the tenant knowledge appearance graph that matches the source of the current query request when responding to a query, thereby achieving strict isolation between different tenant data.
[0042] The construction of the core digital legal genome in the core knowledge base module first involves the construction of legal concept gene nodes. Legal concept gene nodes are the atomic data units that constitute the core digital legal genome.
[0043] The construction of legal concept gene nodes is based on pre-collected legal knowledge source texts. These source texts include national laws, administrative regulations, departmental rules, judicial interpretations, and guiding cases.
[0044] In one specific embodiment, the source text of legal knowledge is processed to extract legal concepts, and this processing applies natural language processing techniques. Specifically, one or more pre-trained named entity recognition models are used to scan and analyze the source text of legal knowledge to identify and extract the smallest conceptual units with clear legal meaning.
[0045] The named entity recognition model is configured to recognize entity types including: legal subjects, legal acts, legal facts, legal principles, and specific legal terms.
[0046] Each identified and extracted smallest conceptual unit is instantiated as an independent legal concept gene node in the core digital legal genome. For example, concepts such as contract, breach of contract, and pre-contractual liability are extracted from contract law texts, and a corresponding legal concept gene node is created and stored for each concept.
[0047] Each legal concept gene node is assigned a unique node identifier and contains attribute information. The attribute information includes the concept name of the node, the source text, and a defining description extracted from the source text, to ensure that each legal concept gene node has a definite technical meaning in the core digital legal genome.
[0048] After completing the construction of legal concept gene nodes in the core knowledge base module, it is necessary to further define the legal logical relationships between legal concept gene nodes.
[0049] In the core digital legal genome, legal logical relationships are manifested as edges connecting different legal concept gene nodes. The definition process of legal logical relationships is achieved by deeply analyzing source texts of legal knowledge and applying relation extraction technology to identify and establish them.
[0050] Legal logical relationships include constitutive relationships, citation relationships, modification relationships, and repeal relationships.
[0051] Constituent relationships are used to describe the relationship between a complex legal concept and its constituent elements. For example, for a legal concept gene node representing the crime of contract fraud, by analyzing the descriptions of the constituent elements of this crime in the criminal law provisions, a constitutive relationship can be identified between it and legal concept gene nodes representing multiple constituent elements such as intent to illegally possess, fabrication of facts, or concealment of the truth. During identification, the system analyzes declarative or enumerative sentence structures in the text, such as "...refers to..." or "...includes the following situations:".
[0052] Citation relationships are used to describe the logic of mutual reference between legal provisions or concepts. For example, if legal provision A explicitly mentions "...the provisions of Article B of this Law apply," the system establishes a citation relationship edge between the two legal concept gene nodes representing provisions A and B, respectively. This relationship is identified by pattern matching in the text, searching for keywords such as "refer to," "apply to," and "in accordance with."
[0053] Modification relationships are used to describe revisions and changes between old and new legal texts. For example, when a legal amendment is issued, the system analyzes the amendment text and establishes a modification relationship between the legal concept gene node representing the new article and the legal concept gene node representing the original Article X for content that states "Article X is amended to...".
[0054] The repeal relationship describes how a legal text or clause is superseded and rendered invalid by a new legal text or clause. For example, if a newly promulgated law Y stipulates that law Z is repealed from the date of its implementation, the system establishes a repeal relationship between the legal concept gene node representing law Y and the legal concept gene node representing law Z.
[0055] Each identified legal logical relationship is instantiated in the core digital legal genome as a directed edge connecting the corresponding legal concept gene nodes, and the edge is assigned an attribute that identifies its relationship type.
[0056] After constructing the legal concept gene nodes and defining the legal logical relationships between the nodes, it is necessary to initialize the gene regulation network weight matrix in the core knowledge base module.
[0057] The gene regulatory network weight matrix is structurally an N×N matrix W, where N is the total number of legal concept gene nodes in the core digital legal genome. The elements W in the matrix... ij Used to characterize the strength of the influence of the legal logical relationship from legal concept gene node i to legal concept gene node j.
[0058] In one specific embodiment, the initialization process of the gene regulatory network weight matrix includes the following steps: assigning all elements W to matrix W... ij Initially, a default value, such as 0, is set; subsequently, the values of specific elements in the matrix are set based on the source text of legal knowledge and the defined legal logical relationships.
[0059] One approach is based on statistical analysis. By analyzing source texts of legal knowledge, the frequency of co-occurrence of different legal concept gene nodes within the same legal clause, paragraph, or sentence is calculated. For any two legal concept gene nodes i and j, their corresponding weight value W is assigned. ij Values can be assigned based on their co-occurrence frequency. For example, the calculated co-occurrence frequency can be mapped to a preset weight range using a normalization function, and this range can be used as W. ij The initial value.
[0060] Another approach is rule-based assignment. For each identified type of legal logical relationship, a predefined weight value is assigned. For example, for an edge defined as a constitutive or referential relationship, the weight W corresponding to the legal concept gene nodes i and j connected by it is assigned. ij The weight W is set to a predefined high value. For edges defined as obsolete, the corresponding weight W... ij It can be set to a specific negative value to characterize the suppression or exclusion effect in subsequent calculations.
[0061] Furthermore, the initialization process can be integrated with a pre-defined expert knowledge rule base. This rule base stores the logical influence strengths between gene nodes representing specific legal concepts, predefined by legal experts. Based on this rule base, the system assigns weights W to the corresponding elements W in the gene regulatory network weight matrix. ij Perform precise assignment.
[0062] After initialization, the gene regulation network weight matrix provides an initial baseline state for the subsequent dynamic updates of the federated learning engine and the weighted inference calculations of the inference response module.
[0063] The tenant knowledge processing module is configured on the tenant's end and is used to process the tenant's private legal knowledge in the tenant's private computing environment.
[0064] Private legal knowledge refers to non-public legal documents held by tenants, specifically including electronic documents such as tenant's historical contract templates, internal legal case files, business compliance review records, and internal legal opinions.
[0065] In one specific embodiment, the tenant knowledge processing module processes private legal knowledge to extract private knowledge nodes and the relationships between them. This processing utilizes natural language processing technology. First, the tenant knowledge processing module employs one or more named entity recognition models to analyze the private legal knowledge document, identifying and extracting tenant-specific, atomic knowledge units as private knowledge nodes. For example, from a contract template, specific equipment delivery terms, product quality acceptance standards, and supplementary dispute resolution agreements can be extracted as private knowledge nodes.
[0066] After extracting the private knowledge nodes, the tenant knowledge processing module further employs a relation extraction model to analyze the context between the extracted private knowledge nodes in the private legal knowledge document, in order to identify the semantic or logical relationships between them. For example, if the document describes that achieving product quality acceptance standards is a prerequisite for fulfilling specific equipment delivery terms, then a dependency relationship representing the prerequisite is established between the corresponding two private knowledge nodes.
[0067] Finally, the tenant knowledge processing module uses all extracted private knowledge nodes as vertices of a graph and the identified relationships between these nodes as edges, thus generating a graph-structured data. This graph-structured data is the tenant knowledge appearance graph. This tenant knowledge appearance graph, in a structured manner, represents the internal logic of the tenant's private legal knowledge and is stored on the tenant's end for subsequent link mapping and local gradient calculation.
[0068] After the tenant knowledge processing module generates the tenant knowledge appearance graph on the tenant side, it is necessary to establish a link mapping relationship between the private knowledge nodes in the tenant knowledge appearance graph and the legal concept gene nodes in the core knowledge base module.
[0069] In one specific embodiment, the tenant knowledge processing module executes a link mapping establishment process. This process aims to find a semantically most corresponding legal concept gene node in the core digital legal genome for each private knowledge node. This process is carried out without altering the structure and content of the core digital legal genome.
[0070] Specifically, the tenant knowledge processing module first extracts the text description information of each private knowledge node and uses a pre-trained text vectorization model to convert the text description information into a high-dimensional private knowledge node vector. Simultaneously, the tenant knowledge processing module obtains the text description information of all legal concept gene nodes in the core digital legal genome and uses the same text vectorization model to convert the text description information of each legal concept gene node into a high-dimensional legal concept gene node vector.
[0071] Subsequently, for each private knowledge node vector, the tenant knowledge processing module calculates its semantic similarity with all legal concept gene node vectors. Semantic similarity is derived by calculating the cosine similarity between the two vectors. For a private knowledge node vector V... p and legal concept gene node vector V c The formula for calculating the cosine similarity S between them is:
[0072]
[0073] Among them, V p ·V c It is the dot product of two vectors, ||V p ||and||V c || are the Euclidean norms of the two vectors.
[0074] The tenant knowledge processing module selects the legal concept gene node with the highest similarity value calculated from the current private knowledge node vector as the candidate mapping target. To ensure the accuracy of the mapping, the system sets a predefined similarity threshold. Only when the calculated highest similarity value is greater than this predefined similarity threshold will the tenant knowledge processing module formally establish a link mapping relationship between the current private knowledge node and the candidate legal concept gene node.
[0075] The established link mapping is stored on the tenant's end in the form of a series of tuples. Each tuple contains a unique identifier for a private knowledge node and a unique identifier for a corresponding legal concept gene node. This link mapping aligns the tenant's personalized knowledge with standardized knowledge without intruding on or modifying the core digital legal genome.
[0076] See attached document Figure 2 , Figure 2 This is a flowchart of a federated learning update process according to an embodiment of the present invention. The federated learning engine is configured to periodically execute federated learning tasks to dynamically update the gene regulatory network weight matrix in the core knowledge base module.
[0077] In one specific embodiment, the triggering of federated learning tasks is managed by a timing control unit deployed on a cloud server. The timing control unit automatically initiates a round of federated learning tasks according to a pre-configured time period (e.g., every 24 hours).
[0078] When a federated learning task is triggered, the global weight aggregation unit deployed on the cloud server first performs the participant selection operation. The global weight aggregation unit selects one or more tenants from all currently online tenants as participants in this round of federated learning task.
[0079] After identifying the tenants participating in this round of tasks, the global weight aggregation unit retrieves the latest version of the gene regulatory network weight matrix W from the core knowledge base module.
[0080] Subsequently, the global weight aggregation unit distributes the acquired gene regulation network weight matrix W to each selected tenant terminal via a secure network communication protocol, and the local gradient calculation unit deployed on the corresponding tenant terminal receives it. This distribution process ensures that each participating tenant terminal starts its local calculation based on the same initial weight matrix, and the gene regulation network weight matrix W serves as the benchmark model for local gradient information calculation.
[0081] The local gradient computation unit deployed on the tenant's end, after receiving the current gene regulatory network weight matrix W distributed by the cloud server, performs local gradient information computation within the tenant's private computing environment. The local gradient information computation is based on the received gene regulatory network weight matrix W and the tenant's private data D stored on the tenant's end. k Performed. Private data D k This includes the tenant's tenant knowledge appearance graph and established link mappings. The entire computation process does not depend on any other tenant's data, and the private data D... k Without leaving the tenant's private computing environment.
[0082] In one specific embodiment, the local gradient calculation unit uses a predefined loss function L k (W;D k To quantify the current gene regulatory network weight matrix W on the tenant's private data D k The degree of fit of the underlying legal logic relationships. Loss function L k The aim is to minimize the difference between the prediction results based on matrix W and the tenant's private data D. k The differences between the actual situation and the actual situation.
[0083] For example, the loss function L k This can be designed as a relation prediction function. For a pair of private knowledge nodes in a tenant's knowledge appearance graph, the system can use link mapping relationships to find the corresponding legal concept gene nodes in the core digital legal genome, and calculate the weighted scores of one or more paths based on the gene regulatory network weight matrix W, thereby predicting the strength of the relationship between the pair of private knowledge nodes. Loss function L k This is the difference between the predicted strength and the actual relationship strength observed in the tenant's private legal knowledge (e.g., the association as explicitly defined in the text). The core task of the local gradient computation unit is to compute the loss function L. k The gradient g of the gene regulatory network weight matrix W k gradient g kThe calculation formula is as follows:
[0084]
[0085] in, This represents the local gradient information g calculated by taking the partial derivative with respect to each element of matrix W. k It is a matrix with the same dimensions as the gene regulatory network weight matrix W, where each element indicates the direction and magnitude of the corresponding weight adjustment in order to better fit the private data of tenant k.
[0086] After completing the local gradient information g k After the calculation, the local gradient calculation unit will use the local gradient information g k The global weight aggregation unit is uploaded to the cloud server. During this process, only gradient information that does not contain the tenant's original private legal knowledge is transmitted out of the tenant's end.
[0087] The global weight aggregation unit, deployed on the cloud server, is used to receive local gradient information uploaded by the local gradient calculation units of one or more tenants participating in this round of federated learning tasks.
[0088] In one specific embodiment, after receiving the local gradient information uploaded by all participating tenants, the global weight aggregation unit performs a gradient aggregation operation to calculate a global update gradient. This aggregation operation employs a weighted average algorithm. Specifically, the global weight aggregation unit calculates the global update gradient g. agg The formula is:
[0089]
[0090] Where K is the total number of tenants participating in the computation in this round of federated learning. k It is the local gradient information calculated and uploaded by the local gradient calculation unit of the k-th tenant. k The private data D used by the k-th tenant to calculate local gradient information. k The number of samples. n is the total number of samples from all K participating tenants, i.e.
[0091] After calculating the global update gradient g agg Then, the global weight aggregation unit uses this global update gradient g. agg The current gene regulation network weight matrix is updated. This update process follows the gradient descent method. Specifically, the updated gene regulation network weight matrix W... t+1 The calculation formula is:
[0092] W t+1 =W t -η·g agg;
[0093] Among them, W t This is the gene regulatory network weight matrix before the start of this round of federated learning, i.e., before the update. t+1 This is the updated gene regulatory network weight matrix. η is a pre-defined hyperparameter called the learning rate, used to control the step size for each update.
[0094] The global weight aggregation unit updates the gene regulation network weight matrix W. t+1 Store it back in the core knowledge base module to replace the original matrix W. t Thus, one round of federated learning is complete. The updated gene regulatory network weight matrix W... t+1 This will serve as the basis for calculating subsequent inference response tasks, as well as the initial matrix for distributing tasks in the next round of federated learning.
[0095] See attached document Figure 3 , Figure 3 This is a flowchart illustrating the inference response process according to an embodiment of the present invention. The inference response module is deployed on the cloud server and executes the inference response task after receiving a query request from a specific tenant. The first step of this task is to construct a fusion graph.
[0096] In one specific embodiment, when the inference response module receives a query request, the user isolation and permission management module first authenticates the source of the request to confirm the tenant to which it belongs.
[0097] After successful verification, the reasoning response module performs the following data acquisition operations: First, it retrieves a complete core digital legal genome from the core knowledge base module. The core digital legal genome includes all legal concept gene nodes, the edges between legal concept gene nodes, and the current latest version of the gene regulatory network weight matrix.
[0098] Simultaneously, based on the verified tenant identity, the reasoning response module retrieves the tenant's tenant knowledge appearance graph from the tenant's data storage, as well as the link mapping relationship between the private knowledge nodes in the tenant's knowledge appearance graph and the legal concept gene nodes in the core digital legal genome.
[0099] After acquiring all the necessary data, the inference response module dynamically constructs a temporary fusion graph in the cloud server's memory for this query request. The construction process of this fusion graph is based on the acquired core digital legal genome, and then integrates information from the tenant's knowledge appearance graph.
[0100] Specifically, the reasoning and response module establishes connections between each private knowledge node in the tenant's knowledge appearance graph and the corresponding legal concept gene node in the core digital legal genome, based on the link mapping relationship. At the same time, the edges in the tenant's knowledge appearance graph that describe the relationships between private knowledge nodes are also added to this temporary graph structure.
[0101] The resulting fusion graph is a unified graph structure containing core knowledge and tenant-specific private knowledge. This fusion graph exists only to process the current query request and is released after the response task is completed. Furthermore, the construction process does not alter the original core digital legal genome stored in the core knowledge base module. This fusion graph provides complete data support for subsequent weighted path search and answer generation.
[0102] After the inference response module constructs a temporary fusion graph for a specific query request, the inference response module executes a weighted path search algorithm on that fusion graph.
[0103] In one specific embodiment, the reasoning response module first performs natural language processing on the received user query request text to identify one or more starting legal concept gene nodes and one or more target legal concept gene nodes from the query.
[0104] Subsequently, the reasoning and response module, starting from the identified initial legal concept gene node, performs a path search in the fused graph to find a logical path connecting to the target legal concept gene node. The path search algorithm is configured to incorporate weight values from the gene regulation network weight matrix, which has been dynamically updated in the latest round by the federated learning engine, when exploring edges in the graph.
[0105] Specifically, for any edge in the fusion graph pointing from legal concept gene node i to legal concept gene node j, the path search algorithm assigns the element W from the gene regulation network weight matrix corresponding to that edge. ij This serves as the travel weight for that edge. During the search process, the algorithm accumulates the travel weights of all edges on the path to calculate the overall weight score for each potential logical path.
[0106] The path search algorithm's search strategy is configured to prioritize expanding paths with higher overall weight scores. In this way, higher-valued weights in the gene regulatory network weight matrix give higher priority to their corresponding legal logical relationships during the reasoning process.
[0107] After traversing the fusion graph or reaching a preset search depth, the path search algorithm outputs one or more logical paths with the highest comprehensive weight scores from the starting legal concept gene node to the target legal concept gene node as search results. These output logical paths are the high-weight logical paths, which will serve as the sole reasoning basis for subsequent causal chain verification and response generation steps.
[0108] After the inference response module executes the weighted path search algorithm and obtains one or more high-weight logical paths, the causal chain verification engine needs to verify the high-weight logical paths.
[0109] The causal chain verification engine aims to ensure that the logical paths generated by the algorithm are significant not only in terms of weight scores but also in terms of the rigor of legal logic. In a specific embodiment, the causal chain verification engine incorporates a predefined legal logic rule base, which stores a set of rules used to determine whether a legal logic chain is valid.
[0110] The working mechanism of the causal chain verification engine includes:
[0111] First, a completeness verification of the constituent elements is performed. For a specific compound legal concept (such as tort liability or a specific crime) involved in a high-weight logical path, the causal chain verification engine queries the core digital legal genome for all the constituent elements that the concept must satisfy. The engine then checks whether the current high-weight logical path completely contains sub-paths or nodes pointing to these necessary constituent elements. If any necessary constituent element is missing, the verification of that path will be marked as failed or assigned a lower confidence score.
[0112] Secondly, exclusionary rule verification is performed. The causal chain verification engine checks whether there are legal concept gene nodes corresponding to exclusionary conditions that can prevent the establishment of this logical chain in the context of high-weight logical paths. For example, when a high-weight logical path points to breach of contract liability, the engine will actively search the fusion graph for nodes related to force majeure, other contractual agreements, or other exemptions, and analyze the strength of their association with the logical path. If a strongly associated exemption exists, the validity of the current logical path will be rejected.
[0113] Finally, logical contradiction detection is performed. The causal chain verification engine analyzes whether there are logical contradictions within high-weight logical paths and between them and other strongly related nodes in the fusion graph. For example, if a path contains nodes representing both contract validity and contract invalidity, and there is no clear legal logic (such as chronological order or conditional triggering) to explain this state change, then the path will be judged to have a logical contradiction.
[0114] Only high-weight logical paths that pass one or more of the above verifications by the causal chain verification engine are recognized as the final valid inference causal chain and passed to the subsequent response generation unit to construct the final answer to the user query.
[0115] After the causal chain verification engine outputs the final valid inference causal chain, the response generation unit in the inference response module is responsible for converting the structured logical chain into a coherent and easy-to-understand natural language text as the final response to the user's query.
[0116] In one specific embodiment, the response generation unit performs a multi-stage text generation process.
[0117] First, the response generation unit traverses each node and edge connecting them in the valid reasoning causal chain. For each connection (e.g., constitutive relation, referential relation), the response generation unit selects one or more corresponding natural language expression templates from a pre-defined response template library.
[0118] Subsequently, the response generation unit fills the selected template with the concept names represented by the nodes in the effective reasoning causal chain. At the same time, for key legal concept gene nodes in the path, the response generation unit extracts the source text information (e.g., specific legal clause numbers) contained in their attribute information and integrates it as legal basis into the generated text to ensure the traceability and authority of the response content.
[0119] Finally, the response generation unit organizes and refines all generated text fragments to form a logically clear and structurally complete final response. This final response typically includes a core conclusion that directly answers the user's question, a step-by-step explanation of the reasoning process, and a list of references outlining the legal basis cited.
[0120] After the final response is generated, it is sent back to the tenant that initiated the query request via the network interface and presented to the user, thus completing the entire inference response process.
Claims
1. A multi-tenant legal knowledge base cloud service system, characterized in that, include: The core knowledge base module is used to store a standardized core digital legal genome, which includes multiple legal concept gene nodes, edges defining the legal logical relationships between the legal concept gene nodes, and a gene regulatory network weight matrix characterizing the influence strength of the legal logical relationships. The tenant knowledge processing module, configured on the tenant side, is used to generate a tenant knowledge appearance graph for each tenant's private legal knowledge, and to establish a link mapping relationship between the private knowledge nodes in the tenant knowledge appearance graph and the legal concept gene nodes in the core digital legal genome. The federated learning engine is used to receive local gradient information from multiple tenants, calculated based on their respective tenant knowledge appearance graphs and the core digital legal genome, and aggregate and generate a global update gradient based on the local gradient information to dynamically update the gene regulatory network weight matrix in the core knowledge base module. The reasoning and response module is used to respond to user query requests. It generates a response by fusing the core digital legal genome and the tenant knowledge epigenetic graph of the current tenant, and by using the gene regulatory network weight matrix for weighted reasoning.
2. The multi-tenant legal knowledge base cloud service system according to claim 1, characterized in that, The core knowledge base module includes: A concept gene storage unit is used to store multiple legal concept gene nodes, wherein each legal concept gene node represents an atomic legal concept unit; A logical relationship storage unit is used to store edges that define the legal logical relationships between multiple legal concept gene nodes, including constitutive relationships, reference relationships, modification relationships, or repeal relationships; A regulatory network storage unit is used to store the weight matrix of the gene regulatory network.
3. The multi-tenant legal knowledge base cloud service system according to claim 1, characterized in that, The tenant knowledge processing module is further configured as follows: Without altering the structure and content of the core digital legal genome, the tenant's internal legal insights, case data, or contract templates contained in the tenant knowledge appearance graph are linked to the corresponding legal concept gene nodes through the link mapping relationship.
4. The multi-tenant legal knowledge base cloud service system according to claim 3, characterized in that, The inference response module is specifically configured as follows: A weighted path search algorithm is performed on the fused graph formed by integrating the core digital legal genome and the tenant knowledge appearance graph of the current tenant; The weight values in the gene regulatory network weight matrix are used to determine the priority of the reasoning path, and to identify and output high-weight logical paths as the basis for reasoning.
5. The multi-tenant legal knowledge base cloud service system according to claim 4, characterized in that, The inference response module also includes a causal chain verification engine, configured as follows: Before generating the final response, the high-weight logical path is verified. The verification includes at least the logical consistency and timeliness of the legal concept gene nodes involved in the path.
6. The multi-tenant legal knowledge base cloud service system according to claim 1, characterized in that, The federated learning engine includes: Multiple local gradient computing units deployed on each tenant's end are configured to calculate local gradient information that optimizes the gene regulatory network weight matrix to fit local knowledge in the tenant's private environment based on their respective tenant knowledge epigenetic graph and the core digital legal genome, and only upload the local gradient information. A global weight aggregation unit deployed on a cloud server is configured to receive and aggregate local gradient information from multiple local gradient calculation units, and calculate a global update gradient for updating the weight matrix of the gene regulatory network.
7. The multi-tenant legal knowledge base cloud service system according to claim 1, characterized in that, The federated learning engine is configured as follows: The federated learning task is performed periodically, enabling the gene regulatory network weight matrix to continuously and adaptively evolve and update based on the collective legal practices of multiple tenants.
8. The multi-tenant legal knowledge base cloud service system according to claim 1, characterized in that, The federated learning engine is configured to periodically perform federated learning tasks, enabling the gene regulatory network weight matrix to continuously and adaptively evolve and update based on the collective legal practices of multiple tenants.
9. A multi-tenant legal knowledge base cloud service system according to claim 5, characterized in that, When performing weighted inference, the gene regulatory network weight matrix used by the inference response module is the latest dynamically updated matrix completed by the federated learning engine, so that the inference results can reflect collective and dynamic legal practice insights. The reasoning response module further includes: The natural language generation unit is used to receive the high-weight logical path verified by the causal chain verification engine as context and generate a response in natural language form.
10. A multi-tenant legal knowledge base cloud service system according to claim 1, characterized in that, Also includes: The user isolation and permission management module is used to ensure that the tenant knowledge appearance graph and the link mapping relationship of each tenant are only visible and available to that tenant itself.