Malicious file detection method and device, equipment and storage medium
By using the multi-scale convolutional layer and the preset model of the meta-learning module in malicious file detection, combined with the feature fusion of dynamic weight sets, the problem of insufficient accuracy in malicious file detection in the existing technology is solved, achieving more efficiency and accuracy. malware identification and differentiation, supporting continuous learning and improvement of generalization capabilities.
Patent Information
- Application Number
- CN202410958181.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-09-24
AI Technical Summary
Existing malicious file detection methods are insufficient in accuracy, making it difficult to effectively identify and distinguish different malware, especially those software families with minor changes in code.
A preset malicious file detection model based on the input layer, multi-scale convolution layer and meta-learning module is used to extract feature data through multiple convolution kernels of different sizes, and the meta-learning algorithm is used to quickly adapt to new malware, combined with dynamic weights Feature fusion is performed on the set to generate detection results.
It improves the accuracy and efficiency of malicious file detection, can better identify and distinguish different malware families, supports continuous learning without retraining from scratch, and enhances the generalization ability and robustness of the model.
Smart Images

Figure CN118690366A
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to malicious file detection methods, devices, equipment and storage media. Background Art
[0002] Malicious file detection is an important branch of cybersecurity, which involves identifying and blocking malware, viruses, worms, Trojans, ransomware, spyware, and other files that pose a threat to computer systems and network security.
[0003] Traditionally, when performing malicious file detection, signature detection, heuristic analysis, sandbox technology and other methods can usually be used. For example, signature detection is to identify malicious files by matching the hash signature or feature code of known malware; heuristic analysis is to use algorithms and rules based on the behavior pattern and code structure of the file to detect unknown or variant malicious files; sandbox technology is to run suspicious files in an isolated and secure environment and observe their behavior to determine whether they are malicious.
[0004] However, the above method has the problem of low accuracy when detecting malicious files. Summary of the invention
[0005] The present application aims to at least solve the technical problems existing in the prior art. To this end, the first aspect of the present application proposes a malicious file detection method, which includes: Get the current malicious file; The current malicious file is input into a preset malicious file detection model for calculation to generate a detection result corresponding to the current malicious file; wherein the preset malicious file detection model is constructed based on an input layer, a multi-scale convolution layer, a meta-learning module, a fully connected layer and an output layer, the multi-scale convolution layer includes multiple convolution kernels of different sizes and is used to extract first feature data, and the meta-learning module is used to extract second feature data through a pre-learned meta-learning algorithm.
[0006] In a possible implementation, the current malicious file is input into a preset malicious file detection model for calculation to generate a detection result corresponding to the current malicious file, including: Inputting the current malicious file into a preset malicious file detection model through an input layer, and processing the current malicious file through a plurality of convolution kernels of different sizes in a multi-scale convolution layer to generate first feature data; Processing the current malicious file using the meta-learning algorithm pre-learned by the meta-learning module to generate a processing result; wherein the processing result includes the second feature data; A detection result is generated based on the first feature data and the second feature data.
[0007] In a possible implementation, the current malicious file is processed by multiple convolution kernels of different sizes in a multi-scale convolution layer to generate first feature data, including: The current malicious file is processed through multiple convolution kernels of different sizes in the multi-scale convolution layer to generate a multi-scale feature map; The multi-scale feature maps are fused using a first preset fusion strategy to generate first feature data.
[0008] In a possible implementation, generating a detection result based on the first feature data and the second feature data includes: The first feature data and the second feature data are fused and processed by using a second preset fusion strategy to generate a fusion feature; wherein the second preset fusion strategy includes a dynamic weight set, and the dynamic weight set is dynamically adjusted during the construction of the preset malicious file detection model; After the fused features pass through the fully connected layer and the output layer, the detection results are generated.
[0009] In a possible implementation, the process of building a preset malicious file detection model includes: Get historical malicious files; The historical malicious files are input into the initial malicious file detection model for training to generate a preset malicious file detection model; wherein the initial malicious file detection model includes an input layer, a multi-scale convolutional layer, a meta-learning module, a fully connected layer and an output layer.
[0010] In a possible implementation, historical malicious files are input into an initial malicious file detection model for training to generate a preset malicious file detection model, including: Input historical malicious files into the initial malicious file detection model for training to generate an intermediate malicious file detection model; The intermediate malicious file detection model is optimized, encapsulated and parameterized to generate a preset malicious file detection model.
[0011] In a possible implementation, the intermediate malicious file detection model is optimized, packaged, and parameterized to generate a preset malicious file detection model, including: The intermediate malicious file detection model is optimized using the preset model evaluation index to generate an optimized malicious file detection model; The optimized malicious file detection model is encapsulated and parameterized to generate a preset malicious file detection model.
[0012] The second aspect of the present application provides a malicious file detection device, which includes: Acquisition module, used to obtain the current malicious file; A generation module is used to input the current malicious file into a preset malicious file detection model for calculation, and generate a detection result corresponding to the current malicious file; wherein the preset malicious file detection model is based on an input layer, a multi-scale convolution layer, a meta-learning module, a fully connected layer and an output layer, the multi-scale convolution layer includes multiple convolution kernels of different sizes, and is used to extract first feature data, and the meta-learning module is used to extract second feature data through a pre-learned meta-learning algorithm.
[0013] In a possible implementation manner, the generation module is specifically used to: Inputting the current malicious file into a preset malicious file detection model through an input layer, and processing the current malicious file through a plurality of convolution kernels of different sizes in a multi-scale convolution layer to generate first feature data; Processing the current malicious file using the meta-learning algorithm pre-learned by the meta-learning module to generate a processing result; wherein the processing result includes the second feature data; A detection result is generated based on the first feature data and the second feature data.
[0014] In a possible implementation manner, the generation module is further used to: The current malicious file is processed through multiple convolution kernels of different sizes in the multi-scale convolution layer to generate a multi-scale feature map; The multi-scale feature maps are fused using a first preset fusion strategy to generate first feature data.
[0015] In a possible implementation manner, the generation module is further used to: The first feature data and the second feature data are fused and processed by using a second preset fusion strategy to generate a fusion feature; wherein the second preset fusion strategy includes a dynamic weight set, and the dynamic weight set is dynamically adjusted during the construction of the preset malicious file detection model; After the fused features pass through the fully connected layer and the output layer, the detection results are generated.
[0016] In a possible implementation manner, the malicious file detection device is further used to: Get historical malicious files; The historical malicious files are input into the initial malicious file detection model for training to generate a preset malicious file detection model; wherein the initial malicious file detection model includes an input layer, a multi-scale convolutional layer, a meta-learning module, a fully connected layer and an output layer.
[0017] In a possible implementation manner, the malicious file detection device is further used to: Input historical malicious files into the initial malicious file detection model for training to generate an intermediate malicious file detection model; The intermediate malicious file detection model is optimized, encapsulated and parameterized to generate a preset malicious file detection model.
[0018] In a possible implementation manner, the malicious file detection device is further used to: The intermediate malicious file detection model is optimized using the preset model evaluation index to generate an optimized malicious file detection model; The optimized malicious file detection model is encapsulated and parameterized to generate a preset malicious file detection model.
[0019] The third aspect of the present application proposes an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the malicious file detection method as described in the first aspect.
[0020] In a fourth aspect, the present application proposes a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the malicious file detection method as described in the first aspect.
[0021] The embodiments of the present application have the following beneficial effects: The malicious file detection method provided in an embodiment of the present application includes: obtaining a current malicious file, inputting the current malicious file into a preset malicious file detection model for calculation, and generating a detection result corresponding to the current malicious file, wherein the preset malicious file detection model is based on an input layer, a multi-scale convolution layer, a meta-learning module, a fully connected layer and an output layer, the multi-scale convolution layer includes multiple convolution kernels of different sizes and is used to extract first feature data, and the meta-learning module is used to extract second feature data through a pre-learned meta-learning algorithm. This solution can obtain the corresponding detection results by directly calculating the current malicious file through the pre-trained preset malicious file detection model, thereby improving the accuracy and efficiency of malicious file detection; in addition, the meta-learning module can quickly adapt to new or unknown types of malware, and through meta-learning, the model not only learns the specific features of a specific task, but also learns how to transfer knowledge from task to task, thereby improving the generalization ability of the model on different data sets; and, through multi-scale convolutional layers, it can capture features of different granularities, which is conducive to understanding the complexity and diversity of malware; at the same time, the improved preset malicious file detection model can better identify and distinguish different malware families, even if they have minor changes in the code, and can be designed to support continuous learning and continuously learn from new data without retraining from scratch. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A block diagram of a computer device provided in an embodiment of the present application; Figure 2 A flowchart of a malicious file detection method provided in an embodiment of the present application; Figure 3 A flowchart of the steps of constructing a preset malicious file detection model provided in an embodiment of the present application; Figure 4 A flowchart of the steps for generating a preset malicious file detection model provided in an embodiment of the present application; Figure 5 Another flowchart of the steps for generating a preset malicious file detection model provided in an embodiment of the present application; Figure 6 A flowchart of the steps for generating a test result provided in an embodiment of the present application; Figure 7 A flowchart of the steps for generating first characteristic data provided in an embodiment of the present application; Figure 8 Another flow chart of steps for generating a test result provided in an embodiment of the present application; Fig. 9 A structural block diagram of a malicious file detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "multiple" means two or more. In addition, the use of "based on" or "according to" means openness and inclusiveness, because the process, steps, calculations or other actions "based on" or "according to" one or more of the conditions or values may be based on additional conditions or values beyond the described values in practice.
[0025] The malicious file detection method provided in the present application can be applied to a computer device (electronic device), which can be a server or a terminal, wherein the server can be a single server or a server cluster composed of multiple servers. The embodiments of the present application do not specifically limit this. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices.
[0026] Take the computer device as a server as an example. Figure 1 A block diagram of a server is shown, such as Figure 1 As shown, the server may include a processor and a memory connected via a system bus. The processor of the server is used to provide computing and control capabilities. The memory of the server includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, a malicious file detection method is implemented.
[0027] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. Optionally, the server may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0028] It should be noted that the execution subject of the embodiments of the present application may be a computer device or a malicious file detection device. The following method embodiments are described using a computer device as the execution subject.
[0029] Figure 2 The following is a flowchart of the steps of the malicious file detection method provided in the embodiment of the present application. Figure 2 As shown, the method comprises the following steps: Step 202: Obtain the current malicious file.
[0030] Among them, malicious file detection is an important branch of network security, which involves identifying and blocking malware, viruses, worms, Trojan horses, ransomware, spyware and other files that pose a threat to computer systems and network security.
[0031] When performing malicious file detection, it is necessary to first obtain the current malicious file, and the obtained current malicious file may be multiple files. In addition, the format of the current malicious file may be a portable executable file (Portable Executable, referred to as PE) or a binary file, which is not specifically limited in the embodiment of the present application.
[0032] Step 204: input the current malicious file into a preset malicious file detection model for calculation to generate a detection result corresponding to the current malicious file.
[0033] Among them, the preset malicious file detection model is constructed based on the input layer, multi-scale convolution layer, meta-learning module, fully connected layer and output layer. The multi-scale convolution layer includes multiple convolution kernels of different sizes and is used to extract the first feature data. The meta-learning module is used to extract the second feature data through the pre-learned meta-learning algorithm.
[0034] After the current malicious file is obtained, the current malicious file may be input into a preset malicious file detection model for calculation, thereby generating a detection result corresponding to the current malicious file.
[0035] The above-mentioned preset malicious file detection model needs to be pre-built. In some optional embodiments, such as Figure 3 As shown, Figure 3 A flowchart of the steps of building a preset malicious file detection model provided in an embodiment of the present application includes: Step 302: Obtain historical malicious files.
[0036] Step 304: Input the historical malicious files into the initial malicious file detection model for training to generate a preset malicious file detection model.
[0037] Among them, the initial malicious file detection model can also include an input layer, a multi-scale convolutional layer, a meta-learning module, a fully connected layer and an output layer.
[0038] When historical malicious files are input into the initial malicious file detection model for training, such as Figure 4 As shown, Figure 4 A flowchart of the steps of generating a preset malicious file detection model provided in an embodiment of the present application includes: Step 402: Input the historical malicious files into the initial malicious file detection model for training to generate an intermediate malicious file detection model.
[0039] Among them, we can first select the MalConv model as the basis for the malicious file detection and identification scenario, and then perform a series of optimizations and improvements on it to obtain the initial malicious file detection model. In the field of network security, the MalConv model is a deep learning model implemented based on PyTorch, which is used to identify and classify whether computer files are malware.
[0040] Next, we need to build a loosely coupled model architecture, which includes input layer design, multi-scale convolution layer design, meta-learning module design, and output design. The input layer is used to receive the byte sequence of PE files or binary files; in the multi-scale convolution layer, we need to design multiple groups of convolution kernels of different sizes, each group of convolution kernels is responsible for capturing features of different scales; in the meta-learning module, by embedding this module, we can quickly adapt to new malware samples and enhance the generalization ability of the model.
[0041] Specifically, for the multi-scale convolution layer, multiple groups of different convolution kernels can be defined first, such as convolution kernels of different sizes such as 3x1, 5x1, and 7x1. Then, the input byte sequence is convolved by these convolution kernels to obtain a multi-scale feature map, and finally the feature maps of different scales are fused by the first preset fusion strategy to obtain a richer feature representation. Among them, exemplarily, the first preset fusion strategy can be weighted summation, concatenation, and the like.
[0042] Taking the first preset fusion strategy of weighted summation as an example, the specific process may include: first pre-define an initial weight coefficient w(i) for each convolution kernel, where i represents the size index of the convolution kernel. Then use the softmax function to normalize each initial weight coefficient to ensure that the sum of the initial weight coefficients is 1, and obtain the normalized weight coefficient ,in, , j ranges from 1 to i. Next, the normalized weight coefficient is multiplied by the corresponding feature map, and then the weighted sum of all products is calculated to obtain the fused feature map F(fused), where , F(i) is the feature map corresponding to the output of the i-th convolution kernel. Finally, F(fused) will be output as a feature map that fuses information of different scales.
[0043] For the meta-learning module, the goal of meta-learning is to learn a learning algorithm on labeled data in order to obtain better performance on unknown data. When designing a meta-learning module, historical malicious files can be collected and labeled first, and then a possible meta-learning algorithm set can be constructed. For example, the meta-learning algorithm set can include multiple meta-learning algorithms such as convolutional neural networks, recurrent neural networks, Transformers, stochastic gradient descent, Bayesian optimization, and genetic algorithms. The meta-learning module can be constructed using machine learning models such as neural networks and decision trees, and the output of the meta-learning module is a feature set, wherein the feature set has the same dimension as the features of the multi-scale convolutional layer; in addition, the output of the meta-learning module can include a weight vector, a feature vector, and an adjustment parameter, wherein the weight vector is a set of weights used to adjust or amplify the features in the multi-scale convolutional layer. The feature vector is a set of features that have the same dimension as the features of the multi-scale convolutional layer and can be combined with it. The adjustment parameters can include learning rate, attention weight, etc., which are used to guide the rapid adjustment of the model.
[0044] Next, the selected meta-learning algorithm and preprocessed data can be used to train the meta-learning module, whose task is to learn how to quickly adapt to the new data distribution. Finally, the test set can be used to evaluate the model performance, and the performance of the meta-learning module on each algorithm can be used to select the best meta-learning algorithm and hyperparameters. In addition, when encountering new malicious files, the meta-learning module can quickly adjust parameters to improve the overall efficiency of the model.
[0045] After constructing the multi-scale convolution layer and meta-learning module, you can use the multi-expert model fusion strategy, that is, the second preset fusion strategy, to treat the multi-scale convolution layer and the meta-learning module as two independent "experts" and design a dynamic weighting mechanism to fuse these two independent "experts". The dynamic weighting mechanism in the second preset fusion strategy can be to first assume that the feature vector output by the multi-scale convolution is vm1, the feature vector output by the meta-learning module is vm2, and the dynamic weighted evaluation index is vm0. Then let , where gm1 and gm2 are dynamic weight sets, which are hyperparameters of the model. They are initialized when the model is built and dynamically adjusted during model training. The dynamic weighting mechanism balances performance and accuracy. In addition, through dynamic adjustment, it can automatically adjust to the most suitable state in different preferences and data sets. It is flexible and adaptable. Finally, the second preset fusion strategy can be used to fuse the multi-scale convolutional layer and the meta-learning module.
[0046] The embodiments of the present application can help the model better understand and adapt to adversarial attacks through meta-learning, improve the robustness of the model to these attacks, and meta-learning also provides the ability to quickly adjust parameters, reducing the time to retrain or fine-tune the model. Through meta-learning, the model can provide better interpretability because it can highlight the most important features for quickly adapting to new tasks. And compared to training large models from scratch, the meta-learning method can use existing knowledge and reduce the consumption of computing resources.
[0047] Moreover, the additional features or weight adjustments provided by the meta-learning model can enhance the feature representation of the multi-scale convolutional layer, thereby improving the accuracy of detection. In addition, the multi-scale convolutional layer combined with meta-learning can more effectively utilize the training data and reduce the risk of overfitting. The fusion method of the multi-scale convolutional layer and the meta-learning module is also more flexible, and can quickly adjust the model according to new threats. It is also easy to extend to other types of security analysis tasks.
[0048] In addition, after fusing the multi-scale convolutional layer and the meta-learning module to obtain the fused feature representation, a fully connected layer is added for the final classification decision. In addition, a softmax layer is also added to output the probability of each category.
[0049] During the model training process, you also need to select a loss function suitable for multi-classification problems, such as the cross entropy loss function; and select a suitable optimizer, such as the Adaptive Moment Estimation (Adam) optimizer or the Stochastic Gradient Descent (SGD) optimizer to optimize the model parameters. The Adam optimizer is an adaptive learning rate optimization algorithm that uses the first-order and second-order momentum of the gradient to adaptively adjust the learning rate. The main idea of the SGD optimizer is to use only the gradient of the loss function of one sample (or a small batch of samples) to update the model parameters in each iteration. This method is more computationally efficient than the traditional gradient descent algorithm, especially when dealing with large-scale data sets.
[0050] Finally, it is also necessary to build a training strategy for the model. Specifically, first, for the training of the meta-learning module, the model's learning ability can be optimized through meta-learning or "learning to learn" methods, so that it can adapt to new tasks more quickly. Secondly, for the training of the multi-scale convolutional layer, convolution kernels of different sizes can be used to extract multi-scale feature maps to enhance the model's ability to capture information at different levels. Then, through joint training, the advantages of the meta-learning module and the multi-scale convolutional layer are integrated to improve the overall performance of the model. Finally, in order to more comprehensively evaluate the performance of the model in different aspects, so that the model can be optimized, multi-dimensional performance evaluation is included, specifically including accuracy, robustness and generalization ability, which provides a scientific basis for model selection.
[0051] When evaluating performance, we can first calculate the total loss using formula (1); then calculate the total F1 score in the same way as the total loss, which can be expressed as ; Finally, the overall evaluation index y is calculated by formula (2).
[0052] (1) Among them, L total is the total loss; W meta , W conv and W reg They are the weights corresponding to the meta-learning module, multi-scale convolutional layer, and joint training, which can be customized in advance; L meta is the loss of the meta-learning module; L conv is the loss of the multi-scale convolutional layer; L reg is the regularization term.
[0053] (2) in, are the total loss and The corresponding weights can be customized in advance.
[0054] After inputting historical malicious files into the initial malicious file detection model and training using the above training process, an intermediate malicious file detection model can be generated.
[0055] Step 404: Optimize, encapsulate and parameterize the intermediate malicious file detection model to generate a preset malicious file detection model.
[0056] Wherein, optionally, Figure 5 As shown, Figure 5 Another flowchart of steps for generating a preset malicious file detection model provided in an embodiment of the present application includes: Step 502: Optimize the intermediate malicious file detection model using a preset model evaluation index to generate an optimized malicious file detection model.
[0057] Step 504: encapsulate and parameterize the optimized malicious file detection model to generate a preset malicious file detection model.
[0058] Among them, the preset model evaluation indicators may include accuracy, recall rate, F1 score, etc., so that the intermediate malicious file detection model can be optimized through these preset model evaluation indicators to generate an optimized malicious file detection model. In addition, the hyperparameters of the model can also be adjusted according to the evaluation results, including learning rate, regularization coefficient, multi-expert weight, etc. By designing multi-expert weights, they can be flexibly adjusted according to different preferences.
[0059] Finally, the optimized malicious file detection model can be encapsulated and parameterized to generate a preset malicious file detection model.
[0060] After the preset malicious file detection model is built, when the current malicious file is input into the preset malicious file detection model for calculation, such as Figure 6 As shown, Figure 6 A flowchart of the steps for generating a test result provided in an embodiment of the present application includes: Step 602: Input the current malicious file into a preset malicious file detection model through an input layer, and process the current malicious file through a plurality of convolution kernels of different sizes in a multi-scale convolution layer to generate first feature data.
[0061] The first feature data is the fused feature map F(fused) obtained by fusing the multi-scale feature maps in the above embodiment. Figure 7 As shown, Figure 7 A flowchart of the steps of generating first feature data provided in an embodiment of the present application includes: Step 702: Process the current malicious file using multiple convolution kernels of different sizes in the multi-scale convolution layer to generate a multi-scale feature map.
[0062] Step 704: Use a first preset fusion strategy to fuse the multi-scale feature maps to generate first feature data.
[0063] Among them, the first preset fusion strategy can also be weighted summation, concatenation, etc. The specific process of fusing the multi-scale feature map using the first preset fusion strategy can refer to the process of constructing a preset malicious file detection model in the above embodiment, which will not be repeated here.
[0064] Step 604: Process the current malicious file using the meta-learning algorithm pre-learned by the meta-learning module to generate a processing result.
[0065] The processing result is the output of the meta-learning module, and the output of the meta-learning module may include: weight vector, feature vector, adjustment parameter. The feature vector output here is the second feature data, which is a set of features, has the same dimension as the features of the multi-scale convolutional layer, and can be combined with it.
[0066] Step 606: Generate a detection result based on the first feature data and the second feature data.
[0067] Among them, Figure 8 As shown, Figure 8 Another step flow chart for generating a test result provided in an embodiment of the present application includes: Step 802: Use a second preset fusion strategy to fuse the first feature data and the second feature data to generate a fusion feature.
[0068] Step 804: After the fused features pass through the fully connected layer and the output layer, a detection result is generated.
[0069] Among them, the second preset fusion strategy includes a dynamic weight set, and the dynamic weight set is dynamically adjusted during the construction process of the preset malicious file detection model. The dynamic weight set here is gm1 and gm2 in the above embodiment. The specific generation process of the detection result can refer to the process of constructing the preset malicious file detection model in the above embodiment, which will not be repeated here.
[0070] The present application provides a malicious file detection method, which includes: obtaining a current malicious file, inputting the current malicious file into a preset malicious file detection model for calculation, and generating a detection result corresponding to the current malicious file, wherein the preset malicious file detection model is based on an input layer, a multi-scale convolution layer, a meta-learning module, a fully connected layer and an output layer, the multi-scale convolution layer includes multiple convolution kernels of different sizes and is used to extract first feature data, and the meta-learning module is used to extract second feature data through a pre-learned meta-learning algorithm. This solution can obtain the corresponding detection results by directly calculating the current malicious file through the pre-trained preset malicious file detection model, thereby improving the accuracy and efficiency of malicious file detection; in addition, the meta-learning module can quickly adapt to new or unknown types of malware, and through meta-learning, the model not only learns the specific features of a specific task, but also learns how to transfer knowledge from task to task, thereby improving the generalization ability of the model on different data sets; and, through multi-scale convolutional layers, it can capture features of different granularities, which is conducive to understanding the complexity and diversity of malware; at the same time, the improved preset malicious file detection model can better identify and distinguish different malware families, even if they have minor changes in the code, and can be designed to support continuous learning and continuously learn from new data without retraining from scratch.
[0071] Fig. 9 A structural block diagram of a malicious file detection device provided in an embodiment of the present application.
[0072] like Fig. 9 As shown, the malicious file detection device 900 includes: The acquisition module 902 is used to acquire the current malicious file.
[0073] The generation module 904 is used to input the current malicious file into a preset malicious file detection model for calculation, and generate a detection result corresponding to the current malicious file; wherein the preset malicious file detection model is based on an input layer, a multi-scale convolution layer, a meta-learning module, a fully connected layer and an output layer, the multi-scale convolution layer includes a plurality of convolution kernels of different sizes, and is used to extract first feature data, and the meta-learning module is used to extract second feature data through a pre-learned meta-learning algorithm.
[0074] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here. Each module in the above malicious file detection device can be implemented in whole or in part by software, hardware, and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations of the above modules.
[0075] In one embodiment of the present application, a computer device is provided, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: Get the current malicious file; The current malicious file is input into a preset malicious file detection model for calculation to generate a detection result corresponding to the current malicious file; wherein the preset malicious file detection model is constructed based on an input layer, a multi-scale convolution layer, a meta-learning module, a fully connected layer and an output layer, the multi-scale convolution layer includes multiple convolution kernels of different sizes and is used to extract first feature data, and the meta-learning module is used to extract second feature data through a pre-learned meta-learning algorithm.
[0076] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps: Inputting the current malicious file into a preset malicious file detection model through an input layer, and processing the current malicious file through a plurality of convolution kernels of different sizes in a multi-scale convolution layer to generate first feature data; Processing the current malicious file using the meta-learning algorithm pre-learned by the meta-learning module to generate a processing result; wherein the processing result includes the second feature data; A detection result is generated based on the first feature data and the second feature data.
[0077] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps: The current malicious file is processed through multiple convolution kernels of different sizes in the multi-scale convolution layer to generate a multi-scale feature map; The multi-scale feature maps are fused using a first preset fusion strategy to generate first feature data.
[0078] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps: The first feature data and the second feature data are fused and processed by using a second preset fusion strategy to generate a fusion feature; wherein the second preset fusion strategy includes a dynamic weight set, and the dynamic weight set is dynamically adjusted during the construction of the preset malicious file detection model; After the fused features pass through the fully connected layer and the output layer, the detection results are generated.
[0079] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps: Get historical malicious files; The historical malicious files are input into the initial malicious file detection model for training to generate a preset malicious file detection model; wherein the initial malicious file detection model includes an input layer, a multi-scale convolutional layer, a meta-learning module, a fully connected layer and an output layer.
[0080] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps: Input historical malicious files into the initial malicious file detection model for training to generate an intermediate malicious file detection model; The intermediate malicious file detection model is optimized, encapsulated and parameterized to generate a preset malicious file detection model.
[0081] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps: The intermediate malicious file detection model is optimized using the preset model evaluation index to generate an optimized malicious file detection model; The optimized malicious file detection model is encapsulated and parameterized to generate a preset malicious file detection model.
[0082] The computer device provided in the embodiment of the present application has similar implementation principles and technical effects to those of the above-mentioned method embodiment, and will not be described in detail here.
[0083] In one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: Get the current malicious file; The current malicious file is input into a preset malicious file detection model for calculation to generate a detection result corresponding to the current malicious file; wherein the preset malicious file detection model is constructed based on an input layer, a multi-scale convolution layer, a meta-learning module, a fully connected layer and an output layer, the multi-scale convolution layer includes multiple convolution kernels of different sizes and is used to extract first feature data, and the meta-learning module is used to extract second feature data through a pre-learned meta-learning algorithm.
[0084] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented: Inputting the current malicious file into a preset malicious file detection model through an input layer, and processing the current malicious file through a plurality of convolution kernels of different sizes in a multi-scale convolution layer to generate first feature data; Processing the current malicious file using the meta-learning algorithm pre-learned by the meta-learning module to generate a processing result; wherein the processing result includes the second feature data; A detection result is generated based on the first feature data and the second feature data.
[0085] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented: The current malicious file is processed through multiple convolution kernels of different sizes in the multi-scale convolution layer to generate a multi-scale feature map; The multi-scale feature maps are fused using a first preset fusion strategy to generate first feature data.
[0086] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented: The first feature data and the second feature data are fused and processed by using a second preset fusion strategy to generate a fusion feature; wherein the second preset fusion strategy includes a dynamic weight set, and the dynamic weight set is dynamically adjusted during the construction of the preset malicious file detection model; After the fused features pass through the fully connected layer and the output layer, the detection results are generated.
[0087] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented: Get historical malicious files; The historical malicious files are input into the initial malicious file detection model for training to generate a preset malicious file detection model; wherein the initial malicious file detection model includes an input layer, a multi-scale convolutional layer, a meta-learning module, a fully connected layer and an output layer.
[0088] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented: Input historical malicious files into the initial malicious file detection model for training to generate an intermediate malicious file detection model; The intermediate malicious file detection model is optimized, encapsulated and parameterized to generate a preset malicious file detection model.
[0089] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented: The intermediate malicious file detection model is optimized using the preset model evaluation index to generate an optimized malicious file detection model; The optimized malicious file detection model is encapsulated and parameterized to generate a preset malicious file detection model.
[0090] The computer-readable storage medium provided in this embodiment has similar implementation principles and technical effects to those of the above method embodiments, and will not be described in detail here.
[0091] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0092] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0093] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for detecting malicious files. It is characterized in that The method comprises: Get the current malicious file; The current malicious file is input into a preset malicious file detection model for calculation to generate a detection result corresponding to the current malicious file; wherein the preset malicious file detection model is constructed based on an input layer, a multi-scale convolution layer, a meta-learning module, a fully connected layer and an output layer, the multi-scale convolution layer includes a plurality of convolution kernels of different sizes and is used to extract first feature data, and the meta-learning module is used to extract second feature data through a pre-learned meta-learning algorithm.
2. The method according to claim 1, It is characterized in that The step of inputting the current malicious file into a preset malicious file detection model for calculation to generate a detection result corresponding to the current malicious file includes: Inputting the current malicious file into a preset malicious file detection model through the input layer, and processing the current malicious file through a plurality of convolution cores of different sizes in the multi-scale convolution layer to generate the first feature data; Processing the current malicious file using the meta-learning algorithm pre-learned by the meta-learning module to generate a processing result; wherein the processing result includes the second feature data; The detection result is generated based on the first feature data and the second feature data.
3. The method according to claim 2, It is characterized in that The processing of the current malicious file by using a plurality of convolution cores of different sizes in the multi-scale convolution layer to generate the first feature data includes: Processing the current malicious file through a plurality of convolution kernels of different sizes in the multi-scale convolution layer to generate a multi-scale feature map; The multi-scale feature maps are fused using a first preset fusion strategy to generate the first feature data.
4. The method according to claim 2 or 3, It is characterized in that The generating the detection result based on the first feature data and the second feature data includes: The first feature data and the second feature data are fused by using a second preset fusion strategy to generate a fusion feature; wherein the second preset fusion strategy includes a dynamic weight set, and the dynamic weight set is dynamically adjusted during the construction of the preset malicious file detection model; After the fused features pass through the fully connected layer and the output layer, the detection result is generated.
5. The method according to any one of claims 1 to 3, It is characterized in that The process of building the preset malicious file detection model includes: Get historical malicious files; The historical malicious files are input into the initial malicious file detection model for training to generate the preset malicious file detection model; wherein the initial malicious file detection model includes an input layer, a multi-scale convolutional layer, a meta-learning module, a fully connected layer and an output layer.
6. The method according to claim 5, It is characterized in that The step of inputting the historical malicious file into the initial malicious file detection model for training to generate the preset malicious file detection model includes: Inputting the historical malicious files into the initial malicious file detection model for training to generate an intermediate malicious file detection model; The intermediate malicious file detection model is optimized, packaged and parameterized to generate the preset malicious file detection model.
7. The method according to claim 6, It is characterized in that The optimizing, encapsulating and parameterizing the intermediate malicious file detection model to generate the preset malicious file detection model includes: The intermediate malicious file detection model is optimized using a preset model evaluation index to generate an optimized malicious file detection model; The optimized malicious file detection model is encapsulated and parameterized to generate the preset malicious file detection model.
8. A malicious file detection device, It is characterized in that The device comprises: Acquisition module, used to obtain the current malicious file; A generation module is used to input the current malicious file into a preset malicious file detection model for calculation, and generate a detection result corresponding to the current malicious file; wherein the preset malicious file detection model is based on an input layer, a multi-scale convolution layer, a meta-learning module, a fully connected layer and an output layer, the multi-scale convolution layer includes a plurality of convolution kernels of different sizes, and is used to extract first feature data, and the meta-learning module is used to extract second feature data through a pre-learned meta-learning algorithm.
9. An electronic device, It is characterized in that The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the malicious file detection method as described in any one of claims 1-7.
10. A computer-readable storage medium, It is characterized in that The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the malicious file detection method as described in any one of claims 1-7.
