Network security semantic knowledge base construction method and system

By setting entity, event and semantic relationship models, combining attention mechanism and hierarchical policy network, semantic extraction and mapping of network security data is solved, and the data consistency and richness of network security semantic knowledge base construction in the existing technology is solved. The problem of insufficient achieves deeper semantic analysis and network security defense support.

CN118917319APending Publication Date: 2024-11-08NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410970084.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively build a network security semantic knowledge base, especially when processing network security data in different data sources, data formats and complex contexts, resulting in insufficient data consistency and richness, and the inability to fully record network security events, affecting the network. Security defense and coordination.

Method used

A network security semantic knowledge base construction method is adopted, including the preparation stage, the semantic extraction stage, the semantic mapping stage and the semantic knowledge base construction stage. By setting entity knowledge model, event knowledge model and semantic relationship model, using attention mechanism-based The two-way long and short-term memory network, hierarchical policy network and pattern rule matching network are used to extract and map entities, events and semantic relationships, forming a unified RDF document and continuously transforming it into a semantic knowledge base.

Benefits of technology

It realizes unified semantic analysis of multiple network security data, improves the richness of the semantic knowledge base and the adaptability and robustness of complex text structures, enhances the accuracy of extraction of entity and event knowledge and the accuracy of semantic relationships. Supports deeper semantic analysis and network security defense.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118917319A_ABST
    Figure CN118917319A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for constructing a network security semantic knowledge base, relates to the field of network security, and is used for analyzing multiple network security data with different modalities, types and formats into a unified semantic form which can be understood by a computer. The method comprises four stages: a preparation stage: setting formats of an entity knowledge model, an event knowledge model and a semantic relationship model; network secure text data for a current period is received. The semantic extraction stage comprises the step of respectively carrying out entity knowledge extraction, event knowledge extraction and semantic relation extraction from network security text data according to a set format. The semantic mapping stage comprises the step of respectively mapping entity knowledge, event knowledge and semantic relationships into RDF documents. The semantic knowledge base construction stage comprises the step that RDF documents obtained in different periods are continued to a semantic knowledge base. According to the method, more accurate and richer association and analysis of texts in different formats among semantic knowledge are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a method and system for constructing a network security semantic knowledge base. Background Art

[0002] Semantics is the knowledge used to understand and reason about semantic relationships in natural language processing, which assists computers in making connections and inferences between knowledge, so as to more accurately understand the true meaning of text. A semantic knowledge base is a structured knowledge base that provides relevant semantic knowledge representation and analysis and describes semantic relationships. The accuracy and richness of a cybersecurity semantic knowledge base directly affects the effectiveness of identifying cybersecurity incidents.

[0003] Building a cybersecurity semantic knowledge base is an indispensable but arduous task in the construction and development of cybersecurity cognitive intelligence. The existing general methods mainly extract the relationship between entities from a single sentence of the text, but due to the particularity of cybersecurity data, the difficulty of building a cybersecurity semantic knowledge base is increased. First, cybersecurity data comes from different networks, different businesses and different subjects, resulting in different data structures and formats, and there are data consistency problems. It is necessary to merge, clean and standardize data from different data sources for effective semantic parsing; secondly, cybersecurity data includes various specific concepts, technical terms and contextual information. A large number of entities are often in multiple sentences in the context, or even in multiple files. How to extract entity knowledge in a more complex context is the main problem; finally, cybersecurity data cannot guarantee that all events and situations can be fully recorded, which may lead to missing or incomplete data. Therefore, the semantic parsing algorithm needs to use appropriate methods to infer possible complete information from fragmented and localized data to better support cybersecurity defense actions, the system application of elements and coordinated linkage.

[0004] The Chinese patent document with publication number CN112199957A introduces a person entity alignment method and system based on joint embedding of attribute and relationship information. It collects person entity data in the network, extracts entity attribute information and relationship information, and respectively forms a relationship vector for describing entity relationship characteristics and an attribute vector for describing entity attribute characteristics; respectively calculates the similarity of the relationship vector and the attribute vector in any two person entities, and fits the similarity of the relationship vector and the attribute vector to obtain the person entity similarity to determine whether the two person entities are the same entity. This method only involves the construction of the person entity model and the comparison of the similarity between person entities, and does not involve network security applications.

