Virus detection method and device

By obtaining and converting the behavior logs of files to be detected, building a virus detection model, and automatically generating feature vectors, solving the problems of inefficiency and high cost caused by the virus database relying on manual extraction of feature vectors in the existing technology, and achieving efficient and accurate Virus detection.

CN110008698BActive Publication Date: 2024-11-22SHENZHEN TENCENT COMP SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201810008093.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-01-04
Publication Date
2024-11-22
Estimated Expiration
2038-01-04

AI Technical Summary

Technical Problem

The feature vectors in the existing virus database rely on manual extraction, which is inefficient, resulting in low efficiency and high cost of virus detection, which is prone to false detection and missed detection.

Method used

By obtaining the behavior log of the file to be detected, converting it into feature vectors, and using the feature vectors and sample labels of the training samples to build a virus detection model, automatically generating feature vectors, and avoiding the manual extraction process.

Benefits of technology

It improves the efficiency and accuracy of virus detection, reduces labor costs, and reduces the occurrence of false and missed detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110008698B_ABST
    Figure CN110008698B_ABST
Patent Text Reader

Abstract

The present invention relates to a virus detection method and device, wherein the virus detection comprises: obtaining a behavior log of a file to be detected, wherein the behavior log reflects the behavior triggered to be executed when the file to be detected is running in a corresponding operating environment; converting the behavior identifier used to represent the behavior in the behavior log to obtain a feature vector of the file to be detected; calling a virus detection model to predict the feature vector of the file to be detected, obtaining a sample label of the file to be detected, and determining whether the file to be detected is a virus by using the sample label; wherein the virus detection model is obtained by model training based on the feature vector and sample label of a training sample, and the feature vector of the training sample is converted based on the behavior log formed by the training sample in the corresponding operating environment. The present invention no longer relies on manual extraction of feature vectors, thereby solving the problem of low efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a virus detection method and device. Background Art

[0002] With the development of computer technology, viruses are also increasing, causing harm to user devices without the user's knowledge. At present, user devices such as desktop computers and smart phones are generally installed with anti-virus software to remove viruses hidden in user devices. In addition, in order to improve the ability to detect and kill viruses, anti-virus software will collect suspected viruses on user devices from time to time with the user's permission, and report them to the server for further virus detection.

[0003] For the server, the virus detection process is: perform feature vector matching search for suspected viruses in the virus database. If the suspected virus hits the feature vector in the virus database, the suspected virus is considered to be a virus. The feature vector in the virus database is formed by analysts analyzing the virus and extracting continuous binary fragments from it.

[0004] From the above, we can see that the feature vectors in the existing virus database rely on manual extraction and still have the limitation of low efficiency. Summary of the invention

[0005] In order to solve the above technical problems, an object of the present invention is to provide a virus detection method and device.

[0006] Wherein, the technical solution adopted by the present invention is:

[0007] A virus detection method comprises: obtaining a behavior log of a file to be detected, wherein the behavior log reflects the behavior that is triggered to be executed when the file to be detected is running in a corresponding running environment; converting the behavior identifier used to represent the behavior in the behavior log to obtain a feature vector of the file to be detected; calling a virus detection model to predict the feature vector of the file to be detected to obtain a sample label of the file to be detected, and determining whether the file to be detected is a virus through the sample label; wherein the virus detection model is obtained by model training based on the feature vector and sample label of a training sample, and the feature vector of the training sample is converted based on the behavior log formed by the training sample in the corresponding running environment.

[0008] A virus detection device comprises: a log acquisition module, used for acquiring a behavior log of a file to be detected, wherein the behavior log reflects the behavior that is triggered to be executed when the file to be detected is running in a corresponding running environment; a log conversion module, used for converting a behavior identifier used to represent the behavior in the behavior log to obtain a feature vector of the file to be detected; and a virus prediction module, used for calling a virus detection model to predict the feature vector of the file to be detected, obtain a sample label of the file to be detected, and determine whether the file to be detected is a virus through the sample label; wherein the virus detection model is obtained by model training based on the feature vector and sample label of a training sample, and the feature vector of the training sample is converted based on the behavior log formed by the training sample in the corresponding running environment.

[0009] A virus detection device includes a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the virus detection method described above is implemented.

[0010] A computer-readable storage medium stores a computer program, which implements the virus detection method described above when executed by a processor.

[0011] In the above technical solution, the behavior identifier in the behavior log of the file to be detected is converted into a feature vector of the file to be detected, and then the feature vector of the file to be detected is predicted by the virus detection model to determine whether the file to be detected is a virus according to the predicted sample label, wherein the virus detection model is obtained by model training based on the feature vector and sample label of the training sample, and the feature vector of the training sample is converted based on the behavior log formed by the training sample in the corresponding operating environment. Therefore, for the virus detection model, the manual extraction of feature vectors is avoided, thereby solving the problem of low efficiency.

[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0014] Figure 1 The figure is a hardware structure block diagram of a server according to an exemplary embodiment.

[0015] Figure 2 The present invention is a flowchart of a method for constructing a virus detection network according to an exemplary embodiment.

[0016] Figure 3 yes Figure 2 The corresponding embodiment is a flowchart of step 330 in one embodiment.

[0017] Figure 4 yes Figure 2 The corresponding embodiment is a flowchart of step 350 in one embodiment.

[0018] Figure 5 yes Figure 2 The flowchart of step 350 in the corresponding embodiment in another embodiment.

[0019] Figure 6 yes Figure 2 The corresponding embodiment is a flowchart of step 370 in one embodiment.

[0020] Figure 7 yes Figure 6 A schematic diagram of an embodiment of a specified model structure used for modeling in a corresponding embodiment.

[0021] Figure 8 yes Figure 6 A schematic diagram of another embodiment of the specified model structure used for modeling in the corresponding embodiment.

[0022] Fig. 9 The figure is a hardware structure block diagram of a user equipment according to an exemplary embodiment.

[0023] Fig.10 is a schematic diagram of an implementation environment according to an exemplary embodiment Figure 1 .

[0024] Fig.11 is a schematic diagram of an implementation environment according to an exemplary embodiment Figure 2 .

[0025] Fig.12 The figure is a flow chart of a virus detection method according to an exemplary embodiment.

[0026] Fig.13 yes Fig.12 The corresponding embodiment is a flowchart of step 610 in one embodiment.

[0027] Fig.14 The following is a flowchart showing a log record storage process in one embodiment according to an exemplary embodiment.

[0028] Fig.15 The flowchart of the log record storage process in another embodiment is shown according to an exemplary embodiment.

