Knowledge graph construction method for integrating fragmented network security information

Through the W2NER model and network security ontology model, the problem of identifying overlapping entities and discontinuous entities in the field of network security is solved, the automatic construction and update of the knowledge graph is realized, redundancy is reduced, the accuracy and efficiency of the graph are improved, and network security is supported Analysis and defense.

CN118569372APending Publication Date: 2024-08-30UNIV OF ELECTRONICS SCI & TECH OF CHINA +1

Patent Information

Application Number
CN202410759493.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

It is difficult for existing technologies to effectively identify and integrate overlapping entities and discontinuous entities in the field of network security, and there are redundant problems in the construction of knowledge graphs, which affects the accuracy and efficiency of the graph.

Method used

Using the W2NER model combined with the ontology model of the network security domain, through named entity recognition and multi-feature similarity calculation, it automatically extracts entity relationships and updates the knowledge graph, reducing manpower consumption and solving redundant problems.

Benefits of technology

It improves the identification accuracy and timeliness of the network security knowledge graph, reduces redundant information, improves the quality and processing efficiency of the graph, and supports the initiative of network security analysis and defense.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569372A
    Figure CN118569372A
Patent Text Reader

Abstract

The invention belongs to the technical field of crossing of computer science and network security, particularly relates to a knowledge graph construction method for integrating fragmented network security information, and solves the problems that overlapped entities and discontinuous entities are difficult to process and knowledge graph entities are redundant in the prior art. Comprising the following steps: 1) collecting a large amount of open source security data as original data; 2) constructing a network security ontology model; 3) preprocessing the original data to obtain initial data, and manually annotating the data to construct a training set; 4) training a named entity recognition model, using the model and the network security ontology model to perform security entity recognition and relationship extraction on the initialized data, and using the graph database to construct a security knowledge graph; 5) realizing repeated entity screening based on multi-feature similarity to solve the redundancy problem of the knowledge graph; and 6) periodically and repeatedly executing the step 1), the step 3) and the step 5) to update the security knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the interdisciplinary field of computer science and network security, and specifically relates to a knowledge graph construction method for integrating fragmented network security information. Background Art

[0002] In recent years, the network environment has become increasingly complex, and malicious attacks have emerged in an endless stream in various forms. In addition, in the scenario of APT attacks, due to the information gap between the attacker and the defender, the defender is always at a disadvantage in passive defense.

[0003] Open source cyber threat intelligence is actionable cyber threat information released by security practitioners. It is data that describes cyber security threats in detail. As the network environment becomes more complex, cyber threat intelligence plays an increasingly important role in obtaining cyber security information. Proper use of cyber threat intelligence can reduce the information gap between the offense and defense, help security teams identify potential attackers, and more proactively prevent and combat cyber attacks. Unfortunately, most cyber threat intelligence is expressed based on unstructured text. At the same time, cyber threat intelligence comes from various sources, based on different natural languages, with varying quality and complex application environments. How to efficiently extract and integrate fragmented cyber security knowledge is an important challenge in the use of open source cyber threat intelligence.

[0004] Knowledge graph is a key technology component in the next generation of trusted artificial intelligence. With its powerful semantic expression, storage and reasoning capabilities, knowledge graph provides an effective solution for data knowledge organization and intelligent applications in the Internet era.

[0005] By extracting network security knowledge from unstructured texts through named entity recognition technology and using knowledge graphs to express network threat intelligence, a special knowledge graph in the field of cyberspace security can provide important information basis and reasoning intelligence support for attack and defense games in strong confrontation and high dynamic environments, and has broad application value. Existing research on network security special knowledge graphs is still incomplete, especially for the extraction of overlapping and non-continuous entities in security texts. There is still a large gap, and although the existing invention patent with publication number CN117828093A discloses a method for constructing a network security knowledge graph, the entity extraction method involved ignores the processing of overlapping entities and non-continuous entities and does not deal with the redundancy problems that may exist in the constructed knowledge graph. Summary of the invention

[0006] The purpose of the present invention is to provide a knowledge graph construction method for integrating fragmented network security information. By utilizing W2NER, the problem of difficulty in identifying overlapping entities and discontinuous entities in the current network security knowledge graph construction is solved, and the network security field ontology model is combined to realize automatic extraction of entity relationships to reduce manpower consumption and realize the automatic update function of the graph. At the same time, the present invention provides a duplicate entity screening method combining multiple features to solve the redundancy problem existing in the construction and update process of the knowledge graph.