[0005] The Chinese patent document with the publication number CN114764506A introduces a method for constructing a network security knowledge base, which obtains a historical security document library, extracts words from the historical security documents in the historical security document library, obtains a set of words to be processed, performs correlation analysis on each word to be processed in the set of words to be processed, obtains the result of the correlation analysis, groups the set of words to be processed according to the analysis result, obtains a semantic association group and a grammatical association group, generates a directed acyclic graph of the set of words to be processed according to the semantic association group and the grammatical association group, and establishes a network security knowledge base according to the directed acyclic graph. This method performs document parsing based on the historical security document library, requires a unified data format, and cannot complete the parsing of texts with different data structures and formats caused by different networks, different businesses, different subjects, etc.; in addition, it performs semantic and grammatical grouping according to synonyms, abbreviations, and grammar, which can only achieve the classification of keywords, and the richness of the knowledge base is poor. Summary of the invention

[0006] The purpose of the present invention is to provide a method and system for constructing a network security semantic knowledge base in response to the above-mentioned problems, aiming to parse network security data of various modalities, types, and formats into a unified semantic form that can be understood by a computer, while improving the richness of the semantic knowledge base.

[0007] The technical solution adopted by the present invention is as follows:

[0008] A method for constructing a network security semantic knowledge base includes a preparation stage, a semantic extraction stage, a semantic mapping stage, and a semantic knowledge base construction stage, wherein:

[0009] The preparation stage includes: setting the formats of entity knowledge model, event knowledge model and semantic relationship model; receiving network security text data of the current period;

[0010] The semantic extraction stage includes: extracting entity knowledge, event knowledge and semantic relationship from network security text data according to the set entity knowledge model, event knowledge model and semantic relationship model formats;

[0011] The semantic mapping stage includes: mapping the entity knowledge, event knowledge and semantic relationship obtained in the semantic extraction stage into RDF documents respectively;

[0012] The semantic knowledge base construction phase includes: persisting the RDF documents obtained at different times into the semantic knowledge base.

[0013] Furthermore, in the semantic extraction stage, a bidirectional long short-term memory network based on an attention mechanism is used to extract entity knowledge.

[0014] Furthermore, in the semantic extraction stage, a hierarchical strategy network is used to extract event knowledge.

[0015] Further, the hierarchical strategy network includes an input layer, an event-level strategy network layer, a parameter-level strategy network layer and an output layer;

[0016] Preprocessing the network security text data through an input layer;

[0017] The preprocessed text is used to identify event trigger words of network security events at the event-level policy network layer, and after identifying the event trigger words, a probability-based random strategy is used to determine the event type and event parameters related to the event trigger words from a predefined option set, wherein the option set includes various event types and related event parameters;

[0018] If the event type is identified from the option set, the parameter-level strategy network layer is used to assign corresponding labels to the event parameters related to the event;

[0019] The identified event types, related event parameters and labels of each event parameter are summarized in the output layer according to the format of the event knowledge model.

[0020] Furthermore, in the semantic extraction stage, semantic relationship extraction is performed based on pattern rule matching network.

[0021] Furthermore, the pattern rule-based matching network includes an input layer, a causal relationship fragment extraction layer, a causal event pair extraction layer and an output layer;

[0022] Preprocessing the network security text data through an input layer and defining a semantic relationship matching pattern;

[0023] Matching the preprocessed text with the semantic relationship matching pattern at the causal relationship segment extraction layer to extract at least one set of associated cause segments and result segments;

[0024] According to the extraction rules set in the causal event pair extraction layer, causal relationship pairs are extracted from all associated cause fragments and result fragments;

[0025] At the output layer, the data output by the input layer, the causal relationship fragment extraction layer and the causal event pair extraction layer are aggregated and verified, and the aggregated data is converted into the format of the semantic relationship model.

[0026] Furthermore, the extraction rules set in the causal event pair extraction layer include:

[0027] Event trigger word rule constraint: traverse each group of cause fragments and result fragments obtained by semantic relationship matching pattern matching. If there is no event trigger word, filter out the current group of cause fragments and result fragments;

[0028] Relationship cue word rule constraint: for multiple groups of cause fragments and result fragments obtained by semantic relationship matching pattern matching for the same sentence, the group with the closest distance between two relationship cue words is selected as the cause fragment and result fragment of the sentence;

[0029] Select the event trigger word that is closest to the relationship prompt word in the cause segment, and use the network security event indicated by the event trigger word as the cause event; select the event trigger word that is closest to the relationship prompt word in the result segment, and use the network security event indicated by the event trigger word as the result event.

[0030] Furthermore, the semantic relationship matching modes include five types: matching mode from effect to cause, matching mode from cause to effect, central mode from cause to effect, front-end mode from cause to effect, and central mode from effect to cause.

[0031] Furthermore, the verification of data by the output layer of the pattern rule matching network includes verification of consistency and integrity.

