Virus detection method, device, computer device and storage medium

By obtaining and comparing hash values ​​in computer devices and using blockchain networks for virus detection, it solves the problem of traditional virus detection relying on database update speed and achieves efficient virus detection.

CN111832018BActive Publication Date: 2024-09-17FU TAI HUA IND SHENZHEN +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910321502.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-19
Publication Date
2024-09-17
Estimated Expiration
2039-10-26

AI Technical Summary

Technical Problem

Traditional virus detection methods rely on the update speed of virus databases and cannot detect all viruses in a timely manner, resulting in low detection efficiency.

Method used

By obtaining the file list of the computer device, calculating the hash value and writing it to the blockchain, comparing the hash value of the original state and the working state, it is determined whether it is infected by the virus, independent of the update of the virus database.

Benefits of technology

The efficiency of virus detection is improved, so that virus detection no longer relies on the update efficiency of the virus database, and can detect all viruses, greatly improving detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111832018B
    Figure CN111832018B
Patent Text Reader

Abstract

The present invention provides a virus detection method, the method comprising: obtaining a list of files stored in a computer device, marking it as an original state list; calculating the hash value of the files listed in the original state list, and writing the hash value into a blockchain; obtaining a list of files stored in a computer device in a working state, marking it as a working state list; calculating the hash value of the files listed in the working state list; obtaining the hash value of the files listed in the original state list from a blockchain network, and comparing the hash value of the files listed in the original state list with the hash value of the files listed in the working state list; if the hash values ​​do not match, it is determined that the files with the inconsistent hash values ​​have been infected by a virus. The present invention can enable virus detection to be performed in a more independent and quick manner, and no longer rely on the update speed of viruses in a virus database.
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 computer virus detection method, a virus detection device, a computer device and a computer-readable storage medium. Background Art

[0002] In today's society, information technology is advanced, and computer devices surround every corner of our lives. There are very few people who do not use computer devices, so the security of computer devices is extremely important. If computer devices lose their security, in addition to endangering personal privacy, intellectual property, and computer systems, they may seriously cause major property losses, affecting the public or others, and the huge losses are often difficult to estimate. Computer viruses are one of the factors that endanger the security of computer devices. How to detect viruses, prevent virus invasion and infection, isolate and delete after virus infection, etc., has always been an important task of anti-virus and anti-virus software. In traditional virus detection methods, users need to open the security software on the computer device and rely on the virus detection method on the virus database of the security software for targeted detection. Therefore, the effect of virus detection depends on the update efficiency of the virus database, and the virus database of the security software cannot collect all viruses in time. Summary of the invention

[0003] In view of the above, it is necessary to propose a virus detection method and device, a computer device and a computer-readable storage medium, which can detect viruses in a more independent and quicker manner and no longer rely on the update speed of viruses in the virus database.

[0004] The first aspect of the present application provides a virus detection method, the method comprising:

[0005] Obtain a list of files stored in the computer device, and mark it as a list in an original state;

[0006] Calculate the hash value of the files listed in the original state list, and write the hash value into the blockchain;

[0007] Obtain a list of files stored in the computer device in the working state, and mark it as the working state list;

[0008] Calculate the hash values ​​of the files listed in the work status list;

[0009] Obtaining hash values ​​of the files listed in the original status list from the blockchain network, and comparing the hash values ​​of the files listed in the original status list with the hash values ​​of the files listed in the working status list;

[0010] If the hash value does not match, it is determined that the file with the inconsistent hash value has been infected by a virus.

[0011] Preferably, the archive list includes application and / or system archive names and archive path names.

[0012] Preferably, the method for calculating the hash value of the archives listed in the original status list includes:

[0013] Get the names and path names of all archives in the original state list;

[0014] A hash value of the file name and the path name is calculated using a preset algorithm according to the file name and the path name.

[0015] Preferably, the preset algorithm includes any one of SHA224, SHA256, SHA384, SHA512, SHA1, SHA2 or MD5.

[0016] Preferably, the method for obtaining the hash value of the archives listed in the original status list from the blockchain network is:

[0017] After the computer device is connected to the blockchain network, a scanning program is executed, and the scanning program obtains a list of programs and system files on the blockchain by scanning blockchain node information.

[0018] Preferably, the method of comparing the hash values ​​of the files listed in the original status list with the hash values ​​of the files listed in the working status list comprises:

[0019] Get the hash values ​​of the archives and archive paths listed in the work status list;