[0007] In order to achieve the above purpose, the present invention adopts the following technical solutions:

[0008] The present invention provides a knowledge graph construction method for integrating fragmented network security information, comprising the following steps:

[0009] Step 1: Collect open source security text data to obtain original data;

[0010] Step 2: Construct a network security domain ontology model;

[0011] Step 3: Preprocess the original data to obtain the initialization data and construct the training set;

[0012] Step 4: Use the training set to train the named entity recognition model, and use the model and the network security domain ontology model to perform security entity recognition and relationship extraction on the initialization data, and then use the graph database to construct the initial security knowledge graph;

[0013] Step 5: Calculate the multi-feature similarity of entities and select entities with high similarity for fusion and duplicate relationship deletion to achieve knowledge graph reduction;

[0014] Step 6: Repeat steps 1, 3, and 5 regularly to extract new entities and relationships to update the knowledge graph.

[0015] In the above technical solution, step 1 includes:

[0016] Step 1.1: Use the Scrapy framework to crawl data from websites, reports, and blogs related to network security;

[0017] Step 1.2: Integrate the captured data to form the original data set.

[0018] In the above technical solution, the network security ontology model in step 2 is structurally represented as a set of classes and a set of relationships between classes.

[0019] In the above technical solution, in step 3, for the unstructured text data collected by the crawler, various special characters and spaces contained therein are removed to obtain initialization data, and then part of the initialization data is taken to construct a training set, and network security entities are annotated according to the class information divided by the ontology model.

[0020] In the above technical solution, the named entity recognition model in step 4 is W2NER. The W2NER model converts the NER task into predicting the word-word relationship category. It can effectively handle three NER tasks: flat entity, overlapping entity and non-continuous entity. It mainly includes the following steps:

[0021] Step 4.1, input the initialization data obtained in step 2 into the WordPiece word segmenter in units of sentences to obtain token_list, and at the same time obtain the word pair position relationship grid_mask2d and the word pair distance relationship dist_inputs;

[0022] Step 4.2, perform dictionary mapping, tag filling and padding alignment on the subword sequence token_list obtained in step 4.1, and finally obtain bert_inputs;

[0023] Step 4.3, input the bert_inputs obtained in step 4.2 into the encoding layer composed of BERT and BiLSTM to obtain word_reps;

[0024] Step 4.4: Input word_reps obtained in step 4.3 into CLN to further obtain the word pair, i.e., word-word embedding vector wordpair_emb, and combine the word pair position relationship grid_mask2d and the word pair distance relationship dist_inputs to obtain the embedding reg_emb and distance embedding dist_emb of the triangular region where the word pair is located, and finally obtain the input conv_inputs of the convolutional layer;

[0025] Step 4.5, send the conv_inputs in step 4.4 to the convolutional layer to obtain conv_outputs;

[0026] Step 4.6, conv_outputs passes through the joint decoding layer CoPredictor to obtain outputs;

[0027] Step 4.7 calculates the loss function and back-propagates to update the model parameters;

[0028] Step 4.8: After the W2NER model training is completed, the initialization data obtained in step 3 is used as input, and steps 4.1-4.6 are re-executed, and the extracted network security entity is obtained by decoding the word pair relationship;

[0029] Step 4.9: Use the inter-class relationships defined in the security ontology model to extract the relationships between network security entities to obtain knowledge graph triples, and import them into the graph database to obtain the initial security knowledge graph.

[0030] In the above technical solution, the knowledge graph reduction method in step 5 includes the following steps:

[0031] Step 5.1, obtain the semantic embedding vector bert_embs of the network entity based on the pre-trained model BERT;

[0032] Step 5.2: Use the knowledge graph embedding method TransE to obtain the structural information vector str_embs of the network entity;

[0033] Step 5.3, classify various entities into different entity clusters according to the labels of network entities;

[0034] Step 5.4, use cosine similarity to calculate the semantic information vector similarity BertSim and structural information vector similarity StrSim between each pair of network entities in the cluster;

[0035] Step 5.5, calculate the text similarity TextSim of each entity pair in each cluster. For Chinese words, first convert them into pinyin and then calculate the edit distance. For English word pairs, directly use the edit distance.

[0036] Step 5.6: Combine the semantic information vector similarity BertSim, the structural information vector similarity StrSim and the text similarity Jaccard to calculate the entity comprehensive similarity Sim and select entity pairs with high similarity;