[0032] The present invention also provides a network security semantic knowledge base construction system, which is configured to execute the above-mentioned network security semantic knowledge base construction method.

[0033] The present invention also provides a readable storage medium, which stores a network security semantic knowledge base constructed by adopting the above-mentioned network security semantic knowledge base construction method.

[0034] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0035] The present invention proposes a fusion semantic extraction framework covering entity knowledge, event knowledge, and semantic relations. This framework integrates entity knowledge, event knowledge, and semantic relationship extraction methods, and improves the comprehensive understanding and processing capabilities of semantic knowledge. By integrating these three semantic extraction technologies into one framework, the content of network security text data can be captured and understood more comprehensively, and deeper semantic analysis can be achieved. The fusion framework uses a unified strategy and hierarchical processing to make the extraction of various types of semantic knowledge more coordinated and consistent in the context, enhancing the adaptability and robustness of the model to complex text structures. The extraction of entities and concepts is achieved based on the attention mechanism. The attention mechanism is widely used in natural language processing tasks, and performs well in entity labeling tasks required for knowledge extraction. The attention mechanism can help the model automatically learn to identify important entity fragments in the text, thereby improving the accuracy of entity knowledge extraction; in event knowledge extraction, the method of hierarchical strategy network is mainly used. Event knowledge extraction is to extract event types, trigger words and other information from text, and the hierarchical strategy network can set different levels and strategies for different extraction subtasks, which is helpful for processing multi-level and multi-step event extraction tasks. It can enable the model to better model complex semantic structures and long-distance dependencies (the semantics of a word is affected by other words at a long distance), and improve the accuracy and robustness of event knowledge extraction; in semantic relationship extraction, it is mainly based on pattern rule matching methods, which directly locates and extracts key entity relationships by accurately matching specific language patterns, especially when processing large amounts of structured text. It has the advantages of high efficiency and accuracy. In addition, adjusting the matching rules can quickly adapt to new semantic relationships, so that this method remains flexible in the definition of complex semantic relationships. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The present invention will now be described by way of example with reference to the accompanying drawings, in which:

[0037] Figure 1 It is a flow chart of the method for constructing a network security semantic knowledge base.

[0038] Figure 2 It is a diagram of the “entity-event-relationship” fusion semantic extraction framework.

[0039] Figure 3 It is a flowchart for extracting causal event pairs based on template rule matching.

[0040] Figure 4 It is a flow chart constructed based on RDF of aggregation mapping. DETAILED DESCRIPTION

[0041] All features disclosed in this specification, or steps in all methods or processes disclosed, except mutually exclusive features and / or steps, can be combined in any manner.

[0042] Any feature disclosed in this specification (including any additional claims and abstract), unless otherwise stated, may be replaced by other equivalent or alternative features having similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.

[0043] Example 1

[0044] The method for constructing a network security semantic knowledge base includes four steps: preliminary preparation, semantic extraction, semantic mapping, and semantic knowledge base construction.

[0045] The specific construction process is as follows Figure 1 shown.

[0046] (1) Preliminary preparation

[0047] The preliminary preparation for building a cybersecurity semantic knowledge base is to input cybersecurity text data such as security and confidentiality product manuals, white papers, standard specifications, technical reports, test reports, attack and defense examples, vulnerability reports, security forums, news reports, academic papers, etc., and set the format of the entity knowledge model, event knowledge model, and semantic relationship model. Subsequently, semantic extraction and semantic mapping are used to build a cybersecurity semantic knowledge base in multiple fields.

[0048] To build an entity knowledge model, we first need to identify the important entities in the network security business field, and then collect specific attributes related to these entities, such as user identity, permission level, file confidentiality level, access rights, etc., and set up relevant entity relationships according to business needs, such as the affiliation of users and organizations, the association between devices and files, etc.

[0049] To build an event knowledge model, we first classify events according to the scope of network security business, then determine the types of events that need to be collected and recorded, collect important information related to these events, such as the time and place of the event, the description of the event, the degree of impact, etc., and establish the relationship between events and related entities according to business needs, such as the entity that triggers the event, the entity affected by the event, and the entity that describes the response and response to the event.

[0050] To build a semantic relationship model, we first identify common semantic relationships in the network security business field, such as temporal relationships, hierarchical relationships, logical relationships, etc., and then further subdivide possible semantic relationship types, such as concurrent relationships, sequential relationships, reverse relationships, etc. in temporal relationships, hierarchical relationships and composition relationships, etc., and causal relationships, conditional relationships, parallel relationships, transitional relationships, etc. in logical relationships.

[0051] (2) Semantic Extraction