[0029] Fig.16 yes Fig.12The corresponding embodiment is a flowchart of step 630 in one embodiment.

[0030] Fig.17 yes Fig.12 The flowchart of step 630 in the corresponding embodiment is another embodiment.

[0031] Fig.18 This is a schematic diagram of a specific implementation of a virus detection method in an application scenario.

[0032] Fig.19 The figure is a block diagram of a virus detection device according to an exemplary embodiment.

[0033] Fig. 20 yes Fig.19 The block diagram of the log acquisition module 910 in one embodiment of the corresponding embodiment.

[0034] Fig.21 is a block diagram of another virus detection device according to an exemplary embodiment.

[0035] Fig. 22 is a block diagram of another virus detection device according to an exemplary embodiment.

[0036] Fig.23 yes Fig.19 The following is a block diagram of a vector acquisition module 930 in one embodiment of the corresponding embodiment.

[0037] Fig.24 yes Fig.19 The corresponding embodiment is a block diagram of the vector acquisition module 930 in another embodiment.

[0038] Fig.25 is a block diagram of another virus detection device according to an exemplary embodiment.

[0039] Fig.26 yes Fig.25 A block diagram of the training data acquisition module 1210 in one embodiment of the corresponding embodiment.

[0040] The above-mentioned drawings have shown clear embodiments of the present invention, which will be described in more detail hereinafter. These drawings and textual descriptions are not intended to limit the scope of the present invention in any way, but to illustrate the concept of the present invention for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0041] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0042] As mentioned above, the feature vectors in the existing virus database rely on manual extraction. As the number of viruses gradually increases, the feature vector extraction time is too long, which will make it difficult to improve the efficiency. In addition, human factors directly affect the extraction quality of the feature vector, which not only places high demands on analysts, resulting in high labor costs, but also easily causes virus detection errors. For example, suspected viruses may be misdetected or missed due to inaccurate feature vector extraction.

[0043] To this end, the present invention proposes a method for constructing an efficient virus detection network. The method for constructing a virus detection network is applicable to a server. The server can be a single server, or a server cluster composed of multiple servers, a cloud computing center, etc., which is not limited here.

[0044] Figure 1 is a hardware structure block diagram of a server according to an exemplary embodiment. It should be noted that the server is only an example adapted to the present invention and cannot be considered to provide any limitation on the scope of use of the present invention. The server cannot be interpreted as needing to rely on or must have Figure 1 One or more components of the exemplary server shown in .

[0045] The hardware structure of the server 200 may vary greatly due to differences in configuration or performance, such as Figure 1 As shown, the server 200 includes: a power supply 210 , an interface 230 , at least one memory 250 , and at least one central processing unit (CPU) 270 .

[0046] The power supply 210 is used to provide operating voltage for each hardware device on the server 200 .

[0047] The interface 230 includes at least one wired or wireless network interface 231 , at least one serial-to-parallel conversion interface 233 , at least one input-output interface 235 , and at least one USB interface 237 , etc., for communicating with external devices.