[0037] Step 5.7, merge the pre-selected network entities in the neo4j graph database and delete duplicate relationships to obtain the final cyberspace security domain knowledge graph;

[0038] In the above technical solution, in step 5.1, the pre-trained model BERT is used to obtain the semantic embedding vector of the network entity, and a multi-layer transformer structure combined with the attention mechanism is used to learn the contextual semantics in the input sentence.

[0039] In the above technical solution, in step 5.2, the knowledge graph embedding model TransE is used to obtain the structural information of the entity nodes. TransE is a distance-based model that models the relationship between nodes in the knowledge graph as a distance transformation from the head entity to the tail entity, and defines the scoring function through the transformed distance difference. When training and learning the embedded representation of entities and relationships, the optimization goal is to make the score of the existing triples in the knowledge graph higher than the score of the triples that have not appeared. The structural information of the network entities in the knowledge graph is obtained through the TransE model.

[0040] In the above technical solution, step 6 includes the step of updating the knowledge graph, including:

[0041] Step 6.1: Regularly use crawler tools to collect the latest cybersecurity threat intelligence information and obtain the latest cybersecurity data;

[0042] Step 6.2, preprocessing the updated raw data, including filtering special characters and other meaningless HTML tag characters in the raw data to obtain structured data;

[0043] Step 6.3: Use the W2NER model to perform named entity recognition on the structured data obtained in step 6.2, and extract relationships in combination with the knowledge graph ontology model to obtain new network security entities and relationships between entities;

[0044] Step 6.4: merge the new network security entities and the relationships between entities obtained in step 6.3 into the previous knowledge graph to obtain an updated knowledge graph;

[0045] Step 6.5: Execute the knowledge graph reduction method to integrate the newly added entities and relationships to reduce redundancy and maintain the consistency of the knowledge graph;

[0046] Step 6.6: Update the knowledge graph in the neo4j graph database to ensure the timeliness and accuracy of the knowledge graph;

[0047] Step 6.7: Repeat step 6 to continuously update and maintain the knowledge graph in the field of network security.

[0048] Because the present invention adopts the above technical means, it has the following beneficial effects:

[0049] Compared with the prior art, the advantages of the present invention are: the present invention combines the security ontology model with automated technology to extract security field data and construct a knowledge graph, which reduces manual labor while ensuring the accuracy of the extraction results.

[0050] The present invention adopts the W2NER model to solve the problem of low recognition rate of network security entities in existing methods, especially for the recognition of overlapping entities and discontinuous entities;

[0051] The present invention provides the update and expansion functions of the security knowledge graph, ensuring the timeliness and high availability of the security knowledge graph;

[0052] The present invention proposes a multi-feature fusion entity similarity measurement method, which solves the problem of screening duplicate entities in the knowledge graph by combining the semantic features, structural features and text features of network entities, alleviates the redundancy problem that occurs during the construction and update of the security knowledge graph, and saves storage costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A flowchart for constructing a network security knowledge graph of the present invention;

[0054] Figure 2 It is the overall structure diagram of the network entity recognition model in the present invention;

[0055] Figure 3 for Figure 2 The structural diagram of the preprocessing layer and the encoding layer in ;

[0056] Figure 4 for Figure 2 The structure diagram of the CLN layer, convolution layer, joint prediction layer and decoding layer in . DETAILED DESCRIPTION

[0057] The following is a detailed description of the embodiments of the present invention. Although the present invention will be described and illustrated in conjunction with some specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, modifications or equivalent substitutions made to the present invention should all be included in the scope of the claims of the present invention.

[0058] In addition, in order to better illustrate the present invention, numerous specific details are given in the following specific embodiments. It will be understood by those skilled in the art that the present invention can also be implemented without these specific details.

[0059] The specific steps of the method of the present invention are as follows:

[0060] Step 1: Use the distributed crawler framework Scrapy to collect various semi-structured and unstructured network security data that appear in the open network, including open network knowledge bases, blogs and articles regularly published by major network security organizations, network security consulting websites, open source network blacklists and other sources.

[0061] Step 2: Construct a network security domain ontology model:

[0062] Step 2.1, the professional field of the ontology was determined to be cybersecurity;

[0063] Step 2.2, evaluate the applicability of existing ontology models such as UCO and intrusion detection domain ontology to determine their reusability;