[0052] Semantic extraction covers the extraction of cybersecurity entity knowledge, event knowledge, and semantic relationships. Entities, events, and semantic relationships are also indispensable components of each other in the field of cybersecurity. They complement each other and jointly support the construction and application of the semantic knowledge base of cybersecurity knowledge. The three are extracted according to the set entity knowledge model, event knowledge model, and semantic relationship model format.

[0053] Network security entities include attackers, victims, vulnerabilities, malware, security tools, etc. Through entity extraction, network security-related semantic information can be structured and organized to facilitate subsequent semantic association and reasoning analysis.

[0054] Cybersecurity incidents include cyberattack incidents, malicious program incidents, information destruction incidents, information content security incidents, and equipment and facility failure incidents. Through event extraction, a large amount of cybersecurity semantic knowledge can be automatically processed and classified, and different types of events can be identified, which helps to monitor the occurrence and evolution of cybersecurity incidents in real time, discover abnormal situations in a timely manner and take corresponding countermeasures, and improve the emergency response capabilities of cybersecurity incidents. In addition, event extraction can facilitate the mining and analysis of cybersecurity incident data, discover the relationship between events and potential attack patterns, so as to better formulate and implement corresponding security policies and measures, which helps to improve the efficiency and accuracy of cybersecurity incident processing.

[0055] In network security semantic extraction, extracting relationships between entities or events can help discover the correlation and dependency between them. For example, the relationship between attackers and attack methods, the relationship between vulnerabilities and affected systems, etc. These relationship information are important for discovering potential threat behaviors and vulnerability exploitation methods. Through relationship extraction, complex associations between network security entities can be constructed to provide support for security event analysis and security threat warning.

[0056] This embodiment constructs a semantic extraction framework covering entity knowledge extraction, event knowledge extraction, and semantic relationship extraction, and adopts the "entity-event-relationship" fusion semantic extraction method. The fusion semantic extraction framework is shown in the attached figure. Figure 2 shown.

[0057] This embodiment uses a bidirectional long short-term memory network (Bi-LSTM) based on the attention mechanism to extract network security entities and concepts. The attention mechanism allows the machine learning model to focus on the network security entities or concepts most relevant to the current task and detect the most important content in the input data. Bi-LSTM can assist the machine learning model in understanding the contextual information of network security entities and concepts, so as to more accurately identify the context on which entities and concepts depend. The machine learning model for entity knowledge extraction specifically includes an input layer, a Bi-LSTM layer, an attention mechanism layer, and an output layer.

[0058] At the input layer, the network security text data is first preprocessed, including text cleaning, unified text format, tokenization, stem extraction and part-of-speech tagging.

[0059] The preprocessed text sequence is input into the Bi-LSTM layer, which includes a forward LSTM and a reverse LSTM. The forward LSTM traverses from the beginning to the end of the text sequence to build a contextual understanding from front to back; the reverse LSTM traverses from the end to the beginning of the text sequence to build a contextual understanding from back to front. Therefore, for each word in the text sequence, regardless of its position, the model can effectively identify and understand its context. In the cybersecurity entity extraction task, the output of the Bi-LSTM processing is fed into a classifier (such as softmax) to identify whether each word belongs to a specific entity category (such as attacker, attack type, victim asset, etc.). Since each word incorporates contextual information, the model can more accurately determine the part of speech of each word and its association with other cybersecurity entities. The output of the Bi-LSTM layer is a vector sequence that contains the surrounding context information. The vector sequence not only captures the information of the word itself, but also incorporates the information of the words before and after it, thereby providing a comprehensive semantic representation.

[0060] The output of the Bi-LSTM layer is fed into the attention mechanism layer, which mimics a key feature of human attention: that is, when processing a large amount of information, it focuses on some information and ignores other unimportant information. The attention mechanism layer first needs to decide how to allocate attention, that is, calculate weights. A query is a vector that represents the current focus or task-specific goal. For a given query, the attention mechanism assigns a weight to each key by calculating the similarity between the query and each key in the sequence. After obtaining the weight of each key, these weights are normalized by a softmax function to ensure that the sum of all weights is 1. The weight normalization operation converts the weights into probabilistic form. Each value is weighted according to its corresponding weight. This means that each element of the vector sequence input to the Bi-LSTM layer will determine its output according to the importance assigned to it. The higher the weight, the larger the output value corresponding to the corresponding element. Finally, all weighted values ​​are aggregated to form an output vector, which represents the important information in the current task. Each element in the vector sequence is executed according to this operation, resulting in an output vector sequence of the same length as the input vector sequence.

