A method, device, medium and electronic device for analyzing language model of threats

By combining large language models and knowledge graphs, appropriate information extraction methods are used for different types of threat intelligence to build a threat knowledge graph, which solves the problems of slow response and poor reliability of threat intelligence analysis in the existing technology, and achieves efficient identification and prevention APT attack capabilities.

CN117786088BActive Publication Date: 2024-08-30GUANGZHOU UNIVERSITY +2

Patent Information

Application Number
CN202410051928.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-15
Publication Date
2024-08-30
Estimated Expiration
2044-01-15

AI Technical Summary

Technical Problem

When faced with complex and ever-changing network threats, the existing technology has slow response and poor reliability in threat intelligence analysis, making it difficult to effectively identify and prevent APT attacks. Especially when dealing with large amounts of data and complex network environments, the response time and processing capabilities of the model are compromised. become a limiting factor.

Method used

By combining large-scale language models and knowledge graphs, threat intelligence is obtained, its type is determined, and appropriate information extraction methods are selected for analysis based on the type, using prompts, large model-enhanced extraction, search engines, large model-enhanced extraction, or long text-oriented Methods are used to extract information, build threat knowledge graphs, and improve information processing efficiency and interpretability.

Benefits of technology

It achieves efficient extraction and integration of information from a large amount of unstructured network threat intelligence, enhances the ability to identify and analyze APT attacks, improves real-time monitoring and response capabilities, reduces the risk of network attacks, and enhances the model by integrating knowledge graphs interpretability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117786088B
    Figure CN117786088B
Patent Text Reader

Abstract

The present invention provides a threat language model analysis method, including: obtaining threat intelligence, determining the type of threat intelligence; selecting an information extraction method for language model analysis of threat intelligence according to the type of threat intelligence; applying the selected information extraction method to extract information from threat intelligence; obtaining information extraction results to obtain a threat knowledge graph corresponding to threat intelligence. Application of this method can efficiently extract and integrate information from a large amount of unstructured network threat intelligence, improve the efficiency of information processing, enhance the ability to identify and analyze APT attacks; can quickly identify abnormal behaviors in the network, and respond in a timely manner, effectively reducing the risk of network attacks; by integrating knowledge graphs, the interpretability of large language models is increased, and the comprehensibility and reliability of model output results are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network security and event extraction, and in particular to a language model analysis method, device, medium and electronic equipment for threats. Background Art

[0002] With the rapid development of the Internet and information technology, the attack patterns of advanced persistent threats (APTs) are becoming more and more complex and difficult to prevent. This type of attack usually involves multiple attack stages, including initial infection, lateral movement, and data theft, and often uses highly customized attack methods. Therefore, traditional security protection methods, such as firewalls and intrusion detection systems, have been unable to meet the needs of modern network security. In today's highly confrontational cyberspace, based on the actual needs of resisting network threats, exploring the combined application of artificial intelligence technology, threat intelligence, and knowledge graphs is of great significance for the research and application of building large-scale APT threat knowledge graphs in a more efficient and intelligent way.

[0003] The rise of artificial intelligence has become the core driving force to support intelligent network attack and defense. As an important branch of artificial intelligence, knowledge graphs have to some extent solved the problem of structured correlation of threat intelligence.

[0004] Before the LLMs era, named entity recognition (NER) and relation extraction technologies mainly relied on rule-based methods, machine learning algorithms, and some deep learning models. Entering the era of large language models (LLMs), large models such as GPT-4 and ChatGLM have proven to have excellent performance in multiple tasks and scenarios. Different from traditional models, LLMs can automatically extract meaningful features and patterns from large amounts of network data, thereby helping security analysts to more effectively identify and prevent potential threats. With the real-time analysis capabilities of LLMs, security teams can quickly identify abnormal behaviors in the network and respond in a timely manner, greatly reducing the risks posed by network attacks.