[0064] Step 2.3: List the key terms in the field of cybersecurity, including assets, attacks, attack methods, attackers, vulnerabilities, malware, etc.

[0065] Step 2.4, define the class set, including network, domain name, IP, port, host, hardware, operating system, software, vulnerability, attack organization, tool, malware, attacker, etc.;

[0066] Step 2.5: Define the relationships between classes, including networks having IP addresses, hosts having operating systems, attackers exploiting vulnerabilities, and software having vulnerabilities.

[0067] Step 2.6: Integrate the class set and the inter-class relationship set to form an ontology model in the field of network security, which is used to construct the upper-level representation of the security knowledge graph.

[0068] Step 3: Preprocess the collected unstructured and semi-structured data. The preprocessing stage includes filtering special characters and other meaningless HTML tag characters in the original data. The filtering method adopts regular matching and other methods to obtain initialization data, and take part of the initialization data to construct a training set, and annotate network security entities according to the class information divided by the ontology model;

[0069] Step 4: Use the training set to train a named entity recognition model, here the W2NER model, and use this model and the network security domain ontology model to perform security entity recognition and relationship extraction on the initialization data, and then use the graph database to construct the initial security knowledge graph;

[0070] Step 4.1. Input the training set data obtained in step 3 into the WordPiece word segmenter in units of sentences for processing. WordPiece is a sub-word level tagging algorithm that is very similar to BPE (BytePairEncoding). During training, BPE first splits the sentence into characters, then counts the continuous strings that appear most frequently in the sentence, merges these characters and performs the next round of iteration. The termination condition of the iteration is that the total sub-word vocabulary reaches the predefined sub-word vocabulary or the highest frequency of the next round is 1. WordPiece merges new sub-words based on the maximum likelihood rather than the next highest frequency. This likelihood value represents the correlation between two sub-words. For example, WordPiece will eventually split {loves, loving, loved} into

[0071] {lov, ed, ing, es}, of which {ed, es, ing} are subwords shared by the entire corpus, which can greatly reduce the number of words in the subword list. The input initial security domain text data will be divided into a series of subword tokens by the WordPiece tokenizer and a token list is obtained. At the same time, the word pair position relationship grid_mask2d and the word pair distance relationship dist_inputs are obtained;

[0072] Step 4.2: Convert the subwords in the subword sequence token_list obtained in step 4.1 into corresponding ids according to the dictionary, add CLS and SEP tags, and align the id sequence with padding to meet the input format of the BERT model, and finally get bert_inputs. At the same time, in order to shield the influence of the characters expanded by padding alignment on the atomic words, an attention_mask is generated during the padding process to mark the expanded content.

[0073] Step 4.3, input the bert_input obtained in step 4.2 into the encoding layer for processing. The encoding layer consists of BERT and Bi-LSTM layers. BERT is a pre-trained language representation model that abandons traditional recurrent neural networks and convolutional neural networks. It adopts a multi-layer transformer structure combined with an attention mechanism to learn the contextual semantics in the input sentence. Bert_input is processed by the BERT layer to obtain the high-level semantic representation of each token, that is, the semantic embedding vector bert_embs. Then bert_embs is formatted and input into the BiLSTM layer to further learn the contextual information and finally obtain word_reps;

[0074] Step 4.4: Input word_reps obtained in step 4.3 into CLN (ConditionalLayerNormalization) to further obtain the word pair, i.e., word-word embedding vector wordpair_emb, and obtain the embedding reg_emb and distance embedding dist_emb of the triangular region where the word pair is located through grid_mask2d and dist_input respectively. Concatenate wordpair_emb, grid_emb and dist_emb in the last dimension to obtain the input conv_inputs of the convolutional layer.

[0075] Step 4.5: Process the conv_inputs in step 4.4 through multi-granularity dilated convolution (granularity = 1, 2, 3), and concatenate the convolution results to obtain conv_outputs;

[0076] Step 4.6, conv_outputs passes through the joint decoding layer CoPredictor to get outputs. This layer consists of a biaffine predictor (Biaffine) and a multi-layer perceptron (MLP). MLP is used to predict word pair relationships and Biaffine is used to assist in improving the performance of classification relationships. outputs represents three types of relationships between words, including NONE, NNW, and THW, which respectively indicate that there is no relationship between two words, that two words are located in adjacent positions of the same entity, and that two words are located in the same entity and are the entity head and entity tail, respectively;

