Bayesian network-based tin-based material knowledge graph query method and system and storage medium

CN122509315BActive Publication Date: 2026-10-27YUNNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611013216.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-10-27
Estimated Expiration
2046-07-08

AI Technical Summary

Technical Problem

[0005]本申请的主要目的在于提供一种基于贝叶斯网的锡基材料知识图谱查询方法,旨在解决如何实现锡基材料知识图谱中的复杂逻辑查询的问题

Benefits of technology

[0042]1、通过从锡基材料知识图谱中挖掘Horn规则并将其映射为有向无环图,实现了无需标注数据即可构建描述成分-工艺-性能关联关系的贝叶斯网。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122509315B_ABST
    Figure CN122509315B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of knowledge graphs, in particular to a tin-based material knowledge graph query method and system based on a Bayesian network and a storage medium. A rule set contained in a tin-based material knowledge graph is mined, the rules are converted into a unified directed acyclic graph, the conditional probability parameters of each variable in the graph are calculated, a Bayesian network describing the correlation between tin-based material components, processes and performances is constructed, the Bayesian network is referred to as a tin-based Bayesian network, strategy network training is further implemented based on the probability inference of the tin-based Bayesian network, the tin-based material knowledge graph query is converted into a variable serialization assignment problem through the strategy network, the optimal answer entity satisfying a constraint condition is obtained, tin-based material knowledge graph query is realized, and a reliable technical scheme is provided for tin-based material formula optimization, performance prediction and process improvement and the like. The application aims to solve the problem of how to realize complex logical query in a tin-based material knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of knowledge graph technology, and in particular to a method, system and storage medium for querying tin-based material knowledge graphs based on Bayesian networks. Background Technology

[0002] The Knowledge Graph (KG) for tin-based materials uses a triplet structure of <head entity, relation, tail entity> to organize information on the composition, processing, and properties of tin-based materials, providing a unified data organization architecture for analyzing the complex relationships in the field of tin-based materials.

[0003] Among related technical solutions, Bayesian Networks (BNs), as an important probabilistic graphical model, represent the dependencies between random variables through a Directed Acyclic Graph (DAG) and quantify the degree of mutual influence between variables through a Conditional Probability Table (CPT). In recent years, they have been attempted to be applied in the field of materials analysis. While this model can achieve probabilistic inference between material composition and properties, in practical applications, existing methods for constructing Bayesian Networks typically rely on a large amount of labeled data or historical samples for structure learning and parameter estimation. This is because the structure learning and parameter estimation of Bayesian Networks depend on sufficient labeled samples to statistically determine the conditional dependencies between variables. However, labeled data in tin-based materials knowledge graphs is often scarce, making it difficult for direct statistical learning methods to effectively construct DAGs and calculate conditional probability tables, thus limiting the practical application of Bayesian Networks in tin-based materials knowledge graph queries.

[0004] In view of this, this application proposes a Bayesian network-based knowledge graph query method for tin-based materials. The aim is to construct a knowledge graph query that can simultaneously handle multiple logical constraints and make quantitative inferences about the relationship between composition, process and performance, under the condition of scarce labeled data for tin-based material knowledge graphs, so as to accurately obtain the optimal answer entity that satisfies the constraints. Summary of the Invention

[0005] The main purpose of this application is to provide a Bayesian network-based knowledge graph query method for tin-based materials, aiming to solve the problem of how to perform complex logical queries in the knowledge graph of tin-based materials.

[0006] To achieve the above objectives, this application provides a method for querying tin-based materials knowledge graphs based on Bayesian networks, the method comprising:

[0007] S10, a set of Horn rules that describes the relationship between composition, process and performance, is extracted from the knowledge graph of tin-based materials;

[0008] S20, the Horn rule is converted into a directed acyclic graph. If the directed acyclic graph includes multiple rule body variables of the Horn rule, a Core node is introduced to aggregate the information of each rule body variable and then pass it to the rule head node.

[0009] S30, determine the probability parameters of each variable in the directed acyclic graph, and construct a tin-based Bayesian network based on the conditional probability table formed by each probability parameter.

[0010] S40, a policy network is constructed with head entities and relations as inputs and tail entity probability distribution as outputs, wherein the policy network is trained using the probabilistic inference results of the tin-based Bayesian network as reward signals;

[0011] S50 utilizes the trained policy network to perform serialized variable assignment search starting from the query entity, and obtains the answer entity that satisfies the logical constraints.

[0012] Optionally, in S20, a Core node is introduced to aggregate information from each rule body variable and then pass it to the rule head node, including:

[0013] For multiple Horn rules with the same rule header, retain the Core node corresponding to each rule and the connection between the Core node and the rule header node;

[0014] Obtain the constant false auxiliary node whose value is always 0, and set the constant false auxiliary node as the common parent node of each Core node and its logical negation;

[0015] Configure the common parent node to point to the rule head node so that information about different component-process variables can be passed to the rule head node through the corresponding Core node.

[0016] Optionally, S20 also includes:

[0017] If a Horn rule has only one variable in its body, then a directed edge is constructed from the variable node in the body to the head node of the rule.

[0018] Optionally, in S30, determining the probability parameters of each variable in the directed acyclic graph includes:

[0019] Determine the variable type of each variable in the directed acyclic graph;

[0020] For the first variable whose variable type is no parent node, the confidence of the rule header and rule body corresponding to the first variable is used as the prior probability of the first variable;

[0021] For a second variable whose variable type is a disjunction relationship between parent and child nodes, the conditional probability that the child node has a value of 1 is 1 when at least one variable in the parent node set has a value of 1, and 0 otherwise.

[0022] Optionally, in S40, training using the probabilistic inference results of the tin-based Bayesian network as a reward signal includes:

[0023] Multiple samples are generated from the tin-based Bayesian network. Samples in which all variables have the same value as the current state are considered valid samples. The frequency of the target tail entity in the valid samples is counted to obtain the posterior probability estimate.

[0024] Calculate the score of the candidate triplet. When the score is greater than or equal to a preset threshold, the posterior probability estimate is used as the reward; otherwise, a negative reward is given.

[0025] Optionally, the expression for the comprehensive reward function of the policy network during training is:

[0026]

[0027] In the formula, This represents the posterior probability estimate. Represents a triplet The rating, For the preset threshold, The negative reward magnitude value;

[0028] in:

[0029]

[0030] In the formula, Let this be an indicator function, representing the state when the sample... Includes target tail entity hour, The value is 1 if it is not 1, and 0 otherwise; M is the number of samples. This is the current state.

[0031] Optionally, in S50, the logical constraint condition includes at least one of the following:

[0032] If a subquery contains a quantifier, the subquery is mapped to the tail entity probability distribution directly output by the policy network;

[0033] If the subquery represents negation, the subquery corresponding to the negation will be mapped to the complement of the probability distribution of the tail entity;

[0034] If a subquery represents a conjunction, map the subquery corresponding to the conjunction to the product of the probability distributions of each subquery;

[0035] If a subquery represents a disjunction, the subquery corresponding to the disjunction is mapped to the product of the probability distributions of each subquery.

[0036] Optionally, step S10 includes:

[0037] Obtain the initial set of Horn rules in the tin-based materials knowledge graph that have the same rule body and whose rule heads do not intersect:

[0038] Determine the head coverage rate of each Horn rule in the initial Horn rule set, and select the target Horn rule that is within the preset head coverage rate range; The confidence level of each target Horn rule is determined, and a greedy algorithm is used to select the target Horn rule with the highest confidence level to form the Horn rule set.

[0039] In addition, to achieve the above objectives, this application also provides a computer system, the computer system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, it implements the steps of the Bayesian network-based tin-based material knowledge graph query method as described in any of the preceding claims.

[0040] In addition, to achieve the above objectives, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the Bayesian network-based tin-based material knowledge graph query method as described in any of the preceding claims.

[0041] This application has at least the following beneficial effects:

[0042] 1. By mining Horn rules from the knowledge graph of tin-based materials and mapping them to a directed acyclic graph, a Bayesian network describing the relationship between composition, process and performance can be constructed without labeling data.

[0043] 2. By using the probabilistic inference results of the Sigmund Bayesian network as the reward signal for reinforcement learning, the policy network can effectively utilize domain prior knowledge to make inference decisions during the query process.

[0044] 3. By unifying symbolic logical operations such as existence quantifiers, conjunctions, disjunctions, and negations into probability numerical calculations, end-to-end joint processing of multiple logical constraints is achieved. Attached Figure Description

[0045] Figure 1 This is a flowchart illustrating the Bayesian network-based knowledge graph query method for tin-based materials, as described in an embodiment of this application. Figure 2 This is another schematic diagram of the Bayesian network of tin-based materials involved in the embodiments of this application; Figure 3 This is a schematic diagram of a knowledge graph of tin-based materials involved in the embodiments of this application; Figure 4 This is a schematic diagram illustrating the decomposition of the Bayesian network structure and the construction of logical condition nodes in an embodiment of this application, wherein, Figure 4 (a) and (b) respectively show two sets of local Bayesian substructures. Figure 4 (c) shows a schematic diagram of combining two local substructures into a composite Bayesian network; Figure 5 This is a flowchart illustrating the training process of the policy network involved in an embodiment of this application; Figure 6 This is a schematic diagram of the hardware operating environment of the computer system involved in the embodiments of this application.

[0046] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0047] To better understand the above technical solutions, exemplary embodiments of this disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of this disclosure to those skilled in the art.

[0048] First Embodiment

[0049] Reference Figure 1 This embodiment provides a method for querying knowledge graphs of tin-based materials based on Bayesian networks. The method includes the following steps:

[0050] S10, a set of Horn rules that describes the relationship between composition, process and performance, is extracted from the knowledge graph of tin-based materials;

[0051] In this embodiment, the Horn rule is a logical rule that can effectively describe the relationship between a set of facts. It takes the form of a logical implication that "if the condition in the rule body is true, then the conclusion in the rule head is true".

[0052] For example, a typical Horn rule can express the causal chain that "if an alloy contains SnCu and is aged, its tensile strength increases".

[0053] It should be noted that traditional Bayesian network construction heavily relies on statistical learning with labeled sample data or manual definitions by domain experts, while the tin-based materials field faces the bottleneck of scarce labeled data. Horn rules themselves inherently contain a logical dependency structure between variables—the variables in the rule body jointly determine the value of the rule header variable—this structural information can directly drive the topology generation of the directed acyclic graph of the Bayesian network, thus bypassing the dependence on labeled data.

[0054] In this embodiment, each rule in the rule set mined in S10 will become a logical unit in the subsequent graph structure transformation.

[0055] Further and optionally, step S10 includes:

[0056] S11, Obtain the same rule bodies in the tin-based materials knowledge graph. And rule header The initial set of disjoint Horn rules: S12, determine the head coverage rate of each Horn rule in the initial Horn rule set, and select the target Horn rule that is in the preset head coverage rate range; S13, determine the confidence level of each target Horn rule and use a greedy algorithm to select the target Horn rule with the highest confidence level to form the Horn rule set.

[0057] As an optional implementation, the relationship between the composition, process, and properties of tin-based materials is described in the form of logical rules, represented as follows: ,in, Let be the entity variables in tin-based KG, corresponding to any head entity and tail entity of the triplet in tin-based material KG, respectively. This is a prerequisite for the formation of ternary components in tin-based materials like KG, based on... The conclusion of the triplet obtained through reasoning is denoted as .

[0058] To uncover the implicit correlations between the composition, processing, and properties of tin-based materials, this invention designs a rule metric function and a pruning strategy to mine high-confidence Horn rules from tin-based material knowledge groups (KGs). First, head coverage, a core metric for evaluating the learning quality of rules in a KG, is used to measure the confidence level of a Horn rule within a given KG. The coverage degree in tin-based materials (KG) is defined as follows:

[0059] (1)

[0060] in, Indicates to make and The entities in G established at the same time Quantity; express The number of triples involved in G.