[0005] Although large language models are highly praised for their excellent performance in various natural language processing tasks, they have also attracted attention for generating false information and lacking interpretability. To overcome these problems, researchers have proposed using knowledge graphs to enhance large language models. Two main methods have been proposed: one is to incorporate knowledge graphs into the model during the pre-training stage of LLMs, so that LLMs can absorb knowledge from the knowledge graph; the other is to integrate knowledge graphs into LLMs during the reasoning stage to retrieve domain-specific knowledge from the knowledge graph, significantly improving the performance of the model.

[0006] However, although large language model-augmented knowledge graphs (LLM-augmented KGs) are an effective solution in theory, there are still many problems in practice: it is a challenge to effectively integrate the structured information of knowledge graphs with the unstructured data of large language models, which requires precise algorithms and model design to ensure the effective combination of the two while maintaining the performance and reliability of the model, which is extremely difficult to implement. Although LLMs such as GPT-4 have demonstrated excellent performance in multiple tasks and scenarios, their application in specific fields still faces the challenge of generalization ability, and the models need to be further trained and adjusted for specific fields. In addition, in terms of real-time monitoring and response of APT protection, although LLMs provide new possibilities, how to ensure the accuracy and timeliness of real-time analysis remains a challenge. When dealing with large amounts of data and complex network environments, the response time and processing power of the model will become limiting factors.

[0007] Therefore, it is necessary to provide a threat analysis method that can respond promptly, accurately and reliably in the face of the current complex and ever-changing network attack and defense scenarios. Summary of the invention

[0008] The purpose of the present invention is to provide a threat language model analysis method, device, medium and electronic device to improve the problem of slow response and poor reliability of threat intelligence analysis.

[0009] In a first aspect, the threat language model analysis method provided by the present invention includes: obtaining threat intelligence and determining the type of the threat intelligence; selecting an information extraction method for performing language model analysis on the threat intelligence according to the type of the threat intelligence; applying the selected information extraction method to extract information from the threat intelligence; and obtaining the information extraction result to obtain a threat knowledge graph corresponding to the threat intelligence.

[0010] The beneficial effect of the threat language model analysis method provided by the present invention is that by combining a large language model and a knowledge graph, it is possible to efficiently extract and integrate information from a large amount of unstructured network threat intelligence, which not only improves the efficiency of information processing, but also enhances the ability to identify and analyze APT attacks. Furthermore, by utilizing the real-time analysis capability of a large language model, it is possible to quickly identify abnormal behaviors in the network and respond in a timely manner, thereby achieving enhanced real-time monitoring and response, and effectively reducing the risk of network attacks. By integrating the knowledge graph, the interpretability of the large language model is increased, allowing security analysts to better understand and trust the output of the model.

[0011] In a possible embodiment, an information extraction method for performing language model analysis on the threat intelligence is selected according to the type of the threat intelligence, including: when the type of the threat intelligence is short text threat intelligence, using a large model enhancement extraction method based on prompts to extract information for language model analysis on the threat intelligence; when the type of the threat intelligence is comprehensive M threat intelligence, using a large model enhancement extraction method based on a search engine to extract information for language model analysis on the threat intelligence, where M>1; when the type of the threat intelligence is long text threat intelligence, using a large model enhancement method for long text threat intelligence to extract information for language model analysis on the threat intelligence.

[0012] In another possible embodiment, when the type of the threat intelligence is short text threat intelligence, the selected information extraction method is applied to extract information from the threat intelligence, including: determining an information extraction target; designing prompts according to the extraction target; and guiding a large language model to identify and extract information according to the prompts to obtain an information extraction result.

[0013] In other possible embodiments, when the type of the threat intelligence is M comprehensive threat intelligence, the selected information extraction method is applied to extract information from the threat intelligence, where M>1, including: constructing a question according to the information extraction target; extracting keywords in the question using a keyword extraction algorithm; performing a search engine search based on the keywords to obtain feedback text; constructing an enhanced query text based on the feedback text and the question; and performing a large language model query based on the enhanced query text to obtain an information extraction result.