[0077] Step 4.7 calculates the loss function and back-propagates to update the model parameters. The loss function is

[0078]

[0079] Where N represents the number of words in the sentence, Represents the true relationship Label of the bigram pair, y is the predicted probability, R represents the predefined relationship set, |R| represents the number of predefined relationships, and r represents the rth relationship in the predefined relationship set.

[0080] Step 4.8: After the model training is completed, the initialization data obtained in step 3 is used as input, and steps 4.1-4.6 are re-executed, and the extracted network security entity is obtained by decoding the word pair relationship;

[0081] Step 4.9: Use the inter-class relationships defined in the security ontology model to extract the relationships between network security entities to obtain knowledge graph triples, and import them into the Neo4j database to obtain the initial security knowledge graph. Neo4j is a high-performance graph database suitable for processing complex relational data.

[0082] Step 5: Calculate the multi-feature similarity of entities by combining labels, semantic embedding information, structural embedding information and text information, select entities with high similarity, merge the pre-selected entities in the Neo4j database, and delete duplicate relationships to achieve knowledge graph reduction; the security knowledge graph reduction method includes the following steps:

[0083] Step 5.1, obtain the semantic embedding vector bert_embs of the network entity based on the pre-trained model BERT;

[0084] Step 5.2: Use the knowledge graph embedding method TransE to obtain the structural information vector str_embs of the network entity;

[0085] Step 5.3, classify various entities into different entity clusters according to the labels of network entities;

[0086] Step 5.4, use cosine similarity to calculate the semantic information vector similarity BertSim and structural information vector similarity StrSim between each pair of network entities in the cluster. For any two entities e1, e2 and their semantic information vectors E1, E2, structural information vectors S1, S2, the calculation formula of cosine similarity is:

[0087]

[0088] Step 5.5, calculate the text similarity TextSim of each entity pair in each cluster. For Chinese words, convert them into pinyin and then calculate the edit distance. For English word pairs, use the edit distance directly. The edit distance represents the minimum number of operations required to convert one string into another, where operations include insertion, modification, and deletion. For any two entities n1, n2, the calculation formula of TextSim is:

[0089]

[0090] Where ED represents the edit distance between any two English entities or the edit distance obtained after converting Chinese entities into pinyin; Len represents the length of the string.

[0091] Step 5.6: Combine the semantic information vector similarity BertSim, the structural information vector similarity StrSim and the text similarity Jaccard to calculate the entity comprehensive similarity Sim, and filter out entity pairs with high similarity by setting an appropriate threshold. The calculation formula is:

[0092] Sim(n1,n2)=αTextSim(n1,n2)+βBertSim(n1,n2)+γStrSim(n1,n2)

[0093] Among them, α, β, and γ are hyperparameters.

[0094] Step 5.7, merge the pre-selected network entities in the neo4j graph database and delete duplicate relationships to obtain the final cyberspace security domain knowledge graph;

[0095] Step 6: Regularly repeat steps 1, 3, and 5 in order to update the knowledge graph in the network security field.

[0096] Step 6.1: Regularly use crawler tools to collect the latest cybersecurity threat intelligence information and obtain the latest cybersecurity data;

[0097] Step 6.2, preprocessing the updated raw data, including filtering special characters and other meaningless HTML tag characters in the raw data to obtain structured data;

[0098] Step 6.3: Use the W2NER model to perform named entity recognition on the structured data obtained in step 6.2, and extract relationships in combination with the knowledge graph ontology model to obtain new network security entities and relationships between entities;

[0099] Step 6.4: merge the new network security entities and the relationships between entities obtained in step 6.3 into the previous knowledge graph to obtain an updated knowledge graph;

[0100] Step 6.5: Execute the knowledge graph reduction method to integrate the newly added entities and relationships to reduce redundancy and maintain the consistency of the knowledge graph;

[0101] Step 6.6: Update the knowledge graph in the neo4j graph database to ensure the timeliness and accuracy of the knowledge graph;

[0102] Step 6.7: Repeat step 6 to continuously update and maintain the knowledge graph in the field of network security.

[0103] In summary, the technical effects and advantages of the present invention are as follows:

[0104] 1. Integrate fragmented information: By collecting open source security text data, the present invention can integrate a large amount of scattered network security information to form an original data set, thereby solving the problem of information fragmentation.