[0061] A higher head coverage value indicates a higher correlation between this rule and the KG of tin-based materials. The more variables there are, the stronger the interpretability of the rules. Furthermore, since each tin-based material's "composition-process-performance" variable corresponds to a unique node in G, to avoid structural redundancy caused by directly selecting rules that satisfy the head coverage threshold, we first obtain rules with the same... and Disjoint sets of Horn rules :

[0062] (2)

[0063] in, and They represent Any two rules and The rules in the text.

[0064] Given head coverage threshold Using standard confidence level as a metric for the reliability of rule bodies, for rules that meet the requirements... rule head set To obtain Horn rules with high total confidence while ensuring the elimination of structural redundancy. Its confidence level is calculated using the following formula:

[0065] (3)

[0066] in, Indicates to make When it was established Middle Entity Pair Quantity, Indicates to make and At the same time The number of triples in the middle.

[0067] Based on formula (3), a greedy search strategy is used to mine rule sets from tin-based KG. The specific steps are as follows:

[0068] (1) From the head coverage threshold that satisfies formula (2) rule head set In the middle, obtain a rule header ;

[0069] (2) Initialization , , Used to record entities of selected tin-based materials;

[0070] (3) Targeting Generate a new rule And calculate its confidence level from tin-based KG based on formula (3). And sort all candidate rules from highest to lowest confidence level;

[0071] (4) If the current rule The rules and If there is no intersection, then add this rule. and will join in .

[0072] Repeat steps (1)-(4) above to obtain the set of "process-composition-performance" rules contained in tin-based material KG. .

[0073] S20, the Horn rule is converted into a directed acyclic graph. If the directed acyclic graph includes multiple rule body variables of the Horn rule, a Core node is introduced to aggregate the information of each rule body variable and then pass it to the rule head node.

[0074] In this step, to quantify the relationship between composition, process, and performance in tin-based material KG, and to evaluate the impact of different combinations of composition and process parameters on the performance of tin-based materials, The rules in the code are converted into SnBN structures. ,in, For a DAG, each node represents a triple in a KG of tin-based material. Let be a set of directed edges, represented by directed edges. Dependencies between different triplet nodes.

[0075] In this embodiment, for a Horn rule whose rule body contains multiple variables, for example:

[0076] "Variable C is derived when both variable A and variable B are true".

[0077] If we simply construct a directed edge pointing to the rule head for each rule body variable, the graph structure will incorrectly encode the conjunction relation as multiple independent unidirectional dependencies, failing to express the logical semantics of "both preconditions must be satisfied simultaneously." To solve this problem, S20 introduces an intermediate convergence node called the Core node: each rule body variable node points to the Core node, and the Core node then points to the rule head node. Logically, the Core node performs the function of conjunction operation—only when all rule body variables are true does the Core node pass the truth signal to the rule head node, thus accurately preserving the conjunction semantics of the Horn rule.

[0078] It's important to note that Core nodes enable directed acyclic graphs to encode the logical conjunction relationships within Horn rules without introducing additional probability parameters to describe the synergistic effects between variables. In the graph structure of traditional Bayesian networks, when multiple parent nodes point to the same child node, the conditional probability table of the child node needs to explicitly encode the interaction patterns between parent nodes—this encoding behavior expands exponentially with the number of parent nodes, meaning the size of the conditional probability table grows exponentially with the number of parent nodes. However, with the introduction of Core nodes, the conjunction logic of the multivariate rule body is "folded" into the graph structure itself. The conditional probability table only needs to encode the single dependency relationship from the Core node to the rule head, thus significantly reducing the complexity of parameter learning.

[0079] S30, determine the probability parameters of each variable in the directed acyclic graph, and construct a tin-based Bayesian network based on the conditional probability table formed by each probability parameter.

[0080] After obtaining the topology of the directed acyclic graph, this step assigns probability parameters to each variable node, transforming it into a complete Bayesian network—namely, a Tinky Bayesian network.

[0081] In this embodiment, the calculation of the Conditional Probability Table (CPT) follows a basic principle: the statistical confidence of Horn rules in the knowledge graph is transformed into probability parameters. For root variable nodes without parent nodes, their prior probability is directly determined by the confidence of the corresponding rule; for internal variable nodes, their conditional probability is determined by the type of logical relationship between variables.

[0082] It should be noted that the confidence level of a rule reflects its reliability within the knowledge graph, while the conditional probability of a Bayesian network is essentially a parameter that quantifies the strength of dependencies between variables. This mapping allows the statistical information inherent in structured triples in the knowledge graph to be transferred to the probabilistic graphical model without the need for additional parameter fitting or maximum likelihood estimation. After calculation by S30, the tin-based material knowledge graph information, originally existing in the form of discrete triples, is completely encoded into a unified probabilistic model containing variable dependency topology and association strength parameters, namely, a tin-based Bayesian network.

[0083] S40, a policy network is constructed with head entities and relations as inputs and tail entity probability distribution as outputs, wherein the policy network is trained using the probabilistic inference results of the tin-based Bayesian network as reward signals;

[0084] After obtaining the Sikki Bayesian network, a policy network is constructed with head entities and relations as inputs and tail entity probability distributions as outputs. The probabilistic inference results of the Sikki Bayesian network are then used as reward signals to train the network.

[0085] A policy network is essentially a neural network model that transforms knowledge graph queries into a sequential decision problem: given the current query state (the set of entities that have already been assigned values) and the target relation, the policy network outputs the probability of selecting each candidate tail entity, thereby determining the next entity to be assigned a value. The structure of a policy network typically employs an encoder-decoder architecture, where the encoder fuses the head entity embeddings and relation embeddings into contextual features, and the decoder maps these features into a probability distribution in the tail entity space.

[0086] Compared to traditional policy networks, this embodiment innovatively introduces the probabilistic inference results of the tin-based Bayesian network as a reward signal for training. Specifically, traditional reinforcement learning-based knowledge graph query methods typically rely solely on triple embedding scores, such as ComplEx, to guide the training direction of the policy network. However, triple scores only reflect local semantic rationality and cannot measure the consistency of variable assignment results across the global scope. This invention introduces the probabilistic inference results of the tin-based Bayesian network as an additional reward signal, enabling the policy network to consider not only the semantic rationality of the choice in the embedding space but also the rationality of the joint probability of the choice in the component-process-performance causal relationship network when making tail entity selections. This allows the network to proactively avoid variable assignment paths that contradict known causal relationships during the inference phase.

