Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a virus intelligent scanning processing method and a device.
The embodiment of the invention provides an intelligent virus scanning processing method, which is applied to a central control system and comprises the following steps:
judging whether the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task or not for any virtual machine in the service range of the central control system;
if the virtual machine load condition reported by the current virtual machine does not meet the preset starting condition of the virus scanning task, determining that the virus scanning task is started in a delayed mode, and after the preset delay time period, returning to the step of judging whether the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task or not until the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task.
Optionally, before determining, for any virtual machine within the service range of the central control system, whether the load condition of the virtual machine reported by the current virtual machine meets a preset starting condition of the virus scanning task, the method further includes:
and receiving the load condition of the virtual machines reported by all the virtual machines in the service range of the central control system every a preset time period.
Optionally, the virtual machine load condition includes: at least one of a CPU occupancy rate of the virtual machine and a memory occupancy rate of the virtual machine.
Optionally, for any virtual machine within the service range of the central control system, determining whether the load condition of the virtual machine reported by the current virtual machine meets a preset starting condition of the virus scanning task, including:
for any virtual machine within the service range of the central control system, if the CPU occupancy rate of the virtual machine reported by the current virtual machine is greater than a preset CPU occupancy rate threshold value and/or the memory occupancy rate of the virtual machine reported by the current virtual machine is greater than a preset memory occupancy rate threshold value, determining that the load condition of the virtual machine reported by the current virtual machine does not meet the preset starting condition of the virus scanning task, and otherwise, determining that the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task.
Optionally, after determining, for any virtual machine within the service range of the central control system, whether the load condition of the virtual machine reported by the current virtual machine meets a preset starting condition of the virus scanning task, the method further includes:
and if the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task, sending a command for starting the virus scanning task to the current virtual machine.
Optionally, after sending an instruction to start a virus scanning task to the current virtual machine, the method further includes:
and if the virus scanning task of the current virtual machine is not started after the preset timeout period is detected, canceling the virus scanning task of the current virtual machine.
The embodiment of the invention provides an intelligent virus scanning and processing device, which is applied to a central control system and comprises:
the judging module is used for judging whether the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task or not for any virtual machine in the service range of the central control system;
and the delay module is used for determining the delayed start of the virus scanning task if the virtual machine load condition reported by the current virtual machine does not meet the preset start condition of the virus scanning task, and returning to execute the judging module after a preset delay time period until the virtual machine load condition reported by the current virtual machine meets the preset start condition of the virus scanning task.
An embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the method are implemented.
Embodiments of the present invention provide a non-transitory computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the method as described above.
Embodiments of the present invention provide a computer program product comprising computer executable instructions for implementing the steps of the above method when executed.
The method and the device for processing the intelligent virus scanning provided by the embodiment of the invention judge whether the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task or not by aiming at any virtual machine in the service range of the central control system, if not, the virus scanning task is determined to be started in a delayed manner, after the preset delay time period, returning to the step of judging whether the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task or not until the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task, therefore, the intelligent virus scanning of the virtual machines in the server can be realized, the problem that the response of the server is slow due to the fact that the virus scanning is executed on the virtual machines in the server under the condition that the system resources of the server are too high is avoided, and the influence of the virus scanning on the occupied server resources is reduced to the minimum.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 shows a schematic flowchart of a virus intelligent scanning processing method according to an embodiment of the present invention, and referring to fig. 1, the virus intelligent scanning processing method according to the embodiment includes:
and S1, judging whether the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task or not for any virtual machine in the service range of the central control system.
It should be noted that the intelligent virus scanning processing method described in this embodiment is applied to a central control system, which is a device for centrally controlling various devices such as sound, light, electricity, and the like, and is applied to a multimedia classroom, a multifunctional conference hall, a command control center, an intelligent home, and the like.
In a specific application, the load condition of the virtual machine according to this embodiment may include: at least one of a CPU (Central processing Unit) occupancy rate of the virtual machine and a memory occupancy rate of the virtual machine. The CPU occupancy rate of the virtual machine is the occupancy rate of the virtual machine occupying the CPU of the server to which the virtual machine belongs, and the memory occupancy rate of the virtual machine is the occupancy rate of the virtual machine occupying the memory of the server to which the virtual machine belongs.
It can be understood that, in this embodiment, it is required to first determine, for any virtual machine within the service range of the central control system, whether the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task, so as to implement the virus intelligent scanning processing on the current virtual machine according to the determination result in the following.
And S2, if the virtual machine load condition reported by the current virtual machine does not meet the preset starting condition of the virus scanning task, determining that the virus scanning task is started in a delayed mode, and after a preset delay time period, returning to the step of judging whether the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task or not until the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task.
In a specific application, the preset delay time period may be set according to an actual situation, and this embodiment does not limit this, for example, the preset delay time period may be set to 10 minutes, half an hour, 1 hour, and the like.
It can be understood that, in this embodiment, after determining whether the virtual machine load condition reported by the current virtual machine satisfies the preset starting condition of the virus scanning task, for the case that the virtual machine load condition reported by the current virtual machine does not satisfy the preset starting condition of the virus scanning task, it indicates that the resource occupied by the current virtual machine on the server to which the current virtual machine belongs is too high, it may be determined that the virus scanning task is started in a delayed manner, and after a preset delay time period, the step S1 is returned to re-determine whether the virtual machine load condition reported by the current virtual machine satisfies the preset starting condition of the virus scanning task, so as to avoid the problem that the response of the server is slow when the virtual machine in the server executes virus scanning under the condition that the system resource of the server is too high.
It can be understood that, in this embodiment, first, for any virtual machine within the service range of the central control system, it is determined whether the load condition of the virtual machine reported by the current virtual machine satisfies the preset starting condition of the virus scanning task, and for the condition that the load condition of the virtual machine reported by the current virtual machine does not satisfy the preset starting condition of the virus scanning task, it is determined that the virus scanning task is started in a delayed manner, and after a preset delay time period, it returns to step S1 to re-determine whether the load condition of the virtual machine reported by the current virtual machine satisfies the preset starting condition of the virus scanning task, so that the virus scanning of the current virtual machine can avoid a peak period of server resource occupation, and the influence of the server resource occupation by the virus scanning is reduced to the minimum.
The intelligent virus scanning processing method provided by the embodiment of the invention judges whether the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task or not for any virtual machine in the service range of the central control system, if not, the delayed starting of the virus scanning task is determined, after the preset delay time period, returning to the step of judging whether the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task or not until the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task, therefore, the intelligent virus scanning of the virtual machines in the server can be realized, the problem that the response of the server is slow due to the fact that the virus scanning is executed on the virtual machines in the server under the condition that the system resources of the server are too high is avoided, and the influence of the virus scanning on the occupied server resources is reduced to the minimum.
Based on the content of the foregoing embodiment, in this embodiment, before determining, for any virtual machine within the service range of the central control system, whether the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task, the method in this embodiment may further include:
and receiving the load condition of the virtual machines reported by all the virtual machines in the service range of the central control system every a preset time period.
In a specific application, the preset time period may be set according to actual conditions, and the present embodiment does not limit this, for example, the preset time period may be set to 5 minutes, 10 minutes, half an hour, and the like.
It can be understood that, in this embodiment, each virtual machine within the service range of the central control system reports its own virtual machine load condition to the central control system every other preset time period, so that the central control system can conveniently determine whether the preset start condition of the virus scanning task is satisfied according to the virtual machine load condition newly reported by each virtual machine, and thus, the virus intelligent scanning processing of each virtual machine within the service range of the central control system can be realized according to the determination result in the following.
Based on the content of the foregoing embodiment, in this embodiment, when the virtual machine load condition includes: when at least one of the CPU occupancy rate of the virtual machine and the memory occupancy rate of the virtual machine is satisfied, the determining, for any virtual machine within the service range of the central control system, whether the virtual machine load condition reported by the current virtual machine satisfies the preset starting condition of the virus scanning task may specifically include:
for any virtual machine within the service range of the central control system, if the CPU occupancy rate of the virtual machine reported by the current virtual machine is greater than a preset CPU occupancy rate threshold value and/or the memory occupancy rate of the virtual machine reported by the current virtual machine is greater than a preset memory occupancy rate threshold value, determining that the load condition of the virtual machine reported by the current virtual machine does not meet the preset starting condition of the virus scanning task, and otherwise, determining that the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task.
In a specific application, the preset CPU occupancy threshold may be set according to an actual situation, and this embodiment does not limit this, for example, the preset CPU occupancy threshold may be set to 60%, 63%, 65%, and the like.
In a specific application, the preset memory occupancy threshold may be set according to an actual situation, and the preset memory occupancy threshold is not limited in this embodiment, for example, the preset memory occupancy threshold may be set to 60%, 63%, 65%, and the like.
It can be understood that, in this embodiment, as long as any one of the following three conditions occurs, it may be determined that the virtual machine load condition reported by the current virtual machine does not satisfy the preset starting condition of the virus scanning task:
(1) the CPU occupancy rate of the virtual machine reported by the current virtual machine is greater than a preset CPU occupancy rate threshold value;
(2) the memory occupancy rate of the virtual machine reported by the current virtual machine is greater than a preset memory occupancy rate threshold value;
(3) the CPU occupancy rate of the virtual machine reported by the current virtual machine is greater than the preset CPU occupancy rate threshold value, and the memory occupancy rate of the virtual machine reported by the current virtual machine is greater than the preset memory occupancy rate threshold value.
It can be understood that, in this embodiment, the CPU occupancy rate of the virtual machine reported by the current virtual machine is greater than the preset CPU occupancy rate threshold, and the memory occupancy rate of the virtual machine reported by the current virtual machine is less than or equal to the preset memory occupancy rate threshold, which belongs to the above (1) case where the CPU occupancy rate of the virtual machine reported by the current virtual machine is greater than the preset CPU occupancy rate threshold; the memory occupancy rate of the virtual machine reported by the current virtual machine is greater than the preset memory occupancy rate threshold, and the CPU occupancy rate of the virtual machine reported by the current virtual machine is less than or equal to the preset CPU occupancy rate threshold, which belongs to the above (2) case where the memory occupancy rate of the virtual machine reported by the current virtual machine is greater than the preset memory occupancy rate threshold.
Therefore, the embodiment can judge whether the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task.
Based on the content of the foregoing embodiment, in this embodiment, after determining, for any virtual machine within the service range of the central control system, whether the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task, the method may further include:
and if the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task, sending a command for starting the virus scanning task to the current virtual machine.
It can be understood that, after determining whether the virtual machine load condition reported by the current virtual machine satisfies the preset start condition of the virus scanning task, for the condition that the virtual machine load condition reported by the current virtual machine satisfies the preset start condition of the virus scanning task, it indicates that the resource occupied by the server to which the current virtual machine belongs is not too high, and may send an instruction for starting the virus scanning task to the current virtual machine, so that the current virtual machine starts the virus scanning task, and the server to which the current virtual machine belongs may quickly respond to the start of the virus scanning task, and complete the virus scanning of the current virtual machine.
Based on the content of the foregoing embodiment, in this embodiment, after sending an instruction to start a virus scanning task to a current virtual machine, the method may further include:
and if the virus scanning task of the current virtual machine is not started after the preset timeout period is detected, canceling the virus scanning task of the current virtual machine.
It can be understood that, after the instruction for starting the virus scanning task is sent to the current virtual machine, if it is detected that the virus scanning task of the current virtual machine is not started yet after exceeding the preset timeout period, the virus scanning task of the current virtual machine is automatically cancelled.
The virus intelligent scanning processing method provided by the embodiment of the invention is applied to a central control system, can realize intelligent virus scanning on the virtual machines in the server based on the virtual machine load condition reported by each virtual machine in the service range of the central control system, avoids the problem of slow server response caused by virus scanning on the virtual machines in the server under the condition of overhigh server system resources, and reduces the influence of the server resources occupied by the virus scanning to the minimum.
Based on the same inventive concept, another embodiment of the present invention provides a virus intelligent scanning processing apparatus, referring to fig. 2, the virus intelligent scanning processing apparatus of the embodiment includes: a judging module 21 and a time delay module 22; wherein:
the judging module 21 is configured to judge, for any virtual machine within the service range of the central control system, whether the virtual machine load condition reported by the current virtual machine meets a preset starting condition of a virus scanning task;
the delay module 22 is configured to determine that the virus scanning task is started in a delayed manner if the virtual machine load condition reported by the current virtual machine does not meet the preset starting condition of the virus scanning task, and return to execute the determining module after a preset delay time period until the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task.
Specifically, the determining module 21 determines, for any virtual machine within the service range of the central control system, whether the virtual machine load condition reported by the current virtual machine meets a preset starting condition of the virus scanning task; and if the virtual machine load condition reported by the current virtual machine does not meet the preset starting condition of the virus scanning task, the delay module 22 determines that the virus scanning task is started in a delayed manner, and returns to execute the judging module after a preset delay time period until the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task.
It should be noted that the intelligent virus scanning processing device described in this embodiment is applied to a central control system, which is a device for centrally controlling various devices such as sound, light, electricity, and the like, and is applied to a multimedia classroom, a multifunctional conference hall, a command control center, an intelligent home, and the like.
In a specific application, the load condition of the virtual machine according to this embodiment may include: at least one of a CPU occupancy rate of the virtual machine and a memory occupancy rate of the virtual machine. The CPU occupancy rate of the virtual machine is the occupancy rate of the virtual machine occupying the CPU of the server to which the virtual machine belongs, and the memory occupancy rate of the virtual machine is the occupancy rate of the virtual machine occupying the memory of the server to which the virtual machine belongs.
Based on the content of the foregoing embodiment, in this embodiment, the virus intelligent scanning processing apparatus may further include:
and the receiving module is used for receiving the load conditions of the virtual machines reported by all the virtual machines in the service range of the central control system every other preset time period.
Based on the content of the foregoing embodiments, in the present embodiment, the determining module 21 may be specifically configured to
For any virtual machine within the service range of the central control system, if the CPU occupancy rate of the virtual machine reported by the current virtual machine is greater than a preset CPU occupancy rate threshold value and/or the memory occupancy rate of the virtual machine reported by the current virtual machine is greater than a preset memory occupancy rate threshold value, determining that the load condition of the virtual machine reported by the current virtual machine does not meet the preset starting condition of the virus scanning task, and otherwise, determining that the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task.
Based on the content of the foregoing embodiment, in this embodiment, the virus intelligent scanning processing apparatus may further include:
and the sending module is used for sending a command for starting the virus scanning task to the current virtual machine if the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task.
Based on the content of the foregoing embodiment, in this embodiment, the virus intelligent scanning processing apparatus may further include:
and the canceling module is used for canceling the virus scanning task of the current virtual machine if the virus scanning task of the current virtual machine is not started after the instruction for starting the virus scanning task is sent to the current virtual machine and exceeds the preset timeout period.
Since the virus intelligent scanning processing apparatus provided in this embodiment can be used to execute the virus intelligent scanning processing method described in the above embodiment, and the operation principle and the beneficial effect are similar, detailed descriptions are omitted here, and specific contents can be referred to the description of the above embodiment.
The intelligent virus scanning processing device provided by the embodiment of the invention is applied to a central control system, can realize intelligent virus scanning on the virtual machines in the server based on the load condition of the virtual machines reported by each virtual machine in the service range of the central control system, avoids the problem of slow response of the server caused by virus scanning on the virtual machines in the server under the condition of overhigh system resources of the server, and reduces the influence of the server resources occupied by the virus scanning to the minimum.
Based on the same inventive concept, another embodiment of the present invention provides an electronic device, which may include a memory 302, a processor 301, a bus 303, and a computer program stored in the memory 302 and running on the processor 301, referring to fig. 3, wherein the processor 301 and the memory 302 are in communication with each other through the bus 303. The processor 301, when executing the computer program, implements the steps of the above method, for example, including: judging whether the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task or not for any virtual machine in the service range of the central control system; if the virtual machine load condition reported by the current virtual machine does not meet the preset starting condition of the virus scanning task, determining that the virus scanning task is started in a delayed mode, and after the preset delay time period, returning to the step of judging whether the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task or not until the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task.
Based on the same inventive concept, yet another embodiment of the present invention provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the above method, for example, including: judging whether the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task or not for any virtual machine in the service range of the central control system; if the virtual machine load condition reported by the current virtual machine does not meet the preset starting condition of the virus scanning task, determining that the virus scanning task is started in a delayed mode, and after the preset delay time period, returning to the step of judging whether the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task or not until the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task.
Based on the same inventive concept, a further embodiment of the present invention provides a computer program product comprising computer executable instructions for implementing the steps of the above method when executed, for example comprising: judging whether the load condition of the virtual machine reported by the current virtual machine meets the preset starting condition of the virus scanning task or not for any virtual machine in the service range of the central control system; if the virtual machine load condition reported by the current virtual machine does not meet the preset starting condition of the virus scanning task, determining that the virus scanning task is started in a delayed mode, and after the preset delay time period, returning to the step of judging whether the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task or not until the virtual machine load condition reported by the current virtual machine meets the preset starting condition of the virus scanning task.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.