[0014] When the type of threat intelligence is long text threat intelligence, the selected information extraction method is applied to extract information from the threat intelligence, including: segmenting the long text threat intelligence to obtain N text segments, where N>1; storing the N text segments after vectorization processing; retrieving the text segments most relevant to the information extraction target content from the N text segments to obtain relevant text segments; constructing a question and answer environment based on the relevant text segments; and using a large language model to perform question and answer processing corresponding to the question and answer environment to obtain an information extraction result.

[0015] In a second aspect, the present invention further provides a threat language model analysis device, comprising:

[0016] A determination unit, used to obtain threat intelligence and determine the type of the threat intelligence;

[0017] A selection unit, configured to select an information extraction method for performing language model analysis on the threat intelligence according to the type of the threat intelligence;

[0018] An extraction unit, configured to extract information from the threat intelligence using a selected information extraction method;

[0019] The acquisition unit is used to obtain the information extraction result to obtain a threat knowledge graph corresponding to the threat intelligence.

[0020] Among them, the selection unit selects an information extraction method for performing language model analysis on the threat intelligence according to the type of the threat intelligence, including: when the type of the threat intelligence is short text threat intelligence, using a large model enhancement extraction method based on prompts to extract information for language model analysis on the threat intelligence; when the type of the threat intelligence is comprehensive M threat intelligence, using a large model enhancement extraction method based on a search engine to extract information for language model analysis on the threat intelligence, wherein M>1; when the type of the threat intelligence is long text threat intelligence, using a large model enhancement method for long text threat intelligence to extract information for language model analysis on the threat intelligence.

[0021] When the type of the threat intelligence is short text threat intelligence, the extraction unit applies the selected information extraction method to extract information from the threat intelligence, including: determining an information extraction target; designing prompts according to the extraction target; and guiding a large language model to identify and extract information according to the prompts to obtain an information extraction result.

[0022] When the type of the threat intelligence is M comprehensive threat intelligence, the extraction unit applies the selected information extraction method to extract information from the threat intelligence, where M>1, including: constructing a question according to the information extraction target; extracting keywords in the question using a keyword extraction algorithm; performing a search engine search based on the keywords to obtain a feedback text; constructing an enhanced query text based on the feedback text and the question; and performing a large language model query based on the enhanced query text to obtain an information extraction result.

[0023] When the type of the threat intelligence is long text threat intelligence, the extraction unit applies the selected information extraction method to extract information from the threat intelligence, including: segmenting the long text threat intelligence to obtain N text segments, where N>1; storing the N text segments after vectorization processing; retrieving the text segments most relevant to the information extraction target content from the N text segments to obtain relevant text segments; constructing a question and answer environment based on the relevant text segments; and using a large language model to perform question and answer processing corresponding to the question and answer environment to obtain information extraction results.

[0024] In a third aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the language model analysis method for the above-mentioned threat is implemented.

[0025] In a fourth aspect, the present invention also provides an electronic device, comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory, so that the electronic device performs the above-mentioned language model analysis method of threats.

[0026] For the beneficial effects of the second to fourth aspects, reference may be made to the description of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A flowchart of a language model analysis method for threats provided by an embodiment of the present invention;

[0028] Figure 2 A schematic diagram of a specific implementation method of a threat language model analysis method provided by an embodiment of the present invention;

[0029] Figure 3 An example diagram of prompts for a large model-enhanced extraction method based on prompts provided in an embodiment of the present invention;

[0030] Figure 4 An example diagram of analysis results of a large model enhanced extraction method based on prompts provided in an embodiment of the present invention;

[0031] Figure 5 A specific method example diagram of a large model enhanced extraction method based on a search engine provided in an embodiment of the present invention;

[0032] Figure 6 An example diagram of a query result of a large model enhanced extraction method based on a search engine provided by an embodiment of the present invention in two cases: without search engine query enhancement and with search engine query enhancement;

[0033] Figure 7 A specific flow chart of a large model enhancement method for long text threat intelligence provided by an embodiment of the present invention;