[0087] S50 utilizes the trained policy network to perform serialized variable assignment search starting from the query entity, and obtains the answer entity that satisfies the logical constraints.

[0088] After training is completed, a trained policy network is obtained. Using the fully trained policy network, a serialized variable assignment search is performed starting from the query entity to gradually fill in the unknown variables in the query, and finally the answer entity that satisfies all logical constraints is obtained. Thus, the query for tin-based material KG is transformed into an optimal answer entity search process based on the policy network.

[0089] In this embodiment, serialized variable assignment search refers to the following process: in each iteration of the search process, the policy network outputs the probability distribution of the next candidate entity based on the currently assigned entity state. The system samples or selects the entity with the highest probability according to the distribution to complete the assignment, and adds the newly assigned entity to the state set to update the current state. This process is repeated until all query variables are assigned.

[0090] In the technical solution provided in this embodiment, the rule set contained in the knowledge graph of tin-based materials is mined, and then the rules are transformed into a unified directed acyclic graph. The conditional probability parameters of each variable in the graph are calculated, and a Bayesian network describing the relationship between the composition, process, and performance of tin-based materials is constructed, which is called the tin-based Bayesian network. Furthermore, the policy network is trained based on the probabilistic reasoning of the tin-based Bayesian network. The tin-based material knowledge graph query is transformed into a variable serialization assignment problem through the policy network to obtain the optimal answer entity that meets the constraints. This realizes the query of the tin-based material knowledge graph and provides a reliable technical solution for the needs of tin-based material formulation optimization, performance prediction, and process improvement.

[0091] Second Embodiment

[0092] Based on the first embodiment, this embodiment describes the implementation method for converting Horn rules into a directed acyclic graph. In step S20, the Core node is introduced to aggregate the information of each rule body variable and then pass it to the rule head node, including:

[0093] S21, For multiple Horn rules with the same rule header, retain the Core node corresponding to each rule and the connection between the Core node and the rule header node;

[0094] S22, obtain the constant false auxiliary node whose value is always 0, and set the constant false auxiliary node as the common parent node of each Core node and its logical negation;

[0095] S23, configure the common parent node to point to the rule head node so that information on different component-process variables can be passed to the rule head node through the corresponding Core node.

[0096] Specifically, The rules in the code are converted into SnBN structures. ,in, For a DAG, each node represents a triple in a KG of tin-based material. Let be a set of directed edges, represented by directed edges. Dependencies between different triplet nodes in the rule body. When there is only one variable, directly construct a line from point to The directed edge. When multiple variables are involved, the DAG construction steps are as follows:

[0097] First, each Horn rule Represented as the Horn clause ( ), A ternary group representing the composition, process, or properties of any tin-based material.