[0061] The main task of the output layer is to classify and label entities and concepts based on the previous processing results. The output layer converts the output vector of the attention mechanism layer into the final classification decision, usually selecting the output vector with the highest value as the label of the entity or concept. In some cases, some post-processing operations are performed after the output layer to optimize the final output of the model. This may include correcting or optimizing the classification results according to some rules, such as using the knowledge base in the field of network security to correct entity recognition, or applying some heuristic methods to improve the machine learning model's recognition of specific entities or concepts. Finally, the output of the model is formatted accordingly. In the task of extracting network security entities and concepts, the output is structured data labeled with entity and concept types and their related information. In practical applications, machine learning models can be optimized, and the performance and effect of the model can also be improved by increasing training data, adjusting model hyperparameters, and using more efficient attention mechanism variants.

[0062] This embodiment uses a hierarchical policy network to extract network security event knowledge. The hierarchical policy network is used to hierarchically detect network security events and their parameters. Its event knowledge extraction process consists of a two-level hierarchical network consisting of an event-level policy network and a parameter-level policy network. The machine learning model for event knowledge extraction specifically includes an input layer, an event-level policy network layer, a parameter-level policy network layer, and an output layer.

[0063] At the input layer, the text data of network security incidents is input and preprocessing is performed. The preprocessed data will be used as the input of the next level to ensure the standardization and consistency of the input data. This step is similar to the preprocessing operation of entity knowledge extraction.

[0064] At the event-level policy network layer, the model conducts a comprehensive analysis of the pre-processed cybersecurity event text data, scanning word by word from the beginning to the end. Once the model identifies the event trigger word of the cybersecurity event, it uses a probability-based random policy option and reward mechanism to determine the event type and detailed information related to the event trigger word. Through this mechanism, the cybersecurity event can be accurately identified and classified. The so-called trigger word is the keyword that can identify the event type in the text description of the cybersecurity event. These words are usually directly related to the event type, such as verbs or nouns, and can clearly describe the occurrence of the event, for example, "attack", "intrusion", "infection", etc. The option set is pre-defined based on the cybersecurity event data collected in the early stage. The option set contains various cybersecurity event types and their related event parameters. As event parameters, they are additional information related to the cybersecurity event, but they are not keywords that directly identify the event type. These words may describe the background, impact, or other details of the event, for example, "computer", "system", "data", etc. Take the text description of a network security event as an example: "APT attack caused data leakage, affecting the business of multiple companies", where the event trigger words are "APT attack", "data leakage", and the event parameters are: "hacker", "company", "business". In addition, event parameters can also include "time", "system", "impact", etc. For example, for the network security event text: "On June 15, 2023, a company's server suffered a large-scale DDoS (distributed denial of service) attack. The attacker used a large amount of false traffic to make the company's server unable to respond to normal user requests, resulting in website service interruption. The attack lasted for about two hours, affecting the company's online business and causing economic losses of approximately US$100,000. After investigation, the source of the attack pointed to a group of hacker organizations that used botnets to attack." Event parameters can include the following: time: June 15, 2023; affected system: company server; attack method: a large amount of false traffic; attack duration: about two hours; impact: website service interruption; economic loss: about US$100,000; attack source: hacker organization using botnets to attack. The option set is used to clearly identify the specific category of the network security event associated with the current event trigger word. Based on the currently identified event trigger words, the most likely type of cybersecurity event to occur is selected from the option set through probability analysis. The reward mechanism strengthens the model's tendency to correctly identify event types by giving the machine learning model instant rewards when it correctly identifies and classifies cybersecurity events.Once the model identifies a specific event type, it gives an immediate reward, which is estimated based on the impact and return that the event may bring in the short term. If the model identifies a new event type in the current step, it will remain in the event-level policy state; if the model identifies a specific event (i.e., a certain event type) in the option set, the model will start a new subtask and enter the parameter-level policy network layer, and then conduct a detailed analysis of the specific parameters involved in the event. The reward mechanism helps the model to continuously optimize its identification and classification strategies. Through this positive feedback, the model can gradually improve its recognition accuracy and classification efficiency of network security events. In this way, the event-level policy network can not only effectively identify and classify network security events, but also enhance the pertinence and effectiveness of security event handling by establishing connections between events and related entities. Once the model detects a specific network security event that matches the option set, it will move from the event-level policy network layer to the parameter-level policy network layer. The goal of the parameter-level policy network layer is to assign appropriate labels to the model parameters extracted from network security events to clarify the role and function of each parameter. The model uses the time step as a benchmark, and provides more detailed event information to make more accurate parameter decisions. The parameter-level processing process includes options and state representations from the event-level policy network layer as auxiliary inputs. "Options" are a series of network security event types and related event parameters predefined in the option set based on the identified event trigger words when the model analyzes the network security event text data at the event-level policy network layer. "State representation" is the cognition or understanding of the current network security event that the model has obtained at the event-level policy network layer, such as the confirmed event type, extracted event features, etc. The state input of the parameter-level processing process also includes descriptive text of historical events, identified initial events, and the specific network security event that the current model is processing, including detailed information about the specific event, such as the attack type, time, affected systems, and possible impacts of the attack. At the parameter-level policy network layer, the above event information helps the model understand the background, severity, and other related factors of the event, and assists the model to correctly classify and label each parameter, so that the overall and detailed event information can be comprehensively considered when extracting and summarizing security event knowledge.