[0034] Figure 8 An example diagram of the results of extracting information from threat intelligence using a large model enhancement method for long text threat intelligence provided by an embodiment of the present invention;

[0035] Fig. 9 A schematic diagram of a language model analysis device for threats provided by an embodiment of the present invention;

[0036] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

[0038] In view of the problems existing in the prior art, embodiments of the present invention provide a language model analysis method, device, medium and electronic device for threats.

[0039] This embodiment provides a threat language model analysis method. Figure 1 , the method comprising:

[0040] S101: Obtain threat intelligence and determine the type of threat intelligence.

[0041] In S101, in a possible embodiment, the method of the present invention obtains network threat intelligence to perform language model analysis of threats. The threat intelligence information analyzed has multiple types. After obtaining the threat intelligence, it is necessary to judge the type of the acquired threat intelligence. Exemplarily, the acquired threat intelligence to be used for a language model analysis includes short text threat intelligence, long text threat intelligence, and comprehensive M pieces of threat intelligence, where M>1.

[0042] S102: Select an information extraction method for performing language model analysis on the threat intelligence according to the type of threat intelligence.

[0043] In S102, in a possible embodiment, the present invention uses different methods to extract threat intelligence information using language model analysis according to the characteristics of different types of threat intelligence, so that the information extraction results can be better understood and trusted by users.

[0044] See the instruction manual Figure 2Exemplarily, an information extraction method for performing language model analysis on the threat intelligence is selected according to the type of the threat intelligence, including: when the type of the threat intelligence is short text threat intelligence, using a large model enhancement extraction method based on prompts to extract information for language model analysis on the threat intelligence; when the type of the threat intelligence is comprehensive M threat intelligence, using a large model enhancement extraction method based on a search engine to extract information for language model analysis on the threat intelligence; when the type of the threat intelligence is long text threat intelligence, using a large model enhancement method for long text threat intelligence to extract information for language model analysis on the threat intelligence.

[0045] S103: Apply the selected information extraction method to extract threat intelligence information.

[0046] In S103, in a possible embodiment, when the type of threat intelligence is short text threat intelligence, the selected information extraction method is applied to extract information from the threat intelligence, including: determining the information extraction target; designing prompts according to the extraction target; guiding the large language model to identify and extract information according to the prompts to obtain information extraction results. When the type of threat intelligence is comprehensive M pieces of threat intelligence, the selected information extraction method is applied to extract information from the threat intelligence, including: constructing questions according to the information extraction target; extracting keywords in the questions using a keyword extraction algorithm; performing a search engine search based on the keywords to obtain feedback text; constructing an enhanced query text based on the feedback text and the question; and performing a large language model query based on the enhanced query text to obtain information extraction results. When the type of threat intelligence is long text threat intelligence, the selected information extraction method is applied to extract information from the threat intelligence, including: segmenting the long text threat intelligence to obtain N text segments, where N>1; storing the N text segments after vectorization processing; retrieving the text segment most relevant to the information extraction target content from the N text segments to obtain the relevant text segment; building a question-and-answer environment based on the relevant text segment; using a large language model to perform question-and-answer processing corresponding to the question-and-answer environment to obtain the information extraction result. In addition, the method of the present invention can also extract information from threat intelligence in PDF file format, including: storing PDF documents related to the threat intelligence, then decomposing the PDF documents to extract text content, segmenting the text content to obtain N text segments; storing the N text segments after vectorization processing; retrieving the text segment most relevant to the information extraction target content from the N text segments to obtain the relevant text segment; building a question-and-answer environment based on the relevant text segment; using a large language model to perform question-and-answer processing corresponding to the question-and-answer environment to obtain the information extraction result.

[0047] In a possible embodiment, information extraction targets for extracting threat intelligence include entity relationship types, entity attribute information and entity identification, entity relationships and attributes.

