A knowledge graph-based method, system, equipment, and medium for recommending safety training knowledge for special operations.
By introducing a dual-path attention mechanism and combining it with knowledge graphs for deep interaction, the importance weights of different nodes in the knowledge graph under specific circumstances are dynamically calculated. This solves the problems of delayed early warning and generalized recommendations in traditional methods, and enables precise intervention in special operations safety training.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HULUDAO SUNSHINE SAFETY CONSULTING SERVICE CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-06-30
Smart Images

Figure CN122309852A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of knowledge graphs, and in particular relates to a method, system, device and medium for recommending safety training knowledge for special operations based on knowledge graphs. Background Technology
[0002] With the deepening development of intelligent technologies in the field of special operations safety training, structured knowledge management methods centered on knowledge graphs have become mainstream. This method provides a solid knowledge foundation for systematic training by constructing a semantic network containing entities such as safety regulations, risk factors, and accident cases, along with their complex relationships. Traditional technical approaches typically rely on static global representations of graphs, employing uniform graph embedding algorithms to map discrete knowledge nodes to a low-dimensional vector space, and then using similarity calculations to achieve knowledge recommendation. However, in highly dynamic and interactive training scenarios such as simulated operations, current implementations face significant challenges. Traditional models, due to their static and homogeneous weight allocation mechanisms, cannot sensitively respond to the rapidly changing real-time conditions of the work site and the personalized operating habits of trainees. Specifically, during training simulations, the system struggles to dynamically identify and highlight the key safety nodes most relevant to the current operational risks from the densely interconnected knowledge network. This leads to a mismatch between recommended knowledge and the trainee's actual task context, failing to effectively warn of high-risk behaviors and significantly reducing the precision of training intervention. Summary of the Invention
[0003] Therefore, it is necessary to provide a knowledge graph-based method, system, device, and medium for recommending special operation safety training knowledge, which can introduce a dual-path attention mechanism and combine knowledge graphs for deep interaction, thereby avoiding early warning lag and recommendation generalization.
[0004] Firstly, this application provides a knowledge graph-based method for recommending safety training knowledge for special operations, including:
[0005] Acquire scene data and behavior data, extract scene features from scene data to obtain job type identification information and specific environmental parameters, and extract behavior features from behavior data to obtain behavior representation vectors;
[0006] The initial knowledge subgraph is obtained by matching knowledge subgraph nodes with corresponding job type identification information from the global knowledge graph.
[0007] Based on the initial knowledge subgraph, behavior representation vector, and specific environmental parameters, cross-attention weighting is performed to obtain the comprehensive attention weight;
[0008] Based on the comprehensive attention weight, the nodes of the knowledge subgraph are weighted and sorted to obtain a priority list of knowledge nodes.
[0009] Based on the knowledge node priority list, the safety training knowledge content of the corresponding knowledge subgraph node is matched to obtain the recommended content package; the recommended content package is used to assist in the decision-making of special operation safety training.
[0010] Furthermore, by matching knowledge subgraph nodes corresponding to the job type identification information from the global knowledge graph, an initial knowledge subgraph is obtained, including:
[0011] Based on the knowledge node association mapping table for job type, knowledge nodes corresponding to job type identification information are extracted from the global knowledge graph to obtain a knowledge node list.
[0012] Based on the knowledge node list, the edges between knowledge nodes are extracted from the global knowledge graph, and the neighborhood of the knowledge nodes is expanded by a graph traversal algorithm to obtain the basic knowledge subgraph.
[0013] For each knowledge node in the basic knowledge subgraph, calculate the node importance score, and remove knowledge nodes whose node importance scores are less than the importance threshold to obtain the pruned knowledge subgraph;
[0014] Remove isolated knowledge nodes from the pruned knowledge subgraph to obtain a simplified knowledge subgraph, and initialize the simplified knowledge subgraph with graph representation to obtain the initial knowledge subgraph.
[0015] Preferably, based on the initial knowledge subgraph, behavior representation vector, and specific environmental parameters, cross-attention weighting is performed to obtain a comprehensive attention weight, including:
[0016] Based on the initial knowledge subgraph, a graph neural network is used to aggregate the neighborhood information of nodes to obtain an enhanced knowledge node matrix.
[0017] Based on the augmented knowledge node matrix and the behavior representation vector, the interaction attention weights of behaviors on the augmented knowledge nodes in the augmented knowledge node matrix are calculated to obtain the behavior attention weight vector.
[0018] Based on the enhanced knowledge node matrix and specific environmental parameters, the interaction attention weights of the scene to the enhanced knowledge nodes are calculated to obtain the scene attention weight vector.
[0019] Based on gating fusion, the behavioral attention weight vector and the scene attention weight vector are dynamically weighted and fused to obtain the fused attention weight, and the fused attention weight is normalized to obtain the comprehensive attention weight.
[0020] Furthermore, based on the enhanced knowledge node matrix and the behavior representation vector, the interaction attention weights of behaviors on the enhanced knowledge nodes in the enhanced knowledge node matrix are calculated to obtain the behavior attention weight vector, including:
[0021] Based on linear projection transformation, the behavior representation vector is mapped to the behavior query vector, and each enhanced knowledge node in the enhanced knowledge node matrix is mapped to a key vector to obtain the knowledge node key matrix;
[0022] Map each enhanced knowledge node in the enhanced knowledge node matrix to a value vector to obtain the knowledge node value matrix;
[0023] Based on the behavior query vector, knowledge node key matrix, and knowledge node value matrix, a preliminary attention score is obtained by calculating the dot product. Then, based on the scaling factor, the preliminary attention score is numerically scaled to obtain the attention score vector.
[0024] Normalize the attention score vector to obtain the behavioral attention weight vector.
[0025] Preferably, the formula for calculating the attention score vector is:
[0026]
[0027] in, Let be the attention score vector. For behavior query vectors, Let i be the key vector of the i-th augmented knowledge node. This is the scaling factor;
[0028] The scaling factor is calculated using the following formula:
[0029]
[0030] in, For the transpose of the learnable weight vector, For learnable bias terms, for and The concatenated vector, For dynamic part weighting coefficients, These are the static part weighting coefficients. For a fixed scaling factor, For activation function, The dimension of the query vector and key vector, where i represents the enhanced knowledge node index.
[0031] Furthermore, based on the knowledge node priority list, the security training knowledge content of the corresponding knowledge subgraph nodes is matched to obtain a recommended content package, including:
[0032] Based on the knowledge node priority list, the top N knowledge nodes are extracted to obtain the recommended knowledge node list;
[0033] Based on the recommended knowledge node list, diverse controls are implemented to obtain deduplicated knowledge nodes, and based on the deduplicated knowledge nodes, security training courses are matched from the knowledge base.
[0034] Based on information extraction, key safety points and operations are extracted from the safety training course, and a summary of the safety training course is generated based on natural language generation.
[0035] Enter the key safety points, course summaries, and safety training courses into the corresponding positions in the course template to obtain the recommended content package.
[0036] Secondly, this application also provides a knowledge graph-based special operations safety training knowledge recommendation system, including:
[0037] The feature module is used to acquire scene data and behavior data, extract scene features from the scene data to obtain job type identification information and specific environmental parameters, and extract behavior features from the behavior data to obtain behavior representation vectors.
[0038] The subgraph module is used to match knowledge subgraph nodes with corresponding job type identification information from the global knowledge graph to obtain the initial knowledge subgraph;
[0039] The weighting module is used to perform cross-attention weighting based on the initial knowledge subgraph, behavior representation vector, and specific environmental parameters to obtain the comprehensive attention weight;
[0040] The weighting module is used to perform weighted sorting of knowledge subgraph nodes based on comprehensive attention weights to obtain a priority list of knowledge nodes;
[0041] The training module is used to match the safety training knowledge content of the corresponding knowledge subgraph nodes based on the knowledge node priority list to obtain a recommended content package; the recommended content package is used to assist in making decisions on safety training for special operations.
[0042] Thirdly, this application also provides a computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement any step of the method provided in the first aspect of this application.
[0043] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any step of the method provided in the first aspect of this application.
[0044] The aforementioned knowledge graph-based method, system, equipment, and medium for recommending safety training knowledge for special operations involves acquiring scenario data and behavioral data. Scenario features are extracted from the scenario data to obtain operation type identification information and specific environmental parameters. Behavioral features are extracted from the behavioral data to obtain behavioral representation vectors. Knowledge subgraph nodes corresponding to the operation type identification information are matched from the global knowledge graph to obtain an initial knowledge subgraph. Based on the initial knowledge subgraph, behavioral representation vectors, and specific environmental parameters, cross-attention weighting is performed to obtain a comprehensive attention weight. Based on the comprehensive attention weight, the knowledge subgraph nodes are weighted and sorted to obtain a knowledge node priority list. Based on the knowledge node priority list, safety training knowledge content is matched to the corresponding knowledge subgraph nodes to obtain a recommended content package. The recommended content package is used to assist in making decisions regarding safety training for special operations. It can capture student behavior and work environment details in real time through multimodal perception, and use an interactive graph attention mechanism to dynamically calculate the importance weight of different nodes in the knowledge graph under specific contexts. It introduces a dual-path attention mechanism to evaluate the matching degree between the risks implied by environmental parameters and each knowledge point. Attention is dynamically weighted through a learnable fusion module, and finally a dynamic and contextualized knowledge weight distribution is generated. This allows safety reminders to be accurately anchored to the most vulnerable links in the student's operation flow, thereby effectively solving the problems of delayed warnings and generalized recommendations in traditional methods. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is a schematic diagram of the process of a knowledge graph-based special operations safety training knowledge recommendation method provided in an embodiment of the present invention;
[0047] Figure 2 This is a schematic diagram of the structure of a knowledge graph-based special operations safety training knowledge recommendation system provided in an embodiment of the present invention. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0049] In one embodiment, such as Figure 1As shown, a knowledge graph-based method for recommending safety training knowledge for special operations is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0050] Step 101: Obtain scene data and behavior data; extract scene features from scene data to obtain job type identification information and specific environmental parameters; and extract behavior features from behavior data to obtain behavior representation vectors.
[0051] Scene data refers to raw data collected from the physical environment of the work site, typically from various sensors and cameras. This includes video streams, images, temperature, humidity, gas concentration, noise levels, and geographical location. Scene data reflects the objective conditions of the work location.
[0052] Behavioral data refers to raw data collected from workers that reflects their actions and operations. This includes time-series data such as worker posture, displacement trajectory, tool usage actions, and operational rhythm obtained through wearable devices, motion capture systems, or video analytics. Behavioral data is used to reflect what a person is doing.
[0053] The job type identification information is a classification label derived from high-level semantic understanding of scene data. It is a clear category judgment, including high-altitude welding operations, confined space entry operations, live-line maintenance operations, heavy hoisting operations, etc., and is used to define the major categories of safety procedures currently in progress.
[0054] Specific environmental parameters are a series of key physical quantities obtained after quantifying and analyzing scene data. These include, after identifying it as high-altitude welding work, further detailed values or conditions such as wind speed of 8 m / s, platform height of 15 meters, and the presence of flammable materials nearby. Specific environmental parameters provide a refined and digital description of the work environment.
[0055] A behavior representation vector is a fixed-dimensional mathematical vector obtained after deep feature extraction and encoding of raw behavior data. Behavior representation vectors condense the core patterns and features of the behavior data and can be used for subsequent mathematical calculations and similarity comparisons. For example, a behavior vector representing irregular climbing will be significantly different in mathematical space from a behavior vector representing proper ladder climbing.
[0056] The terminal receives raw scene data, including surveillance video and sensor signals. It analyzes the video / images using a computer vision model to determine basic task type identification information. From the sensor data stream and video analysis results, the terminal extracts and quantifies specific environmental parameters strongly related to safety.
[0057] The terminal receives raw behavioral data and learns and analyzes the time-series data through a behavior recognition model or sequence encoder to capture features such as the pattern, amplitude, and sequence of actions. Finally, it compresses and encodes the data into a behavior representation vector with representational capabilities. The behavior representation vector is a mathematical representation that contains behavioral semantics.
[0058] Step 102: Match the knowledge subgraph nodes corresponding to the job type identification information from the global knowledge graph to obtain the initial knowledge subgraph.
[0059] Specifically, a global knowledge graph is a pre-built, large-scale structured security knowledge base. It is organized in the form of a graph, where nodes represent entities or concepts, edges represent relationships between nodes, and it contains all security knowledge across domains and job types.
[0060] A knowledge subgraph node is a subset of nodes in the global knowledge graph that are associated with a specific topic. In this embodiment, it specifically refers to the core knowledge nodes that are directly related to job type identification information.
[0061] The initial knowledge subgraph is a local graph extracted from the global knowledge graph, centered around knowledge subgraph nodes and containing their associated nodes and relationships. After preliminary cleaning and vectorization, the initial knowledge subgraph forms the basis for subsequent deep computation.
[0062] Based on the job type identification information, the terminal searches and matches within the global knowledge graph to find all knowledge subgraph nodes corresponding to that job type. The terminal then extracts the nodes and their relationships within the global graph, collectively forming a smaller knowledge network focused on the current job type—the initial knowledge subgraph.
[0063] Step 103: Based on the initial knowledge subgraph, behavior representation vector, and specific environmental parameters, perform cross-attention weighting to obtain the comprehensive attention weight.
[0064] Specifically, the terminal allows the behavior representation vector and specific environment parameters to query each knowledge node in the initial knowledge subgraph. Through interactive computation, the attention weights of the behavior and the scene for each node are obtained separately. These two sets of weights are then merged in a certain way to generate a unified comprehensive attention weight. The comprehensive attention weight indicates which nodes in the knowledge subgraph are most critical in the current specific behavior and environment.
[0065] Step 104: Based on the comprehensive attention weight, the knowledge subgraph nodes are weighted and sorted to obtain a priority list of knowledge nodes.
[0066] Weighted sorting refers to arranging the knowledge nodes in the initial knowledge subgraph in descending order based on the magnitude of each value in the comprehensive attention weight vector.
[0067] The knowledge node priority list is an ordered list, where each item is a knowledge node and its corresponding comprehensive attention weight score. The list is arranged from highest to lowest score, with nodes ranked higher considered more critical and requiring more attention in the current task and environment.
[0068] The terminal reads the comprehensive attention weight vector. The indices of the comprehensive attention weight vector correspond one-to-one with the nodes in the initial knowledge subgraph. Based on the weight values, all nodes are sorted in descending order to generate an ordered priority list of knowledge nodes. The list intuitively displays the urgency and importance of security concerns.
[0069] Step 105: Based on the knowledge node priority list, match the safety training knowledge content of the corresponding knowledge subgraph node to obtain the recommended content package; wherein, the recommended content package is used to assist in making decisions on safety training for special operations.
[0070] The safety training content consists of multimedia training materials stored in the backend knowledge base and associated with knowledge graph nodes. These include instructional videos, documents, operating procedure texts, and illustrated accident case studies.
[0071] The recommended content package is a personalized training suggestion package delivered to training managers or operational staff. It is a structured collection of information containing training materials tailored to the current high-risk situation, along with their key takeaways.
[0072] The terminal, based on the knowledge node priority list, sequentially matches the associated security training knowledge content behind each knowledge node in order of priority. The terminal then packages these specific contents together to form a final recommended content package. This recommended content package can be directly provided to training administrators or operators for highly targeted security training or reminders.
[0073] This embodiment provides a knowledge graph-based method for recommending safety training knowledge for special operations. It acquires scenario data and behavioral data, extracts scenario features from the scenario data to obtain operation type identification information and specific environmental parameters, and extracts behavioral features from the behavioral data to obtain behavioral representation vectors. It then matches knowledge subgraph nodes corresponding to the operation type identification information from the global knowledge graph to obtain an initial knowledge subgraph. Based on the initial knowledge subgraph, behavioral representation vectors, and specific environmental parameters, it performs cross-attention weighting to obtain a comprehensive attention weight. Based on the comprehensive attention weight, it weights and sorts the knowledge subgraph nodes to obtain a knowledge node priority list. Finally, based on the knowledge node priority list, it matches the safety training knowledge content of the corresponding knowledge subgraph nodes to obtain a recommended content package. This recommended content package is used to assist in making decisions regarding safety training for special operations. Through the above methods, multimodal perception can capture student behavior and work environment details in real time. An interactive graph attention mechanism is used to dynamically calculate the importance weights of different nodes in the knowledge graph under specific contexts. A dual-path attention mechanism is introduced to evaluate the matching degree between the risks implied by environmental parameters and each knowledge point. Attention is dynamically weighted through a learnable fusion module, ultimately generating a dynamic and contextualized knowledge weight distribution. This allows safety reminders to be accurately anchored to the most vulnerable links in the student's operation flow, thereby effectively solving the problems of delayed warnings and generalized recommendations in traditional methods.
[0074] In one embodiment, an initial knowledge subgraph is obtained by matching knowledge subgraph nodes corresponding to job type identification information from the global knowledge graph, including:
[0075] Step 201: Based on the knowledge node association mapping table for job type, extract the knowledge nodes corresponding to the job type identification information from the global knowledge graph to obtain a knowledge node list.
[0076] The assignment type knowledge node association mapping table is a predefined index table or dictionary structure. It establishes a direct mapping relationship between assignment type identification information and one or more specific core knowledge nodes in the global knowledge graph, and is crucial for quickly locating the starting point of knowledge.
[0077] The knowledge node list is a linear list of node identifiers. The knowledge nodes in the knowledge node list are retrieved directly from the global knowledge graph by querying the task type knowledge node association mapping table, based on task type identification information. The knowledge node list represents the set of knowledge entities most directly and fundamentally related to this task type.
[0078] The terminal queries the knowledge node association mapping table for each job type. This table is similar to a directory, where each key corresponds to one or more values. The values are the identifiers of the core nodes representing that job type in the global knowledge graph. The terminal uses these node identifiers as seeds to perform a precise search within the global knowledge graph, extracting complete information about the knowledge nodes and placing them into an ordered or unordered set, forming a knowledge node list. This knowledge node list forms the basis for subsequent graph structure expansion.
[0079] Step 202: Based on the knowledge node list, extract the edges between knowledge nodes from the global knowledge graph, and expand the neighborhood of knowledge nodes through a graph traversal algorithm to obtain a basic knowledge subgraph.
[0080] Specifically, an edge is a directed or undirected line connecting two knowledge nodes in a global knowledge graph, used to represent the relationship between nodes. Each edge typically has a type attribute, including belonging to, potentially causing, requiring protection, being part of, etc.
[0081] Graph traversal algorithms are used to access all nodes and edges in a graph. In this embodiment, it specifically refers to an algorithm that starts from a set of initial nodes, explores along the edges connecting the initial nodes, and collects information about their surrounding neighboring nodes and relationships. Commonly used graph traversal algorithms include breadth-first search or depth-first search.
[0082] Knowledge node neighborhood expansion refers to the process of expanding the scope of knowledge by using a graph traversal algorithm to explore and absorb the directly or indirectly connected neighboring nodes and their relationships, starting from a node in the knowledge node list.
[0083] The basic knowledge subgraph is a larger local graph containing more nodes and relationships, obtained through the knowledge node neighborhood expansion operation. The basic knowledge subgraph includes an initial list of knowledge nodes and related nodes reachable through relational paths, forming a relatively complete knowledge network fragment with preliminary semantic connections.
[0084] The terminal uses all nodes in the knowledge node list as the starting point for traversal. It selects a graph traversal algorithm and, starting from each seed node, visits its one-hop neighbor nodes along the out-degree and in-degree edges, recording the edges between newly discovered nodes and the seed node. The traversal process can continue to the second hop, the third hop, until a preset stopping condition is met. After traversal, the terminal combines all collected nodes, including the initial seed node, newly discovered neighbor nodes, and all edges connecting nodes, into a new, independent graph data structure. This new graph is the basic knowledge subgraph, containing richer relational information than the initial knowledge node list.
[0085] Step 203: Calculate the node importance score for each knowledge node in the basic knowledge subgraph, and remove knowledge nodes whose node importance scores are less than the importance threshold to obtain the pruned knowledge subgraph.
[0086] Specifically, a node importance score is a quantitative metric calculated for each node in a basic knowledge subgraph, used to measure the relative importance or centrality of that node within the overall subgraph structure. Common methods for calculating node importance scores include degree centrality, proximity centrality, or the PageRank algorithm.
[0087] The importance threshold is a preset numerical critical point used to compare with the node's importance score to determine whether the node should stay or leave.
[0088] Pruned knowledge subgraphs are smaller, more refined graphs obtained by removing all nodes in the basic knowledge subgraph whose importance scores are below the importance threshold. The goal is to filter out weakly related or less important knowledge nodes and retain the core structure.
[0089] For each node in the basic knowledge subgraph, the terminal calculates its importance score using a selected centrality algorithm. For example, the terminal can calculate the number of connections for each node; nodes with more connections are generally considered more important. The terminal compares each node's importance score with a preset importance threshold. The terminal iterates through all nodes, deleting those whose scores are strictly below the importance threshold. When a node is deleted, all edges connected to it are simultaneously removed. After the deletion operation, the remaining nodes and edges constitute a pruned knowledge subgraph, which retains the most important nodes and the primary relationships between them from the original graph.
[0090] Step 204: Remove isolated knowledge nodes from the pruned knowledge subgraph to obtain a simplified knowledge subgraph, and initialize the simplified knowledge subgraph with graph representation to obtain an initial knowledge subgraph.
[0091] Isolated knowledge nodes are those nodes in a pruned knowledge subgraph that have no edges connecting them to other nodes. Isolated knowledge nodes are completely disconnected from other nodes and are isolated points in the graph. Because the importance scoring criteria may include unstructured semantic weights, the removed node is not necessarily the node with the lowest degree. Therefore, a pruned knowledge subgraph may retain some semantically crucial nodes that, after this pruning, have lost all their neighbors, thus becoming isolated knowledge nodes.
[0092] A simplified knowledge subgraph is a local knowledge graph obtained by removing all isolated knowledge nodes from a pruned knowledge subgraph. A simplified knowledge subgraph ensures that all remaining nodes in the graph are interconnected through paths, forming a coherent knowledge network.
[0093] Graph representation initialization is the process of assigning an initial numerical vector representation to each node and each edge in a simplified knowledge subgraph. These vectors form the basis for subsequent computations in the graph neural network. Node vector initialization can be based on node type, attributes, or simple random initialization; edge vector initialization can be based on their relation type.
[0094] The initial knowledge subgraph is a knowledge subgraph that has undergone structural cleanup and graph representation initialization. The initial knowledge subgraph includes a node feature matrix, where each row represents the initialization vector of a node; and an adjacency matrix, which is a matrix representing the connection relationships between nodes.
[0095] The terminal re-examines the pruned knowledge subgraph, identifying all nodes with a degree of 0, i.e., isolated knowledge nodes. The terminal removes these isolated knowledge nodes from the graph. Because isolated knowledge nodes contain no relational information, they contribute nothing to subsequent graph computation based on relational propagation and may even cause interference. After removing isolated nodes, the terminal obtains a compact and well-connected simplified knowledge subgraph. The terminal generates an initial feature vector for each node in the simplified knowledge subgraph; for example, this can be based on the embedding of node labels or a randomly generated fixed-length vector. Simultaneously, the terminal assigns an identifier or vector to each type of edge. The terminal then encapsulates the vectorized initialized graph structure into the initial knowledge subgraph.
[0096] In one embodiment, cross-attention weighting is performed based on the initial knowledge subgraph, behavior representation vector, and specific environmental parameters to obtain a comprehensive attention weight, including:
[0097] Step 301: Based on the initial knowledge subgraph, the node neighborhood information is aggregated through a graph neural network to obtain an enhanced knowledge node matrix.
[0098] Graph neural networks are a class of deep learning models specifically designed for processing graph-structured data. They can propagate and aggregate information through the connections between nodes, thereby learning the feature representation of each node in the graph. This representation not only contains information about the node itself but also includes contextual information about its local graph structure.
[0099] Node neighborhood information aggregation refers to collecting feature information of a given central node from its directly adjacent nodes and then using a learnable aggregation function, including summation, averaging, or neural networks, to fuse the neighbor information with the central node's own information, thereby updating the central node's representation.
[0100] The augmented knowledge node matrix is a new node feature matrix output after aggregating node neighborhood information through one or more layers of a graph neural network. Each row of the augmented knowledge node matrix corresponds to the updated vector representation of a knowledge node in the initial knowledge subgraph. Compared to the input, the augmented knowledge node matrix enhances the semantic information from its neighboring nodes, ensuring that the representation of each node includes the context of its local graph structure.
[0101] The terminal inputs an initial knowledge subgraph into a pre-defined graph neural network. For each knowledge node in the subgraph, the graph neural network performs a neighborhood information aggregation operation. The graph neural network identifies all direct neighbors of that node and inputs the current feature vectors of the neighboring nodes, along with the node's own feature vector, into an aggregation function. This function learns how to selectively or weightedly merge this information to generate a new feature vector that represents the node and its local environment. The aggregation process is performed synchronously on all nodes and can be stacked multiple times, allowing information to spread over a wider range. After the operation, the updated feature vectors of all nodes are reorganized into a new matrix, namely the enhanced knowledge node matrix. At this point, the node's vector not only contains its own attributes but may also incorporate information from its neighboring nodes.
[0102] Step 302: Based on the augmented knowledge node matrix and the behavior representation vector, calculate the interaction attention weights of behaviors on the augmented knowledge nodes in the augmented knowledge node matrix to obtain the behavior attention weight vector.
[0103] Specifically, interactive attention weighting is a mechanism that measures the degree of association between different information sources by calculating the relevance score between the query and the key. In this embodiment, it specifically refers to the relevance measure between the behavior representation vector and each node in the enhanced knowledge node matrix.
[0104] The behavioral attention weight vector is a numerical vector whose length is equal to the number of nodes in the augmented knowledge node matrix. Each element in the vector represents the interaction attention weight score between the behavioral representation vector and the corresponding knowledge node. The higher the score, the more relevant the current behavioral pattern is to the security knowledge represented by that knowledge node.
[0105] The terminal maps the behavior representation vector to a query vector through a learnable linear transformation layer. Each node vector in the enhanced knowledge node matrix is then mapped to its corresponding key and value vectors through two additional learnable linear layers. The key vectors of all nodes form the knowledge node key matrix, and the value vectors form the knowledge node value matrix. The terminal calculates the dot product between the behavior query vector and each key vector in the knowledge node key matrix to obtain a preliminary attention score. To prevent the dot product from being too large and causing gradient instability, a scaling factor is used to adjust the preliminary score. This scaling factor is obtained by weighted summation of the dynamic and static components. The terminal normalizes the scores of all nodes using the Softmax function, ensuring that the sum of all weights is 1, resulting in a behavior attention weight vector. This attention weight vector precisely quantifies the degree of attention the behavior gives to each knowledge node.
[0106] Step 303: Based on the enhanced knowledge node matrix and specific environmental parameters, calculate the interaction attention weights of the scene to the enhanced knowledge nodes to obtain the scene attention weight vector.
[0107] Specifically, the scene attention weight vector is a numerical vector whose length is equal to the number of nodes in the augmented knowledge node matrix. Each element in the vector represents the interaction attention weight score between a specific environmental parameter and the corresponding knowledge node. The higher the score, the more relevant the current environmental state is to the security knowledge represented by that knowledge node.
[0108] The terminal applies a multilayer perceptron to the specific environmental parameter vector to generate a scene query vector, applies a linear transformation to the knowledge node representation matrix of the graph structure enhancement to generate a scene key matrix, calculates the attention score by scaling the dot product of the scene query vector and the scene key matrix, performs nonlinear amplification of the attention score by a risk-sensitive function, and normalizes the amplified attention score by a Softmax function to generate a scene attention weight vector.
[0109] Step 304: Based on gating fusion, the behavior attention weight vector and the scene attention weight vector are dynamically weighted and fused to obtain the fused attention weight, and the fused attention weight is normalized to obtain the comprehensive attention weight.
[0110] Specifically, gated fusion is a dynamic weight fusion mechanism that uses a learnable gated neural network to automatically generate a set of fusion coefficients based on the fusion or individual information of the current behavior representation vector and specific environmental parameters. These coefficients determine the contribution ratio of the behavior attention weight vector and the scene attention weight vector to the result. Gated fusion allows the fusion strategy to adaptively adjust according to specific circumstances.
[0111] The fused attention weight is an intermediate weight vector that has not yet been normalized, obtained by weighted summation of the behavioral attention weight vector and the scene attention weight vector under the gating fusion mechanism.
[0112] The comprehensive attention weight is a weight vector obtained by applying Softmax normalization to the fused attention weight. Each element of the comprehensive attention weight represents the importance score of the corresponding knowledge node in the current overall context after comprehensively considering both behavioral and environmental factors. The comprehensive attention weight will be directly used for node ranking.
[0113] The terminal concatenates or adds the behavior representation vector and the scene attention weight vector to form a comprehensive state vector. This comprehensive state vector is then input into a gated neural network, which outputs a scalar value between 0 and 1 as the fusion coefficient g. The magnitude of g dynamically reflects the degree to which behavior or environmental attention should be emphasized in the current state. The terminal uses the generated gating coefficient to perform a weighted sum of the two attention weight vectors to calculate the fused attention weight. If g is a vector, element-wise weighting is performed. The terminal applies the Softmax function to the fused attention weight vector for normalization, ensuring that the sum of all its elements is 1. The output is the comprehensive attention weight vector. This comprehensive attention weight vector integrates information from both human behavior and the environment, serving as the basis for prioritizing knowledge nodes.
[0114] In one embodiment, based on the enhanced knowledge node matrix and the behavior representation vector, the interaction attention weights of behaviors on the enhanced knowledge nodes in the enhanced knowledge node matrix are calculated to obtain the behavior attention weight vector, including:
[0115] Step 401: Based on linear projection transformation, the behavior representation vector is mapped to the behavior query vector, and each enhanced knowledge node in the enhanced knowledge node matrix is mapped to a key vector to obtain the knowledge node key matrix.
[0116] Linear projection transformation is a fundamental mathematical operation that maps a vector to another vector space by multiplying it by a learnable weight matrix and adding a learnable bias vector. Its purpose is to transform the original features into a representation space that is more suitable for subsequent computation and to allow the model to learn the transformation.
[0117] The behavior query vector is a new vector obtained by linear projection transformation of the behavior representation vector. In the attention mechanism, it plays the role of query, used to ask for or retrieve relevant information in the knowledge base.
[0118] The key vector is a set of new vectors obtained by linearly projecting each node vector in the augmented knowledge node matrix. In the attention mechanism, the key vector acts as a key, performing matching calculations with the query to determine the importance of the information corresponding to each key.
[0119] The knowledge node key matrix is a matrix formed by stacking the key vectors obtained from mapping all the enhanced knowledge nodes row by row. Each row of the matrix corresponds to the key vector of a knowledge node and is one of the key components for subsequent calculation of attention weights.
[0120] The terminal pre-sets three independent learnable weight matrices, including a matrix for generating queries, a matrix for generating keys, and a matrix for generating values. The input behavior representation vector is multiplied by the query weight matrix to obtain the behavior query vector, which maps the behavior features to the query space. The terminal multiplies the input enhanced knowledge node matrix by the key weight matrix to generate a corresponding key vector for each node. The key vectors of all nodes are stacked to form a knowledge node key matrix.
[0121] Step 402: Map each enhanced knowledge node in the enhanced knowledge node matrix to a value vector to obtain the knowledge node value matrix.
[0122] Specifically, the value vectors are a set of new vectors obtained by transforming each node vector in the augmented knowledge node matrix through an independent linear projection transformation. In the attention mechanism, the value vectors act as values, serving as the source of information for the weighted summation. Each value vector is paired with its corresponding key vector, together representing the same knowledge node.
[0123] The knowledge node value matrix is a matrix formed by stacking the value vectors obtained from mapping all enhanced knowledge nodes row by row. Each row of this matrix corresponds to the value vector of a knowledge node, containing the content extracted from that node for use in the final synthesis.
[0124] The terminal multiplies each row of the input enhanced knowledge node matrix with the value weight matrix to generate a corresponding value vector for each node. The terminal then stacks the value vectors of all nodes to form a knowledge node value matrix.
[0125] Step 403: Based on the behavior query vector, knowledge node key matrix, and knowledge node value matrix, the preliminary attention score is obtained by calculating the dot product. Then, based on the scaling factor, the preliminary attention score is numerically scaled to obtain the attention score vector.
[0126] Specifically, the dot product is a fundamental method for calculating the similarity between two vectors; it involves calculating the sum of the element-wise products of the corresponding vectors. In attention mechanisms, the dot product is used to calculate the degree of matching between the query vector and each key vector.
[0127] The preliminary attention score is a set of raw scalar scores obtained by calculating the dot product between the behavior query vector and each key vector in the knowledge node key matrix. The preliminary attention score initially reflects the association strength between the query and each key, but its value may be unstable.
[0128] The scaling factor is a divisor used to scale the initial attention score, designed to stabilize the training process and prevent the dot product from becoming too large, leading to vanishing or exploding gradients. The scaling factor is a dynamically calculated value based on the query and key, combined with a static dimensionality factor.
[0129] Numerical stabilization scaling is an operation that divides the initial attention score by a scaling factor. The purpose is to keep the scaled score within a suitable numerical range, thereby improving the stability of model training.
[0130] The attention score vector is a vector obtained by numerically scaling the initial attention scores to a stable value. Each element in the attention score vector corresponds to the scaled attention score of a knowledge node, which is more stable but has not yet been normalized, and the sum of its elements is not 1.
[0131] The terminal performs matrix multiplication between the behavior query vector and the transpose of the knowledge node key matrix, essentially calculating the dot product of the query vector and each key vector. The result is a vector, and the elements of this vector represent the initial attention scores for the corresponding knowledge nodes. The terminal then divides the initial attention score of each node by its corresponding scaling factor to obtain the scaled score. The vector composed of all the scaled scores is the attention score vector.
[0132] Step 404: Normalize the attention score vector to obtain the behavior attention weight vector.
[0133] In this embodiment, normalization specifically refers to the mathematical processing performed on the attention score vector using the Softmax function. The Softmax function transforms all elements in the input vector into a probability distribution such that the value of each element is between 0 and 1, and the sum of all elements is 1.
[0134] The behavioral attention weight vector is a weight vector obtained by normalizing the attention score vector. Each element in the weight vector represents a probabilistic weight of the relevance between the current behavior and the corresponding knowledge node, and the sum of all weights is 1. The behavioral attention weight vector is used to quantify the allocation of attention to each knowledge node at the behavioral level.
[0135] The terminal inputs the attention score vector into the Softmax function. The Softmax function performs an exponential operation on each element of the vector and then divides it by the sum of the exponents of all elements. The resulting vector is the behavior attention weight vector.
[0136] In one embodiment, the formula for calculating the attention score vector is:
[0137]
[0138] in, Let be the attention score vector. For behavior query vectors, Let i be the key vector of the i-th augmented knowledge node. This is the scaling factor.
[0139] Specifically, each element in the attention score vector is a scalar value representing the original relevance score between the behavior query vector and the key vector of the i-th enhanced knowledge node, and is a basic unit constituting the attention score vector. The larger the value, the stronger the potential correlation between the current behavior pattern and the security concept or rule represented by the i-th knowledge node.
[0140] The behavior query vector is a vector obtained by transforming the original behavior representation vector through a learnable linear projection layer. It is located in the query space and is used to actively initiate queries to the knowledge base.
[0141] The key vector of the i-th augmented knowledge node is a vector obtained by transforming the feature vector of the i-th augmented knowledge node through another learnable linear projection layer. It is located in the key space and is used to respond to the search keywords of the query.
[0142] The scaling factor is a dynamically calculated positive scalar value used as a divisor to adjust the size of the dot product. It is obtained by a weighted sum of the dynamic learning part and the static baseline part. The core function of the scaling factor is to stabilize training and enhance the model's expressive power. Traditional scaled dot product attention uses a fixed value as the scaling factor, while the scaling factor in this embodiment can dynamically adjust the scaling intensity based on the specific query-key pair, allowing the model to more finely adapt to the scale of different feature interactions.
[0143] The scaling factor is calculated using the following formula:
[0144]
[0145] in, For the transpose of the learnable weight vector, For learnable bias terms, for and The concatenated vector, For dynamic part weighting coefficients, These are the static part weighting coefficients. For a fixed scaling factor, For activation function, The dimension of the query vector and key vector, where i represents the enhanced knowledge node index.
[0146] Specifically, a concatenated vector is a longer vector formed by concatenating the behavior query vector and the key vector end to end along the vector dimension.
[0147] The transpose of the learnable weight vector and the learnable bias term are linear transformation parameters used to compute the dynamic scaling part.
[0148] The dynamic part weighting coefficient and the static part weighting coefficient are two learnable scalar coefficients, used for the weighted dynamic calculation part and the static benchmark part, respectively.
[0149] The fixed scaling factor is the square root of the key vector dimension and is a classic scaling term in standard scaled dot product attention. It provides a stable and theoretically sound scaling baseline. When the dimension of the dot product is large, the variance of the dot product result can be very large; dividing by the fixed scaling factor can alleviate this problem and prevent gradient vanishing or exploding. In this embodiment, the fixed scaling factor serves as the static baseline component.
[0150] An activation function is a smooth, one-sided, inhibitory activation function whose output value is always positive.
[0151] An enhanced knowledge node index is used to identify the subscript or sequence number of a specific node in the enhanced knowledge node matrix.
[0152] This embodiment uses a scaling factor dynamically calculated from the query and the key content itself, allowing the model to flexibly adjust the focus sensitivity of attention based on the specific behavior-knowledge interaction pair, thus enhancing the model's expressive power and adaptability. Retaining the static component inherits the advantage of stable values from classic methods, preventing training difficulties caused by unstable initialization or learning of the dynamic component. The weighted fusion of dynamic and static components allows the model to find an optimal balance between stability and flexibility.
[0153] In one embodiment, based on the knowledge node priority list, the security training knowledge content of the corresponding knowledge subgraph node is matched to obtain a recommended content package, including:
[0154] Step 601: Based on the knowledge node priority list, extract the top N knowledge nodes to obtain the recommended knowledge node list.
[0155] Wherein, N is a preset positive integer threshold used to control the number of knowledge nodes recommended in the final selection. N determines how many nodes are selected from the sorted list as candidates.
[0156] The recommended knowledge node list is an ordered list. Its content is a set of the top N knowledge nodes selected from the knowledge node priority list in descending order of priority. The recommended knowledge node list is the primary and direct basis for content recommendation.
[0157] The terminal reads the preset parameter N, starts from the top of the knowledge node priority list, and sequentially extracts the top N knowledge nodes, that is, the N nodes with the highest weight. The N nodes are then output in their original order to form a recommended knowledge node list. The recommended knowledge node list represents the N core safety knowledge points that need the most attention and training under the current work scenario and behavior.
[0158] Step 602: Based on the recommended knowledge node list, perform diversification control to obtain deduplicated knowledge nodes, and based on the deduplicated knowledge nodes, match and obtain security training courses from the knowledge base.
[0159] Specifically, diversity control is a post-processing strategy designed to ensure that the knowledge points represented by the nodes in the recommended knowledge node list have a certain degree of diversity and breadth in terms of topics or semantics, and to avoid the recommended content being too concentrated or repetitive. Common diversity control methods include filtering based on node type, clustering deduplication based on embedding vectors, or topic dispersion based on rules.
[0160] Deduplicated knowledge nodes are the final set of knowledge nodes obtained after applying diverse controls to the recommended knowledge node list. While retaining high-priority nodes, deduplicated knowledge nodes reduce semantically or functionally redundant nodes, resulting in broader knowledge coverage in the recommendations.
[0161] The knowledge base is a database that stores structured security training materials. Each piece of security training knowledge is associated with one or more knowledge nodes in the global knowledge graph.
[0162] Safety training courses are specific training materials retrieved from a knowledge base and associated with deduplicated knowledge nodes. These materials can be in the form of text, videos, illustrated manuals, or interactive modules, and cover operating procedures, risk warnings, and case studies on specific safety topics.
[0163] The terminal analyzes the nodes in the recommended knowledge node list. For example, it calculates the cosine similarity between node vectors. If two nodes are semantically very similar, the one with slightly lower priority may be removed; or it checks the node types to ensure that different types of nodes are covered, resulting in a deduplicated knowledge node set. The terminal uses each node in the deduplicated knowledge node set as a keyword or index key to query the knowledge base. Each security training course stored in the knowledge base is tagged with its associated or related knowledge nodes. The terminal performs a search operation to find all courses tagged or associated with at least one deduplicated knowledge node and uses these courses as a preliminary candidate course set.
[0164] Step 603: Based on information extraction, extract key security points from the security training course, and based on natural language generation, generate a summary of the security training course to obtain a course summary.
[0165] Information extraction is a natural language processing technique that refers to automatically identifying and extracting key information fragments of predefined categories from unstructured text data, i.e., the main text of security training courses.
[0166] Key safety points are phrases or sentences extracted from safety training course texts using information extraction techniques, which are specific steps, mandatory requirements, prohibited behaviors, or core actions related to safe operation.
[0167] Natural language generation is an artificial intelligence technology that refers to the automatic generation of fluent and coherent natural language text based on input data or text.
[0168] A course summary is a concise text description of the main content of a safety training course, generated using natural language processing technology. It includes the course's core objectives, key risks, and fundamental principles, helping users quickly understand the course.
[0169] The terminal inputs the text content of each security training course into a pre-trained information extraction model. This model is trained to identify key operational entities and relationships in the security domain. It automatically scans the entire text, identifies all sentences or phrases describing specific operations, steps, requirements, or prohibitions, and summarizes, removes duplicates, and organizes them into a clear list of key security operations. The terminal then inputs the text content of the same security training course into a natural language generation model. This model analyzes the entire course text, understands its main idea and structure, and generates a concise and coherent summary—the course abstract. The course abstract is typically much shorter than the original text but retains the core information.
[0170] Step 604: Fill in the key safety points, course summary, and safety training course into the corresponding positions in the course template to obtain the recommended content package.
[0171] The course template is a predefined structured document framework or data schema. It specifies the final presentation format of the recommended content package and includes several reserved placeholder fields for filling in different types of content.
[0172] The recommended content package is a structured information package that can be directly used to assist in safety training decisions. It is a complete deliverable assembled from key safety operation points, course summaries, and safety training courses according to the format requirements of a course template.
[0173] The terminal loads a pre-set course template, preparing key security points, course summaries, and the course itself for each course. The terminal iterates through each course to be recommended. For each course, the terminal fills the template with the list of key security points; the course summary text; and the course title, link, or main content. The terminal then organizes all the filled-in course information according to the template's overall structure to generate the final recommended content package. This package can be a JSON object, a webpage view, or a structured report, delivered to the training system or decision-makers for precise targeting or to assist in developing training plans.
[0174] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0175] Based on the same inventive concept, this application also provides a knowledge graph-based special operations safety training knowledge recommendation system for implementing the aforementioned knowledge graph-based special operations safety training knowledge recommendation method. The solution provided by this system is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more knowledge graph-based special operations safety training knowledge recommendation system embodiments provided below can be found in the limitations of the knowledge graph-based special operations safety training knowledge recommendation method described above, and will not be repeated here.
[0176] In one exemplary embodiment, such as Figure 2 As shown, a special operations safety training knowledge recommendation system 700 based on knowledge graph is provided, including:
[0177] The feature module 701 is used to acquire scene data and behavior data, extract scene features from the scene data to obtain job type identification information and specific environmental parameters, and extract behavior features from the behavior data to obtain behavior representation vectors.
[0178] Subgraph module 702 is used to match knowledge subgraph nodes with corresponding job type identification information from the global knowledge graph to obtain an initial knowledge subgraph;
[0179] The weighting module 703 is used to perform cross-attention weighting based on the initial knowledge subgraph, behavior representation vector and specific environmental parameters to obtain the comprehensive attention weight;
[0180] The weight module 704 is used to perform weighted sorting of knowledge subgraph nodes based on comprehensive attention weights to obtain a priority list of knowledge nodes;
[0181] Training module 705 is used to match the safety training knowledge content of the corresponding knowledge subgraph node based on the knowledge node priority list to obtain a recommended content package; the recommended content package is used to assist in making decisions on safety training for special operations.
[0182] Furthermore, subgraph module 702 is also used for:
[0183] Based on the knowledge node association mapping table for job type, knowledge nodes corresponding to job type identification information are extracted from the global knowledge graph to obtain a knowledge node list.
[0184] Based on the knowledge node list, the edges between knowledge nodes are extracted from the global knowledge graph, and the neighborhood of the knowledge nodes is expanded by a graph traversal algorithm to obtain the basic knowledge subgraph.
[0185] For each knowledge node in the basic knowledge subgraph, calculate the node importance score, and remove knowledge nodes whose node importance scores are less than the importance threshold to obtain the pruned knowledge subgraph;
[0186] Remove isolated knowledge nodes from the pruned knowledge subgraph to obtain a simplified knowledge subgraph, and initialize the simplified knowledge subgraph with graph representation to obtain the initial knowledge subgraph.
[0187] Preferably, the weighting module 703 is also used for:
[0188] Based on the initial knowledge subgraph, a graph neural network is used to aggregate the neighborhood information of nodes to obtain an enhanced knowledge node matrix.
[0189] Based on the augmented knowledge node matrix and the behavior representation vector, the interaction attention weights of behaviors on the augmented knowledge nodes in the augmented knowledge node matrix are calculated to obtain the behavior attention weight vector.
[0190] Based on the enhanced knowledge node matrix and specific environmental parameters, the interaction attention weights of the scene to the enhanced knowledge nodes are calculated to obtain the scene attention weight vector.
[0191] Based on gating fusion, the behavioral attention weight vector and the behavioral attention weight vector are dynamically weighted and fused to obtain the fused attention weight, and the fused attention weight is normalized to obtain the comprehensive attention weight.
[0192] Furthermore, the weighting module 703 is also used for:
[0193] Based on linear projection transformation, the behavior representation vector is mapped to the behavior query vector, and each enhanced knowledge node in the enhanced knowledge node matrix is mapped to a key vector to obtain the knowledge node key matrix;
[0194] Map each enhanced knowledge node in the enhanced knowledge node matrix to a value vector to obtain the knowledge node value matrix;
[0195] Based on the behavior query vector, knowledge node key matrix, and knowledge node value matrix, a preliminary attention score is obtained by calculating the dot product. Then, based on the scaling factor, the preliminary attention score is numerically scaled to obtain the attention score vector.
[0196] Normalize the attention score vector to obtain the behavioral attention weight vector.
[0197] Preferably, the formula for calculating the attention score vector is:
[0198]
[0199] in, Let be the attention score vector. For behavior query vectors, Let i be the key vector of the i-th augmented knowledge node. This is the scaling factor;
[0200] The scaling factor is calculated using the following formula:
[0201]
[0202] in, For the transpose of the learnable weight vector, For learnable bias terms, for and The concatenated vector, For dynamic part weighting coefficients, These are the static part weighting coefficients. For a fixed scaling factor, For activation function, The dimension of the query vector and key vector, where i represents the enhanced knowledge node index.
[0203] Furthermore, training module 705 is used for:
[0204] Based on the knowledge node priority list, the top N knowledge nodes are extracted to obtain the recommended knowledge node list;
[0205] Based on the recommended knowledge node list, diverse controls are implemented to obtain deduplicated knowledge nodes, and based on the deduplicated knowledge nodes, security training courses are matched from the knowledge base.
[0206] Based on information extraction, key safety points and operations are extracted from the safety training course, and a summary of the safety training course is generated based on natural language generation.
[0207] Enter the key safety points, course summaries, and safety training courses into the corresponding positions in the course template to obtain the recommended content package.
[0208] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the knowledge graph-based special operations safety training knowledge recommendation method as described above.
[0209] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0210] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0211] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.
Claims
1. A method for recommending safety training knowledge for special operations based on knowledge graphs, characterized in that, The method includes: Acquire scene data and behavior data, extract scene features from the scene data to obtain job type identification information and specific environmental parameters, and extract behavior features from the behavior data to obtain behavior representation vectors; The initial knowledge subgraph is obtained by matching knowledge subgraph nodes corresponding to the job type identification information from the global knowledge graph. Based on the initial knowledge subgraph, the behavior representation vector, and the specific environment parameters, cross-attention weighting is performed to obtain the comprehensive attention weight; Based on the comprehensive attention weight, the knowledge subgraph nodes are weighted and sorted to obtain a knowledge node priority list; Based on the knowledge node priority list, the safety training knowledge content corresponding to the knowledge subgraph node is matched to obtain a recommended content package; wherein, the recommended content package is used to assist in making decisions on safety training for special operations.
2. The method according to claim 1, characterized in that, The step of matching knowledge subgraph nodes corresponding to the job type identification information from the global knowledge graph to obtain the initial knowledge subgraph includes: Based on the knowledge node association mapping table for job type, knowledge nodes corresponding to the job type identification information are extracted from the global knowledge graph to obtain a knowledge node list. Based on the knowledge node list, the edges between the knowledge nodes are extracted from the global knowledge graph, and the neighborhood of the knowledge nodes is expanded by a graph traversal algorithm to obtain a basic knowledge subgraph. For each knowledge node in the basic knowledge subgraph, a node importance score is calculated, and knowledge nodes with node importance scores less than an importance threshold are removed to obtain a pruned knowledge subgraph. Remove isolated knowledge nodes from the pruned knowledge subgraph to obtain a simplified knowledge subgraph, and initialize the simplified knowledge subgraph with graph representation to obtain the initial knowledge subgraph.
3. The method according to claim 1, characterized in that, The step of performing cross-attention weighting based on the initial knowledge subgraph, the behavior representation vector, and the specific environment parameters to obtain a comprehensive attention weight includes: Based on the initial knowledge subgraph, a graph neural network is used to aggregate the neighborhood information of nodes to obtain an enhanced knowledge node matrix. Based on the enhanced knowledge node matrix and the behavior representation vector, the interaction attention weights of the behavior to the enhanced knowledge nodes in the enhanced knowledge node matrix are calculated to obtain the behavior attention weight vector. Based on the enhanced knowledge node matrix and the specific environmental parameters, the interaction attention weights of the scene to the enhanced knowledge nodes are calculated to obtain the scene attention weight vector. Based on gating fusion, the behavior attention weight vector and the scene attention weight vector are dynamically weighted and fused to obtain the fused attention weight, and the fused attention weight is normalized to obtain the comprehensive attention weight.
4. The method according to claim 3, characterized in that, The step of calculating the interaction attention weights of behaviors on the enhanced knowledge nodes in the enhanced knowledge node matrix based on the enhanced knowledge node matrix and the behavior representation vector, to obtain the behavior attention weight vector, includes: Based on linear projection transformation, the behavior representation vector is mapped to a behavior query vector, and each of the enhanced knowledge nodes in the enhanced knowledge node matrix is mapped to a key vector to obtain a knowledge node key matrix; Each of the enhanced knowledge nodes in the enhanced knowledge node matrix is mapped to a value vector to obtain the knowledge node value matrix; Based on the behavior query vector, the knowledge node key matrix, and the knowledge node value matrix, a preliminary attention score is obtained by calculating the dot product. Then, based on the scaling factor, the preliminary attention score is numerically scaled to obtain an attention score vector. The attention score vector is normalized to obtain the behavior attention weight vector.
5. The method according to claim 4, characterized in that, The formula for calculating the attention score vector is: in, Let the attention score vector be... For behavior query vectors, Let i be the key vector of the i-th augmented knowledge node. This is the scaling factor; The scaling factor is calculated using the following formula: in, For the transpose of the learnable weight vector, For learnable bias terms, for and The concatenated vector, For dynamic part weighting coefficients, These are the static part weighting coefficients. For a fixed scaling factor, For activation function, The dimension of the query vector and key vector, where i represents the enhanced knowledge node index.
6. The method according to claim 1, characterized in that, The process of matching security training knowledge content corresponding to the knowledge subgraph nodes based on the knowledge node priority list yields a recommended content package, including: Based on the knowledge node priority list, the top N knowledge nodes are extracted to obtain a recommended knowledge node list; Based on the recommended knowledge node list, diversified control is performed to obtain deduplicated knowledge nodes, and based on the deduplicated knowledge nodes, security training courses are matched from the knowledge base. Based on information extraction, key security points are extracted from the security training course, and based on natural language generation, a summary of the security training course is generated to obtain a course summary. The key safety points, course summary, and safety training course are entered into the corresponding positions in the course template to obtain the recommended content package.
7. A knowledge graph-based special operations safety training knowledge recommendation system, characterized in that, The system includes: The feature module is used to acquire scene data and behavior data, extract scene features from the scene data to obtain job type identification information and specific environmental parameters, and extract behavior features from the behavior data to obtain behavior representation vectors. The subgraph module is used to match knowledge subgraph nodes corresponding to the job type identification information from the global knowledge graph to obtain an initial knowledge subgraph; The weighting module is used to perform cross-attention weighting based on the initial knowledge subgraph, the behavior representation vector, and the specific environment parameters to obtain a comprehensive attention weight; The weighting module is used to perform weighted sorting of the knowledge subgraph nodes based on the comprehensive attention weights to obtain a priority list of knowledge nodes; The training module is used to match the safety training knowledge content corresponding to the knowledge subgraph node based on the knowledge node priority list to obtain a recommended content package; wherein, the recommended content package is used to assist in making decisions on safety training for special operations.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.