[0065] The output layer summarizes all identified network security event types, related event parameters, and specific labels of these event parameters after analysis and processing at the event-level policy network layer and the parameter-level policy network layer, including but not limited to event information such as attack methods, affected entities, and potential consequences, and presents the above event information in the form of structured data.

[0066] This embodiment uses a pattern rule matching method to extract network security semantic relationships. First, a pattern matching method is used to match prompt words and extract fragments from the semantic relationships of network security events. Then, a rule constraint method is used to extract event pairs from the fragments. Finally, the event pairs are combined with prompt words to extract semantic relationships. This embodiment focuses on the extraction of semantic relationships of causal relationships in network security events. The machine learning model for semantic relationship extraction specifically includes an input layer, a causal relationship fragment extraction layer, a causal event pair extraction layer, and an output layer. The causal relationship extraction process based on template rule matching is shown in the attached figure. Figure 2 shown.

[0067] The main functions of the input layer include two aspects. On the one hand, it performs preprocessing operations on the text data of network security events. This step is similar to the preprocessing operations of entity knowledge extraction and event knowledge extraction. On the other hand, by analyzing the expression characteristics of network security text data, five matching patterns suitable for extracting the causal relationship of network security events are defined. According to the position of the cause and effect clauses, the pattern type is divided into cause-to-effect or effect-to-factor. The causal relationship pattern matching template is shown in Table 1.

[0068] Table 1 Causal pattern matching template

[0069]

[0070] The goal of the causal fragment extraction layer is to identify the boundaries of causal fragments. For a cybersecurity event that contains causal relationships, the model first performs word segmentation and part-of-speech analysis on the sentence, combines the results of the part-of-speech analysis with the event explicit causal relationship matching pattern described in the table to construct a regular expression, and extracts the cause fragment and result fragment in the original text sentence. Figure 3 As shown in the figure, for event sentences containing causal prompt words, such as "On July 23, 2024, in order to steal sensitive data, the attacker implanted malware X into computer Y which stored sensitive data." Through the "from cause to effect front form" in the above table and the connecting word is a preposition ( <prep>) template matching, the cause fragment is "the attacker implanted malware X into computer Y which stores sensitive data", the prompt word is "for", and the result fragment is "steal sensitive data". The cause fragment and result fragment extracted by the causal relationship fragment extraction layer are still unstructured texts, and the cause fragment and result fragment need to be further processed into structured events. Although the boundaries of the cause fragment and the result fragment in the text sentence can be identified by the relationship expression template, there will be the following problems: there may be no network event trigger words in the cause fragment and the result fragment, so that it is impossible to extract a valid causal relationship event pair, so this set of cause fragments and result fragments is invalid; a sentence may be successfully matched by multiple supporting or front-end supporting fusion causal expression templates, but the event pairs therein may not constitute a valid causal relationship.

[0071] Since the event trigger words of network security events have been obtained in the event knowledge extraction stage, in order to solve the problems existing in the results of the causal relationship fragment extraction stage, this embodiment designs extraction rules and rule constraints at the causal event pair extraction layer, thereby realizing the extraction of causal event pairs. The specific process is as follows:

[0072] 1) Event trigger word rule constraints: for multiple groups of cause fragments and result fragments obtained from a sentence through semantic relationship matching pattern matching, each group of cause fragments and result fragments is traversed to search for event trigger words in the text fragments. If there is no event trigger word in the cause fragment or result fragment, the group of cause fragments and result fragments is filtered out.

[0073] 2) Relationship cue word rule constraints: if a sentence involves multiple relationship patterns, and multiple groups of cause fragments and result fragments are obtained through the previous steps, then the group of cause fragments and result fragments matched by the closest distance between the two relationship cue words in the semantic relationship matching pattern is selected.