[0020] According to the hash value of the file path in the working status list, search in the original status list for the file path that has the same hash value as the file path;

[0021] Compare the hash values ​​of the documents under the same archive path in the working status list and the original status list.

[0022] A second aspect of the present application provides a virus detection device, the device comprising:

[0023] A first acquisition module is used to acquire a list of files stored in the computer device, marked as an original state list;

[0024] A first calculation module, used to calculate the hash value of the files listed in the original state list, and write the hash value into the blockchain;

[0025] A second acquisition module is used to acquire a list of files stored in the computer device in a working state, marked as a working state list;

[0026] A second calculation module calculates the hash values ​​of the files listed in the working status list;

[0027] A comparison module, which obtains hash values ​​of the files listed in the original status list from the blockchain network, and compares the hash values ​​of the files listed in the original status list with the hash values ​​of the files listed in the working status list;

[0028] The determination module is used for determining that the file having the inconsistent hash value has been infected by a virus when the hash value does not match.

[0029] A third aspect of the present application provides a computer device, the computer device comprising a processor, the processor being configured to implement the above-mentioned virus detection method when executing a computer program stored in a memory.

[0030] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the virus detection method as described above when executed by a processor.

[0031] The virus detection method of the present invention makes the efficiency of virus detection no longer rely on the updating efficiency of the virus database, so that virus detection can target all viruses and no longer needs to design a corresponding detection method for a certain virus, thereby greatly improving the efficiency of virus detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a schematic diagram of the application environment architecture of the virus detection method provided in Example 1 of the present invention.

[0033] Figure 2 This is a flow chart of the virus detection method provided in Example 2 of the present invention.

[0034] Figure 3 It is a schematic diagram of the structure of a virus detection device provided in Embodiment 3 of the present invention.

[0035] Figure 4 It is a schematic diagram of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0036] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0037] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0039] Embodiment 1

[0040] See also Figure 1 , which is a schematic diagram of the application environment architecture of the virus detection method provided in the first embodiment of the present invention.

[0041] The virus detection method of the present invention is applied in a computer device 1. After the computer device 1 establishes a communication connection with a node 10 in any blockchain in the blockchain network 100, the file list stored in the computer device 1 is sent to the node 10 in the blockchain.

[0042] The computer device 1 can be any electronic product, for example, a smart phone, a tablet computer, a laptop computer, a desktop computer, smart home appliances in the smart home field (such as smart TVs, smart air conditioners, smart electric fans, etc.), smart monitoring computer devices in the environmental monitoring field, and smart computer devices in various fields such as smart agriculture, smart grid, smart transportation, and smart medical care, which are not listed here one by one.

[0043] Blockchain is a decentralized storage and computing technology that generates a persistent, unmodifiable record by stacking encrypted data blocks in chronological order, and stores the record in each node 10 of the blockchain network 100, so that a reliable database is collectively maintained in a decentralized manner.

[0044] The blockchain network 100 may be a public blockchain network, a consortium blockchain network, or a private blockchain network.

[0045] Embodiment 2

[0046] See also Figure 2 FIG. 1 is a flow chart of a virus detection method provided by a second embodiment of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.

[0047] Step S1, obtaining a list of files stored in a computer device, and marking it as an original state list.

[0048] The archive list contains archive names and pathnames to application and / or system archives.

[0049] In one embodiment of the present invention, the path name and file name of the program and / or system file contained in the computer device are obtained through the CMD command prompt in Windows. The path name and file name of the program and / or system file contained in any hard disk under the operating program are retrieved through the command prompt, and the resource manager reads the information of the command prompt and outputs the file name and path name of the program file and system file to be queried by the command prompt in a .txt format file.

[0050] In another embodiment of the present invention, the file names and path names of all files stored in each partition of the computer device are obtained by executing a preset script written in a programming language such as JAVA or C++.

[0051] Step S2: Calculate the hash value of the files listed in the original state list, and write the hash value into the blockchain.

[0052] The method for calculating the hash value of the files listed in the original status list may be:

[0053] Get the names and path names of all archives in the original state list;

[0054] A hash value of the archive name and the path name is calculated according to the archive name and the path name.

[0055] The algorithm includes any one of SHA224, SHA256, SHA384, SHA512, SHA1, SHA2 or MD5.

