A knowledge service processing method for the field of safety production
By constructing a parallel retrieval pathway using semantic vectors and knowledge graphs in the field of safe production, and combining entity association confidence and legal hierarchy priority rules, the problem of disordered legal retrieval accuracy and legal validity in existing technologies is solved, and efficient legal matching in complex scenarios is achieved.
Patent Information
- Application Number
- CN202611563707.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-10
- Publication Date
- 2026-11-06
AI Technical Summary
Existing safety production regulation retrieval technologies cannot dynamically adjust strategies, resulting in difficulty in meeting the accuracy requirements of regulatory clause matching in complex and ever-changing real-world application scenarios. In particular, when user input is vague, terminology is non-standard, or safety features are incomplete, existing technologies cannot effectively utilize the structured reasoning capabilities of knowledge graphs, and the legal validity of retrieval results is disordered.
By constructing two parallel pathways—semantic vector retrieval and knowledge graph retrieval—weighted fusion is performed based on entity association confidence. A large language model is used to sort the data according to legal hierarchy priority rules, and the retrieval strategy is dynamically adjusted to adapt to the quality of input evidence. A comprehensive recall score is generated and a list of terms is output.
It significantly improves the accuracy and robustness of regulatory matching, effectively reduces the risk of missed detections, ensures that search results have a reasonable priority order in terms of legal application, and solves the problems of noise and disordered legal effect caused by entity mapping errors in existing technologies.
Smart Images