[0074] 3) Select the event trigger word that is closest to the position of the relationship prompt word in the cause segment, and use the network security event it indicates as the cause event. Similarly, select the event trigger word that is closest to the position of the relationship prompt word in the result segment, and use the network security event it indicates as the result event to complete the generation of the causal event pair. According to the data obtained in the causal relationship segment extraction stage, the cause segment is extracted to obtain the cause event as "malware implantation", and the result segment is extracted to obtain the result event as "data leakage", thereby realizing the extraction of semantic relations.

[0075] The output layer needs to aggregate and verify the information and data collected and processed by the input layer, causal fragment extraction layer, and causal event pair extraction layer to ensure the consistency and integrity of the data. This includes confirming that the data format of each causal event pair meets the requirements to ensure the correctness of the causal logic. In addition, the output layer needs to format the aggregated data, such as converting it into JavaScript Object Notation (JSON) or Extensible Markup Language (XML) format to improve data quality and improve the efficiency of subsequent processing. This formatting process is also applicable to entity knowledge extraction and event knowledge extraction.

[0076] (3) Semantic Mapping

[0077] In this stage, the entity knowledge, event knowledge and semantic relationship obtained in the semantic extraction stage are mapped into RDF documents respectively. This embodiment adopts an RDF construction method based on aggregate mapping. The specific software modules include: data input module, mapping module and data output module. The construction process is shown in the attached figure. Figure 4 As shown, the process of importing XML documents from the data input module and converting them into RDF documents in the data output module through the mapping module is described.

[0078] The data input module is responsible for importing XML documents and presenting them in the form of a Document Object Model (DOM) tree. XML documents are divided into two types: a single XML document and a document containing XML and XML Schema.

[0079] The mapping module can be divided into an RDF Schema vocabulary building module and an RDF sequence building module. The RDF Schema vocabulary building module builds RDF Schema terms based on specific mapping rules and algorithms using the abstract structural model of the aggregation class. For a single XML document, the document itself is directly parsed; for a document containing XML and XML Schema, the XML Schema document referenced by the document is parsed. The design of mapping rules and mapping algorithms includes two levels: the first level is based on the classification and aggregation of XML elements, which is used to build RDF Schema; the second level is based on the first level to achieve direct mapping from XML to RDF. The RDF sequence building module is used to mark equivalent elements and build RDF sequences, marking equivalent elements in XML documents to reduce the redundancy of RDF data generated by the mapping. Based on the acquired aggregation classes, constructed RDF Schema terms and mapping rules, the marked XML documents are processed to generate the corresponding RDF sequences.

[0080] The data output module combines the RDF Schema and RDF sequence into a whole, generates an RDF document, and uses the generated RDF document as the unified data structure of the semantic knowledge base.

[0081] (4) Construction of semantic knowledge base

[0082] In this phase, the RDF documents obtained at different times are continuously stored in the semantic knowledge base. This phase includes three aspects: semantic knowledge integration and optimization, semantic extraction method integration, and continuous expansion and interoperability of the semantic knowledge base.

[0083] The semantic knowledge integration and optimization process involves integrating the data collected from different stages into a unified data structure of RDF documents. Through deduplication operations, data quality and storage performance are optimized. In addition, classification and indexing strategies are implemented to ensure that the required information can be retrieved quickly and accurately, thereby maintaining the integrity and accuracy of the semantic knowledge base.

[0084] The fusion process of semantic extraction methods involves the effective integration of entities and concepts, event knowledge, and semantic relationships extracted in the field of network security. The Bi-LSTM network enhances contextual understanding by focusing on key information of entities and concepts; the hierarchical strategy network uses its event-level and parameter-level structures to accurately identify the relationship between network security events and their parameters; the pattern rule matching method enhances the extraction of semantic relationships such as event cause and effect. Finally, the extracted information will be integrated into a multi-level, highly correlated structure through a series of well-defined fusion algorithms and techniques, such as weight allocation and context fusion, thereby enhancing the semantic depth and practical value of the knowledge base.

[0085] The continuous expansion and interoperability of the semantic knowledge base involves integration with external data sources and services, including connections with other cybersecurity data pools and knowledge bases, as well as the development of application programming interfaces (APIs) and software development kits (SDKs) to enable third-party developers to easily build applications using the semantic knowledge base. In addition, an updated and maintained API is established to continuously import semantic information from new cybersecurity reports and databases, while implementing a feedback mechanism to optimize the service and quality of the knowledge base.

[0086] Example 2

[0087] This embodiment introduces a network security semantic knowledge base construction system, which is configured to execute the network security semantic knowledge base construction method of embodiment 1.