[0048] Exemplarily, when using a large model-enhanced extraction method based on prompts to extract entity relationships from threat intelligence, the specific process includes: clarifying what type of entity relationship you want to extract from the threat intelligence, and then designing one or a series of prompts based on the entity relationship type to be extracted, and guiding the large language model to identify and extract information through the prompts, thereby obtaining the extracted entity relationship information. Among them, the prompt is designed as follows: first, the extraction target is formulated based on APT professional knowledge, then the output format is specified in the form of samples, and finally the interaction method of the large language model during the extraction process is specified. The prompt design process can be pre-set according to the type of entity relationship. After clarifying the entity relationship type to be extracted, the prompt design can be completed according to the set prompt design process.

[0049] Please refer to the instructions for instructions Figure 3 As shown, take a report on the Bahamut APT organization released by ESET in November 2022 as an example. The report revealed an active malware distribution campaign by Bahamut targeting Android users since January 2022. These malware are distributed through a fake SecureVPN website. They are tampered versions of legitimate VPN applications (such as SoftVPN or OpenVPN) and implanted with Bahamut's spyware code. These software are designed to extract sensitive user data and monitor the victim's instant messaging applications. The entity relationship extraction of threat intelligence is performed using the large model enhanced extraction method based on prompts designed by the present invention, and the analysis results are as follows: Figure 4 As shown. ChatGPT3.5 extracts entity relationship information related to APT attacks very well. It can be seen that the series of prompts designed by the present invention can well guide ChatGPT3.5 to perform entity relationship joint extraction according to specific requirements for unstructured text in the field of threat intelligence.

[0050] When the entity attributes of threat intelligence are extracted by using a large model enhanced extraction method based on a search engine, the specific process includes: inputting questions about the entity attribute information that you want to mark, using ChatGPT or other keyword extraction algorithms to extract keywords in the question, inputting the keywords into a search engine for a search engine search to obtain a summary text fed back by the search engine, expanding the summary text fed back by the search engine together with the question to construct an enhanced query text, providing the enhanced query text as input to ChatGPT for a large language model query, and the answer generated by ChatGPT is the extracted entity attribute information.

[0051] LLMs and web search engines each have different advantages. LLMs can provide more user-friendly and context-related answers, while search engines are generally more suitable for quickly obtaining information. The combination of the two can allow users to obtain more comprehensive solutions on a single platform. First, through the natural language processing capabilities of LLMs, the accuracy and relevance of search engines may be significantly improved, especially for complex or ambiguous queries. Second, LLMs can guide users to describe their needs more accurately in the form of dialogue, so that search engines can provide relevant information more effectively. Therefore, the method of the present invention combines search engines and ChatGPT to extract entity attributes. See the attached specification. Figure 5 , gives a specific example of how to use search engine results to improve ChatGPT's generated answers.

[0052] Suppose you want to annotate the attribute information of the malware CROSSWALK using a large model-enhanced extraction method based on a search engine. Figure 6 The examples shown show examples of answers given by ChatGPT3.5 using the method proposed in the present invention without search engine query enhancement a) and with search engine query enhancement b). Figure 6 We can clearly see the difference between the two answers in terms of alias, version, operating system, description and official address. In terms of alias, the answer with search engine query enhancement b) easily obtained the alias of CROSSWALK through the search engine. In terms of version, CROSSWALK is a malware used in APT attacks and has no accurate version number disclosed. Therefore, the answer with search engine query enhancement b) is Unspecified, while the answer without search engine query enhancement a) is v1.0, which creates a "hallucination" phenomenon (the answer of the large model does not match the facts). Similarly, in the three aspects of operating system, description and official address, the answer without search engine query enhancement a) all created a "hallucination" phenomenon, which is inconsistent with the actual situation.

