A coal mine safety risk inference method, system, device and storage medium
Patent Information
- Application Number
- CN202410286098.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2026-08-07
- Estimated Expiration
- 2044-03-13
AI Technical Summary
然而,这些方案在涉及知识图谱的存储安全性、数据可追溯性、吞吐量以及推断效能方面的优化上相对缺乏,这限制了它们在如煤矿安全风险推断系统这样的关键应用领域的有效性
[0076](1)本发明提出的煤矿安全风险推断方法有效提升了数据安全性和可追溯性。区块链的不可篡改性和透明性特征使得煤矿安全风险数据的存储更加安全可靠,同时提高了数据处理的信任度。
Smart Images

Figure CN118297158B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of coal mine safety risk inference technology, and in particular to a coal mine safety risk inference method, system, equipment and storage medium. Background Technology
[0002] In the context of modern artificial intelligence and data science, knowledge graphs play a crucial role in coal mine safety risk inference systems. Their storage security, data traceability, maximum data throughput, and inference efficiency are essential for the smooth operation and timeliness of the system. However, with the continuous expansion of the coal mining industry and the increasing demand for safety, the security and efficiency of knowledge graphs are facing unprecedented challenges. These challenges mainly involve how to securely and traceably store large amounts of dynamic data and efficiently access and retrieve it, i.e., improving data processing throughput. Simultaneously, considering the complexity of the data and the need for rapid response, ensuring the stable operation of the system and enabling fast and effective inference analysis of the collected coal mine data are also important issues currently facing the field of knowledge graphs.
[0003] The Chinese invention patent application CN202311154631.4, entitled "A Method and System for Constructing a Contaminated Site Profile Based on Knowledge Graph Reasoning," discloses a scheme that integrates contaminated site investigation report data, constructs and analyzes triplet tables, and applies graph neural networks to build a detailed profile of the contaminated site and improve the accuracy of pollution assessment. However, this scheme focuses on expanding the knowledge graph and analyzing the dependencies between entities, without addressing aspects such as knowledge graph storage security, data traceability, increased throughput, and inference efficiency.
[0004] The Chinese invention patent application CN202311126198.3, entitled "Method, Apparatus, Device, and Medium for Recommending Emergency Response Plans Based on Knowledge Graphs," discloses a scheme that utilizes reinforcement learning and graph convolutional network techniques to analyze and expand the fault knowledge graph. It then uses a knowledge graph attention network algorithm to analyze the causes of faults and dependencies between entities, thereby recommending effective emergency response plans for specific faults and improving the system's fault handling capabilities and stability. While this scheme does indeed improve the system's fault handling capabilities and stability, its primary focus is on knowledge graph reasoning and emergency response plan recommendation, without clearly explaining how to securely and traceably store the knowledge graph.
[0005] The Chinese invention patent application CN202311112645.X, entitled "A Few-Sample Knowledge Graph Completion Method Based on Reinforcement Learning," discloses a solution to the problems of data sparsity and interpretability of knowledge graphs by determining and completing the dynamic completion of the knowledge graph through iterative reasoning. While this solution can address the interpretability and sparsity issues of knowledge graphs, its primary objective is the dynamic completion of the knowledge graph, and it does not address how to store the knowledge graph to increase its throughput or how to improve inference efficiency.
[0006] The Chinese invention patent application CN202310990444.3, entitled "A Method and Device for Reasoning in a Multimodal Knowledge Graph of Traditional Chinese Medicine Based on Rules and Paths," discloses a solution that utilizes target triples combined with various embedded representations of entities to improve the accuracy of reasoning and prediction in traditional Chinese medicine. However, the application scope of this solution is mainly limited to traditional Chinese medicine, and it primarily focuses on the accuracy of reasoning and prediction, without addressing the throughput and inference performance of the knowledge graph, nor the storage security and data traceability of the knowledge graph.
[0007] In summary, the above solutions mainly focus on different application areas and technical aspects of knowledge graphs, particularly their construction, completion, and inference. They generally emphasize the effectiveness of algorithms for specific applications, such as the application of graph neural networks and reinforcement learning in knowledge graph construction and inference. However, these solutions are relatively lacking in optimizations related to knowledge graph storage security, data traceability, throughput, and inference performance, which limits their effectiveness in critical application areas such as coal mine safety risk inference systems. Therefore, the challenges remain how to securely and traceably store data, and how to achieve fast and efficient inference of knowledge graphs. Summary of the Invention
[0008] The purpose of this invention is to provide a method, system, device, and storage medium for inferring coal mine safety risks, aiming to improve the security of knowledge graph storage, the traceability of data, the maximum throughput of data, and the efficiency of inference operations.
[0009] The objective of this invention is achieved through the following technical solution:
[0010] A method for assessing coal mine safety risks includes:
[0011] Utilizing blockchain networks to store knowledge graphs in the field of coal mine safety;
[0012] The knowledge graph of the coal mine safety field is obtained from the blockchain network, and the entity embedding matrix in the knowledge graph of the coal mine safety field is decomposed to obtain a matrix containing entity feature information and a shared parameter matrix.
[0013] The system performs entity classification by combining a matrix containing entity feature information. It then calculates the posterior probability distribution between the entity and a given relationship by combining the entity classification results with a shared parameter matrix. Using the posterior probability distribution, it makes effective inferences about coal mine safety-related risks and events.
[0014] A coal mine safety risk assessment system, comprising:
[0015] A blockchain network for storing knowledge graphs in the field of coal mine safety;
[0016] The entity embedding matrix decomposition unit is used to obtain the knowledge graph of the coal mine safety field from the blockchain network, and decompose the entity embedding matrix in the knowledge graph of the coal mine safety field to obtain a matrix containing entity feature information and a shared parameter matrix.
[0017] The coal mine safety risk inference unit is used to perform entity classification tasks by combining a matrix containing entity feature information. It calculates the posterior probability distribution between the entity and a given relationship by combining the entity classification results with a shared parameter matrix, and uses the posterior probability distribution to infer coal mine safety-related risks and events.
[0018] A processing device includes: one or more processors; and a memory for storing one or more programs;
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method.
[0020] A readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned method.
[0021] As can be seen from the technical solutions provided by the present invention, the blockchain-based knowledge graph storage and optimized transaction processing scheme can improve the security of knowledge graph storage, the traceability of data, and the maximum throughput of data; the entity embedding decomposition scheme can reduce parameter redundancy, improve reasoning efficiency by using refined type-aware reasoning, and combine self-supervised entity classification models and efficient graph neural network processing to optimize the construction and query processing of knowledge graphs to achieve efficient reasoning and application of large-scale knowledge graphs. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart illustrating a method for inferring coal mine safety risks provided in an embodiment of the present invention;
[0024] Figure 2 This is a schematic diagram of low-rank entity embedding provided in an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of a coal mine safety risk inference system provided in an embodiment of the present invention;
[0026] Figure 4 This is a schematic diagram of a processing device provided in an embodiment of the present invention. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0028] First, the following explanations are provided for the terms that may be used in this article:
[0029] The terms “including,” “comprising,” “containing,” “having,” or other similar semantic descriptions should be interpreted as non-exclusive inclusion. For example, “including a technical feature element (such as raw material, component, ingredient, carrier, dosage form, material, size, part, component, mechanism, device, step, process, method, reaction conditions, processing conditions, parameter, algorithm, signal, data, product or article of manufacture, etc.)” should be interpreted as including not only the expressly listed technical feature element, but also other technical feature elements that are not expressly listed and are well-known in the art.
[0030] The following provides a detailed description of a coal mine safety risk assessment method, system, equipment, and storage medium provided by this invention. Contents not described in detail in the embodiments of this invention are prior art known to those skilled in the art. Where specific conditions are not specified in the embodiments of this invention, they should be performed according to conventional conditions in the art or conditions recommended by the manufacturer.
[0031] Example 1
[0032] This invention provides a method for inferring coal mine safety risks, which is a coal mine safety risk inference scheme based on blockchain-stored knowledge graphs and knowledge graph reasoning. Figure 1 As shown, the main steps include the following:
[0033] Step 1: Utilize a blockchain network to store a knowledge graph in the field of coal mine safety.
[0034] The preferred implementation method for this step is as follows:
[0035] (1) Obtain the knowledge graph of the coal mine safety field that has been constructed, and generate a transaction after encryption, packaging and signing, and send it to the blockchain network.
[0036] For example, the encryption can be hash encryption, and the hash value obtained by hash encryption can be packaged and signed to generate the corresponding transaction.
[0037] (2) The blockchain network is sharded, and a leader node is elected in each shard, with the remaining nodes being follower nodes. The leader node determines the optimal transaction selection plan based on the resource consumption of each transaction and sends the optimal transaction to the follower nodes. In the process of selecting the optimal transaction, the system will comprehensively consider the resource consumption, submission time, and relevance to the field of coal mine safety of each transaction to ensure that the most efficient and relevant knowledge graph information is processed and stored first.
[0038] Commit time is a crucial factor when processing transactions in a blockchain network. Tasks committed earlier are typically processed first, meaning transactions committed earlier tend to be completed sooner. Furthermore, when faced with a large volume of pending transactions, enhancing the blockchain network's computing power can accelerate transaction selection and processing, thereby improving overall system efficiency and responsiveness. Additionally, in practice, a priority selection table can be set up to prioritize transactions with excessively long waiting times (exceeding a set threshold).
[0039] In this embodiment of the invention, each transaction refers to various data and information closely related to the field of coal mine safety. These transactions may include, but are not limited to, knowledge graphs in the field of coal mine safety, safety monitoring records, risk assessment reports, etc., all of which are key components of coal mine safety management and risk inference.
[0040] (3) All nodes in the network shard reach a consensus on the optimal transaction, generate the corresponding block, and broadcast the block to the leader nodes of other network shards for verification. After successful verification, the block is added to the blockchain network. The consensus process in this part may include verification, transaction processing, and block generation; broadcasting the block to the leader nodes of other network shards for verification can prevent double-spending.
[0041] Preferably, an optimal transaction sharding allocation algorithm can be configured on each leader node. This algorithm is based on an optimized dynamic programming algorithm to solve the optimal transaction selection problem, and the steps are as follows:
[0042] (a) Define the input as a list of transactions TL, and the computational resource limit C in the network sharding. LThe unit is a number, and the storage space limit S in the fragment is... L The unit is TB, and the communication resource limit N in the fragment is... L The unit is Gbps; the output is defined as the maximum benefit (MFT) obtained from network sharding, and the optimal choice table (MFPT), which is a list of ranked transactions; where each transaction's attribute is a quadruple (C... i S i N i F i ), C i S represents the computational resources required for the i-th transaction, expressed in milliseconds. i This refers to the storage space occupied, measured in MB or N. i This refers to communication consumption, measured in MB and F. i It represents the benefit obtained; MFT[i][C][S][N] represents the maximum benefit that the first i transactions can obtain under the costs of computing resources C, storage space S and communication cost N; MFPT[i] represents whether to select the i-th transaction.
[0043] (b) Initialize MFT and MFPT; set all attributes of MFT and MFPT to 0 to perform preliminary calculations of the optimal plan.
[0044] (d) Iterate through the transactions in the transaction list. When considering the strategy for choosing or not choosing the i-th transaction, transform it into a problem that only relates to the previous (i-1) transactions. Use a set of temporary variables including cal, sto, net, and fee to store the attributes of the transaction at time (i-1), where cal is the computational resource of the (i-1)-th transaction; sto is the storage space of the (i-1)-th transaction; net is the communication cost of the (i-1)-th transaction; and fee is the gain obtained by the (i-1)-th transaction. MFT[i][j][k][l] is related to MFT[i-1][j][k][l] and MFT[i-1][j-cal][k-sto][l-net], using a three-dimensional array MFT[C L ][S L ][N L Use this to save the state of the previous (i-1) transactions.
[0045] The aforementioned three-dimensional array essentially refers to a data structure used in the optimal transaction selection calculation process to record and evaluate the comprehensive performance and benefits of each transaction under specific resource constraints (computational resources, storage space, and communication resources). The three-dimensional array MFT stores the maximum benefit that the first i transactions can bring, given the constraints of computational resources C, storage space S, and communication costs N. Each dimension represents a type of resource, and each element in the array represents the optimal benefit state achievable under a specific combination of resources.
[0046] (e) Reverse traversal of C L S L and N L Compare the benefits of selecting the i-th transaction with the benefits of not selecting it. If the benefit of selecting the i-th transaction is greater than the benefit of not selecting it, then select the i-th transaction and mark it accordingly in the MFPT. Specifically: from the maximum resource limit (C... L S L N L Start by gradually reducing resource constraints until the minimum constraint is reached. This means first dealing with cases with larger resource constraints, and then gradually considering cases with even tighter resource constraints. For example, if calculating resource constraint C... L If the value is 100, then first calculate the case where c = 100, and then calculate the cases where c = 99, 98, ..., 1.
[0047] (f) Execute in a loop until all transactions in the transaction list TL have been processed, and the optimal transaction selection plan is obtained.
[0048] Step 2: Obtain the knowledge graph of the coal mine safety field from the blockchain network, and decompose the entity embedding matrix in the knowledge graph of the coal mine safety field to obtain a matrix containing entity feature information and a shared parameter matrix.
[0049] In this embodiment of the invention, a low-rank entity embedding scheme is adopted to reduce parameter redundancy and improve reasoning efficiency using refined type-aware reasoning. Specifically, let d be the dimension of entity embedding in the knowledge graph of the coal mine safety field, let |E| be the size of the entity set, and let d×|E| be the total size of the entity embedding matrix Z. The total size of matrix Z increases linearly with the entity dimension and the size of the entity set. Typically, assigning the same large-dimensional vector to both dense and sparse entities leads to parameter redundancy.
[0050] Therefore, this invention uses low-rank entity embedding to decompose the entity embedding matrix Z into two matrices, represented as:
[0051] Z = Z d *W
[0052] Wherein, matrix Z d∈R |E|×r , which contains entity feature information, and the matrix W ∈ R r×d , which is a shared parameter matrix used to establish connections and share information between entities, and r < d, where r is the rank of the two matrices (the rank of the low-rank entity embedding), and R is the symbol for the set of real numbers.
[0053] The above matrix Z d is entity-dependent, while the matrix W is shared by all entities. The total number of entity parameters of the knowledge graph embedding model based on low-rank entity embedding is |E|×r + r×d. Compared with the corresponding complete entity embedding matrix model, low-rank entity embedding can reduce the parameters close to |E|×(d - r), where the shared parameter W can be ignored for a large entity set. The larger the entity set, the higher the efficiency of the model based on low-rank entity embedding. A schematic diagram of low-rank entity embedding is as Figure 3 shown.
[0054] Step 3: Combine the matrix containing entity feature information for entity classification tasks, calculate the posterior probability distribution between the entity and the given relationship by combining the entity classification results and the shared parameter matrix, and use these posterior probability distributions to effectively infer the risks and events related to coal mine safety.
[0055] In the embodiments of the present invention, a fine-grained entity classification task is defined. Given a knowledge graph containing an entity set E and a relationship set R, for each entity en in E, the distribution p(r|en) that measures the likelihood of relationship types when a specific entity is given, r ∈ R, is the fine-grained entity classification of the entity en. Once the fine-grained entity classification is obtained, candidates can be selected based on the posterior distribution, and the posterior distribution is calculated as follows:
[0056]
[0057] where en ∈ N(e q ) indicates that the entity en is an entity in the neighborhood entity set of the query entity e q , and all entities in the neighborhood entity set of the query entity e q are entities related to coal mine safety; p(en|r) is the probability of the entity en appearing in the case of the relationship r (i.e., the posterior distribution); p(r|en) represents the probability of the relationship r appearing in the case of the entity en; p(r) is the prior probability distribution of the relationship r, and p(en) is the prior probability distribution of the entity en, which can be calculated according to the degrees of the relationship r and the entity en; ∝ is the symbol for being proportional.
[0058] The aforementioned candidates specifically refer to the set of entities that may be associated with or affected by one or more specific relationships (e.g., a particular safety risk or preventative measure). These entities can be any object within the coal mine safety field, such as personnel, equipment, monitoring points, or safety areas, that is considered potentially important or relevant in the analysis.
[0059] In this embodiment of the invention, an entity classification task is performed using a self-supervised entity classification model to obtain the entity's category probability p(r|en). Given an entity in a knowledge graph, one of its one-hop relations is randomly masked, and the entity is recovered by reasoning through the masked knowledge graph. The key idea is that missing relations can be inferred from neighborhood relations and the entity. In this embodiment of the invention, the observed triples in the knowledge graph can only provide partial information for fine-grained entity classification.
[0060] To generalize knowledge graphs without node attributes, this invention focuses only on structural information. To efficiently scale to large-scale knowledge graphs, a lightweight inductive model (i.e., a self-supervised entity classification model) is constructed. The self-supervised entity classification model is built around a graph neural network and consists of two parts: (1) relation subgraph extraction and (2) reasoning on the relation subgraph.
[0061] (1) Relationship subgraph extraction. For the target entity, a relationship subgraph is extracted from the knowledge graph of the coal mine safety field. The relationship subgraph contains all entities and relationships related to the target entity; entities are nodes in the relationship subgraph, and the relationships between entities are edges between nodes.
[0062] In this embodiment of the invention, it is assumed that the local graph neighborhood of a specific entity will contain the evidence needed to infer fine-grained entity classification. Since neighborhood triples with different relation types are more important than triples with the same relation, all relation types are preserved as much as possible when sampling neighbors. To further enrich this subgraph, new or reverse relation types can be added, i.e., reverse triples of new relation types are added to the subgraph, because the edge directions of entity relation pairs can have completely different semantics.
[0063] (2) Reasoning on the relational subgraph. In this embodiment of the invention, an alternating relational message passing framework is used to perform reasoning on the relational subgraph, wherein the representation of nodes and edges is iteratively updated by combining the representation of themselves with the aggregated representations of neighboring edges or neighboring nodes, defining... Let e be the hidden state of edge e in the s-th iteration. The message stored for node v in the s-th iteration; the message stored in the node, and the hidden state of the edges are updated in the following way:
[0064]
[0065]
[0066] Where N(v) is the set of edges associated with node v. Let N(e) be the hidden state of edge e in the (s+1)th iteration, N(e) be the set of nodes associated with edge e, v and u are nodes, [·] is the connection function, and W is the hidden state of edge e in the (s+1)th iteration. s With b s These are the learnable transformation matrix and the bias, respectively, and σ(·) is the non-linear activation function, such as the ReLU function. It is the initial feature of edge e, and it is the one-hot identity vector of the relation type to which e belongs.
[0067] Repeat the process K times, updating all nodes and edges in the same way, and using the representations of all intermittent layers and the last layer, to obtain the final representation of the target node t:
[0068] Those skilled in the art will understand that the intermittent layer and the last layer are part of a graph neural network (GNN) used to iteratively update and pass information. In a GNN, each iteration can be viewed as a layer (which may be called an intermittent layer) in which the representations of nodes and edges are progressively updated and improved.
[0069] In the inference process of a graph neural network, the representation M of the target node t is used in all intermittent layers and the last layer. t Aggregation. M t It is a multidimensional feature representation of the target node t obtained through iteration of each layer of the graph neural network. It is used to input into the classification or prediction model, so as to accurately infer the fine-grained relationship between entities in the knowledge graph. For example, it can determine the specific relationship type between the target entity and other entities or the type of the target entity.
[0070] In this embodiment of the invention, during the training of the self-supervised entity classification model, a portion of the relationships in the knowledge graph of the coal mine safety domain is masked. The masked relationships are then recovered through reasoning using the self-supervised entity classification model. This task is treated as a multi-classification problem, using a softmax function and cross-entropy loss to maximize the probability of masked relationships, similar to other self-supervised models. However, the knowledge graph is incomplete; besides the masked relationships, unobserved relationship types may also be correct labels. As the relationship set increases or the number of missing triples increases, incompleteness presents new challenges to this task. Furthermore, the model aims to output a distribution across all relationship types, rather than specific types. Therefore, this task can be viewed as a multi-label learning task, using the following training loss, which includes a pairwise ranking between observed and unobserved relationship types.
[0071]
[0072] Where s represents the logical value corresponding to each relation type, s j S is the score for entity j and relation j. f Let f be the score for entities and relations, γ be a scaling factor, and m be the margin set for better separation. O represents the set of observable (i.e., existing in the knowledge graph) relation types in the coal mine safety domain, which the model can directly learn from the data. U represents the set of unobservable (i.e., not directly represented in the knowledge graph) relation types in the coal mine safety domain. U includes masked relations as well as relations that were not recorded during the construction of the knowledge graph due to various reasons (such as incomplete data, missing information, etc.). These two sets are complementary and together cover all possible relation types in the knowledge graph.
[0073] In this embodiment of the invention, a self-supervised entity classification model is trained using a loss function. This model can then be used for fine-grained entity classification to infer coal mine safety risks. Specifically, fine-grained entity classification allows for a deeper understanding of the association between each entity and different relation types within the knowledge graph. Based on the classification results and the shared parameter matrix W, the posterior probability distribution between an entity and a given relation can be calculated. This reflects the likelihood of each entity appearing given the existence of the relation. Utilizing these posterior probability distributions, effective inferences can be made regarding coal mine safety-related risks and events, such as identifying potential safety hazards or risk points, thereby achieving more accurate risk assessment and prediction in the field of coal mine safety.
[0074] In this embodiment of the invention, matrix factorization can improve the efficiency and accuracy of coal mine safety risk inference methods. This is achieved by decomposing the entity embedding matrix Z into two smaller matrices Zi. d The decomposed matrix Z achieves model parameter optimization and dimensionality reduction, thereby reducing computational resource consumption and improving processing speed. d Specific to entities, it contains the entity's feature information, while matrix W, as a shared parameter matrix, is used to establish connections and share information between entities. Next, these decomposed matrices play a crucial role in entity classification tasks. First, this invention combines the decomposed matrix Z... d The task of entity classification is performed. In this step, for each entity in the knowledge graph of the coal mine safety domain, fine-grained entity classification is performed using its low-dimensional embedding representation. This classification process relies on the entity embedding matrix Z. dThe low-dimensional features in the data are used to identify the specific category of each entity, such as monitoring equipment, hazardous areas, and safety measures. Subsequently, based on the entity classification results and combined with the shared parameter matrix W, this invention calculates the posterior probability distribution between entities and given relationships. This calculation process leverages the advantages of parameter reduction and information compression in low-rank entity embedding technology, enabling effective inference of potential relationships and interactions between various entities. For example, by analyzing the location and historical data of monitoring equipment, the system can infer potential safety risks in a given area.
[0075] The above-described solution provided by the embodiments of the present invention mainly achieves the following beneficial effects:
[0076] (1) The coal mine safety risk inference method proposed in this invention effectively improves data security and traceability. The immutability and transparency of blockchain make the storage of coal mine safety risk data more secure and reliable, while also improving the trust level of data processing.
[0077] (2) The method proposed in this invention effectively improves the data processing throughput. By using network sharding and optimal transaction sharding allocation algorithms, not only is the efficiency of data access improved, but also the processing of large-scale dynamic data at high efficiency is guaranteed, meeting the needs of the coal mine safety risk inference system for high-speed data processing.
[0078] (3) The method proposed in this invention effectively optimizes the construction of knowledge graphs. By introducing low-rank entity embedding technology, this invention effectively reduces parameter redundancy while maintaining the accuracy of reasoning.
[0079] (4) The method proposed in this invention effectively improves the stability and response speed of the system. Fine-grained type-aware reasoning further enhances the understanding and analysis capabilities of knowledge graphs, making reasoning for complex coal mine data more accurate and efficient. It also enables rapid response to potential safety risks, effectively enhancing the real-time performance of the coal mine safety monitoring system.
[0080] To facilitate the explanation of the process of this invention, a specific example is given below. This example is a detailed illustration of the entire solution, and the various parameter values, entity and relationship information included in the example are all examples.
[0081] I. Using blockchain to store knowledge graphs
[0082] Step a1: First, export the constructed knowledge graph from the database. For example, "KG.csv" is a comma-separated file of knowledge graph triples containing information such as mine temperature and gas concentration. Hash the exported file, for example, using the SHA-256 algorithm. After the hash value of the file is packaged and signed, a transaction is generated and sent to the blockchain network.
[0083] Step a2: In the blockchain network of the coal mine safety system, the network is sharded according to different areas of the mine (such as mining areas, transportation channels, storage areas, etc.). In each shard, a leader node is elected based on the node's performance (such as data processing capabilities and historical performance) and its responsibility in the mine system (such as monitoring the safety of a specific area). These leader nodes are responsible for evaluating transactions from their shards, such as analyzing each transaction's requirements for computing resources, storage space, and communication resources.
[0084] Step a2-1: Define the input as a transaction list TL, which contains data transactions of various mine safety detections, such as transactions formed by temperature, gas concentration, etc., and may contain data transactions from different sensors in the mine (such as temperature sensors, gas detectors).
[0085] Step a2-2: Initialize MFT and MFPT. Set initial parameters on the leader node of each shard to prepare for data processing and resource allocation calculations.
[0086] Steps a2-3: Traverse the transactions in the transaction list. When considering the strategy for the i-th transaction (e.g., this transaction is related to the temperature at the entrance of mine A), it can be transformed into a problem that only relates to the first (i-1) transactions. Use MFT[i][C][S][N] to represent the maximum value that the first i terms can achieve under the cost of three dimensions (computational resources C, e.g., the transaction is expected to take 0.05ms and use 4 cores, storage space S, e.g., the storage space required is expected to be 3MB, and communication cost N, e.g., the network traffic required is expected to be 15MB).
[0087] Step a2-4: Traverse C in reverse order L S L and N L For example, this shard has 128 cores, 32TB of storage, and 10Gbps of network bandwidth.
[0088] Steps a2-5: Execute repeatedly until all transactions in the time chain are processed, and the optimal transaction selection plan is obtained.
[0089] Step a3: All nodes (including leader and follower nodes of each shard) participate in the consensus process, handling related transactions such as temperature, gas concentration, and employee location, and generating blocks. Each block generated by a shard is broadcast to the leader nodes of other shards for verification to ensure data consistency and prevent errors or duplicate records. Verified valid blocks are ultimately added to the blockchain, providing reliable data support for coal mine safety.
[0090] II. Low-rank entity embedding.
[0091] Step b1: Extract knowledge graph data from the blockchain network of the coal mine safety monitoring system. This data may include various entities in the mine (such as sensors, work areas, equipment, etc.) and their related attributes. For example, dimension d may represent the number of different characteristics of each entity (such as location, temperature range, gas type, etc.), while the size |E| of the entity set represents the total number of different entities in the mine.
[0092] Step b2: Decompose the extracted entity embedding matrix Z into two low-rank matrices: Z d And W. Here, Z d It may be specifically tailored to the characteristics of each mine entity, while W is a shared matrix used for all entities. For example, if there are hundreds of sensors and other devices in a mine safety system (i.e., the size of the entity set |E|), and each entity has multiple monitoring parameters (dimension d), then by using low-rank entity embedding, the number of parameters that need to be stored and processed for this data can be significantly reduced.
[0093] III. Fine-grained type-aware reasoning.
[0094] Step c1: In the coal mine safety monitoring system, define a fine-grained classification for each entity (such as sensors, work areas, equipment, etc.). For example, for a temperature sensor entity, its relationship types with different areas of the mine (such as mining areas, ventilation systems, etc.) might be analyzed. Statistical methods are used to calculate the probability distribution of these entities with various relationships.
[0095] Taking temperature sensors in coal mine safety monitoring systems as an example:
[0096] p(e|r): It is a conditional probability that a specific entity e (such as a temperature sensor) will appear given a known relation r (e.g., located in a specific region). It is also a posterior distribution.
[0097] p(e): It is the prior probability of entity e appearing, that is, the probability of the temperature sensor appearing without considering any other relationship.
[0098] p(r|e): This is another conditional probability, representing the probability that relation r will occur given a specific entity e (such as a temperature sensor). For example, this could be the probability that the temperature sensor is located in a mining area or a ventilation system, given that the temperature sensor is known.
[0099] p(r): The prior probability of a relation r occurring, that is, the general probability of a particular relation (such as being located in a particular region) occurring without considering any particular entity.
[0100] ∝p(e)p(r|e): This part indicates that the conditional probability p(e|r) is proportional to the product of p(e) and p(r|e).
[0101] e∈N(e q This indicates that the entity e under consideration is the query entity e. q One of the neighborhood entities of a particular temperature sensor (e.g., a specific temperature sensor). For example, this could be other sensors or devices that are adjacent to the specific temperature sensor.
[0102] After obtaining the fine-grained entity classification, candidate entities can be selected based on the posterior distribution, which is calculated as follows:
[0103]
[0104] Step c2: Assume the knowledge graph contains the following entities and relations: Entities: Temperature sensor A, Miner B, Mining area C. Relations: Temperature sensor A is located in mining area C, Miner B works in mining area C, Temperature sensor A detects high temperature.
[0105] Masking a relation: Select a relation in the knowledge graph to mask. For example, choose to mask the relation "Temperature sensor A detected high temperature". This means temporarily removing this information from the knowledge graph.
[0106] Reasoning and recovery process: Using the remaining information to attempt to recover the obscured relationships. In this example, it is known that temperature sensor A is located in mining area C, and the temperature in this area may rise due to some activity (such as equipment failure or fire). Meanwhile, miner B also works in this area and may need to be concerned about safety issues.
[0107] Relationship Recovery: Based on reasoning and remaining information, it can be inferred that temperature sensor A detected high temperature because it is located in a high-risk or high-temperature area. Therefore, the relationship "temperature sensor A detected high temperature" can be recovered.
[0108] Step c2-1: Relational Subgraph Extraction. Assume the knowledge graph contains the following entities and relations: Entities: Temperature Sensor A, Coal Miner B, Mining Area C, Ventilation System D; Relations: Temperature Sensor A monitors the temperature of Mining Area C, Coal Miner B works in Mining Area C, Mining Area C uses Ventilation System D.
[0109] Selecting "Temperature Sensor A" as the target entity, we extract all entities and relationships directly related to Temperature Sensor A. In this example, this includes: Temperature Sensor A monitors the temperature of mining area C; Mining area C uses ventilation system D (an indirect relationship, connected through mining area C). This constructs a subgraph containing Temperature Sensor A, Mining area C, and Ventilation system D. This subgraph preserves different types of relationships: monitoring relationships (Temperature Sensor A and Mining area C) and usage relationships (Mining area C and Ventilation system D). To further enrich this subgraph, new or inverse relationship types can be added. For example, consider "The impact of Ventilation system D on mining area C," which is an inverse relationship from the ventilation system to the mining area. Analyzing the relationships in the subgraph allows us to infer a fine-grained classification of Temperature Sensor A. For instance, by analyzing the relationships between Temperature Sensor A, Mining area C, and Ventilation system D, we can infer that the role of Temperature Sensor A extends beyond temperature monitoring; it may also involve monitoring ventilation effectiveness and predicting risks.
[0110] Step c2-2: Assume the knowledge graph includes the following entities and relations: Entities: Temperature sensor A, miner B, ventilation system D; Relationships: Temperature sensor A monitors the temperature of the mining area, miner B works in the mining area, and the mining area uses ventilation system D.
[0111] First, initialization is performed. Each node (e.g., temperature sensor A, coal miner B, ventilation system D) and edge (e.g., monitoring relationship, working relationship, usage relationship) is assigned an initial state. This state can be a vector representing entity characteristics or relationship type.
[0112] Then define the message passing mechanism: message storage. For each node (such as temperature sensor A), calculate the sum of the states of all its neighboring edges (edges directly connected to it) in the current iteration. For example, the message of temperature sensor A might be the sum of its relationship states with the mining area and with the ventilation system. Edge state updates. The new state of each edge is a combination of the messages from its two endpoints and the current edge state. This combination is learned through parameters (transformation matrix W). i Bias b i It is calculated using ) and nonlinear activation functions (such as ReLU).
[0113] Step c3: Assume the task is to predict all possible relationship types between miners and other entities in the mine. Entity: Coal miner B; Possible relationship types: operating equipment, located in an area, repairing equipment, collaborating with other miners, etc.
[0114] O (the set of observed relation types): We now know that coal miner B operated certain equipment and was located in a specific area. These are relations observed from the knowledge graph, where |O| is the number of relations in set O.
[0115] U (Set of Unobserved Relation Types): Coal miner B may also be involved in equipment maintenance or collaboration with other miners, but these relationships are not directly observed in the knowledge graph. |U| is the number of relationships in set U.
[0116] R: The total set of all possible relation types. |R| equals the total number of relation types such as operating equipment, located in a region, maintaining equipment, and collaborating with other miners. That is:
[0117] |O|+|U|=|R|
[0118] For the formula:
[0119]
[0120] Here, s is the logistic value (i.e., the score predicted by the model) corresponding to each relation type. For example, s could be a vector where each element represents the strength of the association between coal miner B and a specific relation type (such as operating equipment). γ is a scaling factor used to adjust the confidence level in the model predictions, amplifying or reducing the influence of the logistic value s. For example, setting γ to 1. m: This is a marginal value used to provide better separation when comparing logistic values of different relation types. For example, setting m to 0.5 means that when comparing the logistic values of two relation types, there needs to be a difference of at least 0.5 between them to be considered significantly different.
[0121] Through the above description of the embodiments, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions of the above embodiments can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, mobile hard drive, etc.), including several instructions to cause a computer device (such as a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0122] Example 2
[0123] This invention also provides a coal mine safety risk inference system, which is mainly used to implement the methods provided in the foregoing embodiments, such as... Figure 3 As shown, the system mainly includes:
[0124] A blockchain network for storing knowledge graphs in the field of coal mine safety;
[0125] The entity embedding matrix decomposition unit is used to obtain the knowledge graph of the coal mine safety field from the blockchain network, and decompose the entity embedding matrix in the knowledge graph of the coal mine safety field to obtain a matrix containing entity feature information and a shared parameter matrix.
[0126] The coal mine safety risk inference unit is used to perform entity classification tasks by combining a matrix containing entity feature information. It calculates the posterior probability distribution between the entity and a given relationship by combining the entity classification results with a shared parameter matrix. Using the posterior probability distribution, it makes effective inferences about coal mine safety-related risks and events.
[0127] Since the technical details of each part of the system have been described in detail in the previous embodiment 1, they will not be repeated here.
[0128] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.
[0129] Example 3
[0130] The present invention also provides a processing device, such as Figure 4 As shown, it mainly includes: one or more processors; a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the foregoing embodiments.
[0131] Furthermore, the processing device also includes at least one input device and at least one output device; in the processing device, the processor, memory, input device, and output device are connected via a bus.
[0132] In this embodiment of the invention, the specific types of the memory, input device, and output device are not limited; for example:
[0133] Input devices can be touchscreens, image acquisition devices, physical buttons, or mice, etc.
[0134] The output device can be a display terminal;
[0135] The memory can be random access memory (RAM) or non-volatile memory, such as disk storage.
[0136] Example 4
[0137] The present invention also provides a readable storage medium storing a computer program that, when executed by a processor, implements the method provided in the foregoing embodiments.
[0138] In this embodiment of the invention, the readable storage medium is a computer-readable storage medium and can be disposed in the aforementioned processing device, for example, as a memory in the processing device. Furthermore, the readable storage medium can also be any medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0139] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for assessing coal mine safety risks, characterized in that, include: Utilizing blockchain networks to store knowledge graphs in the field of coal mine safety; A knowledge graph in the field of coal mine safety is obtained from a blockchain network, and the entity embedding matrix in the knowledge graph is decomposed to obtain a matrix containing entity feature information and a shared parameter matrix, including: Let the dimension of the entity embedding in the knowledge graph of coal mine safety be... The size of the entity set is Entity Embedding Matrix The total size is Embedding entities into a matrix Decomposed into two matrices, represented as follows: ; where the matrix It contains entity feature information, matrix It is a shared parameter matrix used to establish connections and share information between entities, and , Let be the rank of the two matrices. Symbols for the set of real numbers; An entity classification task is performed using a matrix containing entity feature information. The posterior probability distribution between entities and given relations is calculated by combining the entity classification results with a shared parameter matrix. This posterior probability distribution is then used to infer risks and events related to coal mine safety. The conditional probability of entities related to coal mine safety under each relation is expressed as follows: ; in, Representing entities To query entities The entity in the neighborhood entity set, the query entity The entities in the neighborhood entity set are all entities related to coal mine safety; In the case of relation r, entity The probability of occurrence; Indicates in entity The probability of relation r occurring under the given condition; Let r be the prior probability distribution of relation r. For entities The prior probability distribution can be determined based on the relation r and the entity. The degree is calculated; The sign indicates a direct proportion.
2. The method for assessing coal mine safety risks according to claim 1, characterized in that, The use of blockchain networks to store knowledge graphs in the field of coal mine safety includes: Obtain the pre-constructed knowledge graph in the field of coal mine safety, encrypt, package, and sign it to generate a transaction, and send it to the blockchain network; In the blockchain network, network sharding is performed. Each shard elects a leader node, and the remaining nodes are follower nodes. The leader node determines the optimal transaction selection plan and sends the optimal transaction to the follower nodes. During the optimal transaction selection process, the resource consumption, submission time, and relevance to the coal mine safety field of each transaction are comprehensively considered, so that the most efficient and relevant knowledge graph information is prioritized for processing and storage. At the same time, a priority selection table is set up to place transactions with waiting times exceeding a set value into the priority selection table for priority selection. The transactions include: knowledge graphs in the field of coal mine safety, safety monitoring records, and risk assessment reports. All nodes in the network shard reach a consensus on the optimal transaction, generate the corresponding block, and broadcast the block to the leader nodes of other network shards for verification. After successful verification, the block is added to the blockchain network.
3. The method for inferring coal mine safety risks according to claim 2, characterized in that, The leader node determines the optimal transaction selection plan by including: Define the input as a list of transactions. Computational resource limitations in network sharding Storage space limitations in fragments Communication resource limitations in fragmentation The output is defined as the maximum benefit obtained from network sharding. and the optimal choice table Each transaction's attribute is a quadruple. , It is the first The computing resources required for each transaction It refers to the storage space occupied. It's communication consumption. It refers to the gains or benefits obtained. Representative before A transaction in computing resources Storage space and communication costs The maximum benefit that can be obtained under the cost of three dimensions; Represents whether to select the first One transaction; initialization and ; Iterate through the transactions in the transaction list, considering the first transaction... When deciding whether to select a transaction, transform it into a strategy that only considers the previous transaction. A set of transaction-related issues, using a set of... , , and Use temporary variables to store The properties of a transaction, among which For the first The computing resources for each thing; For the first Storage space for each item; For the first The communication cost of an individual item; It is the first The benefits gained from this thing; and and Related, using a three-dimensional array Before saving The states of each transaction, j, k, and l, represent the specific values of computing resources, storage space, and communication costs. Reverse traversal , and Compare and choose the first The benefits of choosing the first option versus not choosing the second option, if the first option is chosen... The benefit of choosing the first option outweighs the benefit of not choosing the second option. If the benefit of the first transaction is to choose the second one... One transaction, and in The corresponding markings are in the middle; The process continues in a loop until the entire transaction list has been processed. For all transactions, obtain the optimal transaction selection plan.
4. The method for assessing coal mine safety risks according to claim 1, characterized in that, Also includes: Entity classification tasks are performed using a self-supervised entity classification model. For the target entity, a relational subgraph is extracted from the knowledge graph of the coal mine safety field. The relational subgraph contains all entities and relations related to the target entity. Entities are nodes in the relational subgraph, and the relations between entities are edges between nodes. An alternating relational message passing framework is used for reasoning on relational subgraphs. The representations of nodes and edges are iteratively updated by aggregating and combining their own representations with those of neighboring edges or neighboring nodes. The definition is... For the first In the next iteration, the edge The hidden state, For the first Nodes in the next iteration Stored messages; messages stored in nodes, and the hidden state of edges are updated in the following ways: ; ; in, For nodes The relevant set of edges, For the first In the next iteration, the edge The hidden state, To be with the edge Related node set, All are nodes. It is a join function. and These are the learnable transformation matrix and the bias, respectively. It is a non-linear activation function. It is the edge Initial characteristics; Repeat the process K times, updating all nodes and edges until the final representation of the target node is obtained. Using the final representation Perform entity classification tasks.
5. The method for inferring coal mine safety risks according to claim 4, characterized in that, During the training of the self-supervised entity classification model, a portion of the relationships in the knowledge graph of the coal mine safety field is masked, and the masked relationships are recovered through reasoning by the self-supervised entity classification model. During the training process, the set of observable relation types in the knowledge graph of the coal mine safety field is denoted as... Let the set of unobserved relation types in the knowledge graph of coal mine safety be denoted as ; The training loss is represented as: ; in, This represents the logical value corresponding to each relation type. For entities and relations The score, For entities and relations The score, It is a scaling factor. The set boundary.
6. A coal mine safety risk assessment system, characterized in that, include: A blockchain network for storing knowledge graphs in the field of coal mine safety; The entity embedding matrix decomposition unit is used to obtain a knowledge graph in the coal mine safety field from the blockchain network, and decompose the entity embedding matrix in the knowledge graph to obtain a matrix containing entity feature information and a shared parameter matrix, including: Let the dimension of the entity embedding in the knowledge graph of the coal mine safety field be denoted as... The size of the entity set is Entity Embedding Matrix The total size is Embedding entities into a matrix Decomposed into two matrices, represented as follows: ; where the matrix It contains entity feature information, matrix It is a shared parameter matrix used to establish connections and share information between entities, and , Let be the rank of the two matrices. Symbols for the set of real numbers; The coal mine safety risk inference unit is used to perform entity classification tasks by combining a matrix containing entity feature information. It then calculates the posterior probability distribution between entities and given relations by combining the entity classification results with a shared parameter matrix. Using this posterior probability distribution, it infers risks and events related to coal mine safety. The conditional probability of entities related to coal mine safety under each relation is expressed as follows: ; in, Representing entities To query entities The entity in the neighborhood entity set, the query entity The entities in the neighborhood entity set are all entities related to coal mine safety; In the case of relation r, entity The probability of occurrence; Indicates in entity The probability of relation r occurring under the given condition; Let r be the prior probability distribution of relation r. For entities The prior probability distribution can be determined based on the relation r and the entity. The degree is calculated; The sign indicates a direct proportion.
7. A processing device, characterized in that, include: One or more processors; Memory, used to store one or more programs; Wherein, when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method as described in any one of claims 1 to 5.
8. A readable storage medium storing a computer program, characterized in that, When a computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Rule and path-based traditional Chinese medicine multi-modal knowledge graph reasoning method and device
CN116705338A
A pollution site portrait construction method and system based on knowledge graph reasoning
CN117009553B
Small sample knowledge graph completion method based on reinforcement learning
CN117150041A
Method and device for recommending emergency plan based on knowledge graph, equipment and medium
CN117150042A
Knowledge representation reasoning method based on encoder and decoder architecture
CN113836312A