[0105] 2. Constructing a network security ontology model: The present invention constructs an ontology model in the field of network security, including a set of classes and a set of relationships between classes, which helps to standardize the terms and concepts in the field of network security and improve the comprehensibility and comparability of information.

[0106] 3. Named Entity Recognition and Relation Extraction: Using the W2NER model, the present invention can effectively identify entities in network security texts and extract relationships between entities, including overlapping entities and non-continuous entities, thereby improving the accuracy and comprehensiveness of entity recognition.

[0107] 4. Knowledge graph construction and update: A security knowledge graph is constructed through a graph database, and the knowledge graph is regularly updated to ensure the timeliness and accuracy of the knowledge graph.

[0108] 5. Entity similarity calculation and knowledge graph reduction: The present invention adopts a multi-feature fusion method to calculate entity similarity, including semantic, structural and text features, effectively identify and merge entities with high similarity, reduce redundant information in the knowledge graph, and improve the quality and efficiency of the knowledge graph.

[0109] 6. Automation and reduction of manpower consumption: The entire knowledge graph construction and update process is highly automated, which reduces manual intervention and consumption and improves processing efficiency.

[0110] 7. Improve network security defense capabilities: By constructing and updating the network security knowledge graph, the present invention provides powerful information support for network security analysis and defense, helps to discover potential threats and vulnerabilities, and improves the initiative and effectiveness of network security defense.

[0111] In summary, the present invention has significant technical advantages in integrating fragmented network security information, improving entity recognition accuracy, and constructing high-quality knowledge graphs, and can effectively support analysis and defense work in the field of network security.

Claims

1. A knowledge graph construction method for integrating fragmented network security information, characterized in that: The steps include: Step 1: Collect open source security text data to obtain original data; Step 2: Construct a network security domain ontology model; Step 3: Preprocess the original data to obtain the initialization data and construct the training set; Step 4: Use the training set to train the named entity recognition model, and use the model and the network security domain ontology model to perform security entity recognition and relationship extraction on the initialization data, and then use the graph database to construct the initial security knowledge graph; Step 5: Calculate the multi-feature similarity of entities and select entities with high similarity for fusion and duplicate relationship deletion to achieve knowledge graph reduction; Step 6: Repeat steps 1, 3, and 5 regularly to extract new entities and relationships to update the knowledge graph.

2. A method for constructing a knowledge graph for integrating fragmented network security information according to claim 1, characterized in that: Step 1 includes: Step 1.1: Use the Scrapy framework to crawl data from websites, reports, and blogs related to network security; Step 1.2: Integrate the captured data to form the original data set.

3. A method for constructing a knowledge graph for integrating fragmented network security information according to claim 1, characterized in that: The network security ontology model in step 2 is structurally represented as a set of classes and a set of relationships between classes.

4. A method for constructing a knowledge graph for integrating fragmented network security information according to claim 1, characterized in that: In step 3, for the unstructured text data collected by the crawler, various special characters and spaces contained therein are removed to obtain initialization data. Then, part of the initialization data is taken to construct a training set, and network security entities are annotated according to the class information divided by the ontology model.

5. A method for constructing a knowledge graph for integrating fragmented network security information according to claim 1, characterized in that: The named entity recognition model in step 4 is W2NER. The W2NER model converts the NER task into predicting word-word relationship categories. It can effectively handle three NER tasks: flat entities, overlapping entities, and non-continuous entities. It mainly includes the following steps: Step 4.1, input the initialization data obtained in step 2 into the WordPiece word segmenter in units of sentences to obtain token_list, and at the same time obtain the word pair position relationship grid_mask2d and the word pair distance relationship dist_inputs; Step 4.2, perform dictionary mapping, tag filling and padding alignment on the subword sequence token_list obtained in step 4.1, and finally obtain bert_inputs; Step 4.3, input the bert_inputs obtained in step 4.2 into the encoding layer composed of BERT and BiLSTM to obtain word_reps; Step 4.4: Input word_reps obtained in step 4.3 into CLN to further obtain the word pair, i.e., word-word embedding vector wordpair_emb, and combine the word pair position relationship grid_mask2d and the word pair distance relationship dist_inputs to obtain the embedding reg_emb and distance embedding dist_emb of the triangular region where the word pair is located, and finally obtain the input conv_inputs of the convolutional layer; Step 4.5, send the conv_inputs in step 4.4 to the convolutional layer to obtain conv_outputs; Step 4.6, conv_outputs passes through the joint decoding layer CoPredictor to obtain outputs; Step 4.7 calculates the loss function and back-propagates to update the model parameters; Step 4.8: After the W2NER model training is completed, the initialization data obtained in step 3 is used as input, and steps 4.1-4.6 are re-executed, and the extracted network security entity is obtained by decoding the word pair relationship; Step 4.9: Use the inter-class relationships defined in the security ontology model to extract the relationships between network security entities to obtain knowledge graph triples, and import them into the graph database to obtain the initial security knowledge graph.