[0056] In one embodiment of the present invention, all the archive names and archive path names in the acquired original status list are used to calculate the hash values ​​of the archive names and archive path names using an existing algorithm, for example, using MD5 (Message Digest Algorithm 5 message digest algorithm fifth edition) to obtain a 128-bit hash value. In another embodiment, SHA1 (Secure Hash Algorithm secure hash algorithm) is used to obtain a 160-bit hash value. Any existing algorithm can be used to obtain a hash value of any size.

[0057] In one embodiment of the present invention, after the computer device sends the names and path names of all the files in the original state list to the nodes of the blockchain network for broadcasting, the nodes in the blockchain network that have the right to record accounts verify the legitimacy of the names and path names of all the files in the original state list, and then write the names and path names of all the files in the original state list into the blockchain through a consensus mechanism.

[0058] Step S3, obtaining a list of files stored in the computer device in the working state, and marking it as the working state list.

[0059] The working state refers to the state of the computer device after being connected to a network, and the network includes but is not limited to the World Wide Web and Ethernet.

[0060] In one embodiment of the present invention, the path name and file name of the program and / or system file included in the computer device are obtained through the CMD command prompt in Windows.

[0061] In another embodiment of the present invention, all file names and paths under each partition of the computer device are obtained by executing a preset script written in a programming language such as JAVA or C++.

[0062] Step S4: Calculate the hash values ​​of the files listed in the work status list.

[0063] In one embodiment of the present invention, the method for calculating the hash value of the files listed in the working status list can be: obtaining the names and path names of all the files in the working status list; and calculating the hash value of the file name and path name according to the file name and path name using any one of the algorithms SHA224, SHA256, SHA384, SHA512, SHA1, SHA2 or MD5.

[0064] Step S5: On the blockchain network, obtain the hash value of the files listed in the original status list, and compare the hash value of the files listed in the original status list with the hash value of the files listed in the working status list.

[0065] On the blockchain network, the method for obtaining the hash value of the archive stored in the original state list can be:

[0066] After the computer device is connected to the blockchain network, a scanning program is executed, and the scanning program obtains a list of programs and system files on the blockchain by scanning blockchain node information.

[0067] In one embodiment of the present invention, the computer device is connected to the blockchain network after being turned on. By utilizing the fact that the node information of the blockchain network cannot be tampered with, the application Block Chain Virus Scan is used to obtain the file names on the blockchain nodes and the paths corresponding to each file name. The blockchain node is the location where the computer device uploads the file list stored in the computer device to the blockchain node in its original state.

[0068] The method of comparing the hash values ​​of the files listed in the original status list with the hash values ​​of the files listed in the working status list may be:

[0069] Get the hash values ​​of the archives and archive paths listed in the work status list;

[0070] According to the hash value of the file path in the working status list, search in the original status list for the file path that has the same hash value as the file path;

[0071] Compare the hash values ​​of the documents under the same archive path in the working status list and the original status list.

[0072] In one embodiment of the present invention, the listed archives and archive paths in the working status list are obtained, and an algorithm is used to calculate the hash value of the archive path listed in the working status list, and the algorithm can be any one of SHA224, SHA256, SHA384, SHA512, SHA1, SHA2 or MD5. According to the archive path in the working status table, the archive path with the same hash value as the archive path in the working status table is searched in the original status table. Under the same archive path, the hash values ​​of the documents in the working status list and the documents in the original status list are compared to see if they are consistent.

[0073] Step S6: If the hash value does not match, it is determined that the file with the inconsistent hash value has been infected by a virus.

[0074] In one embodiment of the present invention, under the same archive path, if the hash value of a document in the working status list is inconsistent with the hash value of a document in the original status list, it means that the document with inconsistent hash value has been infected by a virus.

[0075] In another embodiment of the present invention, when a computer device cannot be turned on due to a virus, the memory of the infected computer device can be connected to an uninfected computer device, and the uninfected computer device can be connected to the blockchain. The blockchain node information is scanned by a scanning program to obtain a list of all programs and system files in the memory, and a working status list is obtained. The hash values ​​of the files and file paths in the working status list are calculated by an algorithm, and the hash values ​​of the documents under a path in the working status list of the memory are compared with the hash values ​​of the documents under the same path in the original file list. If the hash value of a file in the working status list is inconsistent with the hash value of the file in the original file list, it means that the document has been infected.

[0076] In another embodiment of the present invention, if the file is determined to be infected, the name and file path of the infected file are displayed in a preset prompt and sent to a preset user. The prompt includes but is not limited to a text prompt, an email prompt, or a text message prompt.