Figure CN123048742A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of business question-and-answer technology, and in particular to a knowledge business processing method and system for the field of safe production. Background Technology
[0002] The field of work safety involves multiple key industries, including hazardous chemicals, non-coal mines, industry and trade, transportation, and construction. The regulatory and standard system covers multiple levels, including laws, administrative regulations, departmental rules, national standards, industry standards, and local normative documents. The number of clauses is enormous, and there are complex citation relationships and hierarchical dependencies between them. As enterprises increasingly demand compliance management in work safety, quickly and accurately locating applicable clauses that match specific hazard scenarios or business descriptions from a vast amount of heterogeneous and multi-source regulatory and standard texts has become a significant technical challenge in the field of work safety informatization.
[0003] Currently, some technical solutions have attempted to utilize computer-aided methods for the retrieval and matching of safety production regulations. One type of solution is a regulation retrieval method based on semantic vectors, and another is a regulation reasoning method based on knowledge graphs. Building upon this, some improved solutions attempt to combine the two retrieval methods mentioned above.
[0004] However, research has revealed the following shortcomings in the aforementioned technical solutions: Existing integration methods are all static or fixed strategies, meaning that regardless of the user's input description or the reliability of the entity recognition results, the semantic retrieval pathway and the knowledge graph retrieval pathway participate in result fusion in a fixed manner. In practical applications, user-input descriptions often contain vague expressions, non-standard terminology, and incomplete security features, leading to significant confidence fluctuations in the mapping process from security features to knowledge graph entities. When the entity recognition confidence is low, introducing graph retrieval results will introduce noise caused by entity mapping errors into the output, reducing matching accuracy; conversely, when the entity recognition confidence is high, failing to fully utilize the structured reasoning capabilities of the graph may result in overlooking applicable clauses deeply related to the current scenario. Existing technologies cannot perceive the reliability differences in user input content, nor can they dynamically adjust retrieval strategies and fusion methods accordingly, resulting in the accuracy of regulatory clause matching failing to meet actual business needs in complex and ever-changing real-world safety production application scenarios. Summary of the Invention
[0005] To address the aforementioned problems in the prior art, this invention provides a knowledge business processing method for the field of safe production.
[0006] Firstly, this application provides a knowledge business processing method for the field of safety production, comprising: acquiring descriptive text input by a user; vectorizing the descriptive text, performing semantic retrieval in a pre-built regulatory clause vector library, acquiring clauses whose semantic similarity to the descriptive text meets a first preset condition, and using them as a first candidate clause set; extracting safety features from the descriptive text, mapping the safety features to entity nodes in a pre-built safety production regulatory knowledge graph, extending the path along preset relation edges in the knowledge graph starting from the entity nodes, and using the clause nodes traversed by the extended path as a second candidate clause set. Select a set of clauses; determine the entity association confidence level of the current query based on the credibility of each security feature; weight and fuse the semantic similarity of each clause in the first candidate clause set with the graph association of each clause in the second candidate clause set, using the entity association confidence level as the weight, to obtain the comprehensive recall score of each clause; merge clauses with comprehensive recall scores exceeding a preset threshold to generate a third candidate clause set; input the clauses in the third candidate clause set into a large language model, which sorts them according to the legal hierarchy priority rules and outputs a list of clauses matching the description text and their corresponding legal tracing paths.
[0007] Optionally, generating the third candidate clause set specifically includes: counting the number of valid security features successfully mapped to the entity nodes of the knowledge graph in the description text and the mapping credibility of each valid security feature; calculating the arithmetic mean of all mapping credibility as the entity association confidence; obtaining the vector similarity between each clause in the first candidate clause set and the description text; wherein, clauses belonging only to the first candidate clause set have a graph association value of zero; obtaining the graph association between each clause in the second candidate clause set and the entity nodes; wherein, clauses belonging only to the second candidate clause set have a vector similarity value of zero; weighting the graph association of each clause with the entity association confidence as the weight and weighting the vector similarity of each clause with the complement of the entity association confidence as the weight, and fusing them to obtain the comprehensive recall score of each clause; merging clauses whose comprehensive recall score exceeds the preset threshold to generate the third candidate clause set.
[0008] Optionally, obtaining the graph association degree between each clause in the second candidate clause set and the entity node includes: obtaining all reachable paths from the entity node to the clause, each path being formed by sequentially connecting at least one preset relationship edge; configuring a relationship type attenuation coefficient for each preset relationship edge, with different types of preset relationship edges corresponding to different attenuation coefficients; the attenuation coefficient ranges from 0 to 1; using the product of the attenuation coefficients of each relationship edge on a single path as the path weight of that path; and determining the maximum value of the path weight among all reachable paths from the entity node to the clause as the graph association degree between the clause and the entity node.
[0009] Optionally, the legal hierarchy priority rules include: higher-level laws take precedence over lower-level laws, special laws take precedence over general laws, and new laws take precedence over old laws.
[0010] Optionally, the path expansion depth does not exceed 3 levels, and the clause nodes reached by passing through no more than 3 preset relationship edges from the entity node are all regarded as the second candidate clause set.
[0011] Optionally, obtaining clauses whose semantic similarity to the description text satisfies a first preset condition, as a first candidate clause set, includes: determining the corresponding knowledge type label and scope of application label based on the scenario constraint information in the description text; locating the target partition in the regulatory clause vector library using the knowledge type label and the scope of application label as indexes; calculating the cosine similarity between the semantic vector of the description text and the semantic vector of each clause within the target partition; and sorting the clauses by cosine similarity from high to low within the target partition, extracting the top K clauses as the first candidate clause set.
[0012] Optionally, the method further includes: when a new version file is detected to be released, performing structured preprocessing on the new version file to obtain new clause records and their corresponding graph nodes and relation edges; performing clause alignment between the new version file and the old version: calculating the alignment degree between the i-th clause of the new version and the j-th clause of the old version, wherein the alignment degree is obtained by weighted summation of structural position consistency degree and content semantic consistency degree; wherein the structural position consistency degree is determined according to the overlap ratio of the chapter paths where the clauses are located and the correspondence of the clause numbers, and the content semantic consistency degree is determined according to the similarity between the semantic vectors of the two clauses; when the alignment degree between the new version clause and the old version clause is the highest and exceeds a preset alignment threshold, establishing a correspondence between the two clauses; new clauses that do not correspond to any old version clauses are determined to be new clauses, and old clauses that do not correspond to any new version clauses are determined to be abolished clauses; clauses that establish a correspondence but whose content semantic consistency degree is lower than the modification threshold are determined to be modified clauses.
[0013] Optionally, the method further includes: for clauses determined to be modified or repealed, performing a cascading impact analysis in the knowledge graph; traversing backwards along the reference edges pointing to the clause to obtain other clauses referencing the clause; searching along the constraint edges for other clauses bound to the same security object or the same object state as the clause; searching along the hierarchical path for clauses whose scope of application is inherited from the chapter where the clause is located; constructing a set of affected clauses from the clauses obtained by the above traversal; wherein, if the text of the clauses in the set of affected clauses has not changed but the cited evidence, object association, or inherited scope of application contains changed content, recalculation is performed.
[0014] Optionally, the method further includes: performing logical deletion on the graph nodes and their associated edges of the repealed clauses, while retaining the nodes and valid time intervals to support historical traceability queries; generating new version nodes for the modified clauses, and establishing version replacement edges between the old and new version nodes to record the effective time boundary; generating corresponding nodes, relational edges, and semantic vectors for the new clauses; performing incremental updates on the vector index by partition, with only the new and modified clauses written to the corresponding partitions, and unaffected partitions not participating in the update; and using the saved basis relationships to trace back historical business results, marking business result items containing repealed or modified clauses in the basis path as having changed versions.
[0015] Secondly, this application provides a knowledge business processing system for the field of safety production, comprising: an acquisition module for acquiring descriptive text input by a user; a first retrieval module for vectorizing the descriptive text, performing semantic retrieval in a pre-built regulatory clause vector library, and acquiring clauses whose semantic similarity to the descriptive text meets a first preset condition, as a first candidate clause set; and a second retrieval module for extracting safety features from the descriptive text, mapping the safety features to entity nodes in a pre-built safety production regulatory knowledge graph, and extending the path along a preset relation edge in the knowledge graph, starting from the entity node, and extending the path to the clause nodes traversed by the extended path. As the second candidate clause set; the optimization and merging module is used to determine the entity association confidence of the current query based on the credibility of each security feature, and to perform weighted fusion of the semantic similarity of each clause in the first candidate clause set and the graph association of each clause in the second candidate clause set with the entity association confidence as the weight to obtain the comprehensive recall score of each clause, and to merge the clauses with the comprehensive recall score exceeding the preset threshold to generate the third candidate clause set; the output module is used to input the clauses in the third candidate clause set into the big language model, and the big language model sorts them according to the legal hierarchy priority rules, and outputs a list of clauses that match the description text and their corresponding legal tracing paths.
[0016] The beneficial effects of this invention include: by constructing two parallel candidate clause recall pathways—semantic vector retrieval and knowledge graph retrieval—and adaptively weighting and fusing the retrieval results of the two pathways based on entity association confidence, and finally sorting and outputting the results by a large language model according to the legal hierarchy priority rules, the source of candidate clauses can be enriched from different dimensions, effectively reducing the risk of missed detection caused by relying solely on semantic retrieval, and also making up for the deficiency of pure graph retrieval in terms of its insufficient tolerance for natural language description.
[0017] Furthermore, for the two channels, this application dynamically determines the entity association confidence level based on the mapping credibility of security features in the user input description text, and uses this confidence level as a weight to perform weighted fusion of the retrieval results of the two channels, achieving adaptive alignment between the retrieval strategy and the quality of input evidence. When security features can be mapped to knowledge graph entity nodes with high confidence, the entity association confidence level is high, and the graph association degree is given a higher weight during fusion, making full use of the structured reasoning ability of the knowledge graph, and effectively introducing clauses that are difficult to recall by semantic similarity alone but are closely related to the current scenario at the level of regulatory logic into the candidate set. When the security feature mapping credibility level is low, the entity association confidence level tends to be low, and the weight of the graph association degree is automatically reduced during fusion, so that the retrieval results mainly rely on semantic similarity, avoiding the introduction of irrelevant graph noise into the candidate set due to entity mapping errors. The above dynamic adjustment mechanism enables this application to maintain the best fit between the retrieval strategy and input quality when facing complex situations such as ambiguous user input, non-standard terminology, and incomplete security features in actual safety production scenarios, significantly improving the accuracy and robustness of regulatory matching.
[0018] In addition, this application introduces a large language model into the fine-grained ranking of candidate clauses. The large language model sorts the third candidate clause set according to the legal hierarchy priority rules, rather than simply relying on similarity for sorting. This ensures that the final output list of clauses has a reasonable priority order in terms of legal application, effectively solving the problem of disordered legal effect of search results in the prior art. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the steps of a knowledge business processing method for the field of safe production provided in an embodiment of the present invention. Figure 2 This is a flowchart illustrating the steps of another knowledge business processing method for the field of safe production provided in an embodiment of the present invention. Figure 3 This is a block diagram of a knowledge business processing system for the field of safe production provided in an embodiment of the present invention; Figure 4 This is a block diagram of an electronic device for a knowledge business processing method applied to the field of safe production, as provided in an embodiment of the present invention. Detailed Implementation
[0020] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0021] Please see Figure 1 This application provides a knowledge business processing method for the field of safe production, including steps 101 to 105.
[0022] Step 101: Obtain the description text input by the user.
[0023] Users can input descriptive text through an interactive interface. This descriptive text can be a description of a safety hazard in natural language, an inspection record, or a regulatory query request.
[0024] For example, after safety management personnel discover potential hazards during on-site inspections, they may input information such as "the emergency shut-off valve in the liquid ammonia storage tank area is malfunctioning" or "a liquid ammonia storage tank in a chemical plant that constitutes a Class I major hazard source is not equipped with an emergency shut-off device" into the system's interactive interface.
[0025] Step 102: Vectorize the description text, perform semantic retrieval in the pre-built regulatory clause vector library, and obtain clauses whose semantic similarity with the description text meets the first preset condition, as the first candidate clause set.
[0026] Specifically, descriptive text can be input into the embedding model to generate corresponding semantic vectors. The embedding model can be a general text embedding model (such as BERT, RoBERTa, etc.) or a specialized embedding model fine-tuned from corpora in the field of safety production.
[0027] A pre-built library of legal clause vectors contains semantic vectors for each legal clause, along with its corresponding full text, clause number, governing law name, and legal level. The construction method involves: structuring legal documents in the field of work safety, including laws, administrative regulations, departmental rules, and industry standards; extracting clause-level text content; inputting each clause text into an embedding model to generate semantic vectors; establishing a mapping relationship between the vectors and the clause metadata; and storing the vectors.
[0028] The semantic vector of the descriptive text is compared with the semantic vectors of each clause in the legal clause vector library to calculate the similarity, which can be done using cosine similarity as the metric. The calculated similarity is then compared with a first preset condition; for example, a similarity threshold (such as 0.7) or a recall quantity K is set (such as returning the top 50 clauses with the highest similarity). Clauses that meet the condition are then used as the first candidate clause set.
[0029] Step 103: Extract safety features from the description text, map the safety features to entity nodes in the pre-built safety production regulations knowledge graph, start from the entity node, perform path expansion along the preset relationship edges in the knowledge graph, and take the clause nodes traversed by the expansion path as the second candidate clause set.
[0030] Specifically, the descriptive text is segmented and labeled with terms in the field of safety production. Based on a pre-built dictionary of safety production (which includes proper nomenclature, alias mapping, and industry-specific abbreviations), the safety entities and safety status descriptions in the descriptive text can be identified and combined into safety features.
[0031] Safety features are mapped to entity nodes in a pre-built knowledge graph of safety production regulations. The knowledge graph contains entity nodes such as regulatory documents, clauses, industry sectors, hazard types, safety measure types, and responsible entities, as well as relational edges such as superior laws, citations, applicability, and constraints. Mapping is complete when a safety feature matches a specific entity node in the graph.
[0032] Starting with the mapped entity nodes, path expansion is performed along the pre-defined relationship edges in the knowledge graph. These pre-defined relationship edges include constraint edges (linking clauses to security objects or object states), referencing edges (direct referencing relationships between linked clauses), and hierarchical edges (inheritance relationships between legal clauses of different levels of effectiveness). The clause nodes traversed during path expansion become the second set of candidate clauses.
[0033] Step 104: Determine the entity association confidence of the current query based on the credibility of each security feature. Combine the semantic similarity of each clause in the first candidate clause set with the graph association of each clause in the second candidate clause set, and perform weighted fusion with entity association confidence as the weight to obtain the comprehensive recall score of each clause. Combine the clauses with comprehensive recall scores exceeding the preset threshold to generate the third candidate clause set.
[0034] The entity association confidence score is determined based on the credibility of each security feature. Each security feature generates a credibility value (e.g., 0.85) when mapped to a graph entity node, indicating the reliability of the mapping. The arithmetic mean of the credibility scores of all successfully mapped security features is used as the entity association confidence score for the current query. .
[0035] For each clause in the first candidate clause set, obtain its semantic similarity score with the descriptive text. For each clause in the second candidate clause set, obtain its graph correlation score with the entity node. For clauses belonging only to the first candidate set, their graph correlation is... =0; for terms belonging only to the second candidate set, their semantic similarity is 0. =0.
[0036] Calculate the overall recall score for each clause using the following formula. : ; When the confidence level of entity recognition is high ( When the confidence level is close to 1, the graph correlation degree dominates; when the confidence level of entity recognition is low ( (Close to 0), semantic similarity is dominant.
[0037] Clauses with a comprehensive recall score exceeding a preset threshold are merged to generate a third candidate clause set. The preset threshold can be determined by selecting a validation dataset containing multiple historical business samples with correctly labeled regulatory bases.
[0038] Step 105: Input the clauses in the third candidate clause set into the big language model, which sorts them according to the legal hierarchy priority rules and outputs a list of clauses that match the description text and their corresponding legal source paths.
[0039] The clauses in the third candidate clause set are input into the Large Language Model (LLM), which sorts them according to the legal hierarchy priority rules.
[0040] During the sorting process, LLM can determine the legal priority of each clause based on its metadata (level of validity, applicable industry sectors, publication date, etc.) and output a sorted list of clauses according to the aforementioned rules. Simultaneously, it traces upwards along the hierarchical edges of the knowledge graph from each sorted clause node, generating a complete legal tracing path from the highest-level regulation to the current clause. Finally, it outputs a list of clauses that match the descriptive text and their corresponding legal tracing paths.
[0041] In summary, the embodiments of this application provide a knowledge business processing method for the field of safe production, which has the following effects: By constructing two parallel candidate clause recall pathways—semantic vector retrieval and knowledge graph retrieval—and adaptively weighting and fusing the retrieval results of the two pathways based on entity association confidence, and finally sorting and outputting the results by a large language model according to the legal hierarchy priority rules, the source of candidate clauses can be enriched from different dimensions. This effectively reduces the risk of missed detection caused by relying solely on semantic retrieval and also makes up for the deficiency of pure graph retrieval in terms of its insufficient tolerance for natural language description.
[0042] Furthermore, for the two channels, this application dynamically determines the entity association confidence level based on the mapping credibility of security features in the user input description text, and uses this confidence level as a weight to perform weighted fusion of the retrieval results of the two channels, achieving adaptive alignment between the retrieval strategy and the quality of input evidence. When security features can be mapped to knowledge graph entity nodes with high confidence, the entity association confidence level is high, and the graph association degree is given a higher weight during fusion, making full use of the structured reasoning ability of the knowledge graph, and effectively introducing clauses that are difficult to recall by semantic similarity alone but are closely related to the current scenario at the level of regulatory logic into the candidate set. When the security feature mapping credibility level is low, the entity association confidence level tends to be low, and the weight of the graph association degree is automatically reduced during fusion, so that the retrieval results mainly rely on semantic similarity, avoiding the introduction of irrelevant graph noise into the candidate set due to entity mapping errors. The above dynamic adjustment mechanism enables this application to maintain the best fit between the retrieval strategy and input quality when facing complex situations such as ambiguous user input, non-standard terminology, and incomplete security features in actual safety production scenarios, significantly improving the accuracy and robustness of regulatory matching.
[0043] In addition, this application introduces a large language model into the fine-grained ranking of candidate clauses. The large language model sorts the third candidate clause set according to the legal hierarchy priority rules, rather than simply relying on similarity for sorting. This ensures that the final output list of clauses has a reasonable priority order in terms of legal application, effectively solving the problem of disordered legal effect of search results in the prior art.
[0044] Optionally, the above steps for generating the third candidate clause set specifically include: counting the number of valid security features successfully mapped to entity nodes in the description text and the mapping credibility of each valid security feature; calculating the arithmetic mean of all mapping credibility as the entity association confidence; obtaining the vector similarity between each clause in the first candidate clause set and the description text; obtaining the graph association between each clause in the second candidate clause set and the entity nodes; weighting the graph association of each clause with the entity association confidence and the vector similarity of each clause with the complement of the entity association confidence, and fusing them to obtain the comprehensive recall score of each clause; merging clauses with a comprehensive recall score exceeding a preset threshold to generate the third candidate clause set.
[0045] Among them, clauses belonging only to the first candidate clause set have a graph correlation value of zero; clauses belonging only to the second candidate clause set have a vector similarity value of zero.
[0046] For example, if the user input description text includes "the emergency shut-off valve in the liquid ammonia storage area is malfunctioning", two valid safety features are extracted: the mapping confidence of "liquid ammonia" is 0.9, and the mapping confidence of "emergency shut-off valve" is 0.85.
[0047] The entity association confidence level ω = (0.9 + 0.85) / 2 = 0.875.
[0048] Item T1 belongs only to the first candidate set, with a semantic similarity of 0.82 and a graph correlation of 0. The overall score is 0.875×0+0.125×0.82=0.1025.
[0049] Item T2 belongs to both candidate sets, with a semantic similarity of 0.45 and a graph correlation of 0.68. The overall score is 0.875×0.68+0.125×0.45=0.651.
[0050] Item T3 belongs only to the second candidate set, with a semantic similarity of 0 (not recalled in semantic retrieval) and a graph correlation of 0.55. The overall score is 0.875×0.55+0.125×0=0.481.
[0051] Assuming the preset threshold is 0.4, then clauses T2 and T3 are selected into the third candidate set, while T1 is eliminated.
[0052] Optionally, the above steps for obtaining the graph association degree between each clause in the second candidate clause set and the entity node include: obtaining all reachable paths from the entity node to the clause, each path being formed by connecting at least one preset relationship edge in sequence; configuring a relationship type attenuation coefficient for each preset relationship edge, with different types of preset relationship edges corresponding to different attenuation coefficients; the attenuation coefficient ranges from 0 to 1; using the product of the attenuation coefficients of each relationship edge on a single path as the path weight of that path; and determining the maximum value of the path weight among all reachable paths from the entity node to the clause as the graph association degree between the clause and the entity node.
[0053] Specifically, first, all reachable paths from entity nodes to the clause are obtained. Each path is formed by connecting at least one preset relation edge in sequence. For example, from entity node A to node B via relation edge r1, and then to clause node C via relation edge r2, the path A-r1-B-r2-C is a reachable path.
[0054] Next, a relationship type attenuation coefficient μ is configured for each preset relationship edge. Different types of preset relationship edges correspond to different attenuation coefficients. The attenuation coefficient ranges from 0 to 1. For example, the attenuation coefficient for constraint edges can be set to 0.8, the attenuation coefficient for referencing edges can be set to 0.7, and the attenuation coefficient for hierarchical edges can be set to 0.6. The specific value of each attenuation coefficient can be determined by selecting from the verification dataset of the labeled clause relationships.
[0055] Next, the product of the decay coefficients of each relation edge on a single path is used as the path weight of that path. For example, in the path A-r1-B-r2-C, if the decay coefficient of r1 is 0.8 and the decay coefficient of r2 is 0.7, then the path weight of this path is 0.8 × 0.7 = 0.56.
[0056] Finally, the maximum value of the path weights among all reachable paths from the entity node to the clause is determined as the graph association degree between the clause and the entity node.
[0057] It should be noted that in this embodiment, the path weight is taken as the maximum value rather than summed. This is because a complete transmission path is sufficient to demonstrate a legal relationship between the clause and the query object, and the number of paths does not change the strength of this relationship. The existence of multiple paths does not necessarily mean a stronger relationship; therefore, the maximum value is taken instead of summed.
[0058] As can be seen, this application's embodiment achieves quantitative control over the graph path transmission effect by defining a relation type attenuation coefficient, calculating path weights using a product, and determining the graph correlation degree by taking the maximum value. This method enables the graph correlation degree to distinguish between direct and indirect correlations. Direct paths (fewer edges) typically receive higher weights, while indirect paths (more edges) receive lower weights due to the product effect. This ensures that only clauses with sufficient legal transmission effect can obtain a high graph correlation degree, effectively avoiding the problem of weak correlation noise introduced by long paths.
[0059] Optionally, the rules of legal hierarchy priority include: higher-level laws take precedence over lower-level laws, special laws take precedence over general laws, and new laws take precedence over old laws.
[0060] The principle of "superior law takes precedence over inferior law" means that in a legal search, when multiple clauses are relevant to the current query, the clause with the higher legal authority should be cited first.
[0061] The principle of special law taking precedence over general law means that, in a regulatory search, specific provisions for a particular industry sector (such as hazardous chemicals) or a specific type of hazard (such as major hazard sources) should take precedence over general provisions that apply to all industries.
[0062] The new law prevails over the old law. In a regulatory search, when there are old and new versions of the same matter, the latest valid version should take precedence over the old version that has been repealed or amended.
[0063] Optionally, the path expansion depth shall not exceed 3 levels, and the clause nodes reached by passing through no more than 3 preset relationship edges from the entity node shall be regarded as the second candidate clause set.
[0064] That is, when performing path expansion, the system starts from the entity node and traverses the knowledge graph using either breadth-first search (BFS) or depth-first search (DFS) algorithms. A search depth threshold of 3 is set; when the search depth reaches 3, further downward expansion stops. All clause nodes encountered during the search process are collected as a second candidate clause set.
[0065] By limiting the path extension depth to three levels or less, the scope of the query graph recall is strictly confined to paths with direct or relatively close regulatory implications. Paths exceeding three levels are considered weakly related in terms of regulatory logic, and excluding them effectively avoids the introduction of clauses that are only indirectly related to the current query and have no legal binding force due to excessively long paths, thus ensuring the quality and relevance of the second set of candidate clauses.
[0066] Optionally, the above steps to obtain clauses whose semantic similarity to the descriptive text meets the first preset condition, as the first candidate clause set, include: determining the corresponding knowledge type label and scope of application label based on the scenario constraint information in the descriptive text; locating the target partition in the regulatory clause vector library using the knowledge type label and scope of application label as indexes; calculating the cosine similarity between the semantic vector of the descriptive text and the semantic vector of each clause within the target partition; and sorting the clauses by cosine similarity from high to low within the target partition, and extracting the top K clauses as the first candidate clause set.
[0067] Specifically, based on the scenario constraint information in the description text, the corresponding knowledge type label and scope of application label are determined.
[0068] Scenario constraint information can be extracted from the description text or actively selected by the user through the interface (e.g., selecting the industry field as "hazardous chemicals" or the query scope as "industry standards"). Knowledge type tags are used to identify the knowledge category to which the clause belongs (e.g., "safety technology", "safety management", "occupational health"), and scope of application tags are used to identify the industry field to which the clause applies (e.g., "hazardous chemicals", "construction").
[0069] Using knowledge type and scope of application tags as indexes, the target partition is located in the regulatory clause vector library. The regulatory clause vector library is pre-built and divided into multiple partitions based on knowledge type and scope of application; each partition stores the semantic vectors of clauses with the same tags. Cosine similarity is calculated only within the target partition between the semantic vectors of the descriptive text and the semantic vectors of each clause. Then, within the target partition, clauses are sorted from highest to lowest cosine similarity, and the top K clauses are extracted as the first candidate clause set.
[0070] By partitioning the regulatory clause vector library according to knowledge type and scope of application, and performing calculations only on the target partition during retrieval, precise control over the retrieval scope is achieved. This scheme significantly reduces the computational overhead of semantic retrieval and avoids false recalls caused by cross-domain semantic interference, enabling the first candidate clause set to have higher precision while maintaining recall.
[0071] Please see Figure 2 Optionally, the method further includes steps 201 to 203.
[0072] Step 201: When a new version of the file is detected to be released, perform structured preprocessing on the new version of the file to obtain the new clause records and their corresponding graph nodes and relation edges.
[0073] Structured preprocessing includes: extracting plain text content and directory structure by calling the corresponding parsing engine according to the file format; identifying the hierarchical numbering system (such as section, chapter, paragraph, clause, item) in the text based on regular expressions and decision trees; automatically classifying the text to the corresponding level of effectiveness based on the identified numbering features and text context features; automatically extracting the citation relationships between legal provisions from the text; and performing semantic intelligent slicing using "article" or "clause" as the basic unit. After structured preprocessing, the new version of the clause records and their corresponding graph nodes and relationship edges are obtained.
[0074] Step 202: Perform clause alignment between the new and old versions of the file.
[0075] Specifically, clause alignment includes: calculating the alignment degree between the i-th clause in the new version and the j-th clause in the old version. The alignment degree is obtained by weighted summation of the structural position consistency degree and the content semantic consistency degree. The structural position consistency degree is determined based on the overlap ratio of the chapter paths where the clauses are located and the correspondence of the clause numbers, while the content semantic consistency degree is determined based on the similarity between the semantic vectors of the two clauses.
[0076] Alignment can be calculated using the following formula: ; in, This indicates the difference between the i-th clause in the new version and the j-th clause in the old version; It indicates the degree of structural consistency between two clauses, determined by the overlap ratio of the chapter paths in which the clauses are located and the correspondence of the clause numbers. It is 1 when the chapter paths are completely identical and the numbers are not rearranged, and decreases as the chapters are adjusted or the numbers are shifted. The degree of semantic consistency between two clauses is determined by the similarity between the semantic vectors of the two clauses. The weight of structural location evidence is selected from a set of verified clauses that have been manually matched between the old and new versions of the clauses, within the range of 0 to 1. Since the revision of regulations usually maintains the stability of the chapter framework, the weight of structural location evidence is no less than the weight of content semantic evidence.
[0077] Step 203: When the new version of the terms and the old version of the terms have the highest degree of alignment and exceed the preset alignment threshold, establish a correspondence between the two terms; new terms that do not correspond to any old version terms are determined to be new terms, and old terms that do not correspond to any new version terms are determined to be repealed terms; terms that establish a correspondence but whose semantic consistency is lower than the modification threshold are determined to be modified terms.
[0078] The alignment threshold is used to determine whether two clauses are sufficient to establish a correspondence. When the alignment threshold... If the threshold is exceeded, the system considers the two clauses to be new and old versions of the same clause. The alignment threshold is usually set between 0.6 and 0.8, and the specific value can be determined by selecting a validation dataset.
[0079] The modification threshold is a numerical threshold used to distinguish between unchanged and modified clauses in a pair of clauses with established correspondence. It is based on the degree of semantic consistency between the two clauses. If the content falls below this threshold, it indicates that the substantive content of the terms has changed and is considered a modified term; if the semantic consistency of the content is not lower than this threshold, it indicates that the content of the terms has remained essentially unchanged (possibly involving only minor adjustments to the wording) and is considered an unchanged term. The modification threshold is typically set between 0.85 and 0.95.
[0080] In this embodiment, the alignment of old and new clauses is achieved by weighted summation of structural positional consistency and semantic content consistency. This fully leverages the relatively stable chapter framework and gradual content evolution during regulatory revisions, enabling automatic identification of newly added, modified, and repealed clauses. The structural positional weight is no less than the semantic content weight in this embodiment because regulatory revisions typically maintain a stable chapter framework, making positional information more reliable for content similarity comparisons. Compared to purely semantic similarity alignment schemes, this embodiment offers higher alignment accuracy in scenarios where the regulatory chapter structure remains stable but the text content undergoes significant modifications. Compared to purely positional alignment methods, this embodiment exhibits greater robustness in scenarios where the chapter structure is adjusted but the content remains substantially unchanged. This method eliminates the need for manual comparison, significantly reducing the knowledge maintenance costs during regulatory updates.
[0081] Optionally, the method further includes: for clauses determined to be modified or repealed, performing a chain reaction analysis in the knowledge graph; traversing backwards along the reference edges pointing to the clause to obtain other clauses that reference the clause; searching along the constraint edges for other clauses bound to the same security object or the same object state as the clause; searching along the hierarchical path for clauses whose scope of application is inherited from the chapter where the clause is located; constructing a set of affected clauses from the clauses obtained by the above traversal; wherein, if the text of the clauses in the set of affected clauses has not changed but the cited evidence, object association, or inherited scope of application contains changed content, recalculation is performed.
[0082] Specifically, firstly, for clauses determined to be modified or repealed, a cascading effect analysis is performed in the knowledge graph.
[0083] Traverse backwards along the reference edge pointing to the original clause to obtain other clauses that reference it. For example, if clause A is referenced by clause B, then when A is amended or repealed, the evidence for B's citation changes, and B needs to be re-evaluated.
[0084] Then, search along the constraint edges for other clauses that are bound to the same safety object or have the same object status as this clause. For example, if clause A is bound to the safety object "liquid ammonia", then other clauses bound to "liquid ammonia" may need to have their scope of application reassessed due to changes in A.
[0085] Next, follow the hierarchical path to find clauses that inherit from the chapter containing the current clause as their scope of application. For example, if a clause in a higher-level law is amended, clauses in its subordinate laws that reference or inherit that clause may need to be adjusted accordingly.
[0086] Finally, the clauses obtained from the above traversal constitute the set of affected clauses. The text of the clauses in this set remains unchanged, but their cited evidence, related objects, or scope of application contain changed content, and the corresponding calculations are re-performed.
[0087] In this embodiment, all affected clauses are systematically identified by performing a reverse traversal along three dimensions: reference edges, constraint edges, and hierarchy edges. This approach limits the impact of regulatory changes to identifiable graph structure associations, avoiding the inefficient method of full recalculation. This allows incremental updates to accurately locate clauses that need to be reprocessed, significantly reducing system maintenance costs during regulatory updates.
[0088] Optionally, the method further includes: performing logical deletion on the graph nodes and their associated edges of the repealed clauses, while retaining the nodes and valid time intervals to support historical traceability queries; generating new version nodes for the modified clauses, and establishing version replacement edges between the old and new version nodes to record the effective time boundary; generating corresponding nodes, relational edges, and semantic vectors for the new clauses; performing incremental updates on the vector index by partition, with only the new and modified clauses written to the corresponding partitions, and unaffected partitions not participating in the update; and using the saved basis relationships to trace back historical business results, marking business result items containing repealed or modified clauses in the basis path as having changed versions.
[0089] Specifically, firstly, logical deletion is performed on the graph nodes and their associated edges of the repealed clauses, while retaining the nodes and valid time intervals to support historical lookup queries. Logical deletion differs from physical deletion; the nodes and edges are still retained in the database but marked as "deleted," and their valid time intervals are recorded, allowing users to still retrieve the clauses when performing queries at historical points in time.
[0090] Then, a new version node is generated for the modified terms, and a version substitution edge is established between the old and new version nodes to demarcate the effective time. The version substitution edge stores the effective time information of the old and new versions, enabling the system to automatically select the corresponding version based on the query time.
[0091] Next, the newly added clauses are processed using a structured preprocessing workflow to generate corresponding nodes, relation edges, and semantic vectors.
[0092] Then, perform incremental updates on the vector index by partition. Only newly added and modified terms generate new semantic vectors and write them to the corresponding partitions. Unaffected partitions do not participate in the update.
[0093] Finally, by using the saved dependency relationships to trace back historical business results, business result items in the dependency path that contain repealed or modified clauses are marked as having changed versions.
[0094] In this embodiment, a series of operations, including logical deletion and retention of valid time intervals, establishment of version replacement edges, incremental updates of partitions, and backtracking marking of historical results, are used to achieve the synchronous evolution of knowledge graphs, vector indexes, and business results. This approach ensures that after regulatory revisions, the system will not recall outdated clauses (through incremental updates of vector indexes), while historical business conclusions can be automatically identified and marked for review (through backtracking of historical results), effectively avoiding the problems of knowledge state confusion and misuse of basis caused by changes in regulatory versions.
[0095] Please see Figure 3 Based on the same inventive concept, embodiments of this application also provide a knowledge business processing system 30 for the field of safe production, including: The acquisition module 301 is used to acquire the descriptive text input by the user; The first retrieval module 302 is used to vectorize the description text, perform semantic retrieval in a pre-built regulatory clause vector library, and obtain clauses whose semantic similarity with the description text meets the first preset condition, as the first candidate clause set; The second retrieval module 303 is used to extract safety features from the description text, map the safety features to entity nodes in a pre-constructed safety production regulations knowledge graph, extend the path along the preset relationship edges in the knowledge graph starting from the entity nodes, and take the clause nodes traversed by the extension path as the second candidate clause set. The optimization merging module 304 is used to determine the entity association confidence of the current query based on the credibility of each security feature, and to perform weighted fusion of the semantic similarity of each clause in the first candidate clause set and the graph association of each clause in the second candidate clause set with the entity association confidence as the weight to obtain the comprehensive recall score of each clause. Clauses with comprehensive recall scores exceeding a preset threshold are merged to generate a third candidate clause set. The output module 305 is used to input the clauses in the third candidate clause set into the large language model, which sorts them according to the legal hierarchy priority rules and outputs a list of clauses that match the descriptive text and their corresponding legal tracing paths.
[0096] Please see Figure 4 Based on the same inventive concept, this application provides a module block diagram of an electronic device 400 applying the above-described method. The electronic device 400 includes: at least one processor 401 ( Figure 4 (Only one is shown in the image), memory 402, computer program 403 stored in memory 402 and executable on at least one processor 401, processor 401 executing computer program 403 to implement the steps of the method in any of the foregoing embodiments.
[0097] The electronic device 400 can be a server, personal computer, laptop, etc.
[0098] Those skilled in the art will understand that Figure 4 This is merely an example of electronic device 400 and does not constitute a limitation on electronic device 400. It may include more or fewer components than shown, or combine certain components, or use different components.
[0099] The processor 401 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0100] In some embodiments, the memory 402 may be an internal storage unit of the electronic device 400, such as a hard disk or memory of the electronic device 400. In other embodiments, the memory 402 may also be an external storage device of the electronic device 400, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 400. Furthermore, the memory 402 may include both internal storage units and external storage devices of the electronic device 400.
[0101] It should be noted that the above-mentioned systems, devices, etc. are based on the same concept as the method embodiments of this application. The modules designed in the system, as well as the steps performed by the device and the resulting technical effects, can all be found in the method embodiments section, and will not be repeated here.
[0102] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A knowledge business processing method for the field of safety production, characterized in that, include: Get the description text input by the user; The descriptive text is vectorized, and semantic retrieval is performed in a pre-built regulatory clause vector library to obtain clauses whose semantic similarity with the descriptive text meets the first preset condition, which are then used as the first candidate clause set. Safety features are extracted from the description text, and the safety features are mapped to entity nodes in a pre-constructed safety production regulations knowledge graph. Starting from the entity node, a path expansion is performed along the preset relationship edges in the knowledge graph, and the clause nodes traversed by the expansion path are used as the second candidate clause set. The entity association confidence of the current query is determined based on the credibility of each security feature. The semantic similarity of each clause in the first candidate clause set and the graph association of each clause in the second candidate clause set are weighted and fused with the entity association confidence as the weight to obtain the comprehensive recall score of each clause. Clauses with comprehensive recall scores exceeding a preset threshold are merged to generate a third candidate clause set. The clauses in the third candidate clause set are input into the large language model, which sorts them according to the legal hierarchy priority rules and outputs a list of clauses that match the descriptive text and their corresponding legal tracing paths.
2. The safety production field-oriented knowledge business processing method according to claim 1, characterized in that, The generation of the third candidate terms set specifically includes: The number of valid security features that are successfully mapped to entity nodes in the knowledge graph in the description text and the mapping confidence level corresponding to each valid security feature are counted respectively. The arithmetic mean of all the mapping confidence levels is calculated as the entity association confidence level. Obtain the vector similarity between each clause in the first candidate clause set and the description text; wherein, the graph correlation degree of clauses that belong only to the first candidate clause set is zero; Obtain the graph association degree between each clause in the second candidate clause set and the entity node; wherein, the vector similarity degree of clauses that belong only to the second candidate clause set is zero; The graph correlation degree of each clause is weighted by the entity correlation confidence, and the vector similarity degree of each clause is weighted by the complement of the entity correlation confidence, and then fused to obtain the comprehensive recall score of each clause. The clauses whose overall recall score exceeds the preset threshold are merged to generate the third candidate clause set.
3. The knowledge business processing method for the field of safe production according to claim 2, characterized in that, The step of obtaining the graph association degree between each clause in the second candidate clause set and the entity node includes: Obtain all reachable paths from the entity node to the clause, where each path is formed by connecting at least one preset relation edge in sequence; Each preset relationship edge is configured with a relationship type attenuation coefficient, and different preset relationship edges correspond to different attenuation coefficients; the attenuation coefficient ranges from 0 to 1; The path weight is the product of the decay coefficients of each relation edge on a single path. The maximum value of the path weights among all reachable paths from the entity node to the clause is determined as the graph association degree between the clause and the entity node.
4. The knowledge business processing method for the field of safe production according to claim 1, characterized in that, The rules governing the legal hierarchy include: higher-level laws take precedence over lower-level laws, special laws take precedence over general laws, and newer laws take precedence over older laws.
5. The knowledge business processing method for the field of safe production according to claim 1, characterized in that, The path expansion depth does not exceed 3 levels. Starting from the entity node, the clause nodes reached through no more than 3 preset relationship edges are all regarded as the second candidate clause set.
6. The knowledge business processing method for the field of safe production according to claim 1, characterized in that, The step of acquiring clauses whose semantic similarity to the description text satisfies a first preset condition, as a first candidate clause set, includes: Based on the scenario constraint information in the description text, determine the corresponding knowledge type label and scope of application label; Using the knowledge type tag and the scope of application tag as indexes, locate the target partition in the regulatory clause vector library; Calculate the cosine similarity between the semantic vector of the description text and the semantic vector of each clause within the target partition; Within the target partition, the K clauses are sorted from high to low according to their cosine similarity and extracted as the first candidate clause set.
7. The knowledge business processing method for the field of safe production according to claim 1, characterized in that, The method further includes: When a new version of a file is detected to be released, structured preprocessing is performed on the new version of the file to obtain the new clause records and their corresponding graph nodes and relation edges; Perform clause alignment between the new version file and the old version: calculate the alignment degree between the i-th clause of the new version and the j-th clause of the old version. The alignment degree is obtained by weighted summation of structural position consistency degree and content semantic consistency degree. The structural position consistency degree is determined based on the overlap ratio of the chapter paths where the clauses are located and the correspondence of the clause numbers. The content semantic consistency degree is determined based on the similarity between the semantic vectors of the two clauses. When the new version of the terms and the old version of the terms have the highest degree of alignment and exceed the preset alignment threshold, a correspondence is established between the two terms; new terms that do not correspond to any old terms are determined to be new terms, and old terms that do not correspond to any new terms are determined to be repealed terms; terms that have a correspondence but whose semantic consistency is lower than the modification threshold are determined to be modified terms.
8. The knowledge business processing method for the field of safe production according to claim 7, characterized in that, The method further includes: For clauses determined to be modified or repealed, a cascading effect analysis is performed in the knowledge graph. Traverse backwards along the reference edges pointing to this clause to obtain other clauses that reference it; Search along the constraint edges for other clauses that are bound to the same security object or have the same object status as this clause; Search along the hierarchical path for clauses whose scope of application is derived from the chapter in which the clause is located; The clauses obtained from the above traversal constitute the affected clause set; wherein, if the main text of the clauses in the affected clause set has not changed but the cited evidence, object association or inheritance scope contains changed content, the calculation is re-performed.
9. The knowledge business processing method for the field of safe production according to claim 8, characterized in that, The method further includes: Logical deletion is performed on the graph nodes and their associated edges of the repealed clauses, while retaining the nodes and valid time intervals to support historical traceability queries; Generate a new version node for the modified terms, and establish a version replacement edge between the old and new version nodes to demarcate the effective time. Generate corresponding nodes, relation edges, and semantic vectors for the newly added clauses; Incremental updates are performed on the vector index by partition. Only newly added and modified terms are written to the corresponding partitions, and unaffected partitions are not updated. By using the saved dependency relationships to trace back historical business results, business result items that contain repealed or modified clauses in the dependency path are marked as having changed versions.
10. A knowledge-based business processing system for the field of safe production, characterized in that, include: The acquisition module is used to acquire the descriptive text input by the user; The first retrieval module is used to vectorize the description text, perform semantic retrieval in a pre-built regulatory clause vector library, and obtain clauses whose semantic similarity with the description text meets the first preset condition, as the first candidate clause set. The second retrieval module is used to extract safety features from the description text, map the safety features to entity nodes in a pre-built safety production regulations knowledge graph, and perform path expansion along the preset relationship edges in the knowledge graph, starting from the entity nodes, and taking the clause nodes traversed by the expansion path as the second candidate clause set. The optimization and merging module is used to determine the entity association confidence of the current query based on the credibility of each security feature, and to perform weighted fusion of the semantic similarity of each clause in the first candidate clause set and the graph association of each clause in the second candidate clause set with the entity association confidence as the weight to obtain the comprehensive recall score of each clause. Clauses with comprehensive recall scores exceeding a preset threshold are merged to generate a third candidate clause set. The output module is used to input the clauses in the third candidate clause set into the large language model, which sorts them according to the legal hierarchy priority rules and outputs a list of clauses that match the descriptive text and their corresponding legal tracing paths.