[0098] Then, considering the combined effects of various components and process parameters on the performance of tin-based materials, we introduce... express The values ​​of all triples in the set are used to construct the values ​​from each variable. arrive directed edges At the same time, construct edges ( This will unify and aggregate information on various components and processes. node.

[0099] Finally, in order to distinguish those that lead to the same performance metric Different combinations of components or process conditions, for those with the same rule head Multiple Horn rules, retaining the Core node corresponding to each rule and its relation to... Connection, i.e. Simultaneously, based on the logical semantics of the Horn rule, a constant false auxiliary node is introduced. Its value is always 0. Set it as the common parent node of all Core nodes and their logical negations, and point the logical negation of Core to... This ensures that information on different component-process variables can be transmitted through the corresponding Core nodes. .

[0100] Further, and optionally, if the Horn rule contains only one variable, then a directed edge is constructed from the rule body variable node to the rule head node.

[0101] Third Embodiment

[0102] Based on any of the above embodiments, this embodiment further details the steps for determining the probability parameters of each variable in a directed acyclic graph, specifically including:

[0103] S31, Determine the variable type of each variable in the directed acyclic graph;

[0104] S32, for the first variable whose variable type is no parent node, the confidence of the rule header and rule body corresponding to the first variable is used as the prior probability of the first variable;

[0105] S33, for a second variable whose variable type is a disjunction relationship between parent and child nodes, the conditional probability of the child node having a value of 1 is 1 when at least one variable in the parent node set has a value of 1, and 0 otherwise.

[0106] Specifically, since DAG is composed of the same The rules are transformed to obtain the variables in the rule body. By calculating the relationship between the node and the rule header The confidence level is used to calculate its prior probability, thereby transforming the triples in the tin-based material KG into a probability distribution to avoid noise interference and computational overhead caused by full-graph statistics. Therefore, for Constructed variables without parent nodes Its value is Prior probabilities according to calculate,

[0107] in, and They represent and The corresponding node in the DAG It is calculated using formula (3).

[0108] Any change in any key component or processing condition in tin-based materials may lead to changes in their specified properties. Therefore, based on the logical semantics of Horn's rule and its equivalent graph structure representation, ... As the parent node Variables, and as parent node The value of a variable is determined by the disjunction of its parent node. Therefore, the OR constraint in Boolean logic is used for calculation. The conditional probability that a child node has a value of 1 is 1 when at least one variable in the parent node set is 1; the conditional probability is 0 when all parent nodes have values ​​of 0, as defined below:

[0109] (4)

[0110] in, for The set of parent nodes; ( )for Values; if If it has the corresponding tin-based material composition, process, or properties, the value is 1; otherwise, the value is 0.

[0111] Fourth embodiment

[0112] Based on any of the above embodiments, this embodiment provides a further detailed explanation of the construction and training of the policy network:

[0113] (1) Policy Network Construction

[0114] In this embodiment, the KG query for tin-based materials is based on given material composition, process parameters, or performance indicators. Starting with the relationship path, the values ​​of unknown query variables are gradually deduced, requiring precise location of tail entities that satisfy logical constraints within the vast KG candidate entity space. Therefore, constructing a policy network To calculate the value distribution of the query variable, an encoder is set. right With Relationship Encode, Decode the corresponding tail entity As a value for the query variable, the existential quantifier ∃ restricts the value of the query variable, and its definition is as follows:

[0115] (5)

[0116] in, and They are respectively The encoder and decoder, and Entities The vector of relation r, , , and For learnable parameters, It is the Sigmoid activation function. This represents vector concatenation. It is a linear rectifier function.

[0117] Because the KG query for tin-based materials requires assigning values ​​to query variables related to composition, process, and performance to search for answer entities that satisfy logical constraints, and the values ​​of subsequent query variables are determined by the currently assigned set of values, therefore, based on... The system outputs the value distribution of subsequent query variables for the already assigned set, ensuring that each variable assignment yields performance best matched to the current tin-based material composition and process. Set off, The process iteratively selects actions to expand the current inference path until an answer entity that satisfies the KG query constraints for tin-based materials is obtained. This process comprises four parts: state, action, transition, and reward.

[0118] (1) State This represents the set of query variables currently being assigned values, where all values ​​correspond to entities within the tin-based material KG. The initial state only contains... .

[0119] (2) For the given information in the query ,action Representing entities Through relation r, based on The output tail entity probability distribution is The assignment is used to obtain the reasoning path that satisfies the logical constraints in the tin-based material KG.

[0120] (3) Regarding the current state Head entity and relationships transfer function pass The new entity assigned Update status:

[0121]

[0122] in, , .

[0123] (4) In order to make Generation and State The system has already visited highly relevant tail entities. Considering the domain knowledge described by structured triples in tin-based material KG and the "composition-process-performance" variable relationships described by SnBN, a reward design is implemented. The specific steps are as follows:

[0124] First, to obtain an initial vector of entity relations that can characterize knowledge in the tin-based materials domain, ComplEx, an embedding model widely used to characterize KG entity relations, is employed to convert all entities and relations in the tin-based materials KG into computable vectors for calculating candidate triples. rating Only when Greater than the threshold If the candidate triplet is valid, it is considered valid; otherwise, it is deemed not to conform to the domain knowledge logic of tin-based materials KG and a negative reward is given.

[0125] Then, for all that satisfy the threshold Candidate tin-based material entities, calculated based on probabilistic inference using SnBN. To obtain with The most relevant entity is used as the query variable value. To efficiently calculate the correlation strength between tin-based alloys and their "composition-process-performance" combinations, Monte Carlo sampling is used from... Generated in Samples to calculate Each sample consists of a set of tin-based material composition, process, and performance variables with given values. The specific steps are as follows:

[0126] from Starting from the node without a parent, representing the composition, performance, and process, proceed sequentially for each node. Monte Carlo sampling was performed.

[0127] like If there is no parent node, proceed directly based on its prior probability distribution. Randomly select a value ;like If there is a parent node, it is determined based on the current state value of the parent node. From CPT Randomly select a state value .

[0128] Generate includes A complete sample of all component, process, and performance variable values. ,in, express The value of in this sampling.

[0129] Repeat the above steps until you get A sample set was obtained by taking samples to fully describe the relationships and value distributions among the various components, processes, and performance variables in SnBN.

[0130] Based on generation One sample, for the set of observed states calculate First, compare each sample one by one. All variables in The value of , if the sample The values ​​of each variable in the middle are all related to If the samples match, retain them as valid samples. Then, count the valid samples. Frequency of occurrence, as The estimated value:

[0131] (7)

[0132] in, As an indicator function, when the sample Includes target entity hour, The value is 1 if it is not 1, otherwise the value is 0.

[0133] Finally, the reward is fed back to the policy network based on the triple score. Calculate as follows:

[0134] (8)

[0135] in, .

[0136] (2) Policy Network Training

[0137] make Indicates by A variable assignment trajectory generated sequentially in tin-based material KG, where each step corresponds to the value of a variable related to the composition, process, or performance of the tin-based material. Trajectory The generation probability is the product of the conditional probabilities at each step:

[0138] (9)

[0139] in, and Representing trajectories The entity and relation corresponding to the i-th step.

[0140] To ensure The output variable values ​​are the same as The components, processes, and performance entities in the network have the highest correlation. Based on formula (9), the learning objective of the policy network is set to maximize the expected cumulative reward:

[0141] (10)

[0142] in, for Learnable parameters, For trajectory The total reward.

[0143] In the KG query search process for tin-based materials, the variable values ​​include all tin-based materials and their composition, process, and properties, forming a high-dimensional discrete action space. However, the reward signal is only obtained at the end of the inference trajectory, exhibiting delay and sparsity, which can easily lead to... It is difficult to effectively learn the optimal assignment strategy for tin-based materials. On the other hand, the policy network... Outputting the probability distribution of actions in a differentiable manner enables stable and continuous parameter updates in the high-dimensional discrete action space of tin-based material variables. Therefore, the policy gradient method is employed for training. Strengthen learning loss Maximize The expected reward of the induced trajectory is calculated as follows:

[0144] (11)

[0145] Then, the relationship between the probability distribution gradient and its logarithmic gradient is used to calculate... :

[0146] (12)

[0147] Formula (12) in Furthermore, this holds true when the policy is differentiable. Transforming the gradient into the product of the probability and its logarithmic derivative allows the gradient of the expected reward to be converted into an expectation of the log-likelihood of the policy.

[0148] To enable policy networks This invention can learn the correlation between "composition-process-performance" of tin-based materials, thereby optimizing the search path. The invention employs a path traversal training strategy network based on reinforcement learning, with the following steps:

[0149] Any entity in KG of tin-based material As a starting point, add it to Starting from any link relationship r, calculate the probability distribution of the output candidate tail entities. And sample from it to obtain the next entity ;

[0150] Update current head entity And add the newly assigned entity to the state set. This creates a contextual state containing multi-dimensional information such as material composition, process, and performance, continuously expanding the path generation trajectory. ;

[0151] The cumulative loss of the current trajectory is calculated based on formula (12), and the network parameters of the strategy are updated through gradient ascent. .

[0152] Repeat the above steps until the preset maximum number of training epochs N is met, then output the trained policy network parameters. A strategy network that can effectively assign values ​​to tin-based material variables was obtained. .

[0153] The results were:

[0154] S41, generate multiple samples from the tin-based Bayesian network, take all variables in the samples that have the same value as the current state as valid samples, count the frequency of the target tail entity in the valid samples, and obtain the posterior probability estimate.

[0155] S42, calculate the score of the candidate triplet. When the score is greater than or equal to a preset threshold, the posterior probability estimate is used as the reward; otherwise, a negative reward is given.

[0156] Fifth embodiment

[0157] Based on any of the above embodiments, in this embodiment, the logical constraint conditions in S50 include at least one of the following:

[0158] S51, If ​​the subquery contains a quantifier, the subquery is mapped to the tail entity probability distribution directly output by the strategy network;

[0159] S52, if the subquery represents negation, map the subquery corresponding to the negation to the complement of the probability distribution of the tail entity;

[0160] S53, If the subquery represents a conjunction, map the subquery corresponding to the conjunction to the product of the probability distributions of each subquery;

[0161] S54, if the subquery represents a disjunction, map the subquery corresponding to the disjunction to the product of the probability distributions of each subquery.

[0162] Specifically, the logical constraints in the KG query for tin-based materials are decomposed into multiple computable subqueries, each subquery targeting only those of the form " The individual entity-relationship exists and quantifiers are calculated independently, variables The assignment or logical operation represents each subquery, and the tin-based material entity that satisfies the logical constraints is obtained by decoding based on the policy network.

[0163] make This represents the distribution of tin-based material entities corresponding to the subquery. For nodes that correspond to both quantifiers and logical connectives, the calculation is performed as follows: :

[0164] Existential quantifiers. In tin-based material composition-property queries, it is necessary to accurately predict the probability distribution of material entities. Existential quantifiers. Corresponding subqueries aim to predict the outcome of the query entity. Tail entities reachable via relation r The distribution of variables in this subquery is directly determined by the decoder. calculate:

[0165] (13)

[0166] Negation. To eliminate unreasonable combinations in tin-based material design, negation logic needs to be constructed to filter invalid candidates. The operation representing negation... Intended to identify with Entities that do not have a reasonable relationship under relation r ,Right now The logical complement corresponding to the atomic triplet score, through Invert the result to output its approximate value:

[0167] (14)

[0168] in, It is a vector consisting entirely of 1s.

[0169] Conjunction. The comprehensive performance optimization of tin-based materials requires simultaneously meeting multiple key indicators, for operations representing conjunction. The t-norm is used to merge the distributions of each subquery. To ensure a high score for an entity, it must simultaneously meet multiple query criteria such as high ductility and high hardness. The score is calculated using the following formula:

[0170] (15)

[0171] in, This represents the entity distribution of the i-th subquery.

[0172] Extraction. To support the diverse application scenarios of tin-based materials, multi-strategy compatibility assessment is required. For example, the feasibility of querying tin alloys with "high melting point" or "high ductility" should be ensured, guaranteeing a high score as long as any sub-query entity is satisfied. The calculation is performed using the following formula:

[0173] (16)

[0174] Through the above-described layer-by-layer decomposition and variable assignment, this invention can transform the complex material query problem into a computable graph structure to handle existence quantifiers, negation operations, conjunction operations, and disjunction operations in the query, and output the distribution of tin-based material entities, thereby obtaining the optimal entities that satisfy the constraints.

[0175] Sixth Embodiment

[0176] Based on the first to fifth embodiments described above, referring to Figures 2 to 5 In this embodiment, a tin material manufacturing company provides a tin-based material KG containing 1,500 entities, 69 types of relationships, and 1,000,000 ternaries. Examples of ternaries are shown in Table 1.

[0177] surface Examples of tin-based material KG ternary arrays

[0178]

[0179] (1) Construction of Sikki Bayesian Network

[0180] For the data fragments in Table 1, the entity set The set of relationships containing tin-based material entities {Sn, PSn, LiSn, Mg2Sn, Sn, P, Li, Mg} This includes terms such as "contains", "magnetism", "density", and "thermodynamic stability".

[0181] Horn rules are mined from tin-based material KG. First, the head coverage of relations in tin-based material KG is calculated based on formula (2), and all attribute relations that appear as tail entities are counted to obtain candidate rule heads. The total number of instances in tin-based material KG is 50, and a rule header coverage threshold is set. If the value is 0.1, then:

[0182] rule " ",satisfy" "and" The number of instances of "" is 50, and the rule header coverage is 50%. ,reserve.

[0183] rule " ",satisfy" "and" The number of instances of "" is 15, and the rule header coverage is 15%. ,reserve.

[0184] rule " ",satisfy" "and" The number of instances of "" is 20, and the rule header coverage is 20%. .

[0185] rule " ",satisfy" "", "and" The number of instances of "" is 0, and the rule header coverage is 0. ,throw away.

[0186] rule " ",satisfy" "、 and" The number of instances of "" is 20, and the rule header coverage is 20%. ,reserve.

[0187] Then, a greedy search strategy is used to mine the rule set from the tin-based KG, with the following steps:

[0188] Select rule header " ”;

[0189] initialization , ;

[0190] The rule confidence score is calculated using formula (3). With a support score of 20, the total number of materials containing Sn is 100. Calculated sequentially to obtain Confidence level is , Confidence level is , Confidence level is Rules that meet the head coverage threshold are sorted in descending order of confidence. , , , };