[0053] When using a large model enhancement method for long text threat intelligence to perform entity recognition, entity relationship and attribute extraction on threat intelligence in PDF file format, the process is as follows: Figure 7As shown in the figure, the process specifically includes: first, storing PDF documents related to cyber threat intelligence (CTI). Then, using LangChain technology, the PDF document is decomposed through the PyPDF2 library to extract the text content, and the CharacterTextSplitter is used to split it to generate N independent text fragments. The text fragments are vectorized and then stored in a vector space database designed specifically for this purpose. For the entity recognition, entity relationship and attribute information to be extracted, the system retrieves the text fragments most relevant to the entity recognition, entity relationship and attribute information to be extracted from the vector space database, and constructs the context environment of the question based on the most relevant text fragment to obtain the question-answering environment. With the help of a large language model, the question-answering processing of the corresponding question-answering environment is carried out to realize the accurate question-answering of the entity recognition, entity relationship and attribute information to be extracted, and the entity recognition, entity relationship and attribute information of the corresponding threat intelligence are obtained. Among them, decomposing the PDF document through the PyPDF2 library and extracting the text content includes: using the PdfReader object of PyPDF2 to read the PDF file of the CTI text and extract the text content of each page. Splitting text through CharacterTextSplitter can make the text form smaller, easier to process blocks. The text fragments are vectorized and then stored in a vector space database designed for this purpose, including: applying Langchain's OpenAIEmbeddings module for text embedding, combined with the FAISS library to create and maintain a text retrieval system that can store and process vectorized representations of each text block. Constructing the context of the question based on the most relevant text fragments to derive a question-and-answer environment includes: integrating text blocks into a coherent question-and-answer environment through the QA Chain function in LangChain. Using large language models such as GPT to perform question-and-answer processing on text blocks can efficiently perform entity recognition, entity relationship and attribute extraction.

[0054] The main limitation of large language models such as GPT-3.5 in processing long texts and PDF content is that they have a limit on the length of the text, which may affect the understanding of the overall context of the long text. In addition, the model cannot parse PDF files directly and needs to convert the PDF content into plain text, which may result in the loss of formatting and layout information. The large model enhancement method for long text threat intelligence designed in the method of the present invention can solve the above problems well.

[0055] Figure 8The example of obtaining key entity, relationship, and entity attribute information through question and answer is shown, taking a 28-page threat intelligence PDF text released by Kaspersky against the APT organization DARKHOTEL in November 2014 as an example. For the first question "What does this threat intelligence say?", the answer of "Large Model Enhancement for Long Text Threat Intelligence" summarizes the content of the entire threat intelligence; for the second question "What kinds of malware does Darkhotel use?", "Large Model Enhancement for Long Text Threat Intelligence" gives the answer "Information Stealer" by understanding the entire article, thus obtaining<Darkhotel,use,Information Stealer> Such a relationship; for the third question, "Large model enhancement for long text threat intelligence" extracts the relevant attributes of the APT organization DARKHOTEL according to the defined rules:

[0056] Motivation: espionage

[0057] Sophistication: Advanced

[0058] resource_level: organizational

[0059] Category: Spy.

[0060] S104: Obtain information extraction results to obtain a threat knowledge graph corresponding to threat intelligence.

[0061] In S104, in a possible embodiment, the information extraction method designed in the method of the present invention is applied to extract information from threat intelligence to obtain information extraction results, which can construct fragmented threat intelligence information into structured information containing multiple entity types and multiple logical relationship types such as APT attack organization information, threat information entities, campaign weapon sets, etc., to achieve in-depth analysis and feature extraction of multimodal data (such as network traffic, operating system logs, security reports of human experts, etc.), and help build a threat knowledge graph that is both comprehensive and highly dynamic.

[0062] The threat language model analysis method provided by the present invention combines LLMs and knowledge graphs. The present invention can efficiently extract and integrate information from a large amount of unstructured network threat intelligence, which not only improves the efficiency of information processing, but also enhances the ability to identify and analyze APT attacks. Further, by utilizing the real-time analysis capabilities of LLMs, the present invention can quickly identify abnormal behaviors in the network and respond in a timely manner, achieve enhanced real-time monitoring and response, and effectively reduce the risk of network attacks. By integrating knowledge graphs, the interpretability of large language models is increased, the comprehensibility and reliability of the model output results are improved, and security analysts can better understand and trust the output of the model. In addition, the present invention uses special technologies to cope with the challenges of processing long texts and PDF content, and improves the accuracy and reliability of the model when processing such data.