[0077] Above Figure 2The virus detection method of the present invention is introduced in detail. The functional modules of the software device for implementing the virus detection method and the architecture of the hardware device for implementing the virus detection method are introduced below in conjunction with Figures 3-4.

[0078] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited by this structure.

[0079] Embodiment 3

[0080] Figure 3 FIG. 4 is a structural diagram of a preferred embodiment of the virus detection device of the present invention.

[0081] In some embodiments, the virus detection device 20 runs in the computer device 1. The virus detection device 20 may include multiple functional modules composed of program code segments. The program code of each program segment in the virus detection device 20 may be stored in the memory of the computer device 1 and executed by the at least one processor to implement the virus detection function.

[0082] In this embodiment, the virus detection device 20 can be divided into multiple functional modules according to the functions it performs. Figure 3 As shown, the functional modules may include: a first acquisition module 201, a first calculation module 202, a second acquisition module 203, a second calculation module 204, a comparison module 205, and a determination module 206. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

[0083] The first acquisition module 201 is used to acquire a file list stored in a computer device, which is marked as an original state list.

[0084] The archive list contains archive names and pathnames to application and / or system archives.

[0085] In one embodiment of the present invention, the path name and file name of the program and / or system file contained in the computer device are obtained through the CMD command prompt in Windows. The path name and file name of the program and / or system file contained in any hard disk under the operating program are retrieved through the command prompt, and the resource manager reads the information of the command prompt and outputs the file name and path name of the program file and system file to be queried by the command prompt in a .txt format file.

[0086] In another embodiment of the present invention, the file names and path names of all files stored in each partition of the computer device are obtained by executing a preset script written in a programming language such as JAVA or C++.

[0087] The first calculation module 202 is used to calculate the hash value of the files listed in the original state list and write the hash value into the blockchain.

[0088] The method for calculating the hash value of the files listed in the original status list may be:

[0089] Get the names and path names of all archives in the original state list;

[0090] A hash value of the archive name and the path name is calculated according to the archive name and the path name.

[0091] The algorithm includes any one of SHA224, SHA256, SHA384, SHA512, SHA1, SHA2 or MD5.

[0092] In one embodiment of the present invention, all the archive names and archive path names in the acquired original status list are used to calculate the hash values ​​of the archive names and archive path names using an existing algorithm, for example, using MD5 (Message Digest Algorithm 5 message digest algorithm fifth edition) to obtain a 128-bit hash value. In another embodiment, SHA1 (Secure Hash Algorithm secure hash algorithm) is used to obtain a 160-bit hash value. Any existing algorithm can be used to obtain a hash value of any size.

[0093] In one embodiment of the present invention, after the computer device sends the names and path names of all the files in the original state list to the nodes of the blockchain network for broadcasting, the nodes in the blockchain network that have the right to record accounts verify the legitimacy of the names and path names of all the files in the original state list, and then write the names and path names of all the files in the original state list into the blockchain through a consensus mechanism.

[0094] The second acquisition module 203 acquires a file list stored in the computer device in the working state, and marks it as a working state list.

[0095] The working state refers to the state of the computer device after being connected to a network, and the network includes but is not limited to the World Wide Web and Ethernet.

[0096] In one embodiment of the present invention, the path name and file name of the program and / or system file included in the computer device are obtained through the CMD command prompt in Windows.

[0097] In another embodiment of the present invention, all file names and paths under each partition of the computer device are obtained by executing a preset script written in a programming language such as JAVA or C++.

[0098] The second calculation module 204 is used to calculate the hash values ​​of the files listed in the working status list.

[0099] In one embodiment of the present invention, the method for calculating the hash value of the files listed in the working status list can be: obtaining the names and path names of all the files in the working status list; and calculating the hash value of the file name and path name according to the file name and path name using any one of the algorithms SHA224, SHA256, SHA384, SHA512, SHA1, SHA2 or MD5.

[0100] The comparison module 205 is used to obtain the hash values ​​of the files listed in the original status list on the blockchain network, and compare the hash values ​​of the files listed in the original status list with the hash values ​​of the files listed in the working status list.

[0101] On the blockchain network, the method for obtaining the hash value of the archive stored in the original state list can be:

[0102] After the computer device is connected to the blockchain network, a scanning program is executed, and the scanning program obtains a list of programs and system files on the blockchain by scanning blockchain node information.