[0191] The set of rule body variables is ,and No intersection, join ,have , ; The set of rule body variables is ,and No intersection, join ,have , The set of rules for rule 5 is as follows: ,and No intersection, join ,have , ; The set of rule body variables is ,and There is an intersection ,throw away;

[0192] This yields the final rule set. .

[0193] Next, the tin-based Bayesian network structure is constructed, and... The rules in the code are transformed into a DAG structure. The rule body contains only one variable, directly constructing directed edges. ".

[0194] and The rule body contains more than one variable, which will be... Convert to Horn clause as well as At the same time, introduce , They represent and The core node.

[0195] remember Indicates node " "、 Indicates node " "、 Indicates node " "、 express" "、 express" ".

[0196] Depend on Constructed DAG like Figure 4 As shown in (a), its edge set is:

[0197]

[0198] Depend on Constructed DAG like Figure 4 As shown in (b), its edge set is:

[0199]

[0200] Then, a constant false auxiliary node is introduced. Its value is always 0, and it is set to all The node and its common parent node of logical negation will , The constructed DAGs are merged, and the merged structure like Figure 4 As shown in (c), its edge set is:

[0201] Furthermore, regarding nodes without a father... The CPT is calculated based on the rule confidence. (Based on nodes...) For example, when When the value is 0, .when When the value is 1, .node The CPT values ​​are shown in Table 2.