6. A method for constructing a knowledge graph for integrating fragmented network security information according to claim 1, characterized in that; The knowledge graph reduction method in step 5 includes the following steps: Step 5.1, obtain the semantic embedding vector bert_embs of the network entity based on the pre-trained model BERT; Step 5.2: Use the knowledge graph embedding method TransE to obtain the structural information vector str_embs of the network entity; Step 5.3, classify various entities into different entity clusters according to the labels of network entities; Step 5.4, use cosine similarity to calculate the semantic information vector similarity BertSim and structural information vector similarity StrSim between each pair of network entities in the cluster; Step 5.5, calculate the text similarity TextSim of each entity pair in each cluster. For Chinese words, first convert them into pinyin and then calculate the edit distance. For English word pairs, directly use the edit distance. Step 5.6: Combine the semantic information vector similarity BertSim, the structural information vector similarity StrSim and the text similarity Jaccard to calculate the entity comprehensive similarity Sim and select entity pairs with high similarity; Step 5.7: Merge the pre-selected network entities in the neo4j graph database and delete duplicate relationships to obtain the final knowledge graph in the cyberspace security field.

7. A method for constructing a knowledge graph for integrating fragmented network security information according to claim 6, characterized in that: In step 5.1, the pre-trained model BERT is used to obtain the semantic embedding vector of the network entity, and a multi-layer transformer structure combined with the attention mechanism is used to learn the contextual semantics in the input sentence.

8. A method for constructing a knowledge graph for integrating fragmented network security information according to claim 6, characterized in that: In step 5.2, the knowledge graph embedding model TransE is used to obtain the structural information of the entity nodes. TransE is a distance-based model that models the relationship between nodes in the knowledge graph as a distance transformation from the head entity to the tail entity, and defines the scoring function through the transformed distance difference. When training and learning the embedded representation of entities and relationships, the optimization goal is to make the score of the existing triples in the knowledge graph higher than the score of the triples that have not appeared. The structural information of the network entities in the knowledge graph is obtained through the TransE model.

9. A method for constructing a knowledge graph for integrating fragmented network security information according to claim 6, characterized in that: Step 6 includes the step of updating the knowledge graph, including: Step 6.1: Regularly use crawler tools to collect the latest cybersecurity threat intelligence information and obtain the latest cybersecurity data; Step 6.2, preprocessing the updated raw data, including filtering special characters and other meaningless HTML tag characters in the raw data to obtain structured data; Step 6.3: Use the W2NER model to perform named entity recognition on the structured data obtained in step 6.2, and extract relationships in combination with the knowledge graph ontology model to obtain new network security entities and relationships between entities; Step 6.4: merge the new network security entities and the relationships between entities obtained in step 6.3 into the previous knowledge graph to obtain an updated knowledge graph; Step 6.5: Execute the knowledge graph reduction method to integrate the newly added entities and relationships to reduce redundancy and maintain the consistency of the knowledge graph; Step 6.6: Update the knowledge graph in the neo4j graph database to ensure the timeliness and accuracy of the knowledge graph; Step 6.7: Repeat step 6 to continuously update and maintain the knowledge graph in the field of network security.

Citation Information

Patent Citations

  • Knowledge generation method and device based on artificial intelligence, equipment and storage medium

    CN114282002A

  • Knowledge graph construction method and related device

    CN114297403A

  • Answer scoring method and system based on knowledge graph

    CN117648915A

  • Network security vulnerability knowledge graph construction method based on HPO-BiLSTM-CRF

    CN117852635A

Cited By

  • GPT4-based network security domain knowledge enhancement method and system

    CN119182585A

  • Cultural knowledge graph construction method based on W2ner model

    CN120196768A

  • A method for constructing cultural knowledge graph based on W2ner model

    CN120196768B

  • APT knowledge graph generation method and device

    CN120688596A

  • Wading infrastructure toughness evaluation method and device based on multi-source data driving

    CN121212858A