Computer virus scanning method and device
By performing virus scanning in collaboration between local terminals and collaborative terminals, the problem of long virus scanning time for the entire computer disk is solved, fast virus scanning is achieved, the scanning pressure of a single terminal is reduced, and the virus scanning efficiency is improved.
Patent Information
- Application Number
- CN202211664982.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-22
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-12-22
AI Technical Summary
In the prior art, a computer full disk virus scan takes too long, affecting the normal operation of other services on the user side, and limited system resources limit the virus scanning speed.
By obtaining the collaborative scanning strategy, the shared file directory of the local terminal is shared to the collaborative terminal for virus scanning, and the non-shared files are scanned on the local terminal to generate the final scanning results, and the virus scanning task is allocated by multi-terminal collaboration.
This shortens the virus scanning time of a single terminal, reduces the scanning pressure of a single terminal, and improves the virus scanning efficiency without affecting the normal operation of other services on the user side.
Smart Images

Figure CN116305109B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a computer virus scanning method and device. Background Art
[0002] With the rapid development of computer hardware and software, computer storage space is increasing, and the number of services and files it carries is increasing. This has led to a growing time spent on full-disk virus scans. Furthermore, due to limited computer system resources, full-disk virus scans often impact the normal operation of other user-side services. To ensure the normal operation of other user-side services, virus scans are often executed at a limited speed, further increasing the time required for full-disk virus scans.
[0003] Therefore, there is an urgent need for a faster virus scanning method that can solve the problem of long virus scanning time for the entire computer disk while ensuring the normal operation of other services on the user side to the greatest extent. Summary of the Invention
[0004] In view of this, an embodiment of the present invention provides a computer virus scanning method and device to solve the problem that the full disk virus scanning task of a single terminal is too long due to system resources and antivirus software virus scanning speed limitations, thereby affecting the normal operation of other services on the user side.
[0005] In a first aspect, an embodiment of the present invention provides a computer virus scanning method, applied to a terminal, the method comprising:
[0006] Obtaining a preset collaborative scanning strategy; the collaborative scanning strategy includes a non-collaborative scanning directory and a collaborative scanning directory, the non-collaborative scanning directory is used to represent non-shared files in the terminal, and the collaborative scanning directory is used to represent shared files in the terminal;
[0007] Scan the non-shared file for viruses to obtain a first scanning result;
[0008] Sharing the collaborative scanning directory to a preset collaborative terminal, so that the collaborative terminal performs a virus scan on the shared file to obtain a second scanning result;
[0009] receiving a second scanning result sent by the collaborative terminal;
[0010] A final scanning result is generated according to the first scanning result and the second scanning result.
[0011] Optionally, obtaining a preset collaborative scanning strategy includes:
[0012] Through the heartbeat connection with the management center, the collaborative scanning strategy issued by the management center is received.
[0013] Optionally, the collaborative scanning strategy also includes a collaborative terminal list;
[0014] Sharing the collaborative scanning directory to a preset collaborative terminal so that the collaborative terminal performs virus scanning on the shared file includes:
[0015] Determining at least one preset collaborative terminal according to the collaborative terminal list in the collaborative scanning strategy;
[0016] Obtain the network connectivity status of the collaborative terminal through the network diagnostic command to determine the target collaborative terminal for network connectivity;
[0017] The scanning task of the shared file is divided into scanning tasks corresponding to the number of target collaborative terminals, and the designated collaborative scanning directory corresponding to each scanning task is sent to each target collaborative terminal, so that each target collaborative terminal performs virus scanning on the shared file according to the received scanning task.
[0018] Optionally, the method further includes:
[0019] receiving a scanning task status returned by the collaborative terminal during the virus scanning process;
[0020] If a collaborative terminal whose scanning task status is interrupted is detected, unscanned file path information transmitted back by the collaborative terminal is obtained, and the unscanned file path information is shared with other collaborative terminals for virus scanning.
[0021] Optionally, generating a final scanning result according to the first scanning result and the second scanning result includes:
[0022] When it is determined that the scanning task statuses of the scanning tasks corresponding to the shared files are all completed, determining that all file scanning information returned by each collaborative terminal is the second scanning result;
[0023] A final scanning result is generated according to the first scanning result and the second scanning result.
[0024] Optionally, after receiving the second scanning result sent by the second server, the method further includes:
[0025] Close the sharing status of the shared file for the collaborative terminal that has completed scanning or the collaborative terminal that has been interrupted.
[0026] Optionally, sharing the collaborative scanning directory to a preset collaborative terminal includes:
[0027] The collaborative scanning directory is shared read-only to a preset collaborative terminal.
[0028] In a second aspect, an embodiment of the present invention provides a computer virus scanning device, the device comprising:
[0029] An acquisition unit is configured to acquire a preset collaborative scanning strategy; the collaborative scanning strategy includes a non-collaborative scanning directory and a collaborative scanning directory, wherein the non-collaborative scanning directory is used to represent non-shared files in the terminal, and the collaborative scanning directory is used to represent shared files in the terminal;
[0030] A scanning unit, performing virus scanning on the non-shared file to obtain a first scanning result;
[0031] A sharing unit, sharing the collaborative scanning directory to a preset collaborative terminal, so that the collaborative terminal performs a virus scan on the shared file to obtain a second scanning result;
[0032] A receiving unit, receiving a second scanning result sent by the cooperative terminal;
[0033] A result processing unit generates a final scanning result according to the first scanning result and the second scanning result.
[0034] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the computer virus scanning method described in the first aspect above.
[0035] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the computer virus scanning method described in the first aspect.
[0036] A computer virus scanning method and device provided by an embodiment of the present invention utilizes computer file sharing capabilities and, based on a collaborative scanning strategy, rationally allocates virus scanning tasks to local terminals and collaborative terminals, so that the local terminals and collaborative terminals respectively scan their corresponding files for viruses, thereby realizing multi-terminal collaborative scanning, reducing the scanning pressure of a single terminal, and thus shortening the full disk scanning time of a single terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 A flowchart of a computer virus scanning method provided by an embodiment of the present invention;
[0039] Figure 2 A schematic structural diagram of a computer virus scanning device provided by an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0042] It should be understood that the embodiments described are only a portion of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0043] The following is combined with Figure 1 , the solution provided by the embodiment of the present invention is described in detail, Figure 1 The flowchart of a computer virus scanning method provided by an embodiment of the present invention is a terminal. The terminal can be a terminal device, such as a personal computer, a desktop computer, etc. The terminal can also be a server. Figure 1 As shown, the method of this embodiment specifically includes the following steps:
[0044] Step 110: Obtain a preset collaborative scanning strategy.
[0045] In this application, the preset collaborative scanning strategy is set through the user interface function provided by the management center. This terminal receives the collaborative scanning strategy issued by the management center through the heartbeat connection between the terminal and the management center. The collaborative scanning strategy includes: a non-collaborative scanning directory and a collaborative scanning directory. The non-collaborative scanning directory is used to represent non-shared files in this terminal, and the collaborative scanning directory is used to represent shared files in this terminal.
[0046] Preferably, the cooperative scanning strategy may further include: a cooperative scanning enabling state and a cooperative scanning mode.
[0047] Step 120: Scan the non-shared file for viruses to obtain a first scanning result.
[0048] The terminal performs virus scanning on the non-shared files according to the non-cooperative scanning directory, and obtains a first scanning result after the terminal performs virus scanning on the files that cannot be shared with other terminals.
[0049] Step 130: Share the collaborative scanning directory to a preset collaborative terminal, so that the collaborative terminal performs virus scanning on the shared file to obtain a second scanning result.
[0050] It should be noted that the present application does not limit the order of step 120 and step 130. Step 120 and step 130 can be executed in any order or simultaneously.
[0051] This terminal shares the collaborative scan directory with the pre-set collaborative terminal in a read-only manner. After sharing the directory in a read-only manner, the pre-set collaborative terminal can scan these files but cannot modify them. The collaborative terminal performs a virus scan on the shared files based on the collaborative scan directory, and obtains the second scan results of the collaborative terminal's virus scan on these read-only shared files.
[0052] Specifically, the collaborative scanning strategy also includes a collaborative terminal list. Based on the collaborative terminal list in the collaborative scanning strategy, the terminal determines at least one pre-set collaborative terminal. These pre-set collaborative terminals are user-defined terminals that can perform collaborative scanning tasks in this virus scanning task. However, the network status of these pre-set collaborative terminals must be further verified to ensure that they are connected to the network and can complete the collaborative virus scanning task.
[0053] Therefore, this terminal also needs to use network diagnostic commands to obtain the network connectivity status of the preset collaborative terminals to determine the target collaborative terminals. After confirmation, this terminal divides the shared file scanning task into scanning tasks corresponding to the number of target collaborative terminals and sends the designated collaborative scanning directory corresponding to each scanning task to each target collaborative terminal, so that each target collaborative terminal can scan the shared files for viruses based on the received scanning tasks.
[0054] In a specific example, the network diagnosis command may be a ping command executed by calling cmd.exe to detect the network connectivity status of the collaborative terminal and count the number of collaborative terminals connected to the network.
[0055] Preferably, since the collaborative terminal may be interrupted by unexpected factors when performing virus scanning, such as the user manually terminating the virus scan on the collaborative terminal side, during the execution of this application, preferably during the execution of this step, the terminal also needs to monitor the scanning status of the collaborative terminal so that if the collaborative terminal interrupts the scanning task, the terminal can still assign the scanning task to another collaborative terminal that can perform scanning.
[0056] Specifically, the terminal receives the scan task status returned by the collaborative terminal during the virus scanning process. If it detects a collaborative terminal with an interrupted scan task status, it obtains the unscanned file path information returned by the collaborative terminal and shares the unscanned file path information with other collaborative terminals, allowing them to continue virus scanning.
[0057] At the same time, this terminal also needs to close the sharing status of the shared files for the interrupted collaborative terminal.
[0058] Step 140: Receive the second scanning result sent by the cooperative terminal.
[0059] The terminal receives the second scanning result sent by the cooperative terminal after performing virus scanning on the files that can be shared with other terminals.
[0060] In addition, this terminal also needs to close the sharing status of the shared file for the collaborative terminal that has completed the scan.
[0061] Step 150: Generate a final scanning result according to the first scanning result and the second scanning result.
[0062] If the scanning task status of all shared file scan tasks is determined to be completed, all file scan information returned by each collaborative terminal is determined to be the second scan result. Finally, a final scan result is generated based on the first scan result and the second scan result. This final scan result includes both the virus scan results of the local terminal side on the local non-shared files and the virus scan results of the collaborative terminal side on the local shared files, and is the result of a comprehensive virus scan of all local files.
[0063] It is understandable that in all the above statements, the collaborative scanning directory is set to be read-only and shared to the preset collaborative terminal.
[0064] Accordingly, an embodiment of the present application also provides a computer virus scanning device for implementing the above steps 110-150. Figure 2 A schematic diagram of the structure of a computer virus scanning device provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the computer virus scanning device of this embodiment may include:
[0065] The acquisition unit 210 acquires a preset collaborative scanning strategy; the collaborative scanning strategy includes a non-collaborative scanning directory and a collaborative scanning directory, the non-collaborative scanning directory is used to represent non-shared files in the terminal, and the collaborative scanning directory is used to represent shared files in the terminal;
[0066] The scanning unit 220 performs virus scanning on the non-shared file to obtain a first scanning result;
[0067] The sharing unit 230 shares the collaborative scanning directory with a preset collaborative terminal, so that the collaborative terminal performs a virus scan on the shared file to obtain a second scanning result;
[0068] A receiving unit 240 receives a second scanning result sent by the cooperative terminal;
[0069] The result processing unit 250 generates a final scanning result according to the first scanning result and the second scanning result.
[0070] Optionally, the acquiring unit 210 is further configured to:
[0071] Through the heartbeat connection with the management center, the collaborative scanning strategy issued by the management center is received.
[0072] Optionally, the collaborative scanning strategy also includes a collaborative terminal list;
[0073] The sharing unit 230 is further configured to:
[0074] Determining at least one preset collaborative terminal according to the collaborative terminal list in the collaborative scanning strategy;
[0075] Obtain the network connectivity status of the collaborative terminal through the network diagnostic command to determine the target collaborative terminal for network connectivity;
[0076] The scanning task of the shared file is divided into scanning tasks corresponding to the number of target collaborative terminals, and the designated collaborative scanning directory corresponding to each scanning task is sent to each target collaborative terminal, so that each target collaborative terminal performs virus scanning on the shared file according to the received scanning task.
[0077] Optionally, the device further includes a detection unit 260, and the detection unit 260 is configured to:
[0078] receiving a scanning task status returned by the collaborative terminal during the virus scanning process;
[0079] If a collaborative terminal whose scanning task status is interrupted is detected, the unscanned file path information returned by the collaborative terminal is obtained, so that the sharing unit 230 shares the unscanned file path information with other collaborative terminals for virus scanning.
[0080] Optionally, the result processing unit 250 is further configured to:
[0081] When it is determined that the scanning task statuses of the scanning tasks corresponding to the shared files are all completed, determining that all file scanning information returned by each collaborative terminal is the second scanning result;
[0082] A final scanning result is generated according to the first scanning result and the second scanning result.
[0083] Optionally, the sharing unit 230 is further configured to:
[0084] Close the sharing status of the shared file for the collaborative terminal that has completed scanning or the collaborative terminal that has been interrupted.
[0085] Optionally, the sharing unit 230 is further configured to:
[0086] The collaborative scanning directory is shared read-only to a preset collaborative terminal.
[0087] The device of this embodiment can be used to perform Figure 1 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.
[0088] Accordingly, the computer virus scanning device provided by the embodiment of the present invention can also be implemented with another structure. Figure 3 A schematic diagram of the structure of an electronic device embodiment provided by the present invention can implement the present invention Figure 1 The process of the embodiment shown is as follows: Figure 3 As shown, the electronic device may include: a housing 31, a processor 32, a memory 33, a circuit board 34, and a power supply circuit 35. The circuit board 34 is placed within the space enclosed by the housing 31, and the processor 32 and memory 33 are disposed on the circuit board 34. The power supply circuit 35 is used to supply power to various circuits or components of the electronic device. The memory 33 is used to store executable program code. The processor 32 reads the executable program code stored in the memory 33 to run a program corresponding to the executable program code, thereby executing the method described in the aforementioned embodiment.
[0089] For details on the specific execution process of the above steps by the processor 32 and the steps further executed by the processor 32 by running the executable program code, please refer to the present invention. Figure 1 The description of the illustrated embodiment will not be repeated here.
[0090] This electronic device: a device that provides computing services. The electronic device consists of a processor, hard disk, memory, system bus, etc. The electronic device is similar to the general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc.
[0091] It should be noted that, in this document, terms such as "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0092] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0093] In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0094] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable storage medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0095] More specific examples (a non-exhaustive list) of computer-readable storage media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable storage medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0096] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware or a combination thereof.
[0097] In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0098] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0099] For the convenience of description, the above device is described as being divided into various units / modules based on their functions. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.
[0100] From the above description of the embodiments, it can be seen that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention or certain parts of the embodiments.
Claims
1. A computer virus scanning method, characterized in that: Applied to a terminal, the method includes: Obtaining a preset collaborative scanning strategy; the collaborative scanning strategy includes a non-collaborative scanning directory and a collaborative scanning directory, the non-collaborative scanning directory is used to represent non-shared files in the terminal, and the collaborative scanning directory is used to represent shared files in the terminal; Scan the non-shared file for viruses to obtain a first scanning result; Sharing the collaborative scanning directory to a preset collaborative terminal, so that the collaborative terminal performs a virus scan on the shared file to obtain a second scanning result; receiving a second scanning result sent by the collaborative terminal; A final scanning result is generated according to the first scanning result and the second scanning result.
2. The method according to claim 1, characterized in that The obtaining of the preset collaborative scanning strategy includes: Through the heartbeat connection with the management center, the collaborative scanning strategy issued by the management center is received.
3. The method according to claim 1, characterized in that The collaborative scanning strategy also includes a collaborative terminal list; Sharing the collaborative scanning directory to a preset collaborative terminal so that the collaborative terminal performs virus scanning on the shared file includes: Determining at least one preset collaborative terminal according to the collaborative terminal list in the collaborative scanning strategy; Obtain the network connectivity status of the collaborative terminal through the network diagnostic command to determine the target collaborative terminal for network connectivity; The scanning task of the shared file is divided into scanning tasks corresponding to the number of target collaborative terminals, and the designated collaborative scanning directory corresponding to each scanning task is sent to each target collaborative terminal, so that each target collaborative terminal performs virus scanning on the shared file according to the received scanning task.
4. The method according to claim 1, wherein The method further comprises: receiving a scanning task status returned by the collaborative terminal during the virus scanning process; If a collaborative terminal whose scanning task status is interrupted is detected, unscanned file path information transmitted back by the collaborative terminal is obtained, and the unscanned file path information is shared with other collaborative terminals for virus scanning.
5. The method according to claim 4, characterized in that Generating a final scanning result according to the first scanning result and the second scanning result includes: When it is determined that the scanning task statuses of the scanning tasks corresponding to the shared files are all completed, determining that all file scanning information returned by each collaborative terminal is the second scanning result; A final scanning result is generated according to the first scanning result and the second scanning result.
6. The method according to claim 1, characterized in that After receiving the second scanning result sent by the cooperative terminal, the method further includes: Close the sharing status of the shared file for the collaborative terminal that has completed scanning or the collaborative terminal that has been interrupted.
7. The method according to any one of claims 1 to 6, characterized in that: The step of sharing the collaborative scanning directory to a preset collaborative terminal includes: The collaborative scanning directory is shared read-only to a preset collaborative terminal.
8. A computer virus scanning device, characterized in that: The device comprises: An acquisition unit is configured to acquire a preset collaborative scanning strategy; the collaborative scanning strategy includes a non-collaborative scanning directory and a collaborative scanning directory, wherein the non-collaborative scanning directory is used to represent non-shared files in the terminal, and the collaborative scanning directory is used to represent shared files in the terminal; A scanning unit, performing virus scanning on the non-shared file to obtain a first scanning result; A sharing unit, sharing the collaborative scanning directory to a preset collaborative terminal, so that the collaborative terminal performs a virus scan on the shared file to obtain a second scanning result; A receiving unit, receiving a second scanning result sent by the cooperative terminal; A result processing unit generates a final scanning result according to the first scanning result and the second scanning result.
9. An electronic device, characterized in that: The electronic device includes: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method described in any one of claims 1 to 7.
10. A computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, wherein the one or more programs can be executed by one or more processors to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
User sharing-based cloud scanning method
CN102073820A
Virus scanning method and system based on object storage gateway and electronic equipment
CN114915470A