[0048] The memory 250 is a carrier for storing resources, which can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon include an operating system 251, an application 253 and data 255, etc. The storage method can be temporary storage or permanent storage. Among them, the operating system 251 is used to manage and control the hardware devices and application 253 on the server 200 to enable the central processor 270 to calculate and process the massive data 255. It can be WindowsServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc. The application 253 is a computer program based on the operating system 251 to complete at least one specific task, which can include at least one module ( Figure 1 Each module may include a series of computer-readable instructions for the server 200. The data 255 may be photos, pictures, etc. stored in a disk.

[0049] The central processing unit 270 may include one or more processors and is configured to communicate with the memory 250 via a bus for computing and processing the mass data 255 in the memory 250 .

[0050] As described in detail above, the server 200 applicable to the present invention will complete the method for constructing a virus detection network by having the central processor 270 read a series of computer-readable instructions stored in the memory 250 .

[0051] In addition, the present invention can also be implemented by hardware circuits or hardware circuits combined with software. Therefore, the implementation of the present invention is not limited to any specific hardware circuits, software, or a combination of the two.

[0052] The following is a detailed description of the process of building a virus detection network.

[0053] See also Figure 2 In an exemplary embodiment, a method for constructing a virus detection network is applicable to a server. The method for constructing a virus detection network can be executed by the server and may include the following steps:

[0054] Step 310: Obtain training samples configured with sample labels.

[0055] In order to build a virus detection network, a virus detection model is needed, and training samples are the training basis of the virus detection model. Only by obtaining a large number of training samples can an accurate virus detection model be obtained, and a virus detection network can be built to achieve accurate virus detection.

[0056] In acquiring training samples, the training samples may come from active reporting of suspected viruses by user devices, or from interception of suspected viruses by security servers, which is not limited here.

[0057] In this embodiment, the training sample is configured with a sample label to indicate whether the training sample is a virus. For example, a sample label of 1 indicates that the training sample is a virus.

[0058] Furthermore, the training samples can be not only viruses but also non-viruses, and are marked by different sample labels. For example, a sample label of 0 indicates that the training sample is non-virus.

[0059] Using virus and non-virus training samples as the training basis for the virus detection model ensures that the constructed virus detection network not only has the ability to predict unknown viruses, but also can eliminate the interference of non-viruses on virus detection, thereby fully guaranteeing the accuracy of virus detection.

[0060] Step 330: Run the training sample in the running environment corresponding to the training sample to obtain a behavior log of the training sample.

[0061] First of all, it should be noted that the virus used as a training sample is an executable program that can run independently on the user's device. Due to the differences in the operating environment provided by the user's device, the types of training samples are also different. For example, the types of training samples include but are not limited to: APK file type training samples, EXE file type training samples.

[0062] Accordingly, for the virus detection network constructed by the method provided in this embodiment, it will be applicable to different operating environments according to the type of training samples. For example, the virus detection network constructed by training samples of APK file type is applicable to Android system, and the virus detection network constructed by training samples of EXE file type is applicable to Windows system.

[0063] It can also be understood that the virus detection network is constructed according to the different types of training samples.

[0064] Secondly, the behavior log reflects the behaviors that are triggered and executed when the training samples are running in the corresponding running environment.

[0065] Therefore, in the generation of behavior logs, different types of training samples will be input into different operating environments for execution. For example, training samples of APK file type will be executed in the Android system, and training samples of EXE file type will be executed in the Windows system.

[0066] Assuming that the server is pre-installed with an operating system, such as a Windows system, it should be understood that if the training sample is a virus, it will also cause harm to the server when the training sample is run in the Windows system.

[0067] Therefore, the operating environment corresponding to the training sample is different from the operating environment provided by the server. It can also be understood that the operating environment corresponding to the training sample is virtual and different from the real operating environment in the server. For example, the virtual operating environment is the Android system, while the real operating environment in the server is the Windows system. Therefore, the virus detection network built in the server can provide virus detection services for Android users.

[0068] For the server, multiple servers can be deployed, which provide different operating environments for training samples, so that different types of training samples run on different servers, thereby generating behavior logs of training samples. Alternatively, the operating environments that can be used for different types of training samples are simulated in one server to obtain the behavior logs of training samples. The specific deployment method of the server can be adjusted according to actual operational needs and is not limited here.

[0069] Step 350: convert the behavior identifier in the behavior log into a feature vector of a training sample.

[0070] As mentioned above, the behavior log reflects the behavior that is triggered to execute when the training sample is running in the corresponding running environment. The triggered behavior is represented by a behavior identifier in the behavior log, and the behavior identifier includes at least one number, which can also be understood as a combination of one number or multiple numbers as a behavior identifier.

[0071] Accordingly, the feature vector is a set of numbers converted from the behavior identifier as the basic data, which uniquely identifies the behavior of the training sample in the form of numbers, that is, it accurately describes the behavior that is triggered to be executed when the training sample is running in the corresponding running environment. It should be understood that if the training samples are different, the behaviors triggered to be executed by the training samples during the running process will be different, and thus the feature vectors of different training samples will also be different.

[0072] For example, the behavior identifiers in the behavior log are concatenated to form a feature vector of the training sample. Alternatively, the behavior identifiers in the behavior log are accumulated to obtain the feature vector of the training sample.

[0073] Step 370: Perform model training based on the feature vectors and sample labels of the training samples, and construct a virus detection network using the virus detection model obtained through training.

[0074] The virus detection model characterizes the training samples by the specified model structure described by the specified model. It can also be understood that by performing model training of the specified model structure on the feature vectors and sample labels of the training samples based on the specified model, a mapping relationship is established between the feature vectors and the sample labels.

[0075] Therefore, the virus detection network constructed based on the virus detection model can predict the sample label of the feature vector of the file to be detected according to the established mapping relationship, thereby realizing virus detection of the file to be detected.

[0076] In other words, based on the mapping relationship between feature vectors and sample labels, if the feature vector of the file to be detected is extremely similar to or even identical to a feature vector in the mapping relationship, then the sample label of the file to be detected can be regarded as the same as the sample label with the mapping relationship to the feature vector, thereby completing the sample label prediction of the file to be detected, and then determining whether the file to be detected is a virus based on the predicted sample label.

[0077] The specified models include but are not limited to: neural network models, support vector machine models, logistic regression models, etc.

[0078] The specified model structure described by the specified model includes but is not limited to: parallel type, series type, parallel-series combination type, etc.

[0079] Through the process described above, the automatic generation of feature vectors is achieved, that is, the feature vectors are generated based on the behaviors triggered when the training samples are running in the corresponding operating environment, eliminating the process of manually extracting feature vectors. This not only solves the problem of inefficiency, but also reduces labor costs, which is conducive to ensuring the accuracy of virus detection.

[0080] See also Figure 3 In an exemplary embodiment, step 330 may include the following steps:

[0081] Step 331: input the training sample into the started computer simulator, and perform simulated access to the training sample through the input of the training sample.

[0082] As mentioned above, the operating environment corresponding to the training samples is different from the operating environment provided by the server.

[0083] In this embodiment, the operating environment is installed in the server in the form of a computer simulator. That is, the computer simulator simulates a virtual operating environment in the operating system installed in the server, so that the training samples can run in the virtual operating environment without causing harm to the server.

[0084] Therefore, after starting the installed computer simulator in the server, a virtual operating environment is simulated for the training samples, so as to facilitate the subsequent collection of the behaviors triggered and executed by the training samples during the running process.

[0085] Step 333: during the process of simulated access to the training sample, a log record of the training sample is generated according to the behavior of the simulated triggering execution of the training sample, and is stored in the system log.

[0086] Simulated access refers to the behavior of simulating the training sample being triggered and executed in the real operating environment. For example, if the training sample is an App application, the simulated access to the App application includes but is not limited to clicking on the page of the App application in the virtual operating environment.

[0087] During the simulated access of the training sample, the behavior of the training sample triggered by the simulated execution will be recorded in the form of log records and stored in the system log. In other words, in the system log, the behavior of the training sample and the behavior results are recorded according to the behavior triggering time. Among them, the behavior is represented by the behavior identifier.

[0088] It is worth mentioning that the system log here is for the computer simulator, that is, the system log is generated when the computer simulator is installed and deployed on the server's operating system, and is used to store log records for each program running on the computer simulator.

[0089] Step 335 , filtering the system log according to the behavior identifier and the behavior triggering time to generate the behavior log of the training sample.

[0090] As mentioned above, in the system log, the behavior and behavior results of the training samples are recorded according to the behavior triggering time. Therefore, the behavior log reflecting the behavior of the training samples being triggered can be filtered out from the system log.

[0091] Specifically, the training sample identifier is determined according to the training sample. For example, if the training sample is an App application, the training sample identifier is the application identifier. In other words, the training sample identifier is used to uniquely represent the training sample.

[0092] After the training sample identifier is confirmed, the log record corresponding to the training sample identifier is extracted from the system log, and the extracted log record is further filtered according to the behavior identifier and the behavior triggering time to generate the behavior log of the training sample.

[0093] It can also be understood that the behavior log of the training sample is formed by filtering the system log twice. The first filtering is the log records of the remaining training samples, and the second filtering is the relevant information in the log records except the behavior identifier and the behavior trigger time. In other words, the behavior log of the training sample consists of the behavior identifier and the behavior trigger time.

[0094] Under the effect of the above-mentioned embodiments, a data basis is provided for the generation of feature vectors, so that the construction of a virus detection network can be realized.

[0095] See also Figure 4 In an exemplary embodiment, step 350 may include the following steps:

[0096] Step 351, sorting the behavior identifiers according to the behavior triggering time in the behavior log.

[0097] Step 353: concatenate the sorted behavior identification sequences into a feature vector of the training sample.

[0098] For example, after the behavior identifiers are sorted, the behavior log includes: behavior identifier 1, behavior trigger time T1; behavior identifier 2, behavior trigger time T2; behavior identifier 3, behavior trigger time T3; behavior identifier 1, behavior trigger time T4; behavior identifier 1, behavior trigger time T5.

[0099] In this description, the same behavior identifier means that the training samples are triggered to perform the same behavior at different times.

[0100] Based on this, after sequentially concatenating the behavior identifiers as feature values, the feature vector of the training sample is: [1,2,3,1,1].

[0101] Through the above process, the automatic digital conversion of training samples is achieved, avoiding the manual extraction of feature vectors. While effectively improving efficiency, the implementation of virus detection network construction is fully guaranteed.

[0102] For further information, see Figure 5 In an exemplary embodiment, step 350 may further include the following steps:

[0103] Step 352: Perform continuous consistency statistics on the behavior identifiers in the behavior log to obtain the consistency times corresponding to the behavior identifiers.

[0104] Step 354: update the corresponding behavior identifier according to the consistency count, so that the behavior identifier is sorted according to the updated behavior identifier.

[0105] It should be understood that the training samples may be triggered to perform the same behavior at different times during the simulated access process. Therefore, the behavior identifiers will be updated for the same behavior triggered by the training samples at different times.

[0106] Still using the above example, before updating, the feature vector of the training sample is: [1,2,3,1,1].

[0107] After continuous consistency statistics are performed, according to the behavior trigger time, the consistency number of behavior identifier 1 is 1, the consistency number of behavior identifier 2 is 1, the consistency number of behavior identifier 3 is 1, and the consistency number of behavior identifier 1 is 2.

[0108] After obtaining the number of consistency of each behavior identifier, the behavior identifier is updated according to the following calculation formula:

[0109]

[0110] Among them, id_x represents the xth behavior identifier in the behavior log, n represents the consistency number of the behavior identifier id_x, and max represents the maximum consistency number of consecutive appearances of the behavior identifier allowed in the behavior log. For example, max is defined as 100.

[0111] Of course, the update process can be performed on all behavior identifiers, or only on behavior identifiers whose consistency times are not 1, that is, only behavior identifiers are updated for continuously executed behaviors, thereby reducing the task processing workload on the server.

[0112] Therefore, after updating the behavior identifiers whose consistency times are not 1, the feature vector of the training sample is: [1,2,3,202]. It can be seen that in the feature vector, the feature value 202 is much larger than other feature values, which means that the behavior represented by its corresponding behavior identifier 1 is triggered and executed more times continuously, thus more accurately describing the behavior of the training sample and fully ensuring the accuracy of the virus detection model.

[0113] In the above process, not only the amount of data converted into feature vectors is effectively reduced, which is beneficial to reducing the task processing workload on the server and improving efficiency, but also the training samples can be more accurately characterized, which is beneficial to improving the accuracy of the virus detection model, and thus beneficial to improving the accuracy of virus detection.

[0114] See also Figure 6 In an exemplary embodiment, step 370 may include the following steps:

[0115] Step 371, modeling the specified model structure of the feature vectors and sample labels of the training samples according to the long short-term memory network to obtain an artificial intelligence model.

[0116] In this embodiment, modeling is to reflect the mapping relationship between the feature vectors of training samples and the sample labels by means of a specified model structure described by the specified model.

[0117] In other words, the modeling establishes a mapping relationship between feature vectors and sample labels based on a large number of training samples, thereby forming an artificial intelligence model, so as to facilitate subsequent parameter training of the artificial intelligence model so that the mapping relationship between feature vectors and sample labels is optimal.

[0118] Step 373, iteratively optimize the training parameters of the artificial intelligence model, and converge the artificial intelligence model into a virus detection model through iterative optimization of the training parameters.

[0119] In this embodiment, parameter training refers to iterative optimization of the training parameters of the artificial intelligence model to optimize the mapping relationship between the feature vector and the sample label.

[0120] First, the training parameters of the artificial intelligence model are randomly initialized, and then the randomly initialized training parameters are iteratively optimized.

[0121] When the mapping relationship is not optimal, the training parameters are updated with the optimized training parameters, and the iterative optimization process is continued based on the updated training parameters.

[0122] When the mapping relationship reaches the optimal level, it is considered that the optimized training parameters make the artificial intelligence model converge, and the converged artificial intelligence model is regarded as a virus detection model, so as to construct a virus detection network, and then virus detection can be performed based on the virus detection network.

[0123] Furthermore, the virus detection model is stored in the form of a file, so as to provide virus detection services for suspected viruses uploaded by the user device, or sent to the user device as a virus library to perform virus detection.

[0124] The following example illustrates the specified model structure described by the specified model, taking the specified model as a long short-term memory network.

[0125] like Figure 7 As shown, the specified model structure includes two branches, and a long short-term memory network LSTM is deployed in each branch for parallel connection.

[0126] like Figure 8 As shown, the specified model structure includes two branches, which are connected in a long short-term memory network LSTM parallel-serial combination. One branch deploys a long short-term memory network LSTM, and the other branch deploys two long short-term memory networks LSTM in series.

[0127] Specifically, the feature vector of the training sample is input into the long short-term memory network LSTM, and output according to the specified dimension of the long short-term memory network LSTM, for example, the specified dimension is 128; then the feature vector output according to the specified dimension is discarded with a specified probability through the dropout layer, for example, the feature vector output by the long short-term memory network LSTM is discarded with a specified probability of 0.2; then the processed feature vector is flattened using the flatten layer, and then the flattened feature vector is concatenated using the merge layer, and finally the concatenated feature vector is predicted through the dense fully connected layer, so as to obtain the sample label of the training sample to complete the virus detection.

[0128] Of course, the specified model structure and the parameters involved therein (for example, specified dimensions, specified probabilities, etc.) can be flexibly adjusted according to the actual application scenarios. For example, multiple branches can be deployed, or different numbers of long short-term memory networks (LSTMs) can be deployed in series in different branches to improve the accuracy of the virus detection model.

[0129] Through the cooperation of the above embodiments, the construction of a virus detection network is realized, thereby realizing the prediction capability of unknown viruses, and effectively improving the virus detection capability.

[0130] The virus detection process is described below based on the virus detection network constructed by the present invention.

[0131] As mentioned above, in the existing virus detection process, a suspected virus will only be detected as a virus when it hits the feature vector in the virus library. It should be understood that the feature vectors in the virus library will gradually increase as the number of viruses increases. Searching one by one not only increases the virus detection time exponentially, but also may not be able to match the searched feature vector, resulting in low virus detection efficiency.

[0132] To this end, the present invention proposes a virus detection method based on the constructed virus detection network, which can effectively improve the virus detection efficiency. The virus detection method is not only applicable to the server, but also to the user equipment.

[0133] The server can be a single server, or a server cluster or cloud computing center consisting of multiple servers. Figure 1 shown.

[0134] The user device may be a desktop computer, a laptop computer, a tablet computer, a smart phone, or a PDA, etc., which is not limited here.

[0135] Fig. 9 FIG. 1 is a block diagram of a user equipment according to an exemplary embodiment. Fig. 9As shown, the user device 100 includes a memory 101, a storage controller 103, one or more ( Fig. 9 The processor 105 (only one is shown in the figure), the peripheral interface 107, the radio frequency module 109, the positioning module 111, the camera module 113, the audio module 115, the touch screen 117 and the key module 119. These components communicate with each other via one or more communication buses / signal lines 121.

[0136] Among them, the memory 101 can be used to store computer programs and modules, such as computer-readable instructions and modules corresponding to the virus detection method and device in the exemplary embodiment of the present invention. The processor 105 executes various functions and data processing by running the computer-readable instructions stored in the memory 101, thereby completing the virus detection method.

[0137] The memory 101 is a carrier for storing resources, and may be a random access memory, such as a high-speed random access memory, a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other solid-state memory. The storage method may be temporary storage or permanent storage.

[0138] The peripheral interface 107 may include at least one wired or wireless network interface, at least one serial-parallel conversion interface, at least one input / output interface, and at least one USB interface, etc., for coupling various external input / output devices to the memory 101 and the processor 105 to achieve communication with various external input / output devices.

[0139] The radio frequency module 109 is used to receive and transmit electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with other devices through a communication network. The communication network includes a cellular telephone network, a wireless local area network or a metropolitan area network, and the above communication network can use various communication standards, protocols and technologies.

[0140] The positioning module 111 is used to obtain the current geographical location of the user equipment 100. Examples of the positioning module 111 include, but are not limited to, a global satellite positioning system (GPS) and positioning technology based on a wireless local area network or a mobile communication network.

[0141] The camera module 113 is a camera for taking pictures or videos. The taken pictures or videos can be stored in the memory 101 and can also be sent to the host computer through the radio frequency module 109.

[0142] The audio module 115 provides an audio interface to the user, which may include one or more microphone interfaces, one or more speaker interfaces, and one or more headphone interfaces. The audio data is interacted with other devices through the audio interface. The audio data can be stored in the memory 101 and can also be sent through the radio frequency module 109.

[0143] The touch screen 117 provides an input and output interface between the user device 100 and the user. Specifically, the user can perform input operations through the touch screen 117, such as gesture operations such as clicking, touching, sliding, etc., so that the user device 100 responds to the input operation. The user device 100 displays the output content formed by any form or combination of text, pictures or videos to the user through the touch screen 117.

[0144] The button module 119 includes at least one button to provide an interface for the user to input to the user device 100. The user can press different buttons to make the user device 100 perform different functions. For example, the sound adjustment button allows the user to adjust the volume of the sound played by the user device 100.

[0145] Understandably, Fig. 9 The structure shown is for illustration only. The user equipment 100 may also include Fig. 9 More or fewer components as shown, or with Fig. 9 The different components are shown. Fig. 9 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0146] Fig.10 The schematic diagram of an implementation environment of an exemplary embodiment includes a server 410 and a user device 430 .

[0147] A virus detection network 450 for performing virus detection is constructed in the server 410 .

[0148] The user equipment 430 reports the collected suspected viruses to the server 410 irregularly, thereby requesting the server 410 to perform virus detection on the suspected viruses using the constructed virus detection network 450 .

[0149] Specifically, Fig.10 As shown, the virus detection network 450 includes a behavior extraction submodule 451 , a model training submodule 453 , and a detection process control submodule 455 .

[0150] The model training submodule 453 is used to perform model training based on the feature vectors and sample labels of the training samples. The detection process control submodule 455 uses the virus detection model trained by the model training submodule 453 to predict the feature vectors of suspected viruses (regarded as files to be detected), and then determines whether the suspected virus is a virus based on the predicted sample labels.

[0151] The behavior extraction submodule 451 can be called by the model training submodule 453 and the detection process control submodule 455 to obtain the behavior log of the training samples and the behavior log of the suspected virus, and then convert the behavior identifier in the behavior log into the feature vector of the training sample and the feature vector of the suspected virus, and output them to the model training submodule 453 and the detection process control submodule 455 respectively.

[0152] Fig.11 It is a schematic diagram of another implementation environment showing an exemplary embodiment. The implementation environment includes a server 510 and a user device 530 .

[0153] The virus detection network 550 for performing virus detection is jointly constructed by the server 510 and the user equipment 530 .

[0154] Specifically, Fig.11 As shown, the virus detection network 550 includes a behavior extraction submodule 551 and a model training submodule 553 deployed in the server 510 , and a behavior extraction submodule 555 and a detection process control submodule 557 deployed in the user device 530 .

[0155] Among them, on the server side 510, the model training submodule 553 is used to call the behavior extraction submodule 551 to obtain the feature vector of the training sample, and the virus detection model is trained based on the feature vector and sample label of the training sample, and then the virus detection model is sent to the user device 530 as a virus library.

[0156] As for the user device 530, when performing virus detection on the file to be detected, the detection process control submodule 557 calls the behavior extraction submodule 551 to obtain the feature vector of the file to be detected, and inputs the feature vector of the file to be detected into the virus library issued by the server 510 to determine whether the file to be detected is a virus.

[0157] See also Fig.12 In an exemplary embodiment, a virus detection method may include the following steps:

[0158] Step 610: Obtain the behavior log of the file to be detected.

[0159] Among them, the behavior log reflects the behavior that is triggered and executed when the file to be detected runs in the corresponding running environment.

[0160] like Fig.13 As shown, in a specific implementation of an embodiment, step 610 may include the following steps:

[0161] Step 611, confirming the identification of the file to be detected according to the file to be detected.

[0162] Step 613: extract the log record corresponding to the identifier of the file to be detected from the system log.

[0163] Step 615 , filtering the extracted log records according to the behavior identifier and the behavior triggering time to generate a behavior log of the file to be detected.

[0164] Since the system log stores the corresponding log records for the behavior and behavior results of the file to be detected, the behavior log of the file to be detected can be formed by filtering the system log twice. That is, the log records corresponding to the other file identifiers to be detected are filtered for the first time, and the relevant information in the log records except the behavior identifier and the behavior trigger time is filtered for the second time, so as to obtain the behavior log of the file to be detected consisting of the behavior identifier and the behavior trigger time.

[0165] Here, it is necessary to explain the storage process of log records involved in different virus detection application scenarios.

[0166] like Fig.14 As shown, in the application scenario of virus detection on the server side, the running environment of the file to be detected is provided by a computer simulator. Accordingly, the storage process of the log record may include the following steps:

[0167] Step 710: input the file to be detected in the started computer simulator, and perform simulated access to the file to be detected through the input of the file to be detected.

[0168] Step 730: During the simulated access process of the file to be detected, a log record of the file to be detected is generated according to the simulated triggering execution behavior of the file to be detected, and stored in the system log.

[0169] For the server, a computer simulator will simulate a virtual operating environment for the file to be detected, so that the file to be detected will generate corresponding log records when it runs in the virtual operating environment, and then the server can store the log records generated by the file to be detected for further filtering to generate behavior logs of the file to be detected.

[0170] like Fig.15 As shown, in the application scenario of virus detection on a user device, the running environment of the file to be detected is the operating system installed and deployed in the user device. Accordingly, the storage process of the log record may include the following steps:

[0171] Step 720: Load the file to be detected in the operating system to run the file to be detected.

[0172] Step 740: During the execution of the file to be detected, a log record of the file to be detected is generated according to the behavior of the file to be detected being triggered to execute, and is stored in the system log.

[0173] For the user device, the file to be detected uses the operating system installed on the user device as the running environment, thereby generating and storing corresponding log records so that the user device can call them when performing virus detection on the file to be detected.

[0174] That is to say, for the user device, the behavior log of the file to be detected reflects the behavior of the file to be detected being triggered and executed in the real operating environment, while for the server, the behavior log of the file to be detected is obtained by simulating the behavior of the file to be detected in the user device.

[0175] It should be noted that in the user device, the system log is based on the operating system, while in the server, the system log is based on the computer simulator.

[0176] Step 630: convert the behavior identifier used to represent the behavior in the behavior log to obtain a feature vector of the file to be detected.

[0177] like Fig.16 As shown, in a specific implementation of an embodiment, step 630 may include the following steps:

[0178] Step 631, sorting the behavior identifiers according to the behavior triggering time in the behavior log.

[0179] Step 633: concatenate the sorted behavior identification sequences into a feature vector of the file to be detected.

[0180] Furthermore, if Fig.17 As shown, step 630 may further include the following steps:

[0181] Step 632: Perform continuous consistency statistics on the sorted behavior identifiers to obtain the consistency count corresponding to the behavior identifiers.

[0182] Step 634, updating the corresponding behavior identifier according to the consistency number, so that the splicing is performed according to the updated behavior identifier.

[0183] Whether it is the feature vector of the file to be detected or the feature vector of the training sample, they are all converted based on the behavior log formed by the sample in the corresponding operating environment. Therefore, the conversion process of the behavior log of the file to be detected is essentially the same as the conversion process of the behavior log of the training sample described in the above embodiment. The only difference is that one is performed on the file to be detected and the other is performed on the training sample, so it will not be repeated here.

[0184] Step 650: Call the virus detection model to predict the file to be detected based on the feature vector of the file to be detected, obtain a sample label of the file to be detected, and determine whether the file to be detected is a virus based on the sample label.

[0185] Among them, the virus detection model is obtained by model training based on the feature vectors and sample labels of the training samples. The feature vectors of the training samples are converted based on the behavior logs formed by the training samples in the corresponding operating environment.

[0186] In the above process, based on the virus detection model, as long as the feature vector of the file to be detected is obtained, it can be input into the virus detection model for prediction, and then the sample label of the file to be detected is obtained, and the sample label is used to determine whether the file to be detected is a virus, thereby avoiding the problem of being unable to determine whether the file to be detected is a virus due to the failure to match the feature vector. This not only improves the virus detection efficiency, but also effectively improves the virus detection capability.

[0187] Fig.18 This is a schematic diagram of a specific implementation of a virus detection method in an application scenario. The virus detection network constructed in this application scenario is suitable for the Android system.

[0188] In this application scenario, there are two branches: model training branch and virus detection branch.

[0189] Model training branch:

[0190] The input object 801 is a number of training samples, namely a batch of virus samples whose sample labels indicate virus and safety samples whose sample labels indicate safety, and then the behavior extraction submodule 803 is called to obtain the vector representation of the training samples.

[0191] Specifically, by executing steps 8031 ​​to 8033, the training sample is input into a computer simulator for running, so as to obtain a behavior log of the training sample, and the behavior log of the training sample is converted into a feature vector of the training sample.

[0192] For example, after a training sample with a sample label of 0 runs on a computer simulator for a period of time, the corresponding behavior log is as follows:

[0193] Behavior identification 4, behavior triggering time: 10:00;

[0194] Behavior identification 8, behavior triggering time: 10:10;

[0195] Behavior identification 5, behavior triggering time: 10:20;

[0196] Behavior identification 2, behavior triggering time: 10:30;

[0197] …….

[0198] Therefore, after conversion, the feature vector of the training sample with sample label 0 is [4, 8, 5, 2, …].

[0199] After the training sample with sample label 1 runs for a period of time on the computer simulator, the corresponding behavior log is as follows:

[0200] Behavior identification 5, behavior triggering time: 10:00;

[0201] Behavior identification 6, behavior triggering time: 10:20;

[0202] Behavior identification 5, behavior triggering time: 10:30;

[0203] Behavior identification 2, behavior triggering time: 10:10;

[0204] …….

[0205] Therefore, after transformation, the feature vector of the training sample with sample label 1 is [5, 2, 6, 5, …].

[0206] Furthermore, before model training, the sample labels and feature vectors of the training samples are combined into a vector in the following specified format:

[0207] Vector = sample label (safe is 0, virus is 1): feature vector.

[0208] Thus, we obtain the vector representation of the training samples: 0:[4,8,5,2,…] and 1:[5,2,6,5,…].

[0209] After completing the vector representation of the training samples, the virus detection model is trained by executing the model training in step 804, and is used as the model library 805 for virus detection.

[0210] Virus detection branch:

[0211] The input object 802 is a number of files to be detected, which are input to the behavior extraction submodule 803 to execute steps 8031 ​​to 8033 to obtain the feature vector 806 of the files to be detected.

[0212] By loading the virus library 805 , it is possible to predict sample labels for the feature vectors of the files to be detected based on the virus detection model 807 .

[0213] By executing step 808, the predicted sample label is checked to determine whether the file to be detected is a virus.

[0214] For example, the feature vector of the file to be detected 1 is [3, 7, 5, 6, 8, ...], the feature vector of the file to be detected 2 is [4, 8, 5, 2, ...], and the feature vector of the file to be detected 3 is [5, 2, 6, 5, ...].

[0215] After prediction, since there is no feature vector consistent with the feature vector of the file to be detected 1 in the virus library 805, the probability of predicting the sample label of the file to be detected 1 to be 0 or 1 is low, which is not enough to determine whether the file to be detected 1 is a virus.

[0216] Since the feature vector [4,8,5,2,…] of the file to be detected 2 is consistent with the feature vector of the training sample vector represented as 0:[4,8,5,2,…], the sample label of the file to be detected 2 is predicted to be 0, thereby determining that the file to be detected 2 is non-virus.

[0217] Since the feature vector [5,2,6,5,…] of the file to be detected 3 is consistent with the feature vector of the training sample vector represented as 1:[5,2,6,5,…], the sample label of the file to be detected 3 is predicted to be 1, thereby determining that the file to be detected 3 is a virus.

[0218] Thus, the virus detection process of the file to be detected is completed.

[0219] In this application scenario, self-training of the virus detection model is achieved. That is, as the number of training samples increases, the ability to predict sample labels based on feature vectors will continue to increase, and no manual maintenance is required. This not only helps to reduce labor costs, but also improves the efficiency of virus detection and fully guarantees the accuracy of virus detection.

[0220] The following are embodiments of the device of the present invention, which can be used to perform the method involved in the present invention. For details not disclosed in the embodiment of the device of the present invention, please refer to the method embodiment involved in the present invention.

[0221] See also Fig.19 In an exemplary embodiment, a virus detection device 900 includes but is not limited to: a log acquisition module 910 , a vector acquisition module 930 and a virus prediction module 950 .

[0222] The log acquisition module 910 is used to acquire the behavior log of the file to be detected, and the behavior log reflects the behavior that is triggered and executed when the file to be detected runs in the corresponding running environment.

[0223] The vector acquisition module 930 is used to transform the behavior identifier used to represent the behavior in the behavior log to obtain the feature vector of the file to be detected.

[0224] The virus prediction module 950 is used to call the virus detection model to predict the feature vector of the file to be detected, obtain the sample label of the file to be detected, and determine whether the file to be detected is a virus according to the sample label.

[0225] Among them, the virus detection model is obtained by model training based on the feature vectors and sample labels of the training samples. The feature vectors of the training samples are converted based on the behavior logs formed by the training samples in the corresponding operating environment.

[0226] See also Fig. 20 In an exemplary embodiment, the log acquisition module 910 includes but is not limited to:

[0227] The identification confirmation unit 911 is used to confirm the identification of the file to be detected according to the file to be detected.

[0228] The record extraction unit 913 is used to extract the log record corresponding to the to-be-detected file identifier from the system log.

[0229] The record filtering unit 915 is used to generate a behavior log of the file to be detected by filtering the log records according to the behavior identifier and the behavior triggering time.

[0230] See also Fig.21 In an exemplary embodiment, the operating environment is provided by a computer simulator.

[0231] Accordingly, the device 900 further includes but is not limited to: a sample input module 1010 and a record storage module 1030 .

[0232] The sample input module 1010 is used to input the file to be detected in the started computer simulator, and to perform simulated access to the file to be detected through the input of the file to be detected.

[0233] The record storage module 1030 is used to generate a log record of the file to be detected according to the behavior of the simulated triggering execution of the file to be detected during the process of the simulated access of the file to be detected, and store it in the system log.

[0234] See also Fig. 22 In an exemplary embodiment, the operating environment is an operating system installed and deployed in the user device.

[0235] Accordingly, the device 900 further includes but is not limited to: a sample operation module 1110 and a record storage module 1130 .

[0236] The sample running module 1110 is used to load the file to be detected in the operating system to run the file to be detected.

[0237] The record storage module 1130 is used to generate a log record of the file to be detected according to the behavior of the file to be detected being triggered to execute during the running process of the file to be detected, and store it in the system log.

[0238] See also Fig.23In an exemplary embodiment, the vector acquisition module 930 includes but is not limited to: an identification sorting unit 931 and an identification splicing unit 933 .

[0239] The identification sorting unit 931 is used to sort the behavior identifications according to the behavior triggering time in the behavior log.

[0240] The identification concatenation unit 933 is used to sequentially concatenate the sorted behavior identifications into a feature vector of the file to be detected.

[0241] For further information, see Fig.24 In an exemplary embodiment, the vector acquisition module 930 further includes but is not limited to: a consistency statistics unit 932 and an identification updating unit 934 .

[0242] The consistency statistics unit 932 is used to perform continuous consistency statistics on the sorted behavior identifiers to obtain the consistency times corresponding to the behavior identifiers.

[0243] The identifier updating unit 934 is used to update the corresponding behavior identifier according to the consistency number, so that the splicing is performed according to the updated behavior identifier.

[0244] See also Fig.25 In an exemplary embodiment, the device 900 further includes but is not limited to: a training data acquisition module 1210, a model building module 1230 and a parameter optimization module 1250.

[0245] The training data acquisition module 1210 is used to obtain the feature vector and sample label of the training sample, and the sample label is used to indicate whether the training sample is a virus.

[0246] The model building module 1230 is used to model the specified model structure of the feature vectors and sample labels of the training samples according to the long short-term memory network to obtain an artificial intelligence model.

[0247] The parameter optimization module 1250 is used to iteratively optimize the training parameters of the artificial intelligence model, and converge the artificial intelligence model into a virus detection model through iterative optimization of the training parameters.

[0248] See also Fig.26 In an exemplary embodiment, the training data acquisition module 1210 includes but is not limited to: a sample acquisition unit 1211 , a sample operation unit 1213 and a log conversion unit 1215 .

[0249] The sample acquisition unit 1211 is used to acquire training samples configured with sample labels.

[0250] The sample running unit 1213 is used to run the training sample in the running environment corresponding to the training sample to obtain the behavior log of the training sample.

[0251] The log conversion unit 1215 is used to convert the behavior identifier in the behavior log of the training sample into a feature vector of the training sample.

[0252] It should be noted that the virus detection device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when performing virus detection. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the virus detection device will be divided into different functional modules to complete all or part of the functions described above.

[0253] In addition, the virus detection device and the virus detection method provided in the above embodiments belong to the same concept, and the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.

[0254] In an exemplary embodiment, a virus detection device includes a processor and a memory. The electronic device may be a desktop computer, a laptop computer, a tablet computer, a smart phone, or a server, etc., which is not limited here.

[0255] The memory stores computer-readable instructions, which, when executed by the processor, implement the virus detection method in the above-mentioned embodiments.

[0256] In an exemplary embodiment, a computer-readable storage medium stores a computer program, which implements the virus detection method in the above embodiments when executed by a processor.

[0257] The above contents are only preferred exemplary embodiments of the present invention and are not intended to limit the implementation scheme of the present invention. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope required by the claims.

Claims

1. A virus detection method, It is characterized in that include: Obtaining a behavior log of the file to be detected, wherein the behavior log reflects the behavior of the file to be detected that is triggered to execute when the file to be detected is running in the corresponding running environment; Sort the behavior identifiers according to the behavior triggering time in the behavior log; Performing continuous consistency statistics on the sorted behavior identifiers to obtain the number of consistency times corresponding to the behavior identifiers, and updating the corresponding behavior identifiers according to the number of consistency times to obtain a sorting of the updated behavior identifiers; Sorting and splicing the updated behavior identifiers into a feature vector of the file to be detected; Calling a virus detection model to predict the feature vector of the file to be detected, obtaining a sample label of the file to be detected, and determining whether the file to be detected is a virus according to the sample label; Among them, the virus detection model is obtained by training the artificial intelligence model obtained by long short-term memory network modeling according to the feature vector and sample label of the training sample, and the feature vector of the training sample is converted based on the behavior log formed by the training sample in the corresponding operating environment.

2. The method according to claim 1, It is characterized in that The step of obtaining the behavior log of the file to be detected includes: Confirm the identification of the file to be tested according to the file to be tested; Extracting the log record corresponding to the to-be-detected file identifier from the system log; The behavior log of the file to be detected is generated by filtering the extracted log records according to the behavior identifier and the behavior triggering time.

3. The method according to claim 2, It is characterized in that The operating environment is provided by a computer simulator. Before extracting the log record corresponding to the to-be-detected file identifier from the system log, the method further includes: Inputting the file to be detected in the started computer simulator, and performing simulated access to the file to be detected through the input of the file to be detected; During the simulated access process of the file to be detected, a log record of the file to be detected is generated according to the simulated triggered execution behavior of the file to be detected, and is stored in the system log.

4. The method according to claim 2, It is characterized in that The operating environment is an operating system installed and deployed in the user device. Before extracting the log record corresponding to the to-be-detected file identifier from the system log, the method further includes: Loading the file to be detected in the operating system to run the file to be detected; During the running process of the file to be detected, a log record of the file to be detected is generated according to the behavior of the file to be detected being triggered to execute, and is stored in the system log.

5. The method according to any one of claims 1 to 4, It is characterized in that Before calling the virus detection model to predict the feature vector of the file to be detected and obtaining the sample label of the file to be detected, the method further includes: Acquire a feature vector and a sample label of the training sample, wherein the sample label is used to indicate whether the training sample is a virus; Modeling the feature vectors and sample labels of the training samples with a specified model structure according to a long short-term memory network to obtain an artificial intelligence model; The training parameters of the artificial intelligence model are iteratively optimized, and the artificial intelligence model is converged into the virus detection model through the iterative optimization of the training parameters.

6. The method according to claim 5, It is characterized in that The step of obtaining the feature vector and sample label of the training sample includes: Obtain training samples configured with sample labels; Running the training sample in the running environment corresponding to the training sample to obtain a behavior log of the training sample; The behavior identifier in the behavior log of the training sample is converted into a feature vector of the training sample.

7. A virus detection device, It is characterized in that include: A log acquisition module, used to acquire a behavior log of a file to be detected, wherein the behavior log reflects the behavior of the file to be detected that is triggered to execute when the file to be detected is running in a corresponding running environment; A vector acquisition module is used to sort the behavior identifiers according to the behavior trigger time in the behavior log; perform continuous consistency statistics on the sorted behavior identifiers to obtain the consistency times corresponding to the behavior identifiers, and update the corresponding behavior identifiers according to the consistency times to obtain the updated behavior identifier sorting; and splice the updated behavior identifier sorting into the feature vector of the file to be detected; A virus prediction module, used for calling a virus detection model to predict the file to be detected based on the feature vector of the file to be detected, obtaining a sample label of the file to be detected, and determining whether the file to be detected is a virus based on the sample label; Among them, the virus detection model is obtained by training the artificial intelligence model obtained by long short-term memory network modeling according to the feature vector and sample label of the training sample, and the feature vector of the training sample is converted based on the behavior log formed by the training sample in the corresponding operating environment.

8. The device according to claim 7, It is characterized in that The log acquisition module includes: An identification confirmation unit, used to confirm the identification of the file to be detected according to the file to be detected; A record extraction unit, used to extract the log record corresponding to the to-be-detected file identifier from the system log; The record filtering unit is used to generate the behavior log of the file to be detected by filtering the log record according to the behavior identifier and the behavior triggering time.

9. The device as claimed in claim 8, It is characterized in that The operating environment is provided by a computer simulator, and the device further comprises: A sample input module, used for inputting the file to be detected in the started computer simulator, and performing simulated access to the file to be detected through the input of the file to be detected; The record storage module is used to generate a log record of the file to be detected according to the behavior of the simulated triggering execution of the file to be detected during the simulated access process of the file to be detected, and store it in the system log.

10. The device according to claim 8, It is characterized in that The operating environment is an operating system installed and deployed in the user equipment, and the apparatus further includes: A sample running module, used for loading the file to be detected in the operating system to run the file to be detected; The record storage module is used to generate a log record of the file to be detected according to the behavior of the file to be detected being triggered to execute during the running process of the file to be detected, and store it in the system log.

11. The device according to any one of claims 7 to 10, It is characterized in that The device also includes: A training data acquisition module, used to acquire a feature vector and a sample label of the training sample, wherein the sample label is used to indicate whether the training sample is a virus; A model building module, used to model the feature vectors and sample labels of the training samples according to a long short-term memory network to obtain an artificial intelligence model; A parameter optimization module is used to iteratively optimize the training parameters of the artificial intelligence model, and converge the artificial intelligence model into the virus detection model through iterative optimization of the training parameters.

12. The device according to claim 11, It is characterized in that The training data acquisition module comprises: A sample acquisition unit, used to acquire training samples configured with sample labels; A sample running unit, used to run the training sample in a running environment corresponding to the training sample to obtain a behavior log of the training sample; The log conversion unit is used to convert the behavior identifier in the behavior log of the training sample into a feature vector of the training sample.

13. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the virus detection method according to any one of claims 1 to 6 is implemented.

14. A virus detection device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the virus detection method according to any one of claims 1 to 6 is implemented.