[0088] Example 3

[0089] This embodiment introduces a readable storage medium, which stores a network security semantic knowledge base constructed by using the network security semantic knowledge base construction method of Example 1.

[0090] The present invention is not limited to the above-mentioned specific embodiments, but extends to any new features or any new combination disclosed in this specification, as well as any new method or process steps or any new combination disclosed.< / prep>

Claims

1. A method for constructing a network security semantic knowledge base, characterized in that: It includes the preparation stage, semantic extraction stage, semantic mapping stage and semantic knowledge base construction stage, among which: The preparation stage includes: setting the formats of entity knowledge model, event knowledge model and semantic relationship model; receiving network security text data of the current period; The semantic extraction stage includes: extracting entity knowledge, event knowledge and semantic relationship from network security text data according to the set entity knowledge model, event knowledge model and semantic relationship model formats; The semantic mapping stage includes: mapping the entity knowledge, event knowledge and semantic relationship obtained in the semantic extraction stage into RDF documents respectively; The semantic knowledge base construction phase includes: persisting the RDF documents obtained at different times into the semantic knowledge base.

2. The method for constructing a network security semantic knowledge base according to claim 1, characterized in that: In the semantic extraction stage, a bidirectional long short-term memory network based on an attention mechanism is used to extract entity knowledge.

3. The method for constructing a network security semantic knowledge base according to claim 1, characterized in that: In the semantic extraction stage, a hierarchical strategy network is used to extract event knowledge.

4. The method for constructing a network security semantic knowledge base according to claim 3, characterized in that: The hierarchical strategy network includes an input layer, an event-level strategy network layer, a parameter-level strategy network layer and an output layer; Preprocessing the network security text data through an input layer; The preprocessed text is used to identify event trigger words of network security events at the event-level policy network layer, and after identifying the event trigger words, a probability-based random strategy is used to determine the event type and event parameters related to the event trigger words from a predefined option set, wherein the option set includes various event types and related event parameters; If the event type is identified from the option set, the parameter-level strategy network layer is used to assign corresponding labels to the event parameters related to the event; The identified event types, related event parameters and labels of each event parameter are summarized in the output layer according to the format of the event knowledge model.

5. The method for constructing a network security semantic knowledge base according to claim 1, characterized in that: In the semantic extraction stage, semantic relationship extraction is performed based on a pattern rule matching network.

6. The method for constructing a network security semantic knowledge base according to claim 5, characterized in that: The pattern rule matching network includes an input layer, a causal relationship fragment extraction layer, a causal event pair extraction layer and an output layer; Preprocessing the network security text data through the input layer and defining a semantic relationship matching pattern; matching the preprocessed text with the semantic relationship matching pattern at the causal relationship fragment extraction layer to extract at least one group of associated cause fragments and result fragments; According to the extraction rules set in the causal event pair extraction layer, causal relationship pairs are extracted from all associated cause fragments and result fragments; At the output layer, the data output by the input layer, the causal relationship fragment extraction layer and the causal event pair extraction layer are aggregated and verified, and the aggregated data is converted into the format of the semantic relationship model.

7. The method for constructing a network security semantic knowledge base according to claim 6, characterized in that: The extraction rules set in the causal event pair extraction layer include: Event trigger word rule constraint: traverse each group of cause fragments and result fragments obtained by matching the semantic relationship matching pattern. If there is no event trigger word, filter out the current group of cause fragments and result fragments; Relationship prompt word rule constraint: for multiple groups of cause fragments and result fragments obtained by matching the semantic relationship matching pattern of the same sentence, select the group with the closest distance between two relationship prompt words as the cause fragment and result fragment of the sentence; Select the event trigger word that is closest to the relationship prompt word in the cause segment, and use the network security event indicated by the event trigger word as the cause event; select the event trigger word that is closest to the relationship prompt word in the result segment, and use the network security event indicated by the event trigger word as the result event.

8. The method for constructing a network security semantic knowledge base according to claim 6, characterized in that: The semantic relationship matching modes include five types: matching mode from effect to cause, matching mode from cause to effect, central mode from cause to effect, front-end mode from cause to effect, and central mode from effect to cause.

9. The method for constructing a network security semantic knowledge base according to claim 6, characterized in that: The verification of data by the output layer of the pattern rule matching network includes verification of consistency and integrity.

10. A network security semantic knowledge base construction system, characterized in that: The system is configured to execute the network security semantic knowledge base construction method described in any one of claims 1 to 9.

Citation Information

Cited By

  • Network security situation awareness prediction method based on knowledge graph

    CN119766522A