[0202] Table 2. Nodes CPT

[0203]

[0204] by For the parent node Node, when and At that time, we can obtain from formula (4) . Node and its parent node The calculation results of CPT with arbitrary values ​​are shown in Table 3. The CPT calculation results are shown in Table 4.

[0205] Table 3. and CPT

[0206]

[0207] Table 4. CPT

[0208]

[0209] (2) Knowledge graph query of tin-based materials

[0210] First, based on the ComplEx model, the vector dimension is set to 128 to obtain the initial vector representation of the entity relationship in the tin-based material KG.

[0211] For example, the entity e vector is represented as ,relation for .

[0212] Policy Network Settings Encoder right With Relationship Encode, Decode the corresponding tail entity distribution, and iteratively select actions to expand the inference path until the answer entity that satisfies the KG query constraints for tin-based materials is obtained. Given an initial entity For CuSn, the relationship is... For the purpose of "inclusion", the policy network search process includes four parts: state, action, transition, and reward.

[0213] Will Add to the initial state set ;

[0214] Based on formula (5), concatenating LiSn with the relation "contains" yields a 256-dimensional vector. for The weight matrix, for dimensional bias vector, action By using the activation function, the content of tin-based material KG is obtained. The probability distributions of the candidate entities are obtained, and the probability distributions of some tail entities are shown in Table 5.

[0215] Table 5. Partial Results of Tail Entity Distribution

[0216]

[0217] Based on the tail entity distribution in Table 5, Cu is selected as... The values ​​are determined based on formula (6), and the state set is updated. .

[0218] To efficiently compute the policy network reward function, a topological sorting based on SnBN is used to determine the node sampling order, resulting in a sample set for approximate calculation of the posterior probability.

[0219] Suppose that SnBN contains the following nodes: , , , as well as According to the SnBN structure, the topological sorting result of each node is as follows: Monte Carlo sampling is performed on each node in the topological order.

[0220] For the first node According to its prior probability distribution , Sampling is performed to extract random state values. For nodes ,right , Sampling, extracting state values .against , child nodes Based on the sampled parent node state Sampling, extracting random state values And so on, until a complete set of samples is obtained. .

[0221] Set the number of samplings Repeat steps ① and ② to generate One sample.

[0222] Calculating triples using ComplEx The scores and partial results are shown in Table 6.

[0223] Table 6. Fractional results

[0224]

[0225] Set ComplEx score threshold Triples ComplEx score The reward is calculated based on SnBN probabilistic inference. . In each sample The number of valid samples is ,in" "The number of occurrences is 3000, based on formula (7) to obtain..." The calculation result is:

[0226]

[0227] For policy network training, SnBN sampling is used, starting with SnCu, and the network is trained by traversing paths through the tin-based material KG. .

[0228] First, SnCu is used as the starting entity. Add to state set ,at this time trajectory Initialize to , parameter Random initialization.

[0229] Then, using "containment" as the relationship expansion path, The concatenation of SnCu with the "containing" embedding vector is used as input to calculate the probability distribution of all candidate tail entities. For example, the probabilities of Sn and Cu being tail entities are 0.32 and 0.28, respectively. Simultaneously, probabilistic inference based on SnBN quantifies the association between SnCu and tail entities. ,make Assign the optimal entity to the variable based on the context.

[0230] Triple group , If the score is greater than the ComplEx threshold, a reward is calculated based on the sampled data set. , Choosing Cu as the tail entity, the state set is expanded to Cu The trajectory expands to And get a reward based on formula (8). At this moment, the trajectory The length is 1, calculated based on formula (9). The probability of trajectory generation is The trajectory is calculated using formula (10). The expected reward is And calculate the gradient based on formula (11). To maximize the reward. Therefore, based on formula (12) Transform into logarithmic gradient form:

[0231]

[0232] Using learning rate Update network parameters using gradient ascent:

[0233]

[0234] Repeat steps ① to ③ to sample paths and calculate gradients to achieve multiple rounds of iterative training. Rotational training.

[0235] 2.3 Entity Search Based on Policy Networks

[0236] Querying the KG of tin-based materials often requires satisfying multiple conditions or finding the optimal result under multiple logical constraints. For example, querying... Involving " "", "Existential quantifiers, Negation and conjunction operations.

[0237] First, regarding the subquery " ", by policy network The tail entity distribution is decoded, and its complement is calculated based on formula (14) to satisfy the negative query, for example, based on Computable for The probabilities of CSN are respectively , From formula (14), the probability distribution of its complement can be obtained as follows: , Table 7 presents partial results of the tail entity distribution.

[0238] Table 7. Subqueries Tail entity distribution results

[0239]

[0240] Based on formula (15), for " conjunction of ' This operation multiplies the distributions of two subqueries, for example, when... When it is LiSn, and Based on formula (15), we can obtain Similar to calculating the distribution of each entity, some results are shown in Table 8. Based on " From the probability distribution of “”, we can obtain LiSn and CSn as answers that satisfy the constraints.

[0241] Table 8. Partial Results of Conjunction Calculation Entity Distribution

[0242]

[0243] As one implementation scheme, Figure 6 This is a schematic diagram of the hardware operating environment of the computer system involved in the embodiments of this application.

[0244] like Figure 6 As shown, the computer system may include: a processor 1001, such as a CPU; a memory 1005; a user interface 1003; a network interface 1004; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0245] Those skilled in the art will understand that Figure 6 The computer system architecture shown does not constitute a limitation on the computer system and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0246] like Figure 6 As shown, the memory 1005, as a storage medium, may include an operating system, a network communication module, a user interface module, and computer programs. The operating system is a program that manages and controls the hardware and software resources of the computer system, as well as the operation of the computer programs and other software or programs.