[0103] In one embodiment of the present invention, the computer device is connected to the blockchain network after being turned on. By utilizing the fact that the node information of the blockchain network cannot be tampered with, the application Block Chain Virus Scan is used to obtain the file names on the blockchain nodes and the paths corresponding to each file name. The blockchain node is the location where the computer device uploads the file list stored in the computer device to the blockchain node in its original state.

[0104] The method of comparing the hash values ​​of the files listed in the original status list with the hash values ​​of the files listed in the working status list may be:

[0105] Get the hash values ​​of the archives and archive paths listed in the work status list;

[0106] According to the hash value of the file path in the working status list, search in the original status list for the file path that has the same hash value as the file path;

[0107] Compare the hash values ​​of the documents under the same archive path in the working status list and the original status list.

[0108] In one embodiment of the present invention, the listed archives and archive paths in the working status list are obtained, and an algorithm is used to calculate the hash value of the archive path listed in the working status list, and the algorithm can be any one of SHA224, SHA256, SHA384, SHA512, SHA1, SHA2 or MD5. According to the archive path in the working status table, the archive path with the same hash value as the archive path in the working status table is searched in the original status table. Under the same archive path, the hash values ​​of the documents in the working status list and the documents in the original status list are compared to see if they are consistent.

[0109] The determination module 206 is used for determining that the file having the inconsistent hash value has been infected by a virus when the hash value does not match.

[0110] In one embodiment of the present invention, under the same archive path, if the hash value of a document in the working status list is inconsistent with the hash value of a document in the original status list, it means that the document with inconsistent hash value has been infected by a virus.

[0111] In another embodiment of the present invention, when a computer device cannot be turned on due to a virus, the memory of the infected computer device can be connected to an uninfected computer device, and the uninfected computer device can be connected to the blockchain. The blockchain node information is scanned by a scanning program to obtain a list of all programs and system files in the memory, and a working status list is obtained. The hash values ​​of the files and file paths in the working status list are calculated by an algorithm, and the hash values ​​of the documents under a path in the working status list of the memory are compared with the hash values ​​of the documents under the same path in the original file list. If the hash value of a file in the working status list is inconsistent with the hash value of the file in the original file list, it means that the document has been infected.

[0112] In another embodiment of the present invention, if the file is determined to be infected, the name and file path of the infected file are displayed in a preset prompt and sent to a preset user. The prompt includes but is not limited to a text prompt, an email prompt, or a text message prompt.

[0113] Embodiment 4

[0114] Figure 4 FIG. 4 is a schematic diagram of a preferred embodiment of a computer device of the present invention.

[0115] The computer device 1 includes a memory 30, a processor 40, and a computer program 50 stored in the memory 30 and executable on the processor 40, such as a virus detection program. When the processor 40 executes the computer program 50, the steps in the above-mentioned virus detection method embodiment are implemented, such as Figure 2Alternatively, when the processor 40 executes the computer program 50, the functions of each module / unit in the above-mentioned virus detection device embodiment are realized, for example Figure 3 Units 201-206 in.

[0116] Exemplarily, the computer program 50 may be divided into one or more modules / units, which are stored in the memory 30 and executed by the processor 40 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 50 in the computer device 1. For example, the computer program 50 may be divided into Figure 3 The first acquisition module 201, the first calculation module 202, the second acquisition module 203, the second calculation module 204, the comparison module 205, and the determination module 206. The specific functions of each module refer to the third embodiment.

[0117] The computer device 1 may be a desktop computer, a notebook, a PDA, a cloud server, etc. A person skilled in the art may understand that the schematic diagram is only an example of the computer device 1 and does not limit the computer device 1. The computer device 1 may include more or fewer components than shown in the figure, or may combine certain components, or different components. For example, the computer device 1 may also include an input and output computer device, a network access computer device, a bus, etc.

[0118] The processor 40 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 40 may be any conventional processor, etc. The processor 40 is the control center of the computer device 1, and uses various interfaces and lines to connect various parts of the entire computer device 1.

[0119] The memory 30 can be used to store the computer program 50 and / or modules / units. The processor 40 implements various functions of the computer device 1 by running or executing the application programs and / or modules / units stored in the memory 30 and calling the data stored in the memory 30. The memory 30 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the computer device 1 (such as audio data, a phone book, etc.), etc. In addition, the memory 30 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0120] If the module / unit integrated in the computer device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer device readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through an application program. The application program can be stored in a computer readable storage medium, and the application program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the application program includes an application program code, and the application program code can be in the form of source code, object code, executable file or some intermediate form. The readable medium may include: any entity or device capable of carrying the application program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium.