[0063] See the instruction manual Fig. 9 This embodiment also provides a threat language model analysis device, which is used to implement the above method embodiment. The device includes:

[0064] The determination unit 201 is used to obtain threat intelligence and determine the type of threat intelligence.

[0065] The selection unit 202 is used to select an information extraction method for performing language model analysis on the threat intelligence according to the type of threat intelligence.

[0066] The extraction unit 203 is used to extract information from the threat intelligence using the selected information extraction method.

[0067] The acquisition unit 204 is used to acquire the information extraction result to obtain the threat knowledge graph corresponding to the threat intelligence.

[0068] Among them, the selection unit 202 selects an information extraction method for performing language model analysis on the threat intelligence according to the type of threat intelligence, including: when the type of threat intelligence is short text threat intelligence, using a large model enhancement extraction method based on prompts to extract information for language model analysis on the threat intelligence; when the type of threat intelligence is comprehensive M threat intelligence, using a large model enhancement extraction method based on a search engine to extract information for language model analysis on the threat intelligence, where M>1; when the type of threat intelligence is long text threat intelligence, using a large model enhancement method for long text threat intelligence to extract information for language model analysis on the threat intelligence.

[0069] When the type of threat intelligence is short text threat intelligence, the extraction unit 203 applies the selected information extraction method to extract information from the threat intelligence, including: determining the information extraction target; designing prompts according to the extraction target; and guiding the large language model to identify and extract information according to the prompts to obtain information extraction results.

[0070] When the type of threat intelligence is comprehensive M threat intelligence, the extraction unit 203 applies the selected information extraction method to extract information from the threat intelligence, where M>1, including: constructing a question according to the information extraction target; extracting keywords in the question using a keyword extraction algorithm; performing a search engine search based on the keywords to obtain a feedback text; constructing an enhanced query text based on the feedback text and the question; and performing a large language model query based on the enhanced query text to obtain an information extraction result.

[0071] When the type of threat intelligence is long text threat intelligence, the extraction unit 203 applies the selected information extraction method to extract information from the threat intelligence, including: segmenting the long text threat intelligence to obtain N text segments, where N>1; storing the N text segments after vectorization processing; retrieving the text segments most relevant to the information extraction target content from the N text segments to obtain relevant text segments; constructing a question and answer environment based on the relevant text segments; and using a large language model to perform question and answer processing in the corresponding question and answer environment to obtain information extraction results.

[0072] All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0073] In other embodiments of the present application, the present application discloses an electronic device, such as Fig.10 As shown, the electronic device 300 may include: one or more processors 301; a memory 302; a display 303; one or more applications (not shown); and one or more computer programs 304. The above components may be connected via one or more communication buses 305. The one or more computer programs 304 are stored in the above memory and configured to be executed by the one or more processors 301. The one or more computer programs 304 include instructions. The above instructions may be used to execute the following: Figure 1 , Fig. 9 And each step in the corresponding embodiment.

[0074] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0075] Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0076] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk and other media that can store program codes.

[0077] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims

1. A language model analysis method for threats, characterized in that: include: Obtain threat intelligence and determine the type of threat intelligence; Selecting an information extraction method for performing language model analysis on the threat intelligence according to the type of the threat intelligence; Extracting information from the threat intelligence using the selected information extraction method; Obtaining information extraction results to obtain a threat knowledge graph corresponding to the threat intelligence; Wherein, the information extraction method for performing language model analysis on the threat intelligence is selected according to the type of the threat intelligence, including: When the type of the threat intelligence is short text threat intelligence, a large model enhanced extraction method based on prompts is used to extract information from the threat intelligence by language model analysis; When the type of the threat intelligence is M comprehensive threat intelligence, a large model enhanced extraction method based on a search engine is used to extract information by language model analysis on the threat intelligence, wherein M>1; When the type of the threat intelligence is long text threat intelligence, a large model enhancement method for long text threat intelligence is used to extract information from the language model analysis of the threat intelligence; When the type of the threat intelligence is M pieces of comprehensive threat intelligence, the selected information extraction method is applied to extract information from the threat intelligence, where M>1, including: constructing a question according to an information extraction target; extracting keywords in the question using a keyword extraction algorithm; performing a search engine search based on the keywords to obtain a feedback text; constructing an enhanced query text based on the feedback text and the question; performing a large language model query based on the enhanced query text to obtain an information extraction result; When the type of threat intelligence is long text threat intelligence, the selected information extraction method is applied to extract information from the threat intelligence, including: segmenting the long text threat intelligence to obtain N text segments, where N>1; storing the N text segments after vectorization processing; retrieving the text segments most relevant to the information extraction target content from the N text segments to obtain relevant text segments; constructing a question and answer environment based on the relevant text segments; and using a large language model to perform question and answer processing corresponding to the question and answer environment to obtain an information extraction result.

2. The method according to claim 1, characterized in that When the type of the threat intelligence is short text threat intelligence, the selected information extraction method is applied to extract information from the threat intelligence, including: Determine the information extraction target; Designing prompts according to the extraction target; The large language model is guided to recognize and extract information according to the prompt to obtain an information extraction result.

3. A threat language model analysis device, characterized in that: The device comprises: A determination unit, used to obtain threat intelligence and determine the type of the threat intelligence; A selection unit, configured to select an information extraction method for performing language model analysis on the threat intelligence according to the type of the threat intelligence; An extraction unit, configured to extract information from the threat intelligence using a selected information extraction method; An acquisition unit, used to acquire information extraction results to obtain a threat knowledge graph corresponding to the threat intelligence; The selection unit selects an information extraction method for performing language model analysis on the threat intelligence according to the type of the threat intelligence, including: When the type of the threat intelligence is short text threat intelligence, a large model enhanced extraction method based on prompts is used to extract information from the threat intelligence by language model analysis; When the type of the threat intelligence is M comprehensive threat intelligence, a large model enhanced extraction method based on a search engine is used to extract information by language model analysis on the threat intelligence, wherein M>1; When the type of the threat intelligence is long text threat intelligence, a large model enhancement method for long text threat intelligence is used to extract information from the language model analysis of the threat intelligence; When the type of the threat intelligence is M pieces of comprehensive threat intelligence, the extraction unit applies the selected information extraction method to extract information from the threat intelligence, where M>1, including: constructing a question according to an information extraction target; extracting keywords in the question using a keyword extraction algorithm; performing a search engine search based on the keywords to obtain a feedback text; constructing an enhanced query text based on the feedback text and the question; performing a large language model query based on the enhanced query text to obtain an information extraction result; When the type of the threat intelligence is long text threat intelligence, the extraction unit applies the selected information extraction method to extract information from the threat intelligence, including: segmenting the long text threat intelligence to obtain N text segments, where N>1; storing the N text segments after vectorization processing; retrieving the text segments most relevant to the information extraction target content from the N text segments to obtain relevant text segments; constructing a question and answer environment based on the relevant text segments; and using a large language model to perform question and answer processing corresponding to the question and answer environment to obtain information extraction results.

4. The device according to claim 3, characterized in that When the type of the threat intelligence is short text threat intelligence, the extraction unit applies the selected information extraction method to extract information from the threat intelligence, including: Determine the information extraction target; Designing prompts according to the extraction target; The large language model is guided to recognize and extract information according to the prompt to obtain an information extraction result.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the language model analysis method of threats according to any one of claims 1 to 2 is implemented.

6. An electronic device, characterized in that: include: Processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory, so that the electronic device performs the language model analysis method of threats according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Threat intelligence oriented security knowledge graph construction method and system

    CN109857917A

Cited By

  • An APT open source intelligence intelligent analysis system and method empowered by a large model

    CN120996018A