[0247] exist Figure 6 In the computer system shown, the user interface 1003 is mainly used to connect to the terminal and communicate with the terminal; the network interface 1004 is mainly used to communicate with the backend server; and the processor 1001 can be used to call the computer program stored in the memory 1005.

[0248] In this embodiment, the computer system includes: a memory 1005, a processor 1001, and a computer program stored in the memory and executable on the processor, wherein:

[0249] When the processor 1001 calls the computer program stored in the memory 1005, it implements each step of the Bayesian network-based tin-based material knowledge graph query method as described in the above embodiment.

[0250] Furthermore, those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in a computer system to implement the process steps of the embodiments of the above methods.

[0251] Therefore, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the various steps of the Bayesian network-based tin-based material knowledge graph query method described in the above embodiments.

[0252] The computer-readable storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0253] It should be noted that, since the storage medium provided in the embodiments of this application is the storage medium used to implement the methods of the embodiments of this application, those skilled in the art can understand the specific structure and variations of the storage medium based on the methods described in the embodiments of this application, and therefore will not be repeated here. All storage media used in the methods of the embodiments of this application fall within the scope of protection of this application.

[0254] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0255] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0256] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0257] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0258] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0259] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for querying knowledge graphs of tin-based materials based on Bayesian networks, characterized in that, The method includes the following steps: S10, a set of Horn rules that describes the relationship between composition, process and performance, is extracted from the knowledge graph of tin-based materials; S20, the Horn rule is converted into a directed acyclic graph. If the directed acyclic graph includes multiple rule body variables of the Horn rule, a Core node is introduced to aggregate the information of each rule body variable and then pass it to the rule head node. In S20, the Core node is introduced to aggregate information from various rule body variables and then pass it to the rule head node, including: For multiple Horn rules with the same rule header, retain the Core node corresponding to each rule and the connection between the Core node and the rule header node; Obtain the constant false auxiliary node whose value is always 0, and set the constant false auxiliary node as the common parent node of each Core node and its logical negation; Configure the common parent node to point to the rule head node so that information about different component-process variables can be passed to the rule head node through the corresponding Core node; S30, determine the probability parameters of each variable in the directed acyclic graph, and construct a tin-based Bayesian network based on the conditional probability table formed by each probability parameter. In S30, determining the probability parameters of each variable in the directed acyclic graph includes: Determine the variable type of each variable in the directed acyclic graph; For the first variable whose variable type is no parent node, the confidence of the rule header and rule body corresponding to the first variable is used as the prior probability of the first variable; For a second variable whose variable type is a disjunction relationship between parent and child nodes, the conditional probability that the child node has a value of 1 is 1 when at least one variable in the parent node set has a value of 1, and 0 otherwise. S40, a policy network is constructed with head entities and relations as inputs and tail entity probability distribution as outputs, wherein the policy network is trained using the probabilistic inference results of the tin-based Bayesian network as reward signals; S50: Using the trained policy network, serialization variable assignment search is performed starting from the query entity to obtain the answer entity that satisfies the logical constraints. Serialization variable assignment search refers to a process in which, in each iteration of the search process, the policy network outputs the probability distribution of the next candidate entity based on the currently assigned entity state. The system samples or selects the entity with the highest probability according to this distribution to complete the assignment, and adds the newly assigned entity to the state set to update the current state. This process is repeated until all query variables have been assigned values.

2. The method for querying tin-based material knowledge graphs based on Bayesian networks as described in claim 1, characterized in that, S20 also includes: If a Horn rule has only one variable in its body, then a directed edge is constructed from the variable node in the body to the head node of the rule.

3. The method for querying tin-based material knowledge graphs based on Bayesian networks as described in claim 1, characterized in that, In S40, training using the probabilistic inference results of the tin-based Bayesian network as the reward signal includes: Multiple samples are generated from the tin-based Bayesian network. Samples in which all variables have the same value as the current state are considered valid samples. The frequency of the target tail entity in the valid samples is counted to obtain the posterior probability estimate. Calculate the score of the candidate triplet. When the score is greater than or equal to a preset threshold, the posterior probability estimate is used as the reward; otherwise, a negative reward is given.

4. The method for querying tin-based material knowledge graphs based on Bayesian networks as described in claim 3, characterized in that, The expression for the comprehensive reward function of the policy network during the training process is as follows: ; In the formula, This represents the posterior probability estimate. express, Represents a triplet The rating, For the preset threshold, The negative reward magnitude value; For the head entity, For relationship; in: ; In the formula, Let this be an indicator function, representing the state when the sample... Includes target tail entity hour, The value is 1 if it is not 1, and 0 otherwise; M is the number of samples. This is the current state.

5. The method for querying tin-based material knowledge graphs based on Bayesian networks as described in claim 1, characterized in that, In S50, the logical constraint conditions include at least one of the following: If a subquery contains a quantifier, the subquery is mapped to the tail entity probability distribution directly output by the policy network; If the subquery represents negation, the subquery corresponding to the negation will be mapped to the complement of the probability distribution of the tail entity; If a subquery represents a conjunction, map the subquery corresponding to the conjunction to the product of the probability distributions of each subquery; If a subquery represents a disjunction, the subquery corresponding to the disjunction is mapped to the product of the probability distributions of each subquery.

6. The method for querying tin-based material knowledge graphs based on Bayesian networks as described in claim 1, characterized in that, Step S10 includes: Obtain the initial set of Horn rules in the tin-based materials knowledge graph that have the same rule body and whose rule heads do not intersect: Determine the head coverage rate of each Horn rule in the initial Horn rule set, and select the target Horn rule that is within the preset head coverage rate range; The confidence level of each target Horn rule is determined, and a greedy algorithm is used to select the target Horn rule with the highest confidence level to form the Horn rule set.

7. A computer system, characterized in that, The computer system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the Bayesian network-based tin-based material knowledge graph query method as described in any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the Bayesian network-based tin-based material knowledge graph query method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Knowledge graph reasoning method based on logic rules and reinforcement learning

    CN115660086A

  • Reinforced learning sparse graph reasoning method and system based on fusion reward

    CN119918648A