[0121] In the several embodiments provided by the present invention, it should be understood that the disclosed application terminal and method can be implemented in other ways. For example, the application terminal embodiment described above is only illustrative, for example, the division of the unit is only a logical function division, and there may be other division methods in actual implementation.

[0122] In addition, each functional unit in each embodiment of the present invention may be integrated into the same processing unit, each unit may exist physically separately, or two or more units may be integrated into the same unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0123] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or application terminals stated in the application terminal claims can also be implemented by the same unit or application terminal through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A virus detection method, characterized in that: The method comprises: Obtain a list of files stored in the computer device, marked as an original state list, wherein the list of files includes application and / or system file names and file path names, and the original state list is a list of files in the original state of the computer device after the computer device is connected to the blockchain network, and the original state list is stored in the blockchain network; Calculate the hash value of the files listed in the original state list, and write the hash value into the blockchain; Obtain a list of files stored in the computer device in the working state, and mark it as the working state list; Calculate the hash values ​​of the files listed in the work status list; Obtaining hash values ​​of files listed in the original status list from the blockchain network, and comparing the hash values ​​of the files listed in the original status list with the hash values ​​of the files listed in the working status list, including: obtaining hash values ​​of the files and file paths listed in the working status list; searching for a file path in the original status list that is identical to the hash value of the file path according to the hash value of the file path in the working status list; comparing hash values ​​of documents under the same file path in the working status list and the original status list; If the hash value does not match, it is determined that the file with the inconsistent hash value has been infected by a virus; The memory of the computer device to be detected is connected to a computer device that is not infected by a virus, and the computer device that is not infected by a virus is connected to the blockchain network. If the computer device to be detected cannot be turned on, the computer device to be detected is tested for viruses by the computer device that is not infected by a virus. The computer device to be detected is a computer device that needs to be tested for viruses, and the memory stores a working status list of the computer device to be detected.

2. The virus detection method according to claim 1, characterized in that: The method for calculating the hash value of the files listed in the original status list includes: Get the names and path names of all archives in the original state list; A hash value of the file name and the path name is calculated using a preset algorithm according to the file name and the path name.

3. The virus detection method according to claim 2, characterized in that: The preset algorithm includes any one of SHA224, SHA256, SHA384, SHA512, SHA1, SHA2 or MD5.

4. The virus detection method according to claim 1, characterized in that: The method for obtaining the hash value of the archive listed in the original status list from the blockchain network is: After the computer device is connected to the blockchain network, a scanning program is executed, and the scanning program obtains a list of programs and system files on the blockchain by scanning blockchain node information.

5. A virus detection device, characterized in that: The device comprises: A first acquisition module is used to acquire a list of files stored in a computer device, which is marked as an original state list. The list of files includes application and / or system file names and file path names. The original state list is a list of files in the original state of the computer device after the computer device is connected to the blockchain network. The original state list is stored in the blockchain network. A first calculation module, used to calculate the hash value of the files listed in the original state list, and write the hash value into the blockchain; A second acquisition module is used to acquire a list of files stored in the computer device in a working state, marked as a working state list; A second calculation module calculates the hash values ​​of the files listed in the working status list; The comparison module obtains the hash values ​​of the files listed in the original state list from the blockchain network, and compares the hash values ​​of the files listed in the original state list with the hash values ​​of the files listed in the working state list, including: obtaining the hash values ​​of the files and file paths listed in the working state list; searching the original state list for the file path that is the same as the hash value of the file path according to the hash value of the file path in the working state list; comparing the hash values ​​of the documents under the same file path in the working state list and the original state list; A determination module, used for determining that the file having the inconsistent hash value has been infected by a virus when the hash value does not match; The memory of the computer device to be detected is connected to a computer device that is not infected by a virus, and the computer device that is not infected by a virus is connected to the blockchain network. If the computer device to be detected cannot be turned on, the computer device to be detected is tested for viruses by the computer device that is not infected by a virus. The computer device to be detected is a computer device that needs to be tested for viruses, and the memory stores a working status list of the computer device to be detected.

6. A computer device, characterized in that: The computer device comprises a processor, and the processor is used to implement the virus detection method according to any one of claims 1 to 4 when executing a computer program stored in a memory.

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