WO2020232903A1 - Monitoring task dynamic adjustment method and apparatus, and computer device and storage medium - Google Patents

Monitoring task dynamic adjustment method and apparatus, and computer device and storage medium Download PDF

Info

Publication number
WO2020232903A1
WO2020232903A1 PCT/CN2019/103606 CN2019103606W WO2020232903A1 WO 2020232903 A1 WO2020232903 A1 WO 2020232903A1 CN 2019103606 W CN2019103606 W CN 2019103606W WO 2020232903 A1 WO2020232903 A1 WO 2020232903A1
Authority
WO
WIPO (PCT)
Prior art keywords
monitoring task
time
target terminal
predetermined
time period
Prior art date
Application number
PCT/CN2019/103606
Other languages
French (fr)
Chinese (zh)
Inventor
孙家棣
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020232903A1 publication Critical patent/WO2020232903A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3096Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents wherein the means or processing minimize the use of computing system or of computing system component resources, e.g. non-intrusive monitoring which minimizes the probe effect: sniffing, intercepting, indirectly deriving the monitored data from other directly available data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Definitions

  • This application relates to the field of network monitoring technology, and in particular to a method, device, computing device, and computer non-volatile readable storage medium for dynamically adjusting monitoring tasks.
  • the purpose of this application is to provide a method, device, computing device, and computer non-volatile readable storage medium for dynamically adjusting monitoring tasks.
  • a method for dynamically adjusting monitoring tasks including:
  • the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching the first predetermined time period, the current time and the target At least one time point is acquired between times, the difference between the time when the target terminal executes the first monitoring task and the target time is a second predetermined time period, and the second predetermined time period is less than the first predetermined time period ;
  • the first monitoring task is to be used according to the system resources used by the target terminal at each time point and the first monitoring task.
  • the second monitoring task replaced by the monitoring task
  • a device for dynamically adjusting monitoring tasks including:
  • the time point acquisition module is configured to respond to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined value before the target terminal that is to perform the first monitoring task performs the first monitoring task Time period, at least one time point is acquired between the current time and the target time, the difference between the time when the target terminal executes the first monitoring task and the target time is a second predetermined time period, and the second predetermined The time period is less than the first predetermined time period;
  • the system resource acquisition module is configured to acquire the system resources used by the target terminal at each time point;
  • the determining module is configured to determine based on the system resources used by the target terminal at each time point and the first monitoring task in the case that the system resources used by the target terminal at each time point meet a first predetermined condition The second monitoring task to be replaced by the first monitoring task;
  • the instruction module is configured to instruct the target terminal to stop performing the first monitoring task and perform the second monitoring task.
  • a computing device including a memory and a processor, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the monitoring The steps of the task dynamic adjustment method.
  • a computer non-volatile readable storage medium storing computer readable instructions.
  • the computer readable instructions are executed by one or more processors, one or more processors execute the above The steps of the monitoring task dynamic adjustment method.
  • the aforementioned monitoring task dynamic adjustment method, device, computing device and computer non-volatile readable storage medium obtain the time point before the target terminal executes the first monitoring task, and then according to the system actually used by the target terminal at the time point obtained Resources to determine whether to replace the first monitoring task and the second monitoring task to be replaced by the first monitoring task, and finally instruct the target terminal to no longer perform the first monitoring task and perform the second monitoring task, so that the target terminal actually performs the monitoring
  • the task is not fixed, but is dynamically adjusted according to the usage of system resources, which improves the stability of the target terminal and ensures the reliability of the execution of the monitoring task to a certain extent.
  • Fig. 1 is a schematic diagram showing an application scenario of a monitoring task dynamic adjustment method according to an exemplary embodiment
  • Fig. 2 is a flowchart showing a method for dynamically adjusting a monitoring task according to an exemplary embodiment
  • FIG. 3 is a flowchart of step 230 of an embodiment shown according to the embodiment corresponding to FIG. 2;
  • FIG. 4 is a flowchart of the steps after step 231 and the details of step 233 according to an embodiment corresponding to FIG. 3;
  • FIG. 5 is a flowchart of steps after step 240 in an embodiment according to the embodiment corresponding to FIG. 2;
  • FIG. 6 is a flowchart showing details of step 210 of an embodiment according to the embodiment corresponding to FIG. 2;
  • Fig. 7 is a block diagram showing a device for dynamically adjusting a monitoring task according to an exemplary embodiment
  • Fig. 8 is an exemplary block diagram of a computing device that implements the foregoing method for dynamically adjusting monitoring tasks according to an exemplary embodiment
  • Fig. 9 shows a non-volatile computer readable storage medium for realizing the above method for dynamically adjusting monitoring tasks according to an exemplary embodiment.
  • Monitoring tasks refer to activities that can perform monitoring functions. In essence, they can be expressed as a computer-readable instruction or a program module, which can be used to monitor various objects or data that may meet certain requirements or regulations, such as monitoring access Whether the user of the server is an illegal user, you can also monitor whether the data uploaded by the device to the server or the local end is abnormal data, etc.; specifically, the specific way to monitor whether the user accessing the server is an illegal user can be, for example, judging the IP address of the user terminal ( Internet Protocol Address), whether the user's login account is legal, etc., and whether the data uploaded by the monitoring device to the server or on the local end is abnormal data can be performed by analyzing the data to determine whether certain rules are met.
  • IP address Internet Protocol Address
  • the dynamic adjustment of monitoring tasks refers to changing the monitoring tasks so that the monitoring tasks no longer remain unchanged.
  • the implementation terminal of this application can be any device with computing and processing functions.
  • the device can be connected to an external device to receive or send information.
  • it can be a portable mobile device, such as a smart phone, a tablet computer, a notebook computer, or a PDA ( Personal Digital Assistant), etc., can also be fixed devices, such as computer equipment, field terminals, desktop computers, servers, workstations, etc., or a collection of multiple devices, such as the physical infrastructure of cloud computing.
  • the implementation terminal of this application may be a server or a cloud computing physical infrastructure.
  • Fig. 1 is a schematic diagram showing an application scenario of a method for dynamically adjusting a monitoring task according to an exemplary embodiment. As shown in Figure 1, it includes a cloud 110, a server 120, a user terminal 130, and a database 140.
  • the cloud 110 and the user terminal 130 are respectively connected to the server 120 through communication links, and the server 120 can access data stored in the database 140.
  • Either the interaction between the user terminals 130 or the interaction between the user terminal 130 and the server 120 can be expressed as the interaction between the user terminal and the server.
  • the implementation terminal is the cloud 110, which may include virtualized physical computing devices.
  • the server 120 is responsible for performing monitoring tasks and monitoring the behavior or data generated by each user terminal 130.
  • the cloud 110 can adjust or control the server 120.
  • Tasks to be performed such as sending a specific task to the server 120 to instruct it to perform or instructing the server 120 to stop performing the monitoring task it originally performed, etc.
  • the dynamic adjustment of the tasks on the server 120 by the cloud 110 can make the server 120 run Meet the predetermined requirements.
  • Fig. 1 is only an embodiment of the present application.
  • the implementation terminal of the present application is the cloud and the terminal responsible for performing monitoring tasks is the server
  • the implementation terminals of this application may include, but are not limited to, various terminals such as servers, desktop computers, and notebook computers, and the terminals responsible for performing monitoring tasks may also be various terminals.
  • the implementation terminal of this application and the terminal responsible for performing monitoring tasks are two separate terminals, in other embodiments, the two can be the same terminal, that is, the implementation terminal of this application. It can perform monitoring tasks as well as the methods provided in this application. This application does not limit this, and the protection scope of this application should not be restricted in any way.
  • Fig. 2 is a flow chart showing a method for dynamically adjusting a monitoring task according to an exemplary embodiment. As shown in Figure 2, it includes the following steps:
  • Step 210 Before the target terminal that is to perform the first monitoring task performs the first monitoring task, respond to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined period of time, Obtain at least one point in time between the time and the target time.
  • the difference between the time for the target terminal to perform the first monitoring task and the target time is a second predetermined time period, and the second predetermined time period is less than the first predetermined time period, that is, the target time is at the current time And the time when the target terminal executes the first monitoring task.
  • the target time is 16:00, that is, get at least one time point between 15:00 and 16:00.
  • the target terminal may be the implementing terminal of the present application itself, or a terminal other than the implementing terminal of the present application.
  • the target terminal is a terminal other than the terminal implemented in this application.
  • the method includes: acquiring the time when the target terminal is to execute the first monitoring task.
  • the target terminal stores a monitoring task list
  • the monitoring task list correspondingly stores monitoring tasks and the time to be executed corresponding to each monitoring task
  • the time of the first monitoring task includes: crawling the monitoring task list in the target terminal through a script; using the monitoring task list to obtain the time when the target terminal is to execute the first monitoring task.
  • obtaining at least one time point between the current time and the target time includes:
  • a predetermined number of time points are randomly selected between the current time and the target time.
  • obtaining at least one time point between the current time and the target time includes:
  • a time point is acquired every predetermined time period until the time point to be acquired is after the target time.
  • acquiring at least one point in time between the current time and the target time includes: before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the target terminal executing the first monitoring task The difference between the time of the monitoring task and the current time reaches a first predetermined time period, and the time period between the current time and the target time is divided into a first predetermined number of time periods in chronological order;
  • a predetermined number of time points are arbitrarily selected within the time period as at least one time point acquired between the current time and the target time.
  • obtaining at least one time point between the current time and the target time includes:
  • any predetermined number of time points can be selected as at least one time point acquired between the current time and the target time.
  • the advantage of this embodiment is that the representative time point in each time period is obtained in an arbitrary manner, and then the time period for obtaining the time point is determined according to the system resources used by the target terminal at the arbitrary time point. Then, the time point is obtained from the time period, so that the obtained time point can better reflect the system resource consumption of the target terminal before the target time.
  • obtaining at least one time point between the current time and the target time includes:
  • Step 220 Obtain system resources used by the target terminal at each time point.
  • System resources are various resources consumed when the target terminal is running, such as memory resources, processor processing resources, disk IO resources, and so on.
  • the target terminal carries a log that records the system resources used by the target terminal at each time point, and the acquisition of the target terminal at each time point Pointing the used system resources includes: obtaining logs in the target terminal; using the logs to obtain system resources used by the target terminal at each point in time.
  • the target terminal is the local terminal
  • the log in the target terminal is obtained by reading the log stored in the local terminal.
  • the target terminal is a terminal other than the local terminal
  • the obtaining the log in the target terminal includes: using a script to crawl the log in the target terminal.
  • the target terminal is a terminal other than the local terminal
  • the obtaining the system resources used by the target terminal at each time point includes: sending to the target terminal to obtain the target terminal
  • the target terminal will return to the local end the system resources used at each time point according to the request; whenever the current time reaches each time point To receive the system resource used at the time point returned by the target terminal.
  • the target terminal is a terminal other than the local terminal
  • the acquiring system resources used by the target terminal at each time point includes: whenever the current time reaches the time point, The target terminal sends a request to acquire the system resources used by the target terminal at the time point, the target terminal will return the system resources used at the time point to the local terminal according to the request; The system resource returned to the local end for each request.
  • Step 230 In the case that the system resources used by the target terminal at each point in time meet the first predetermined condition, determine what to use according to the system resources used by the target terminal at each point in time and the first monitoring task. The first monitoring task is replaced by the second monitoring task.
  • the system resources include CPU usage rate and memory usage rate
  • the first predetermined condition includes: the CPU usage rate used by the target terminal at each point in time is greater than a predetermined CPU usage rate threshold and the memory usage rate is both Greater than the predetermined memory usage threshold.
  • the system resources include CPU usage rate and memory usage rate
  • the first predetermined condition includes: the CPU usage rate used by the target terminal at each time point is less than a predetermined CPU usage rate threshold and the memory usage rate is both Less than the predetermined memory usage threshold.
  • the system resource includes CPU usage rate and memory usage rate
  • the first predetermined condition includes: the corresponding CPU usage rate at each time point is greater than a predetermined CPU usage rate threshold and the memory usage rate is greater than the predetermined memory usage rate threshold.
  • the number of time points is greater than the predetermined number of time points threshold.
  • the system resource includes CPU usage and memory usage
  • the first predetermined condition includes: the corresponding CPU usage at each time point is greater than a predetermined CPU usage threshold or the memory usage is greater than the predetermined memory usage threshold The number of time points is greater than the predetermined number of time points threshold.
  • the first monitoring task includes a plurality of subtasks
  • the system resources include a CPU usage rate and a memory usage rate
  • the monitoring task, determining the second monitoring task to be replaced by the first monitoring task includes:
  • M is the maximum value of the memory usage rate in the system resources used by the target terminal at each time point
  • C is the maximum value of the CPU usage rate in the system resources used by the target terminal at each time point
  • N is The number of subtasks included in the first monitoring task
  • b is the target parameter value
  • the number of subtasks is arbitrarily selected from the multiple subtasks included in the first monitoring task as the second monitoring task to be replaced by the first monitoring task.
  • the advantage of this embodiment is that the number of subtasks included in the second monitoring task to be replaced by the first monitoring task is related to the original first monitoring task and system resources.
  • the monitoring task can be guaranteed While maintaining a certain degree of operation, it reduces the pressure of monitoring tasks on system resources on the target terminal and improves the stability of the target terminal.
  • obtaining the number of subtasks to be included in the second monitoring task according to the target parameter value includes: obtaining a maximum integer smaller than the target parameter value as the number of subtasks to be included in the second monitoring task .
  • obtaining the number of subtasks to be included in the second monitoring task according to the target parameter value includes: obtaining the smallest integer greater than the target parameter value as the number of subtasks to be included in the second monitoring task .
  • Step 240 Instruct the target terminal to stop executing the first monitoring task and execute the second monitoring task.
  • the target terminal will stop performing the first monitoring task and perform the second monitoring task according to the instruction.
  • the first monitoring task is a repetitively executed task
  • the instructing the target terminal to stop performing the first monitoring task and to perform the second monitoring task specifically includes: instructing the target terminal to stop performing the first monitoring task A monitoring task and starting to execute the second monitoring task at the time when the target terminal executes the first monitoring task.
  • the target terminal is a terminal other than the local terminal
  • step 240 specifically includes: sending a request for instructing the target terminal to perform the first monitoring task and to perform the second monitoring task to the target terminal.
  • the target terminal is the local terminal
  • the monitoring task to be executed on the local terminal is recorded in a preset monitoring task list.
  • Step 240 specifically includes: replacing the first monitoring task in the monitoring task list with the second monitoring task. Monitoring tasks, so that the target terminal stops performing the first monitoring task and executes the second monitoring task.
  • the time point is first acquired, and then the first monitoring is adjusted according to the system resource occupation of the target terminal at the acquired time point.
  • Tasks enable the monitoring tasks actually performed by the target terminal to be adaptively adjusted according to the occupancy of system resources, which improves the stability and reliability of the target terminal, and can also ensure that the monitoring task can continue to a certain extent.
  • FIG. 3 is a flowchart of step 230 in an embodiment shown according to the embodiment corresponding to FIG. 2. As shown in Figure 3, it includes the following steps:
  • Step 231 According to the system resources used by the target terminal at each time point and the first monitoring task, the following formula is used to determine the execution interval of the second monitoring task:
  • T 2 T 1 (e M + e C ),
  • M is the average value of the memory usage rate in the system resources used by the target terminal at each time point
  • C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point
  • T 1 Is the third predetermined time period
  • T 2 is the execution interval of the second monitoring task.
  • the average value of the memory usage rate in the system resources used by the target terminal at each time point reflects the central trend of the memory usage rate used by the target terminal in the time period to which each time point belongs.
  • the average value of the CPU usage rate used by the target terminal at each time point reflects the central tendency of the memory usage rate used by the target terminal at each time point.
  • Step 233 Regarding the first monitoring task, a third predetermined period of time between repeated executions of the first monitoring task is set as the execution interval of the second monitoring task to obtain the second monitoring task.
  • the average value of the memory usage rate in the system resources used by the target terminal at each time point or the average value of the CPU usage rate in the system resources used by the target terminal at each time point The larger is, compared with the third predetermined time period of the execution interval of the first monitoring task, the obtained execution interval of the second monitoring task is larger, that is, the execution period of the second monitoring task becomes longer, thereby
  • the target terminal uses a lot of system resources, the system resource occupied by the monitoring task on the target terminal is reduced, and the stability of the target terminal is improved.
  • the first monitoring task includes: acquiring objects to be monitored whose corresponding characteristic data meets a predetermined rule within a fourth predetermined time period every third predetermined time period, and the fourth predetermined time period is less than the first Three predetermined time periods.
  • the fourth predetermined time period and the third predetermined time period have a common time period.
  • Feature data is data corresponding to the object to be monitored, which can be data or attribute data generated by the behavior or action of the object to be monitored. It is easy to understand. In this embodiment, it is achieved by judging whether the feature data of the object to be monitored meets predetermined rules. The monitoring of the object to be monitored.
  • the object to be monitored is an account
  • the characteristic data includes the payment amount of the account, the transfer amount of the account, etc. If you want to monitor whether the account is suspected of pilfering behavior, the predetermined rule can be that the account transfer amount is greater than the predetermined amount threshold. By judging the characteristic data of the object to be monitored, the monitoring of the object to be monitored can be realized.
  • Step 232 According to the system resources used by the target terminal at each time point and the first monitoring task, the following formula is used to determine the acquisition time range of the object to be monitored for the second monitoring task:
  • M is the average value of the memory usage rate in the system resources used by the target terminal at each time point
  • C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point
  • T 3 Is the fourth predetermined time period
  • T 4 is the acquisition time range of the object to be monitored for the second monitoring task.
  • the obtained second monitoring task has a smaller acquisition time range for the object to be monitored, that is, the task volume of the second monitoring task is smaller than that of the first monitoring task. This reduces the resource consumption of the target terminal when performing monitoring tasks.
  • Step 233' for the first monitoring task, the third predetermined time period of the first monitoring task is set as the execution interval time of the second monitoring task and the fourth predetermined time period of the first monitoring task is set Set the segment to the acquisition time range of the object to be monitored of the second monitoring task to obtain the second monitoring task.
  • the interval time between the execution of the first monitoring task and The acquisition time range of the object to be monitored is replaced separately, which realizes the dynamic adjustment of the monitoring task.
  • the target terminal uses more resources at the acquisition time point, the task volume of the second monitoring task acquired will be greatly reduced, which reduces the monitoring
  • the task pressure on the system resources on the target terminal improves the stability of the target terminal.
  • FIG. 5 is a flowchart of steps after step 240 in an embodiment shown according to the embodiment corresponding to FIG. 2. As shown in Figure 5, it includes the following steps:
  • Step 250 Acquire system resources used by the target terminal in response to the target terminal starting to execute the second monitoring task.
  • the target terminal is a terminal other than the local terminal, and when the target terminal starts to execute the second monitoring task, the target terminal is triggered to return the system resources used by the target terminal to the local terminal.
  • Step 260 In the case where the system resources used by the target terminal do not meet the first predetermined condition, instruct the target terminal to stop executing the second monitoring task and execute all the second monitoring tasks when the second monitoring task is to be executed next time. Describe the first monitoring task.
  • the system resources used by the target terminal and the first predetermined condition are used as the reference to determine the adjustment monitoring task, which realizes the continuous adjustment of the monitoring task, so that the target terminal uses The system resources are more balanced.
  • FIG. 6 is a detailed flowchart of step 210 according to an embodiment shown in the embodiment corresponding to FIG. 2. As shown in Figure 6, it includes the following steps:
  • Step 211 Before the target terminal that is to perform the first monitoring task executes the first monitoring task, in response to the difference between the target terminal executing the first monitoring task and the current time reaching a first predetermined period of time, The time period between the current time and the target time is divided into a first predetermined number of time periods according to the time sequence.
  • the time period between the current time and the target time is evenly divided into a first predetermined number of time periods.
  • the divided time period can be (10:00,10:30], (10 :30,11:00], (11:00,11:30] and (11:30,12:00].
  • Step 212 starting from the first time period, in chronological order, for each time period, whenever it is determined that the system resources used by the target terminal at the two end points of the time period meet the second predetermined Condition, just take the second predetermined number of time points within the time period, and continue to judge the next time period until it is judged that the target terminal uses the time points at the two end points of the targeted time period
  • the system resources do not all satisfy the second predetermined condition or the judgment is made for all time periods.
  • the second predetermined condition may be the same condition as the first predetermined condition, or may be a different condition.
  • the system resource may include a memory usage rate and a CPU usage rate.
  • the first predetermined condition may be that the memory usage rate of the target terminal at each time point is greater than 80% and the CPU usage rate is greater than 85%
  • the second predetermined condition may be The memory usage rate of the target terminal at each time point is greater than 60% and the CPU usage rate is greater than 75%.
  • Step 213 Use the second predetermined number of time points acquired for each time period as at least one time point acquired between the current time and the target time.
  • the system resources used by the target terminal at the end points of each time interval often represent the development trend of the system resources used by the target terminal in the time sequence.
  • the target terminal is used at the end points of the time interval.
  • the time point is obtained based on the system resources of, which makes the time point obtained more representative.
  • This application also provides a device for dynamically adjusting monitoring tasks.
  • the following are device embodiments of the application.
  • Fig. 7 is a block diagram showing a device for dynamically adjusting a monitoring task according to an exemplary embodiment. As shown in FIG. 7, the device 700 includes:
  • the time point acquisition module 710 is configured to respond to the difference between the target terminal performing the first monitoring task and the current time reaching the first monitoring task before the target terminal performing the first monitoring task performs the first monitoring task.
  • a predetermined time period at least one time point is acquired between the current time and the target time, the difference between the time when the target terminal executes the first monitoring task and the target time is a second predetermined time period, and the second The predetermined time period is less than the first predetermined time period;
  • the system resource obtaining module 720 is configured to obtain the system resources used by the target terminal at each time point;
  • the determining module 730 is configured to, when the system resources used by the target terminal at each time point meet a first predetermined condition, according to the system resources used by the target terminal at each time point and the first monitoring task, Determine the second monitoring task to be replaced by the first monitoring task;
  • the instruction module 740 is configured to instruct the target terminal to stop performing the first monitoring task and perform the second monitoring task.
  • the first monitoring task is a task that is repeatedly executed every third predetermined time period
  • the system resources include a CPU usage rate and a memory usage rate
  • the first predetermined condition includes that the CPU usage rate is greater than a predetermined time period.
  • the ratio of the number of time points at which the CPU usage threshold or the memory usage rate is greater than the predetermined memory usage threshold to the total number of time points obtained is less than the predetermined ratio threshold, according to the system resources used by the target terminal at each time point and all
  • the first monitoring task and determining the second monitoring task to be replaced by the first monitoring task include:
  • T 2 T 1 (e M + e C ),
  • M is the average value of the memory usage rate in the system resources used by the target terminal at each time point
  • C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point
  • T 1 Is the third predetermined time period
  • T 2 is the execution interval of the second monitoring task
  • a third predetermined period of time between repeated executions of the first monitoring task is set as the execution interval of the second monitoring task to obtain the second monitoring task.
  • the first monitoring task includes: acquiring objects to be monitored whose corresponding characteristic data meets a predetermined rule within a fourth predetermined time period every third predetermined time period, and the fourth predetermined time period is less than the first Three predetermined time periods, where the fourth predetermined time period and the third predetermined time period have a common time period, and the determining module is further configured to use system resources at each time point according to the target terminal and the first For a monitoring task, after determining the execution interval of the second monitoring task using a formula:
  • the following formula is used to determine the acquisition time range of the object to be monitored for the second monitoring task:
  • M is the average value of the memory usage rate in the system resources used by the target terminal at each time point
  • C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point
  • T 3 Is the fourth predetermined time period
  • T 4 is the acquisition time range of the object to be monitored for the second monitoring task
  • setting the third predetermined period of time between repeated execution of the first monitoring task as the execution interval of the second monitoring task to obtain the second monitoring task includes:
  • the third predetermined time period of the first monitoring task is set as the execution interval time of the second monitoring task and the fourth predetermined time period of the first monitoring task is set to all Obtain the second monitoring task by obtaining the time range of the object to be monitored for the second monitoring task.
  • the first monitoring task is a task that is repeatedly executed every first predetermined period of time
  • the instructing the target terminal to stop performing the first monitoring task and execute the second monitoring task includes:
  • the second monitoring task is a task that is repeatedly executed every fifth predetermined time period
  • the instruction module is further configured to instruct the target terminal to stop performing the first monitoring task and execute the first monitoring task.
  • the target terminal that is to execute the first monitoring task before the target terminal that is to execute the first monitoring task executes the first monitoring task, respond to the difference between the time at which the target terminal executes the first monitoring task and the current time reaches a first predetermined
  • the time period, acquiring at least one point in time between the current time and the target time includes: before the target terminal that is to perform the first monitoring task performs the first monitoring task, responding to the target terminal performing the first monitoring task When the difference between the time and the current time reaches the first predetermined time period, the time period between the current time and the target time is divided into a first predetermined number of time periods in chronological order; for each time period, at the time Any predetermined number of time points in the segment can be taken as at least one time point obtained between the current time and the target time.
  • the target terminal that is to execute the first monitoring task before the target terminal that is to execute the first monitoring task executes the first monitoring task, respond to the difference between the time at which the target terminal executes the first monitoring task and the current time reaches a first predetermined
  • the time period acquiring at least one point in time between the current time and the target time, includes: before the target terminal that is to perform the first monitoring task performs the first monitoring task, responding to the target terminal performing the first monitoring task When the difference between the time and the current time reaches the first predetermined time period, the time period between the current time and the target time is divided into a first predetermined number of time periods in chronological order; starting from the first time period, according to Time sequence.
  • the second one is selected within the time period.
  • a predetermined number of time points and continue to judge for the next time period, until it is judged that the system resources used by the target terminal at the time points at the two end points of the targeted time period do not meet the second predetermined condition or for all
  • the time periods of are all judged; the second predetermined number of time points obtained for each time period are taken as at least one time point obtained between the current time and the target time.
  • a computing device which executes all or part of the steps of any of the above-mentioned methods for dynamically adjusting monitoring tasks.
  • the computing equipment includes:
  • At least one processor At least one processor
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute as shown in any one of the above exemplary embodiments. Dynamic adjustment method for monitoring tasks.
  • the computing device 800 according to this embodiment of the present application will be described below with reference to FIG. 8.
  • the computing device 800 shown in FIG. 8 is only an example, and should not bring any limitation to the functions and usage scope of the embodiments of the present application.
  • the computing device 800 is represented in the form of a general-purpose computing device.
  • the components of the computing device 800 may include, but are not limited to: the aforementioned at least one processing unit 810, the aforementioned at least one storage unit 820, and a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810).
  • the storage unit stores program code, and the program code can be executed by the processing unit 810, so that the processing unit 810 executes the various exemplary methods described in the "Methods of Embodiments" section of this specification. Implementation steps.
  • the storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 821 and/or a cache storage unit 822, and may further include a read-only storage unit (ROM) 823.
  • RAM random access storage unit
  • ROM read-only storage unit
  • the storage unit 820 may also include a program/utility tool 824 having a set (at least one) program module 825.
  • program module 825 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples or some combination may include the implementation of a network environment.
  • the bus 830 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure among multiple bus structures. bus.
  • the computing device 800 may also communicate with one or more external devices 1000 (such as keyboards, pointing devices, Bluetooth devices, etc.), and may also communicate with one or more devices that enable users to interact with the computing device 800, and/or communicate with Any device (eg, router, modem, etc.) that enables the computing device 800 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 850.
  • the computing device 800 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 860. As shown in the figure, the network adapter 860 communicates with other modules of the computing device 800 through the bus 830.
  • LAN local area network
  • WAN wide area network
  • public network such as the Internet
  • computing device 800 includes hardware and/or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
  • the exemplary embodiments described herein can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which may be a personal computer, server, terminal device, or network device, etc.) execute the method according to the embodiment of the present application.
  • a non-volatile storage medium can be a CD-ROM, U disk, mobile hard disk, etc.
  • Including several instructions to make a computing device which may be a personal computer, server, terminal device, or network device, etc.
  • a computer non-volatile readable storage medium on which is stored a program product capable of implementing the above-mentioned method in this specification.
  • various aspects of the present application can also be implemented in the form of a program product, which includes program code.
  • the program product runs on a terminal device, the program code is used to enable the The terminal device executes the steps according to various exemplary embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
  • a computer non-volatile readable storage medium 900 for implementing the above method according to an embodiment of the present application is described, which may adopt a portable compact disk read-only memory (CD-ROM) and includes program code , And can run on terminal devices, such as personal computers.
  • CD-ROM portable compact disk read-only memory
  • the program product of this application is not limited to this.
  • the computer non-volatile readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device, or device. In conjunction with.
  • the program product can use any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • the readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device.
  • the program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
  • the program code used to perform the operations of this application can be written in any combination of one or more programming languages.
  • the programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural Programming language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on.
  • the remote computing device can be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using Internet service providers) Business to connect via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service providers Internet service providers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present application relates to the field of network monitoring, and disclosed are a monitoring task dynamic adjustment method and apparatus, and a computer device and a storage medium. The method comprises: before a target terminal executes a first monitoring task, obtaining a time point between the current time and a target time in response to the case that a difference value between the time when the target terminal executes the first monitoring task and the current time reaches a first preset time period; obtaining a system resource used by the target terminal at each time point; when the system resource used by the target terminal satisfies a first predetermined condition, determining a second monitoring task with which the first monitoring task is replaced according to the system resource used by the target terminal at each time point and the first monitoring task; and indicating the target terminal to stop executing the first monitoring task and execute the second monitoring task. According to the method, the monitoring task actually executed by the target terminal is dynamically adjusted according to the use condition of system resources, so that the stability of the target terminal is improved, and the execution reliability of the monitoring tasks is ensured to a certain extent.

Description

监控任务动态调整方法、装置、计算设备和存储介质Monitoring task dynamic adjustment method, device, computing equipment and storage medium
本申请基于并要求2019年5月23日申请的、申请号为CN 201910435802.8、名称为“监控任务动态调整方法、装置、介质及电子设备”的中国专利申请的优先权,其全部内容在此并入作为参考。This application is based on and claims the priority of the Chinese patent application filed on May 23, 2019, with the application number CN 201910435802.8, and the title "Monitoring task dynamic adjustment method, device, medium and electronic equipment". The entire content is hereby incorporated. Enter as a reference.
技术领域Technical field
本申请涉及网络监控技术领域,特别是涉及一种监控任务动态调整方法、装置、计算设备和计算机非易失性可读存储介质。This application relates to the field of network monitoring technology, and in particular to a method, device, computing device, and computer non-volatile readable storage medium for dynamically adjusting monitoring tasks.
背景技术Background technique
在互联网领域,对与网络监控相关的任务,常常采用基于多种规则进行判断的方式。比如,要监控用户是否非法访问资源,就可以先提取用户的特征,然后基于特征来对用户进行过滤或筛选,从而得到监控的结果。然而,本申请发明人意识到,目前要监控的用户或者对象往往是海量的,而监控所使用的设备的处理能力一般是有限的,监控设备有时不仅用于执行监控任务,还要负责其他任务,此时如果始终如一地执行预先设定好的监控任务,会给监控设备造成巨大压力,可能会导致监控设备宕机,使监控任务无法正常执行,从而造成损失。In the Internet field, for tasks related to network monitoring, judgments based on multiple rules are often used. For example, to monitor whether a user illegally accesses resources, you can first extract the user's characteristics, and then filter or filter the users based on the characteristics to obtain the monitoring results. However, the inventor of the present application realizes that currently the users or objects to be monitored are often massive, and the processing capabilities of the equipment used for monitoring are generally limited. Sometimes the monitoring equipment is not only used to perform monitoring tasks, but also responsible for other tasks. At this time, if the pre-set monitoring tasks are performed consistently, it will cause great pressure on the monitoring equipment, which may cause the monitoring equipment to go down, and the monitoring tasks cannot be performed normally, which will cause losses.
发明内容Summary of the invention
在网络监控技术领域,为了解决上述技术问题,本申请的目的在于提供一种监控任务动态调整方法、装置、计算设备和计算机非易失性可读存储介质。In the field of network monitoring technology, in order to solve the above technical problems, the purpose of this application is to provide a method, device, computing device, and computer non-volatile readable storage medium for dynamically adjusting monitoring tasks.
第一方面,提供了一种监控任务动态调整方法,包括:In the first aspect, a method for dynamically adjusting monitoring tasks is provided, including:
在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,所述目标终端执行所述第一监控任务的时间与所述目标时间的差值为第二预定时间段,所述第二预定时间段小于第一预定时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching the first predetermined time period, the current time and the target At least one time point is acquired between times, the difference between the time when the target terminal executes the first monitoring task and the target time is a second predetermined time period, and the second predetermined time period is less than the first predetermined time period ;
获取所述目标终端在每一所述时间点使用的系统资源;Acquiring system resources used by the target terminal at each time point;
在所述目标终端在各时间点使用的系统资源满足第一预定条件的情况下,根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务;In the case that the system resources used by the target terminal at each time point meet the first predetermined condition, it is determined that the first monitoring task is to be used according to the system resources used by the target terminal at each time point and the first monitoring task. The second monitoring task replaced by the monitoring task;
指示所述目标终端停止执行第一监控任务并执行所述第二监控任务。Instruct the target terminal to stop performing the first monitoring task and perform the second monitoring task.
第二方面,提供了一种监控任务动态调整装置,包括:In the second aspect, a device for dynamically adjusting monitoring tasks is provided, including:
时间点获取模块,被配置为在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,所述目标终端执行所述第一监控任务的时间与所述目标时间的差值为第二预定时间段,所述第二预定时间段小于第一预定时间段;The time point acquisition module is configured to respond to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined value before the target terminal that is to perform the first monitoring task performs the first monitoring task Time period, at least one time point is acquired between the current time and the target time, the difference between the time when the target terminal executes the first monitoring task and the target time is a second predetermined time period, and the second predetermined The time period is less than the first predetermined time period;
系统资源获取模块,被配置为获取所述目标终端在每一所述时间点使用的系统资源;The system resource acquisition module is configured to acquire the system resources used by the target terminal at each time point;
确定模块,被配置为在所述目标终端在各时间点使用的系统资源满足第一预定条件的情况下,根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务;The determining module is configured to determine based on the system resources used by the target terminal at each time point and the first monitoring task in the case that the system resources used by the target terminal at each time point meet a first predetermined condition The second monitoring task to be replaced by the first monitoring task;
指示模块,被配置为指示所述目标终端停止执行第一监控任务并执行所述第二监控任务。The instruction module is configured to instruct the target terminal to stop performing the first monitoring task and perform the second monitoring task.
第三方面,提供了一种计算设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行上述监控任务动态调整方法的步骤。In a third aspect, a computing device is provided, including a memory and a processor, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the monitoring The steps of the task dynamic adjustment method.
第四方面,提供了一种存储有计算机可读指令的计算机非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述监控任务动态调整方法的步骤。In a fourth aspect, there is provided a computer non-volatile readable storage medium storing computer readable instructions. When the computer readable instructions are executed by one or more processors, one or more processors execute the above The steps of the monitoring task dynamic adjustment method.
上述监控任务动态调整方法、装置、计算设备和计算机非易失性可读存储介质,在目标终端执行第一监控任务之前先获取时间点,然后根据目标终端在获取的时间点时实际使用的系统资源来确定是否替换第一监控任务以及要将第一监控任务替换为的第二监控任务,最终指示目标终端不再执行第一监控任务转而执行第二监控任务,使得目标终端实际执行的监控任务不是固定的,而是根据系统资源的使用情况动态调整的,提高了目标终端的稳定性,在一定程度上保证了监控任务执行的可靠性。The aforementioned monitoring task dynamic adjustment method, device, computing device and computer non-volatile readable storage medium obtain the time point before the target terminal executes the first monitoring task, and then according to the system actually used by the target terminal at the time point obtained Resources to determine whether to replace the first monitoring task and the second monitoring task to be replaced by the first monitoring task, and finally instruct the target terminal to no longer perform the first monitoring task and perform the second monitoring task, so that the target terminal actually performs the monitoring The task is not fixed, but is dynamically adjusted according to the usage of system resources, which improves the stability of the target terminal and ensures the reliability of the execution of the monitoring task to a certain extent.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本申请。It should be understood that the above general description and the following detailed description are only exemplary and cannot limit the application.
附图说明Description of the drawings
图1是根据一示例性实施例示出的一种监控任务动态调整方法的应用场景示意图;Fig. 1 is a schematic diagram showing an application scenario of a monitoring task dynamic adjustment method according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种监控任务动态调整方法的流程图;Fig. 2 is a flowchart showing a method for dynamically adjusting a monitoring task according to an exemplary embodiment;
图3是根据图2对应实施例示出的一实施例的步骤230的流程图;FIG. 3 is a flowchart of step 230 of an embodiment shown according to the embodiment corresponding to FIG. 2;
图4是根据图3对应实施例示出的一实施例的步骤231之后步骤以及步骤233的细节的流程图;FIG. 4 is a flowchart of the steps after step 231 and the details of step 233 according to an embodiment corresponding to FIG. 3;
图5是根据图2对应实施例示出的一实施例的步骤240之后步骤的流程图;FIG. 5 is a flowchart of steps after step 240 in an embodiment according to the embodiment corresponding to FIG. 2;
图6是根据图2对应实施例示出的一实施例的步骤210的细节的流程图;FIG. 6 is a flowchart showing details of step 210 of an embodiment according to the embodiment corresponding to FIG. 2;
图7是根据一示例性实施例示出的一种监控任务动态调整装置的框图;Fig. 7 is a block diagram showing a device for dynamically adjusting a monitoring task according to an exemplary embodiment;
图8是根据一示例性实施例示出的一种实现上述监控任务动态调整方法的计算设备的示例框图;Fig. 8 is an exemplary block diagram of a computing device that implements the foregoing method for dynamically adjusting monitoring tasks according to an exemplary embodiment;
图9是根据一示例性实施例示出的一种实现上述监控任务动态调整方法的计算机非易失性可读存储介质。Fig. 9 shows a non-volatile computer readable storage medium for realizing the above method for dynamically adjusting monitoring tasks according to an exemplary embodiment.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are only examples of devices and methods consistent with some aspects of the application as detailed in the appended claims.
此外,附图仅为本申请的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。In addition, the drawings are only schematic illustrations of the application, and are not necessarily drawn to scale. The same reference numerals in the figures denote the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
本申请首先提供了一种监控任务动态调整方法。监控任务是指能够执行监控功能的活动,在本质上,可以表现为一段计算机可读指令或者一个程序模块,其可以用于监控各种可能满足一定要求或者规定的对象或者数据,比如可以监控访问服务器的用户是否为非法用户,还可以监控设备上传至服务器或者本端的数据是否为异常数据等;具体地,监控访问服务器的用户是否为非法用户的具体方式例如可以是判断用户终端的IP地址(Internet Protocol Address,网际协议地址),用户登录的账号是否合法等,而监控设备上传至服务器或者本端的数据是否为异常数据,具体可以通过对数据进行分析,判断是否满足一定规则等方式进行。监控任务的动态调整是指改变监控任务,使监控任务不再维持不变。本申请的实施终端可以是任何具有运算和处理功能的设备,该设备可以与外部设备相连,用于接收或者发出信息,具体可以是便携移动设备,例如智能手机、平板电脑、笔记本电脑、PDA(Personal Digital Assistant)等,也可以是固定式设备,例如,计算机设备、现场终端、台式电脑、服务器、工作站等,还可以是多个设备的集合,比如云计算的物理基础设施。This application first provides a method for dynamically adjusting monitoring tasks. Monitoring tasks refer to activities that can perform monitoring functions. In essence, they can be expressed as a computer-readable instruction or a program module, which can be used to monitor various objects or data that may meet certain requirements or regulations, such as monitoring access Whether the user of the server is an illegal user, you can also monitor whether the data uploaded by the device to the server or the local end is abnormal data, etc.; specifically, the specific way to monitor whether the user accessing the server is an illegal user can be, for example, judging the IP address of the user terminal ( Internet Protocol Address), whether the user's login account is legal, etc., and whether the data uploaded by the monitoring device to the server or on the local end is abnormal data can be performed by analyzing the data to determine whether certain rules are met. The dynamic adjustment of monitoring tasks refers to changing the monitoring tasks so that the monitoring tasks no longer remain unchanged. The implementation terminal of this application can be any device with computing and processing functions. The device can be connected to an external device to receive or send information. Specifically, it can be a portable mobile device, such as a smart phone, a tablet computer, a notebook computer, or a PDA ( Personal Digital Assistant), etc., can also be fixed devices, such as computer equipment, field terminals, desktop computers, servers, workstations, etc., or a collection of multiple devices, such as the physical infrastructure of cloud computing.
优选地,本申请的实施终端可以为服务器或者云计算的物理基础设施。Preferably, the implementation terminal of this application may be a server or a cloud computing physical infrastructure.
图1是根据一示例性实施例示出的一种监控任务动态调整方法的应用场景示意图。如图1所示,包括云端110,服务器120和用户终端130和数据库140,其中,云端110和用户终端130分别与服务器120通过通信链路进行连接,服务器120可以存取数据库140上存储的数据。无论是各用户终端130之间的交互,还是用户终端130与服务器120之间的交互,都可以表现为用户终端与服务器之间的交互。当各用户终端130通过通信链路与服务器120进行交互(比如访问服务器120)后,用户终端130与服务器120进行交互时用户终端130的用户身份信息以及交互行为产生的各种数据会被服务器120记录,并可以将记录的数据或信息存储至与之相连的数据库140,还可以根据需要将这些数据或信息在数据库140上持久保存或者定期删除。在本实施例中,实施终端为云端110,其可以包括经过虚拟化的物理计算设备,服务器120负责执行监控任务,监控各用户终端130的行为或者产生的数据,云端110可以调整或控制服务器120要执行的任务,比如将特定的任务发送给服务器120指示其执行或者指示服务器120停止执行其本来要执行的监控任务等,通过云端110对服务器120上任务的动态调整,可以使服务器120的运行满足预定的要求。Fig. 1 is a schematic diagram showing an application scenario of a method for dynamically adjusting a monitoring task according to an exemplary embodiment. As shown in Figure 1, it includes a cloud 110, a server 120, a user terminal 130, and a database 140. The cloud 110 and the user terminal 130 are respectively connected to the server 120 through communication links, and the server 120 can access data stored in the database 140. . Either the interaction between the user terminals 130 or the interaction between the user terminal 130 and the server 120 can be expressed as the interaction between the user terminal and the server. When each user terminal 130 interacts with the server 120 (such as accessing the server 120) through a communication link, the user identity information of the user terminal 130 and various data generated by the interactive behavior will be transferred to the server 120 when the user terminal 130 interacts with the server 120. Records, and the recorded data or information can be stored in the database 140 connected to it, and the data or information can be persistently stored on the database 140 or periodically deleted as needed. In this embodiment, the implementation terminal is the cloud 110, which may include virtualized physical computing devices. The server 120 is responsible for performing monitoring tasks and monitoring the behavior or data generated by each user terminal 130. The cloud 110 can adjust or control the server 120. Tasks to be performed, such as sending a specific task to the server 120 to instruct it to perform or instructing the server 120 to stop performing the monitoring task it originally performed, etc. The dynamic adjustment of the tasks on the server 120 by the cloud 110 can make the server 120 run Meet the predetermined requirements.
值得一提的是,图1仅是本申请的一个实施例,虽然在图1的实施例中,本申请的实施终端为云端,负责执行监控任务的终端为服务器,但在其他实施例中,本申请的实施终端可以包括但不限于服务器、台式机、笔记本电脑等各种终端,负责执行监控任务的终端也可以是各种终端。另外,虽然在图1的实施例中,本申请的实施终端和负责执行监控任务的终端为两个单独的终端,但在其他实施例中,两者可以是同一终端,即本申请的实施终端既执行本申请提供的方法,还可以执行监控任务。本申请对此不作限定,本申请的保护范围也不应因此而受到任何限制。It is worth mentioning that Fig. 1 is only an embodiment of the present application. Although in the embodiment of Fig. 1, the implementation terminal of the present application is the cloud and the terminal responsible for performing monitoring tasks is the server, in other embodiments, The implementation terminals of this application may include, but are not limited to, various terminals such as servers, desktop computers, and notebook computers, and the terminals responsible for performing monitoring tasks may also be various terminals. In addition, although in the embodiment of FIG. 1, the implementation terminal of this application and the terminal responsible for performing monitoring tasks are two separate terminals, in other embodiments, the two can be the same terminal, that is, the implementation terminal of this application. It can perform monitoring tasks as well as the methods provided in this application. This application does not limit this, and the protection scope of this application should not be restricted in any way.
图2是根据一示例性实施例示出的一种监控任务动态调整方法的流程图。如图2所示,包括以下步骤:Fig. 2 is a flow chart showing a method for dynamically adjusting a monitoring task according to an exemplary embodiment. As shown in Figure 2, it includes the following steps:
步骤210,在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点。Step 210: Before the target terminal that is to perform the first monitoring task performs the first monitoring task, respond to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined period of time, Obtain at least one point in time between the time and the target time.
所述目标终端执行所述第一监控任务的时间与所述目标时间的差值为第二预定时间段,所述第二预定时间段小于第一预定时间段,即所述目标时间在当前时间和所述目标终端执行所述第一监控任务的时间之间。The difference between the time for the target terminal to perform the first monitoring task and the target time is a second predetermined time period, and the second predetermined time period is less than the first predetermined time period, that is, the target time is at the current time And the time when the target terminal executes the first monitoring task.
比如,当前时间为15:00,所述目标终端执行所述第一监控任务的时间为17:00,第一预定时间段为2小时,而第二预定时间段为1小时,则目标时间为16:00,即在15:00和16:00之间获取至少一个时间点。For example, if the current time is 15:00, the time for the target terminal to perform the first monitoring task is 17:00, the first predetermined time period is 2 hours, and the second predetermined time period is 1 hour, the target time is 16:00, that is, get at least one time point between 15:00 and 16:00.
目标终端可以是本申请的实施终端本身,也可以是本申请实施终端之外的终端。The target terminal may be the implementing terminal of the present application itself, or a terminal other than the implementing terminal of the present application.
在一个实施例中,目标终端为本申请实施终端之外的终端,在步骤210之前,所述方法包括:获取所述目标终端要执行所述第一监控任务的时间。In one embodiment, the target terminal is a terminal other than the terminal implemented in this application. Before step 210, the method includes: acquiring the time when the target terminal is to execute the first monitoring task.
在一个实施例中,所述目标终端中保存着监控任务列表,所述监控任务列表对应保存着监控任务以及与每一监控任务对应的要执行的时间,所述获取所述目标终端要执行所述第一监控任务的时间,包括:通过脚本爬取所述目标终端中的监控任务列表;利用所述监控任务列表获取所述目标终端要执行所述第一监控任务的时间。In one embodiment, the target terminal stores a monitoring task list, the monitoring task list correspondingly stores monitoring tasks and the time to be executed corresponding to each monitoring task, and the acquisition of the target terminal to execute all the monitoring tasks The time of the first monitoring task includes: crawling the monitoring task list in the target terminal through a script; using the monitoring task list to obtain the time when the target terminal is to execute the first monitoring task.
在一个实施例中,在当前时间与目标时间之间获取至少一个时间点,包括:In one embodiment, obtaining at least one time point between the current time and the target time includes:
在所述当前时间和所述目标时间之间任取预定数目个时间点。A predetermined number of time points are randomly selected between the current time and the target time.
在一个实施例中,在当前时间与目标时间之间获取至少一个时间点,包括:In one embodiment, obtaining at least one time point between the current time and the target time includes:
从当前时间开始,每隔预定时间段获取一个时间点,直至要获取的时间点在所述目标时间之后。Starting from the current time, a time point is acquired every predetermined time period until the time point to be acquired is after the target time.
在一个实施例中,在当前时间与目标时间之间获取至少一个时间点,包括:在要执行 第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;In one embodiment, acquiring at least one point in time between the current time and the target time includes: before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the target terminal executing the first monitoring task The difference between the time of the monitoring task and the current time reaches a first predetermined time period, and the time period between the current time and the target time is divided into a first predetermined number of time periods in chronological order;
针对每一时间段,在该时间段内任取预定数目个时间点,作为在当前时间与目标时间之间获取的至少一个时间点。For each time period, a predetermined number of time points are arbitrarily selected within the time period as at least one time point acquired between the current time and the target time.
在一个实施例中,在当前时间与目标时间之间获取至少一个时间点,包括:In one embodiment, obtaining at least one time point between the current time and the target time includes:
将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;针对每一时间段,任取一个时间点;获取所述目标终端在每一任取的时间点处使用的系统资源;对所述目标终端在各任取的时间点处使用的系统资源从大到小进行排序;获取排序序号小于预定排序阈值的系统资源对应的时间点;针对每一获取的每一时间点所属的时间段,任取预定数目个时间点,作为在当前时间与目标时间之间获取的至少一个时间点。Divide the time period between the current time and the target time into a first predetermined number of time periods in chronological order; for each time period, take any time point; obtain the time taken by the target terminal at each time System resources used at each point; sort the system resources used by the target terminal at each arbitrary point in time from largest to smallest; obtain the time point corresponding to the system resource whose sorting sequence number is less than the predetermined sorting threshold; for each acquisition For the time period to which each time point belongs, any predetermined number of time points can be selected as at least one time point acquired between the current time and the target time.
本实施例的好处在于,通过任取的方式获取每一时间段内有代表性的时间点,然后根据目标终端在任取的时间点处使用的系统资源来确定用于获取时间点的时间段,然后从所述时间段中获取时间点,使得获取的时间点能更好的反映目标终端在目标时间之前的系统资源消耗情况。The advantage of this embodiment is that the representative time point in each time period is obtained in an arbitrary manner, and then the time period for obtaining the time point is determined according to the system resources used by the target terminal at the arbitrary time point. Then, the time point is obtained from the time period, so that the obtained time point can better reflect the system resource consumption of the target terminal before the target time.
在一个实施例中,在当前时间与目标时间之间获取至少一个时间点,包括:In one embodiment, obtaining at least one time point between the current time and the target time includes:
获取当前时间;从当前时间开始,当经过预定时间段后,获取一个时间点;判断所述目标终端在获取的该时间点处使用的系统资源是否大于所述目标终端在当前时间使用的系统资源;如果是,当再次经过预定时间段后,再次获取一个时间点并判断所述目标终端在获取的该时间点处使用的系统资源是否大于所述目标终端在获取的前一时间点处使用的系统资源,依次类推,直至获取的时间点在所述目标时间之后或者所述目标终端在获取的该时间点处使用的系统资源不大于所述目标终端在获取的前一时间点处使用的系统资源;在获取的每相邻两个时间点之间任取预定数目个时间点,作为在当前时间与目标时间之间获取的至少一个时间点。Obtain the current time; from the current time, after a predetermined period of time has passed, obtain a time point; determine whether the system resources used by the target terminal at the obtained time point are greater than the system resources used by the target terminal at the current time If yes, when the predetermined time period has elapsed again, obtain a time point again and determine whether the system resources used by the target terminal at the time point obtained are greater than the system resources used by the target terminal at the previous time point obtained System resources, and so on, until the acquisition time point is after the target time or the system resources used by the target terminal at the acquisition time point are not greater than the system resources used by the target terminal at the previous time point acquisition Resources; a predetermined number of time points are randomly selected between every two adjacent time points acquired as at least one time point acquired between the current time and the target time.
步骤220,获取所述目标终端在每一所述时间点使用的系统资源。Step 220: Obtain system resources used by the target terminal at each time point.
系统资源是所述目标终端运行时所消耗的各种资源,比如可以是内存资源、处理器处理资源、磁盘IO资源等。System resources are various resources consumed when the target terminal is running, such as memory resources, processor processing resources, disk IO resources, and so on.
在一个实施例中,所述目标终端中携带有日志,所述日志记录了所述目标终端在每一所述时间点时使用的系统资源,所述获取所述目标终端在每一所述时间点使用的系统资源,包括:获取所述目标终端中的日志;利用所述日志获取所述目标终端在每一所述时间点使用的系统资源。In one embodiment, the target terminal carries a log that records the system resources used by the target terminal at each time point, and the acquisition of the target terminal at each time point Pointing the used system resources includes: obtaining logs in the target terminal; using the logs to obtain system resources used by the target terminal at each point in time.
在一个实施例中,所述目标终端为本端,通过读取存储在本端中的日志获取所述目标终端中的日志。In one embodiment, the target terminal is the local terminal, and the log in the target terminal is obtained by reading the log stored in the local terminal.
在一个实施例中,所述目标终端为本端之外的终端,所述获取所述目标终端中的日志,包括:利用脚本爬取所述目标终端中的日志。In an embodiment, the target terminal is a terminal other than the local terminal, and the obtaining the log in the target terminal includes: using a script to crawl the log in the target terminal.
在一个实施例中,所述目标终端为本端之外的终端,所述获取所述目标终端在每一所述时间点使用的系统资源,包括:向所述目标终端发送获取所述目标终端在每一所述时间点使用的系统资源的请求,所述目标终端会根据所述请求向本端返回在每一所述时间点使用的系统资源;每当当前时间达到每一所述时间点,接收所述目标终端返回的在该时间点处使用的系统资源。In one embodiment, the target terminal is a terminal other than the local terminal, and the obtaining the system resources used by the target terminal at each time point includes: sending to the target terminal to obtain the target terminal For requests for system resources used at each time point, the target terminal will return to the local end the system resources used at each time point according to the request; whenever the current time reaches each time point To receive the system resource used at the time point returned by the target terminal.
在一个实施例中,所述目标终端为本端之外的终端,所述获取所述目标终端在每一所述时间点使用的系统资源,包括:每当当前时间到达所述时间点,向所述目标终端发送获取所述目标终端在所述时间点使用的系统资源的请求,所述目标终端会根据所述请求向本端返回在该时间点使用的系统资源;接收所述目标终端根据每一所述请求向本端返回的系 统资源。In one embodiment, the target terminal is a terminal other than the local terminal, and the acquiring system resources used by the target terminal at each time point includes: whenever the current time reaches the time point, The target terminal sends a request to acquire the system resources used by the target terminal at the time point, the target terminal will return the system resources used at the time point to the local terminal according to the request; The system resource returned to the local end for each request.
步骤230,在所述目标终端在各时间点使用的系统资源满足第一预定条件的情况下,根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务。Step 230: In the case that the system resources used by the target terminal at each point in time meet the first predetermined condition, determine what to use according to the system resources used by the target terminal at each point in time and the first monitoring task. The first monitoring task is replaced by the second monitoring task.
在一个实施例中,系统资源包括CPU使用率和内存使用率,所述第一预定条件包括:所述目标终端在各时间点使用的CPU使用率都大于预定CPU使用率阈值且内存使用率都大于预定内存使用率阈值。In one embodiment, the system resources include CPU usage rate and memory usage rate, and the first predetermined condition includes: the CPU usage rate used by the target terminal at each point in time is greater than a predetermined CPU usage rate threshold and the memory usage rate is both Greater than the predetermined memory usage threshold.
在一个实施例中,系统资源包括CPU使用率和内存使用率,所述第一预定条件包括:所述目标终端在各时间点使用的CPU使用率都小于预定CPU使用率阈值且内存使用率都小于预定内存使用率阈值。In one embodiment, the system resources include CPU usage rate and memory usage rate, and the first predetermined condition includes: the CPU usage rate used by the target terminal at each time point is less than a predetermined CPU usage rate threshold and the memory usage rate is both Less than the predetermined memory usage threshold.
在一个实施例中,系统资源包括CPU使用率和内存使用率,所述第一预定条件包括:各时间点中对应的CPU使用率大于预定CPU使用率阈值且内存使用率大于预定内存使用率阈值的时间点的数目大于预定时间点数目阈值。In one embodiment, the system resource includes CPU usage rate and memory usage rate, and the first predetermined condition includes: the corresponding CPU usage rate at each time point is greater than a predetermined CPU usage rate threshold and the memory usage rate is greater than the predetermined memory usage rate threshold. The number of time points is greater than the predetermined number of time points threshold.
在一个实施例中,系统资源包括CPU使用率和内存使用率,所述第一预定条件包括:各时间点中对应的CPU使用率大于预定CPU使用率阈值或内存使用率大于预定内存使用率阈值的时间点的数目大于预定时间点数目阈值。In one embodiment, the system resource includes CPU usage and memory usage, and the first predetermined condition includes: the corresponding CPU usage at each time point is greater than a predetermined CPU usage threshold or the memory usage is greater than the predetermined memory usage threshold The number of time points is greater than the predetermined number of time points threshold.
在一个实施例中,所述第一监控任务包含多个子任务,所述系统资源包括CPU使用率和内存使用率,所述根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务,包括:In an embodiment, the first monitoring task includes a plurality of subtasks, the system resources include a CPU usage rate and a memory usage rate, and the system resources used by the target terminal at various points in time and the first The monitoring task, determining the second monitoring task to be replaced by the first monitoring task, includes:
利用如下公式获取第二监控任务的目标参数值:Use the following formula to obtain the target parameter value of the second monitoring task:
Figure PCTCN2019103606-appb-000001
Figure PCTCN2019103606-appb-000001
其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的最大值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的最大值,N是所述第一监控任务包含的子任务的数目,b是所述目标参数值;Where M is the maximum value of the memory usage rate in the system resources used by the target terminal at each time point, C is the maximum value of the CPU usage rate in the system resources used by the target terminal at each time point, and N is The number of subtasks included in the first monitoring task, and b is the target parameter value;
根据所述目标参数值获取第二监控任务要包含的子任务的数目;Obtaining the number of subtasks to be included in the second monitoring task according to the target parameter value;
在所述第一监控任务包含的多个子任务中任取所述数目个子任务,作为要将所述第一监控任务替换为的第二监控任务。The number of subtasks is arbitrarily selected from the multiple subtasks included in the first monitoring task as the second monitoring task to be replaced by the first monitoring task.
本实施例的好处在于,使得要将所述第一监控任务替换为的第二监控任务包含的子任务的数量与原第一监控任务以及系统资源有关,通过调整监控任务,在保证监控任务可以维持一定程度的运行的同时,降低了监控任务对目标终端上系统资源的压力,提高了目标终端的稳定性。The advantage of this embodiment is that the number of subtasks included in the second monitoring task to be replaced by the first monitoring task is related to the original first monitoring task and system resources. By adjusting the monitoring task, the monitoring task can be guaranteed While maintaining a certain degree of operation, it reduces the pressure of monitoring tasks on system resources on the target terminal and improves the stability of the target terminal.
在一个实施例中,根据所述目标参数值获取第二监控任务要包含的子任务的数目,包括:获取小于所述目标参数值的最大整数,作为第二监控任务要包含的子任务的数目。In one embodiment, obtaining the number of subtasks to be included in the second monitoring task according to the target parameter value includes: obtaining a maximum integer smaller than the target parameter value as the number of subtasks to be included in the second monitoring task .
在一个实施例中,根据所述目标参数值获取第二监控任务要包含的子任务的数目,包括:获取大于所述目标参数值的最小整数,作为第二监控任务要包含的子任务的数目。In one embodiment, obtaining the number of subtasks to be included in the second monitoring task according to the target parameter value includes: obtaining the smallest integer greater than the target parameter value as the number of subtasks to be included in the second monitoring task .
步骤240,指示所述目标终端停止执行第一监控任务并执行所述第二监控任务。Step 240: Instruct the target terminal to stop executing the first monitoring task and execute the second monitoring task.
目标终端会根据指示停止执行第一监控任务并执行第二监控任务。The target terminal will stop performing the first monitoring task and perform the second monitoring task according to the instruction.
在一个实施例中,所述第一监控任务为重复执行的任务,所述指示所述目标终端停止执行第一监控任务并执行所述第二监控任务具体包括:指示所述目标终端停止执行第一监控任务并在所述目标终端执行所述第一监控任务的时间开始执行所述第二监控任务。In one embodiment, the first monitoring task is a repetitively executed task, and the instructing the target terminal to stop performing the first monitoring task and to perform the second monitoring task specifically includes: instructing the target terminal to stop performing the first monitoring task A monitoring task and starting to execute the second monitoring task at the time when the target terminal executes the first monitoring task.
在一个实施例中,目标终端为本端之外的终端,步骤240具体包括:向目标终端发送用于指示所述目标终端执行第一监控任务并执行所述第二监控任务的请求。In one embodiment, the target terminal is a terminal other than the local terminal, and step 240 specifically includes: sending a request for instructing the target terminal to perform the first monitoring task and to perform the second monitoring task to the target terminal.
在一个实施例中,目标终端为本端,本端的要执行的监控任务记录在预设的监控任务列表中,步骤240具体包括:将监控任务列表中的第一监控任务替换为所述第二监控任务, 从而使所述目标终端停止执行第一监控任务并执行所述第二监控任务。In one embodiment, the target terminal is the local terminal, and the monitoring task to be executed on the local terminal is recorded in a preset monitoring task list. Step 240 specifically includes: replacing the first monitoring task in the monitoring task list with the second monitoring task. Monitoring tasks, so that the target terminal stops performing the first monitoring task and executes the second monitoring task.
综上所述,根据图2实施例提供的监控任务动态调整方法,在执行第一监控任务之前首先获取时间点,然后根据目标终端在获取的时间点处的系统资源占用情况来调整第一监控任务,使得目标终端实际执行的监控任务能够根据系统资源的占用情况进行适应性调整,提高了目标终端的稳定性和可靠性,也可以在一定程度上保证监控任务可以继续进行。In summary, according to the monitoring task dynamic adjustment method provided in the embodiment of FIG. 2, before the first monitoring task is executed, the time point is first acquired, and then the first monitoring is adjusted according to the system resource occupation of the target terminal at the acquired time point. Tasks enable the monitoring tasks actually performed by the target terminal to be adaptively adjusted according to the occupancy of system resources, which improves the stability and reliability of the target terminal, and can also ensure that the monitoring task can continue to a certain extent.
图3是根据图2对应实施例示出的一实施例的步骤230的流程图。如图3所示,包括以下步骤:FIG. 3 is a flowchart of step 230 in an embodiment shown according to the embodiment corresponding to FIG. 2. As shown in Figure 3, it includes the following steps:
步骤231,根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的执行间隔时间:Step 231: According to the system resources used by the target terminal at each time point and the first monitoring task, the following formula is used to determine the execution interval of the second monitoring task:
T 2=T 1(e M+e C), T 2 = T 1 (e M + e C ),
其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 1是所述第三预定时间段,T 2是所述第二监控任务的执行间隔时间。 Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, T 1 Is the third predetermined time period, and T 2 is the execution interval of the second monitoring task.
所述目标终端在各时间点使用的系统资源中的内存使用率的平均值反映了所述目标终端在所述各时间点所属的时间段使用的内存使用率的集中趋势,同理,所述目标终端在各时间点使用的CPU使用率的平均值反映了所述目标终端在各时间点所属的时间段使用的内存使用率的集中趋势,在上述公式中,M和C越大,第二监控任务的执行间隔时间与第三预定时间段相比,增加得越多。The average value of the memory usage rate in the system resources used by the target terminal at each time point reflects the central trend of the memory usage rate used by the target terminal in the time period to which each time point belongs. Similarly, the The average value of the CPU usage rate used by the target terminal at each time point reflects the central tendency of the memory usage rate used by the target terminal at each time point. In the above formula, the greater the M and C, the second Compared with the third predetermined time period, the execution interval of the monitoring task increases more.
步骤233,针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务。Step 233: Regarding the first monitoring task, a third predetermined period of time between repeated executions of the first monitoring task is set as the execution interval of the second monitoring task to obtain the second monitoring task.
在图3提供的实施例中,所述目标终端在各时间点使用的系统资源中的内存使用率的平均值或者所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值越大,与第一监控任务的执行间隔的第三预定时间段相比,得到的所述第二监控任务的执行间隔时间越大,即使得所述第二监控任务的执行周期变长,从而减少所述目标终端在使用系统资源较多时监控任务要在目标终端占用的系统资源,提高了目标终端的稳定性。In the embodiment provided in FIG. 3, the average value of the memory usage rate in the system resources used by the target terminal at each time point or the average value of the CPU usage rate in the system resources used by the target terminal at each time point The larger is, compared with the third predetermined time period of the execution interval of the first monitoring task, the obtained execution interval of the second monitoring task is larger, that is, the execution period of the second monitoring task becomes longer, thereby When the target terminal uses a lot of system resources, the system resource occupied by the monitoring task on the target terminal is reduced, and the stability of the target terminal is improved.
在一个实施例中,所述第一监控任务包括:每隔第三预定时间段获取在第四预定时间段内对应的特征数据满足预定规则的待监控对象,所述第四预定时间段小于第三预定时间段,所述第四预定时间段与第三预定时间段有共同的时间段,步骤231之后步骤以及步骤233的细节的流程图如图4所示。特征数据是与待监控对象对应的数据,可以是待监控对象的行为、动作产生的数据或者属性数据,易于理解,在本实施例中,通过对待监控对象的特征数据是否满足预定规则的判断实现对待监控对象的监控。比如,待监控对象为账号,特征数据包括账号的收款金额、账号的转账金额等,如果要监控账号是否涉嫌薅羊毛行为,预定规则可以为账号转账金额大于预定金额阈值,这样,利用预定规则对待监控对象的特征数据进行判断,就可以实现对待监控对象的监控。In an embodiment, the first monitoring task includes: acquiring objects to be monitored whose corresponding characteristic data meets a predetermined rule within a fourth predetermined time period every third predetermined time period, and the fourth predetermined time period is less than the first Three predetermined time periods. The fourth predetermined time period and the third predetermined time period have a common time period. The flowchart of the steps after step 231 and the details of step 233 is shown in FIG. 4. Feature data is data corresponding to the object to be monitored, which can be data or attribute data generated by the behavior or action of the object to be monitored. It is easy to understand. In this embodiment, it is achieved by judging whether the feature data of the object to be monitored meets predetermined rules. The monitoring of the object to be monitored. For example, the object to be monitored is an account, and the characteristic data includes the payment amount of the account, the transfer amount of the account, etc. If you want to monitor whether the account is suspected of pilfering behavior, the predetermined rule can be that the account transfer amount is greater than the predetermined amount threshold. By judging the characteristic data of the object to be monitored, the monitoring of the object to be monitored can be realized.
如图4所示,可以包括以下步骤:As shown in Figure 4, the following steps can be included:
步骤232,根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的待监控对象获取时间范围:Step 232: According to the system resources used by the target terminal at each time point and the first monitoring task, the following formula is used to determine the acquisition time range of the object to be monitored for the second monitoring task:
Figure PCTCN2019103606-appb-000002
Figure PCTCN2019103606-appb-000002
其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 3是所述第四预定时间段,T 4是所述第二监控任务的待监控对象获取时间范围。 Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, and T 3 Is the fourth predetermined time period, and T 4 is the acquisition time range of the object to be monitored for the second monitoring task.
所述目标终端在各时间点使用的系统资源中的内存使用率的平均值越大或者所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值越大,与所述目标终端执行第一监控任务时要获取待监控对象的时间范围相比,得到的第二监控任务的待监控对象获取 时间范围越小,即第二监控任务的任务量比第一监控任务更小,从而减少目标终端在执行监控任务时的资源消耗。The greater the average value of the memory usage rate in the system resources used by the target terminal at each time point or the greater the average value of the CPU usage rate in the system resources used by the target terminal at each time point, the greater the difference with the target Compared with the time range for acquiring the object to be monitored when the terminal performs the first monitoring task, the obtained second monitoring task has a smaller acquisition time range for the object to be monitored, that is, the task volume of the second monitoring task is smaller than that of the first monitoring task. This reduces the resource consumption of the target terminal when performing monitoring tasks.
步骤233',针对所述第一监控任务,将所述第一监控任务的第三预定时间段置为所述第二监控任务的执行间隔时间并且将所述第一监控任务的第四预定时间段置为所述第二监控任务的待监控对象获取时间范围,得到第二监控任务。Step 233', for the first monitoring task, the third predetermined time period of the first monitoring task is set as the execution interval time of the second monitoring task and the fourth predetermined time period of the first monitoring task is set Set the segment to the acquisition time range of the object to be monitored of the second monitoring task to obtain the second monitoring task.
对于与每隔一个时间段获取在另一时间段内的待监控对象,然后进行判断这种形式的监控任务类似的监控任务,在本实施例中,通过对第一监控任务执行的间隔时间以及待监控对象获取时间范围分别进行置换,实现了监控任务的动态调整,当目标终端在获取的时间点处使用的资源较多时,会使得获取的第二监控任务的任务量大大降低,降低了监控任务对目标终端上系统资源的压力,提高了目标终端的稳定性。For a monitoring task similar to that of acquiring the object to be monitored in another time period every other time period, and then judging the monitoring task of this form, in this embodiment, the interval time between the execution of the first monitoring task and The acquisition time range of the object to be monitored is replaced separately, which realizes the dynamic adjustment of the monitoring task. When the target terminal uses more resources at the acquisition time point, the task volume of the second monitoring task acquired will be greatly reduced, which reduces the monitoring The task pressure on the system resources on the target terminal improves the stability of the target terminal.
图5是根据图2对应实施例示出的一实施例的步骤240之后步骤的流程图。如图5所示,包括以下步骤:FIG. 5 is a flowchart of steps after step 240 in an embodiment shown according to the embodiment corresponding to FIG. 2. As shown in Figure 5, it includes the following steps:
步骤250,响应于所述目标终端开始执行所述第二监控任务,获取所述目标终端使用的系统资源。Step 250: Acquire system resources used by the target terminal in response to the target terminal starting to execute the second monitoring task.
在一个实施例中,目标终端为本端之外的终端,当所述目标终端开始执行所述第二监控任务,会触发所述目标终端向本端返回所述目标终端使用的系统资源。In one embodiment, the target terminal is a terminal other than the local terminal, and when the target terminal starts to execute the second monitoring task, the target terminal is triggered to return the system resources used by the target terminal to the local terminal.
步骤260,在所述目标终端使用的系统资源不满足第一预定条件的情况下,指示所述目标终端在下次要执行所述第二监控任务时,停止执行所述第二监控任务并执行所述第一监控任务。Step 260: In the case where the system resources used by the target terminal do not meet the first predetermined condition, instruct the target terminal to stop executing the second monitoring task and execute all the second monitoring tasks when the second monitoring task is to be executed next time. Describe the first monitoring task.
在本实施例中,在目标终端执行第二监控任务之后,通过再次以目标终端使用的系统资源以及第一预定条件为基准来确定调整监控任务,实现了监控任务的持续调整,使得目标终端使用的系统资源更为均衡。In this embodiment, after the target terminal executes the second monitoring task, the system resources used by the target terminal and the first predetermined condition are used as the reference to determine the adjustment monitoring task, which realizes the continuous adjustment of the monitoring task, so that the target terminal uses The system resources are more balanced.
图6是根据图2对应实施例示出的一实施例的步骤210的细节的流程图。如图6所示,包括以下步骤:FIG. 6 is a detailed flowchart of step 210 according to an embodiment shown in the embodiment corresponding to FIG. 2. As shown in Figure 6, it includes the following steps:
步骤211,在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段。Step 211: Before the target terminal that is to perform the first monitoring task executes the first monitoring task, in response to the difference between the target terminal executing the first monitoring task and the current time reaching a first predetermined period of time, The time period between the current time and the target time is divided into a first predetermined number of time periods according to the time sequence.
在一个实施例中,将所述当前时间与目标时间之间的时间段均匀划分为第一预定数目个时间段。In one embodiment, the time period between the current time and the target time is evenly divided into a first predetermined number of time periods.
比如,所述当前时间与目标时间之间的时间段为10:00~12:00,第一预定数目为4,则划分成的时间段可以为(10:00,10:30]、(10:30,11:00]、(11:00,11:30]和(11:30,12:00]。For example, if the time period between the current time and the target time is 10:00~12:00, and the first predetermined number is 4, the divided time period can be (10:00,10:30], (10 :30,11:00], (11:00,11:30] and (11:30,12:00].
步骤212,从第一个时间段开始,按照时间先后顺序,针对每一时间段,每当判断所述目标终端在该时间段的两个端点处的时间点使用的系统资源都满足第二预定条件,就在该时间段内任取第二预定数目个时间点,并继续针对下一时间段进行判断,直至判断所述目标终端在所针对的时间段的两个端点处的时间点使用的系统资源不都满足第二预定条件或者针对所有的时间段都进行了判断。 Step 212, starting from the first time period, in chronological order, for each time period, whenever it is determined that the system resources used by the target terminal at the two end points of the time period meet the second predetermined Condition, just take the second predetermined number of time points within the time period, and continue to judge the next time period until it is judged that the target terminal uses the time points at the two end points of the targeted time period The system resources do not all satisfy the second predetermined condition or the judgment is made for all time periods.
第二预定条件可以是与第一预定条件相同的条件,也可以是不同的条件。比如,系统资源可以包括内存使用率和CPU使用率,第一预定条件可以为所述目标终端在各时间点的内存使用率大于80%且CPU使用率大于85%,而第二预定条件可以为所述目标终端在各时间点的内存使用率大于60%且CPU使用率大于75%。The second predetermined condition may be the same condition as the first predetermined condition, or may be a different condition. For example, the system resource may include a memory usage rate and a CPU usage rate. The first predetermined condition may be that the memory usage rate of the target terminal at each time point is greater than 80% and the CPU usage rate is greater than 85%, and the second predetermined condition may be The memory usage rate of the target terminal at each time point is greater than 60% and the CPU usage rate is greater than 75%.
步骤213,将针对每一时间段获取的第二预定数目个时间点作为在当前时间与目标时间之间获取的至少一个时间点。Step 213: Use the second predetermined number of time points acquired for each time period as at least one time point acquired between the current time and the target time.
目标终端在各时间区间的端点处的时间点所使用的系统资源往往代表了目标终端使用的系统资源在时序上的发展趋势,在本实施例中,通过以目标终端在时间区间的端点处使用的系统资源为基准来获取时间点,使得获取的时间点更具有代表性。The system resources used by the target terminal at the end points of each time interval often represent the development trend of the system resources used by the target terminal in the time sequence. In this embodiment, the target terminal is used at the end points of the time interval. The time point is obtained based on the system resources of, which makes the time point obtained more representative.
本申请还提供了一种监控任务动态调整装置,以下是本申请的装置实施例。This application also provides a device for dynamically adjusting monitoring tasks. The following are device embodiments of the application.
图7是根据一示例性实施例示出的一种监控任务动态调整装置的框图。如图7所示,该装置700包括:Fig. 7 is a block diagram showing a device for dynamically adjusting a monitoring task according to an exemplary embodiment. As shown in FIG. 7, the device 700 includes:
时间点获取模块710,被配置为在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,所述目标终端执行所述第一监控任务的时间与所述目标时间的差值为第二预定时间段,所述第二预定时间段小于第一预定时间段;The time point acquisition module 710 is configured to respond to the difference between the target terminal performing the first monitoring task and the current time reaching the first monitoring task before the target terminal performing the first monitoring task performs the first monitoring task. A predetermined time period, at least one time point is acquired between the current time and the target time, the difference between the time when the target terminal executes the first monitoring task and the target time is a second predetermined time period, and the second The predetermined time period is less than the first predetermined time period;
系统资源获取模块720,被配置为获取所述目标终端在每一所述时间点使用的系统资源;The system resource obtaining module 720 is configured to obtain the system resources used by the target terminal at each time point;
确定模块730,被配置为在所述目标终端在各时间点使用的系统资源满足第一预定条件的情况下,根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务;The determining module 730 is configured to, when the system resources used by the target terminal at each time point meet a first predetermined condition, according to the system resources used by the target terminal at each time point and the first monitoring task, Determine the second monitoring task to be replaced by the first monitoring task;
指示模块740,被配置为指示所述目标终端停止执行第一监控任务并执行所述第二监控任务。The instruction module 740 is configured to instruct the target terminal to stop performing the first monitoring task and perform the second monitoring task.
在一个实施例中,所述第一监控任务为每隔第三预定时间段重复执行的任务,所述系统资源包括CPU使用率和内存使用率,所述第一预定条件包括CPU使用率大于预定CPU使用率阈值或者内存使用率大于预定内存使用率阈值的时间点的数目与获取的时间点的总数的比值小于预定比值阈值,所述根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务,包括:In one embodiment, the first monitoring task is a task that is repeatedly executed every third predetermined time period, the system resources include a CPU usage rate and a memory usage rate, and the first predetermined condition includes that the CPU usage rate is greater than a predetermined time period. The ratio of the number of time points at which the CPU usage threshold or the memory usage rate is greater than the predetermined memory usage threshold to the total number of time points obtained is less than the predetermined ratio threshold, according to the system resources used by the target terminal at each time point and all The first monitoring task and determining the second monitoring task to be replaced by the first monitoring task include:
根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的执行间隔时间:According to the system resources used by the target terminal at each point in time and the first monitoring task, the following formula is used to determine the execution interval of the second monitoring task:
T 2=T 1(e M+e C), T 2 = T 1 (e M + e C ),
其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 1是所述第三预定时间段,T 2是所述第二监控任务的执行间隔时间; Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, T 1 Is the third predetermined time period, and T 2 is the execution interval of the second monitoring task;
针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务。For the first monitoring task, a third predetermined period of time between repeated executions of the first monitoring task is set as the execution interval of the second monitoring task to obtain the second monitoring task.
在一个实施例中,所述第一监控任务包括:每隔第三预定时间段获取在第四预定时间段内对应的特征数据满足预定规则的待监控对象,所述第四预定时间段小于第三预定时间段,所述第四预定时间段与第三预定时间段有共同的时间段,所述确定模块被进一步配置为在根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用公式确定所述第二监控任务的执行间隔时间之后:In an embodiment, the first monitoring task includes: acquiring objects to be monitored whose corresponding characteristic data meets a predetermined rule within a fourth predetermined time period every third predetermined time period, and the fourth predetermined time period is less than the first Three predetermined time periods, where the fourth predetermined time period and the third predetermined time period have a common time period, and the determining module is further configured to use system resources at each time point according to the target terminal and the first For a monitoring task, after determining the execution interval of the second monitoring task using a formula:
根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的待监控对象获取时间范围:According to the system resources used by the target terminal at each point in time and the first monitoring task, the following formula is used to determine the acquisition time range of the object to be monitored for the second monitoring task:
Figure PCTCN2019103606-appb-000003
Figure PCTCN2019103606-appb-000003
其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 3是所述第四预定时间段,T 4是所述第二监控任务的待监控对象获取时间范围; Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, and T 3 Is the fourth predetermined time period, and T 4 is the acquisition time range of the object to be monitored for the second monitoring task;
所述针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务,包括:For the first monitoring task, setting the third predetermined period of time between repeated execution of the first monitoring task as the execution interval of the second monitoring task to obtain the second monitoring task includes:
针对所述第一监控任务,将所述第一监控任务的第三预定时间段置为所述第二监控任务的执行间隔时间并且将所述第一监控任务的第四预定时间段置为所述第二监控任务的待监控对象获取时间范围,得到第二监控任务。For the first monitoring task, the third predetermined time period of the first monitoring task is set as the execution interval time of the second monitoring task and the fourth predetermined time period of the first monitoring task is set to all Obtain the second monitoring task by obtaining the time range of the object to be monitored for the second monitoring task.
在一个实施例中,所述第一监控任务为每隔第一预定时间段重复执行的任务,所述指示所述目标终端停止执行第一监控任务并执行所述第二监控任务,包括:In one embodiment, the first monitoring task is a task that is repeatedly executed every first predetermined period of time, and the instructing the target terminal to stop performing the first monitoring task and execute the second monitoring task includes:
指示所述目标终端停止执行第一监控任务并在所述目标终端执行所述第一监控任务的时间开始执行所述第二监控任务。Instruct the target terminal to stop executing the first monitoring task and start executing the second monitoring task at the time when the target terminal executes the first monitoring task.
在一个实施例中,所述第二监控任务为每隔第五预定时间段重复执行的任务,所述指示模块还被配置为在指示所述目标终端停止执行第一监控任务并执行所述第二监控任务之后:响应于所述目标终端开始执行所述第二监控任务,获取所述目标终端使用的系统资源;在所述目标终端使用的系统资源不满足第一预定条件的情况下,指示所述目标终端在下次要执行所述第二监控任务时,停止执行所述第二监控任务并执行所述第一监控任务。In one embodiment, the second monitoring task is a task that is repeatedly executed every fifth predetermined time period, and the instruction module is further configured to instruct the target terminal to stop performing the first monitoring task and execute the first monitoring task. 2. After the monitoring task: in response to the target terminal starting to execute the second monitoring task, acquiring the system resources used by the target terminal; in the case where the system resources used by the target terminal do not meet the first predetermined condition, instruct When the target terminal is to execute the second monitoring task next time, stop executing the second monitoring task and execute the first monitoring task.
在一个实施例中,所述在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,包括:在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;针对每一时间段,在该时间段内任取预定数目个时间点,作为在当前时间与目标时间之间获取的至少一个时间点。In one embodiment, before the target terminal that is to execute the first monitoring task executes the first monitoring task, respond to the difference between the time at which the target terminal executes the first monitoring task and the current time reaches a first predetermined The time period, acquiring at least one point in time between the current time and the target time, includes: before the target terminal that is to perform the first monitoring task performs the first monitoring task, responding to the target terminal performing the first monitoring task When the difference between the time and the current time reaches the first predetermined time period, the time period between the current time and the target time is divided into a first predetermined number of time periods in chronological order; for each time period, at the time Any predetermined number of time points in the segment can be taken as at least one time point obtained between the current time and the target time.
在一个实施例中,所述在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,包括:在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;从第一个时间段开始,按照时间先后顺序,针对每一时间段,每当判断所述目标终端在该时间段的两个端点处的时间点使用的系统资源都满足第二预定条件,就在该时间段内任取第二预定数目个时间点,并继续针对下一时间段进行判断,直至判断所述目标终端在所针对的时间段的两个端点处的时间点使用的系统资源不都满足第二预定条件或者针对所有的时间段都进行了判断;将针对每一时间段获取的第二预定数目个时间点作为在当前时间与目标时间之间获取的至少一个时间点。In one embodiment, before the target terminal that is to execute the first monitoring task executes the first monitoring task, respond to the difference between the time at which the target terminal executes the first monitoring task and the current time reaches a first predetermined The time period, acquiring at least one point in time between the current time and the target time, includes: before the target terminal that is to perform the first monitoring task performs the first monitoring task, responding to the target terminal performing the first monitoring task When the difference between the time and the current time reaches the first predetermined time period, the time period between the current time and the target time is divided into a first predetermined number of time periods in chronological order; starting from the first time period, according to Time sequence. For each time period, whenever it is judged that the system resources used by the target terminal at the two end points of the time period meet the second predetermined condition, the second one is selected within the time period. A predetermined number of time points, and continue to judge for the next time period, until it is judged that the system resources used by the target terminal at the time points at the two end points of the targeted time period do not meet the second predetermined condition or for all The time periods of are all judged; the second predetermined number of time points obtained for each time period are taken as at least one time point obtained between the current time and the target time.
根据本申请的第三方面,还提供了一种计算设备,执行上述任一所示的监控任务动态调整方法的全部或者部分步骤。该计算设备包括:According to the third aspect of the present application, a computing device is also provided, which executes all or part of the steps of any of the above-mentioned methods for dynamically adjusting monitoring tasks. The computing equipment includes:
至少一个处理器;以及At least one processor; and
与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如上述任一个示例性实施例所示出的监控任务动态调整方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute as shown in any one of the above exemplary embodiments. Dynamic adjustment method for monitoring tasks.
所属技术领域的技术人员能够理解,本申请的各个方面可以实现为系统、方法或程序产品。因此,本申请的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。Those skilled in the art can understand that various aspects of the present application can be implemented as a system, method, or program product. Therefore, each aspect of the present application can be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which can be collectively referred to herein as "Circuit", "Module" or "System".
下面参照图8来描述根据本申请的这种实施方式的计算设备800。图8显示的计算设备800仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。The computing device 800 according to this embodiment of the present application will be described below with reference to FIG. 8. The computing device 800 shown in FIG. 8 is only an example, and should not bring any limitation to the functions and usage scope of the embodiments of the present application.
如图8所示,计算设备800以通用计算设备的形式表现。计算设备800的组件可以包括但不限于:上述至少一个处理单元810、上述至少一个存储单元820、连接不同系统组 件(包括存储单元820和处理单元810)的总线830。As shown in FIG. 8, the computing device 800 is represented in the form of a general-purpose computing device. The components of the computing device 800 may include, but are not limited to: the aforementioned at least one processing unit 810, the aforementioned at least one storage unit 820, and a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810).
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元810执行,使得所述处理单元810执行本说明书上述“实施例方法”部分中描述的根据本申请各种示例性实施方式的步骤。Wherein, the storage unit stores program code, and the program code can be executed by the processing unit 810, so that the processing unit 810 executes the various exemplary methods described in the "Methods of Embodiments" section of this specification. Implementation steps.
存储单元820可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)821和/或高速缓存存储单元822,还可以进一步包括只读存储单元(ROM)823。The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 821 and/or a cache storage unit 822, and may further include a read-only storage unit (ROM) 823.
存储单元820还可以包括具有一组(至少一个)程序模块825的程序/实用工具824,这样的程序模块825包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。The storage unit 820 may also include a program/utility tool 824 having a set (at least one) program module 825. Such program module 825 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples or some combination may include the implementation of a network environment.
总线830可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。The bus 830 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure among multiple bus structures. bus.
计算设备800也可以与一个或多个外部设备1000(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该计算设备800交互的设备通信,和/或与使得该计算设备800能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口850进行。并且,计算设备800还可以通过网络适配器860与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器860通过总线830与计算设备800的其它模块通信。应当明白,尽管图中未示出,可以结合计算设备800使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The computing device 800 may also communicate with one or more external devices 1000 (such as keyboards, pointing devices, Bluetooth devices, etc.), and may also communicate with one or more devices that enable users to interact with the computing device 800, and/or communicate with Any device (eg, router, modem, etc.) that enables the computing device 800 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 850. In addition, the computing device 800 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 860. As shown in the figure, the network adapter 860 communicates with other modules of the computing device 800 through the bus 830. It should be understood that although not shown in the figure, other hardware and/or software modules can be used in conjunction with the computing device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本申请实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本申请实施方式的方法。Through the description of the foregoing embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which may be a personal computer, server, terminal device, or network device, etc.) execute the method according to the embodiment of the present application.
根据本申请的第四方面,还提供了一种计算机非易失性可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。在一些可能的实施方式中,本申请的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在终端设备上运行时,所述程序代码用于使所述终端设备执行本说明书上述“示例性方法”部分中描述的根据本申请各种示例性实施方式的步骤。According to the fourth aspect of the present application, there is also provided a computer non-volatile readable storage medium on which is stored a program product capable of implementing the above-mentioned method in this specification. In some possible implementation manners, various aspects of the present application can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to enable the The terminal device executes the steps according to various exemplary embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
参考图9所示,描述了根据本申请的实施方式的用于实现上述方法的计算机非易失性可读存储介质900,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本申请的程序产品不限于此,在本文件中,计算机非易失性可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。With reference to FIG. 9, a computer non-volatile readable storage medium 900 for implementing the above method according to an embodiment of the present application is described, which may adopt a portable compact disk read-only memory (CD-ROM) and includes program code , And can run on terminal devices, such as personal computers. However, the program product of this application is not limited to this. In this document, the computer non-volatile readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device, or device. In conjunction with.
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product can use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光 信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。The computer-readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。The program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言的任意组合来编写用于执行本申请操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。The program code used to perform the operations of this application can be written in any combination of one or more programming languages. The programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural Programming language-such as "C" language or similar programming language. The program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on. In the case of a remote computing device, the remote computing device can be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using Internet service providers) Business to connect via the Internet).
此外,上述附图仅是根据本申请示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。In addition, the above-mentioned drawings are only schematic illustrations of the processing included in the method according to the exemplary embodiments of the present application, and are not intended for limitation. It is easy to understand that the processing shown in the above drawings does not indicate or limit the time sequence of these processings. In addition, it is easy to understand that these processes can be executed synchronously or asynchronously in multiple modules, for example.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围执行各种修改和改变。本申请的范围仅由所附的权利要求来限制。It should be understood that the present application is not limited to the precise structure that has been described above and shown in the drawings, and various modifications and changes can be performed without departing from its scope. The scope of the application is only limited by the appended claims.

Claims (28)

  1. 一种监控任务动态调整方法,其特征在于,所述方法包括:A method for dynamically adjusting monitoring tasks, characterized in that the method includes:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,所述目标终端执行所述第一监控任务的时间与所述目标时间的差值为第二预定时间段,所述第二预定时间段小于第一预定时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching the first predetermined time period, the current time and the target At least one time point is acquired between times, the difference between the time when the target terminal executes the first monitoring task and the target time is a second predetermined time period, and the second predetermined time period is less than the first predetermined time period ;
    获取所述目标终端在每一所述时间点使用的系统资源;Acquiring system resources used by the target terminal at each time point;
    在所述目标终端在各时间点使用的系统资源满足第一预定条件的情况下,根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务;In the case that the system resources used by the target terminal at each time point meet the first predetermined condition, it is determined that the first monitoring task is to be used according to the system resources used by the target terminal at each time point and the first monitoring task. The second monitoring task replaced by the monitoring task;
    指示所述目标终端停止执行第一监控任务并执行所述第二监控任务。Instruct the target terminal to stop performing the first monitoring task and perform the second monitoring task.
  2. 根据权利要求1所述的方法,其特征在于,所述第一监控任务为每隔第三预定时间段重复执行的任务,所述系统资源包括CPU使用率和内存使用率,所述第一预定条件包括CPU使用率大于预定CPU使用率阈值或者内存使用率大于预定内存使用率阈值的时间点的数目与获取的时间点的总数的比值小于预定比值阈值,所述根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务,包括:The method according to claim 1, wherein the first monitoring task is a task that is repeatedly executed every third predetermined time period, the system resources include a CPU usage rate and a memory usage rate, and the first predetermined The condition includes that the ratio of the number of time points at which the CPU usage rate is greater than the predetermined CPU usage rate threshold or the memory usage rate greater than the predetermined memory usage rate threshold to the total number of time points acquired is less than the predetermined ratio threshold value, and the target terminal at each time Click the used system resources and the first monitoring task, and determine the second monitoring task to be replaced by the first monitoring task, including:
    根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的执行间隔时间:According to the system resources used by the target terminal at each point in time and the first monitoring task, the following formula is used to determine the execution interval of the second monitoring task:
    T 2=T 1(e M+e C), T 2 = T 1 (e M + e C ),
    其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 1是所述第三预定时间段,T 2是所述第二监控任务的执行间隔时间; Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, T 1 Is the third predetermined time period, and T 2 is the execution interval of the second monitoring task;
    针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务。For the first monitoring task, a third predetermined period of time between repeated executions of the first monitoring task is set as the execution interval of the second monitoring task to obtain the second monitoring task.
  3. 根据权利要求2所述的方法,其特征在于,所述第一监控任务包括:每隔第三预定时间段获取在第四预定时间段内对应的特征数据满足预定规则的待监控对象,所述第四预定时间段小于第三预定时间段,所述第四预定时间段与第三预定时间段有共同的时间段,在根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用公式确定所述第二监控任务的执行间隔时间之后,所述方法还包括:The method according to claim 2, wherein the first monitoring task comprises: acquiring the object to be monitored whose corresponding characteristic data meets a predetermined rule within a fourth predetermined time period every third predetermined time period, and The fourth predetermined time period is less than the third predetermined time period, and the fourth predetermined time period and the third predetermined time period have a common time period. According to the system resources used by the target terminal at each time point and the first For monitoring tasks, after determining the execution interval of the second monitoring task by using a formula, the method further includes:
    根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的待监控对象获取时间范围:According to the system resources used by the target terminal at each point in time and the first monitoring task, the following formula is used to determine the acquisition time range of the object to be monitored for the second monitoring task:
    Figure PCTCN2019103606-appb-100001
    Figure PCTCN2019103606-appb-100001
    其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 3是所述第四预定时间段,T 4是所述第二监控任务的待监控对象获取时间范围; Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, and T 3 Is the fourth predetermined time period, and T 4 is the acquisition time range of the object to be monitored for the second monitoring task;
    所述针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务,包括:For the first monitoring task, setting the third predetermined period of time between repeated execution of the first monitoring task as the execution interval of the second monitoring task to obtain the second monitoring task includes:
    针对所述第一监控任务,将所述第一监控任务的第三预定时间段置为所述第二监控任务的执行间隔时间并且将所述第一监控任务的第四预定时间段置为所述第二监控任务的待监控对象获取时间范围,得到第二监控任务。For the first monitoring task, the third predetermined time period of the first monitoring task is set as the execution interval time of the second monitoring task and the fourth predetermined time period of the first monitoring task is set to all Obtain the second monitoring task by obtaining the time range of the object to be monitored for the second monitoring task.
  4. 根据权利要求1所述的方法,其特征在于,所述第一监控任务为每隔第一预定时间段重复执行的任务,所述指示所述目标终端停止执行第一监控任务并执行所述第二监控任务, 包括:The method according to claim 1, wherein the first monitoring task is a task that is repeatedly executed every first predetermined time period, and the instructing the target terminal to stop performing the first monitoring task and execute the first monitoring task Two monitoring tasks, including:
    指示所述目标终端停止执行第一监控任务并在所述目标终端执行所述第一监控任务的时间开始执行所述第二监控任务。Instruct the target terminal to stop executing the first monitoring task and start executing the second monitoring task at the time when the target terminal executes the first monitoring task.
  5. 根据权利要求1所述的方法,其特征在于,所述第二监控任务为每隔第五预定时间段重复执行的任务,在指示所述目标终端停止执行第一监控任务并执行所述第二监控任务之后,所述方法还包括:The method according to claim 1, wherein the second monitoring task is a task that is repeatedly executed every fifth predetermined time period, and the target terminal is instructed to stop performing the first monitoring task and execute the second monitoring task. After the monitoring task, the method further includes:
    响应于所述目标终端开始执行所述第二监控任务,获取所述目标终端使用的系统资源;In response to the target terminal starting to execute the second monitoring task, acquiring system resources used by the target terminal;
    在所述目标终端使用的系统资源不满足第一预定条件的情况下,指示所述目标终端在下次要执行所述第二监控任务时,停止执行所述第二监控任务并执行所述第一监控任务。In the case that the system resources used by the target terminal do not meet the first predetermined condition, instruct the target terminal to stop executing the second monitoring task and execute the first monitoring task when the second monitoring task is to be executed next time. Monitoring tasks.
  6. 根据权利要求1所述的方法,其特征在于,所述在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,包括:The method according to claim 1, characterized in that, before the target terminal that is to perform the first monitoring task performs the first monitoring task, respond to the time when the target terminal performs the first monitoring task and the current time When the difference value reaches the first predetermined time period, at least one time point is acquired between the current time and the target time, including:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined time period, the current time The time period from the target time is divided into a first predetermined number of time periods in chronological order;
    针对每一时间段,在该时间段内任取预定数目个时间点,作为在当前时间与目标时间之间获取的至少一个时间点。For each time period, a predetermined number of time points are arbitrarily selected within the time period as at least one time point acquired between the current time and the target time.
  7. 根据权利要求1所述的方法,其特征在于,所述在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,包括:The method according to claim 1, characterized in that, before the target terminal that is to perform the first monitoring task performs the first monitoring task, respond to the time when the target terminal performs the first monitoring task and the current time When the difference value reaches the first predetermined time period, at least one time point is acquired between the current time and the target time, including:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined time period, the current time The time period from the target time is divided into a first predetermined number of time periods in chronological order;
    从第一个时间段开始,按照时间先后顺序,针对每一时间段,每当判断所述目标终端在该时间段的两个端点处的时间点使用的系统资源都满足第二预定条件,就在该时间段内任取第二预定数目个时间点,并继续针对下一时间段进行判断,直至判断所述目标终端在所针对的时间段的两个端点处的时间点使用的系统资源不都满足第二预定条件或者针对所有的时间段都进行了判断;Starting from the first time period, in chronological order, for each time period, whenever it is determined that the system resources used by the target terminal at the two endpoints of the time period meet the second predetermined condition, Take any second predetermined number of time points within this time period, and continue to make judgments for the next time period until it is determined that the system resources used by the target terminal at the two end points of the targeted time period are not All satisfy the second predetermined condition or judge for all time periods;
    将针对每一时间段获取的第二预定数目个时间点作为在当前时间与目标时间之间获取的至少一个时间点。The second predetermined number of time points acquired for each time period are taken as at least one time point acquired between the current time and the target time.
  8. 一种监控任务动态调整装置,其特征在于,所述装置包括:A monitoring task dynamic adjustment device, characterized in that the device includes:
    时间点获取模块,被配置为在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,所述目标终端执行所述第一监控任务的时间与所述目标时间的差值为第二预定时间段,所述第二预定时间段小于第一预定时间段;The time point acquisition module is configured to respond to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined value before the target terminal that is to perform the first monitoring task performs the first monitoring task Time period, at least one time point is acquired between the current time and the target time, the difference between the time when the target terminal executes the first monitoring task and the target time is a second predetermined time period, and the second predetermined The time period is less than the first predetermined time period;
    系统资源获取模块,被配置为获取所述目标终端在每一所述时间点使用的系统资源;The system resource acquisition module is configured to acquire the system resources used by the target terminal at each time point;
    确定模块,被配置为在所述目标终端在各时间点使用的系统资源满足第一预定条件的情况下,根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务;The determining module is configured to determine based on the system resources used by the target terminal at each time point and the first monitoring task in the case that the system resources used by the target terminal at each time point meet a first predetermined condition The second monitoring task to be replaced by the first monitoring task;
    指示模块,被配置为指示所述目标终端停止执行第一监控任务并执行所述第二监控任务。The instruction module is configured to instruct the target terminal to stop performing the first monitoring task and perform the second monitoring task.
  9. 根据权利要求8所述的装置,其特征在于,所述第一监控任务为每隔第三预定时间段重复执行的任务,所述系统资源包括CPU使用率和内存使用率,所述第一预定条件包括CPU使用率大于预定CPU使用率阈值或者内存使用率大于预定内存使用率阈值的时间点的数目与获取的时间点的总数的比值小于预定比值阈值,所述根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务,包括:The device according to claim 8, wherein the first monitoring task is a task that is repeatedly executed every third predetermined time period, the system resources include a CPU usage rate and a memory usage rate, and the first predetermined The condition includes that the ratio of the number of time points at which the CPU usage rate is greater than the predetermined CPU usage rate threshold or the memory usage rate greater than the predetermined memory usage rate threshold to the total number of time points acquired is less than the predetermined ratio threshold value, and the target terminal at each time Click the used system resources and the first monitoring task, and determine the second monitoring task to be replaced by the first monitoring task, including:
    根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的执行间隔时间:According to the system resources used by the target terminal at each point in time and the first monitoring task, the following formula is used to determine the execution interval of the second monitoring task:
    T 2=T 1(e M+e C), T 2 = T 1 (e M + e C ),
    其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 1是所述第三预定时间段,T 2是所述第二监控任务的执行间隔时间; Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, T 1 Is the third predetermined time period, and T 2 is the execution interval of the second monitoring task;
    针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务。For the first monitoring task, a third predetermined period of time between repeated executions of the first monitoring task is set as the execution interval of the second monitoring task to obtain the second monitoring task.
  10. 根据权利要求9所述的装置,其特征在于,所述第一监控任务包括:每隔第三预定时间段获取在第四预定时间段内对应的特征数据满足预定规则的待监控对象,所述第四预定时间段小于第三预定时间段,所述第四预定时间段与第三预定时间段有共同的时间段,所述确定模块被进一步配置为在根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用公式确定所述第二监控任务的执行间隔时间之后:The device according to claim 9, wherein the first monitoring task comprises: acquiring the object to be monitored whose corresponding characteristic data meets a predetermined rule within a fourth predetermined time period every third predetermined time period, and The fourth predetermined time period is less than the third predetermined time period, and the fourth predetermined time period and the third predetermined time period have a common time period, and the determining module is further configured to use the target terminal at each time point according to the After the system resources of and the first monitoring task are determined using a formula to determine the execution interval of the second monitoring task:
    根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的待监控对象获取时间范围:According to the system resources used by the target terminal at each point in time and the first monitoring task, the following formula is used to determine the acquisition time range of the object to be monitored for the second monitoring task:
    Figure PCTCN2019103606-appb-100002
    Figure PCTCN2019103606-appb-100002
    其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 3是所述第四预定时间段,T 4是所述第二监控任务的待监控对象获取时间范围; Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, and T 3 Is the fourth predetermined time period, and T 4 is the acquisition time range of the object to be monitored for the second monitoring task;
    所述针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务,包括:For the first monitoring task, setting the third predetermined period of time between repeated execution of the first monitoring task as the execution interval of the second monitoring task to obtain the second monitoring task includes:
    针对所述第一监控任务,将所述第一监控任务的第三预定时间段置为所述第二监控任务的执行间隔时间并且将所述第一监控任务的第四预定时间段置为所述第二监控任务的待监控对象获取时间范围,得到第二监控任务。For the first monitoring task, the third predetermined time period of the first monitoring task is set as the execution interval time of the second monitoring task and the fourth predetermined time period of the first monitoring task is set to all Obtain the second monitoring task by obtaining the time range of the object to be monitored for the second monitoring task.
  11. 根据权利要求8所述的装置,其特征在于,所述第一监控任务为每隔第一预定时间段重复执行的任务,所述指示所述目标终端停止执行第一监控任务并执行所述第二监控任务,包括:The apparatus according to claim 8, wherein the first monitoring task is a task that is repeatedly executed every first predetermined time period, and the instructing the target terminal to stop performing the first monitoring task and execute the first monitoring task Two monitoring tasks, including:
    指示所述目标终端停止执行第一监控任务并在所述目标终端执行所述第一监控任务的时间开始执行所述第二监控任务。Instruct the target terminal to stop executing the first monitoring task and start executing the second monitoring task at the time when the target terminal executes the first monitoring task.
  12. 根据权利要求8所述的装置,其特征在于,所述第二监控任务为每隔第五预定时间段重复执行的任务,所述指示模块还被配置为在指示所述目标终端停止执行第一监控任务并执行所述第二监控任务之后:The device according to claim 8, wherein the second monitoring task is a task that is repeatedly executed every fifth predetermined time period, and the instruction module is further configured to instruct the target terminal to stop executing the first After the monitoring task and executing the second monitoring task:
    响应于所述目标终端开始执行所述第二监控任务,获取所述目标终端使用的系统资源;In response to the target terminal starting to execute the second monitoring task, acquiring system resources used by the target terminal;
    在所述目标终端使用的系统资源不满足第一预定条件的情况下,指示所述目标终端在下次要执行所述第二监控任务时,停止执行所述第二监控任务并执行所述第一监控任务。In the case that the system resources used by the target terminal do not meet the first predetermined condition, instruct the target terminal to stop executing the second monitoring task and execute the first monitoring task when the second monitoring task is to be executed next time. Monitoring tasks.
  13. 根据权利要求8所述的装置,其特征在于,所述在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,包括:The device according to claim 8, wherein before the target terminal that is to perform the first monitoring task performs the first monitoring task, respond to the time when the target terminal performs the first monitoring task and the current time When the difference value reaches the first predetermined time period, at least one time point is acquired between the current time and the target time, including:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined time period, the current time The time period from the target time is divided into a first predetermined number of time periods in chronological order;
    针对每一时间段,在该时间段内任取预定数目个时间点,作为在当前时间与目标时间之间获取的至少一个时间点。For each time period, a predetermined number of time points are arbitrarily selected within the time period as at least one time point acquired between the current time and the target time.
  14. 根据权利要求8所述的装置,其特征在于,所述在要执行第一监控任务的目标终端 执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,包括:The device according to claim 8, wherein before the target terminal that is to perform the first monitoring task performs the first monitoring task, respond to the time when the target terminal performs the first monitoring task and the current time When the difference value reaches the first predetermined time period, at least one time point is acquired between the current time and the target time, including:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined time period, the current time The time period from the target time is divided into a first predetermined number of time periods in chronological order;
    从第一个时间段开始,按照时间先后顺序,针对每一时间段,每当判断所述目标终端在该时间段的两个端点处的时间点使用的系统资源都满足第二预定条件,就在该时间段内任取第二预定数目个时间点,并继续针对下一时间段进行判断,直至判断所述目标终端在所针对的时间段的两个端点处的时间点使用的系统资源不都满足第二预定条件或者针对所有的时间段都进行了判断;Starting from the first time period, in chronological order, for each time period, whenever it is determined that the system resources used by the target terminal at the two endpoints of the time period meet the second predetermined condition, Take any second predetermined number of time points within this time period, and continue to make judgments for the next time period until it is determined that the system resources used by the target terminal at the two end points of the targeted time period are not All meet the second predetermined condition or judge for all time periods;
    将针对每一时间段获取的第二预定数目个时间点作为在当前时间与目标时间之间获取的至少一个时间点。The second predetermined number of time points acquired for each time period are taken as at least one time point acquired between the current time and the target time.
  15. 一种计算设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行:A computing device includes a memory and a processor, the memory stores computer readable instructions, and when the computer readable instructions are executed by the processor, the processor executes:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,所述目标终端执行所述第一监控任务的时间与所述目标时间的差值为第二预定时间段,所述第二预定时间段小于第一预定时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching the first predetermined time period, the current time and the target At least one time point is acquired between times, the difference between the time when the target terminal executes the first monitoring task and the target time is a second predetermined time period, and the second predetermined time period is less than the first predetermined time period ;
    获取所述目标终端在每一所述时间点使用的系统资源;Acquiring system resources used by the target terminal at each time point;
    在所述目标终端在各时间点使用的系统资源满足第一预定条件的情况下,根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务;In the case that the system resources used by the target terminal at each time point meet the first predetermined condition, it is determined that the first monitoring task is to be used according to the system resources used by the target terminal at each time point and the first monitoring task. The second monitoring task replaced by the monitoring task;
    指示所述目标终端停止执行第一监控任务并执行所述第二监控任务。Instruct the target terminal to stop performing the first monitoring task and perform the second monitoring task.
  16. 根据权利要求15所述的计算设备,其特征在于,所述第一监控任务为每隔第三预定时间段重复执行的任务,所述系统资源包括CPU使用率和内存使用率,所述第一预定条件包括CPU使用率大于预定CPU使用率阈值或者内存使用率大于预定内存使用率阈值的时间点的数目与获取的时间点的总数的比值小于预定比值阈值,所述根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务,包括:The computing device according to claim 15, wherein the first monitoring task is a task that is repeatedly executed every third predetermined time period, the system resources include a CPU usage rate and a memory usage rate, and the first monitoring task The predetermined condition includes that the ratio of the number of time points when the CPU usage rate is greater than the predetermined CPU usage rate threshold or the memory usage rate greater than the predetermined memory usage rate threshold to the total number of time points obtained is less than the predetermined ratio threshold value, and the target terminal is in each The system resources used at the time point and the first monitoring task, and determining the second monitoring task to be replaced by the first monitoring task include:
    根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的执行间隔时间:According to the system resources used by the target terminal at each point in time and the first monitoring task, the following formula is used to determine the execution interval of the second monitoring task:
    T 2=T 1(e M+e C), T 2 = T 1 (e M + e C ),
    其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 1是所述第三预定时间段,T 2是所述第二监控任务的执行间隔时间; Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, T 1 Is the third predetermined time period, and T 2 is the execution interval of the second monitoring task;
    针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务。For the first monitoring task, a third predetermined period of time between repeated executions of the first monitoring task is set as the execution interval of the second monitoring task to obtain the second monitoring task.
  17. 根据权利要求16所述的计算设备,其特征在于,所述第一监控任务包括:每隔第三预定时间段获取在第四预定时间段内对应的特征数据满足预定规则的待监控对象,所述第四预定时间段小于第三预定时间段,所述第四预定时间段与第三预定时间段有共同的时间段,在根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用公式确定所述第二监控任务的执行间隔时间之后,所述计算机可读指令被所述处理器执行时,使得所述处理器还执行:The computing device according to claim 16, wherein the first monitoring task comprises: acquiring, every third predetermined period of time, the corresponding characteristic data in the fourth predetermined period of time to meet a predetermined rule to be monitored, so The fourth predetermined time period is less than the third predetermined time period, and the fourth predetermined time period and the third predetermined time period have a common time period. According to the system resources used by the target terminal at each time point and the first For a monitoring task, after the execution interval of the second monitoring task is determined by a formula, when the computer-readable instruction is executed by the processor, the processor also executes:
    根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的待监控对象获取时间范围:According to the system resources used by the target terminal at each point in time and the first monitoring task, the following formula is used to determine the acquisition time range of the object to be monitored for the second monitoring task:
    Figure PCTCN2019103606-appb-100003
    Figure PCTCN2019103606-appb-100003
    其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 3是所述第四预定时间段,T 4是所述第二监控任务的待监控对象获取时间范围; Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, and T 3 Is the fourth predetermined time period, and T 4 is the acquisition time range of the object to be monitored for the second monitoring task;
    所述针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务,包括:For the first monitoring task, setting the third predetermined period of time between repeated execution of the first monitoring task as the execution interval of the second monitoring task to obtain the second monitoring task includes:
    针对所述第一监控任务,将所述第一监控任务的第三预定时间段置为所述第二监控任务的执行间隔时间并且将所述第一监控任务的第四预定时间段置为所述第二监控任务的待监控对象获取时间范围,得到第二监控任务。For the first monitoring task, the third predetermined time period of the first monitoring task is set as the execution interval time of the second monitoring task and the fourth predetermined time period of the first monitoring task is set to all Obtain the second monitoring task by obtaining the time range of the object to be monitored for the second monitoring task.
  18. 根据权利要求15所述的计算设备,其特征在于,所述第一监控任务为每隔第一预定时间段重复执行的任务,所述指示所述目标终端停止执行第一监控任务并执行所述第二监控任务,包括:The computing device according to claim 15, wherein the first monitoring task is a task that is repeatedly executed every first predetermined time period, and the instructing the target terminal to stop executing the first monitoring task and execute the The second monitoring task includes:
    指示所述目标终端停止执行第一监控任务并在所述目标终端执行所述第一监控任务的时间开始执行所述第二监控任务。Instruct the target terminal to stop executing the first monitoring task and start executing the second monitoring task at the time when the target terminal executes the first monitoring task.
  19. 根据权利要求15所述的计算设备,其特征在于,所述第二监控任务为每隔第五预定时间段重复执行的任务,在指示所述目标终端停止执行第一监控任务并执行所述第二监控任务之后,所述计算机可读指令被所述处理器执行时,使得所述处理器还执行:The computing device according to claim 15, wherein the second monitoring task is a task that is repeatedly executed every fifth predetermined time period, and the target terminal is instructed to stop performing the first monitoring task and execute the first monitoring task. After the second monitoring task, when the computer-readable instructions are executed by the processor, the processor also executes:
    响应于所述目标终端开始执行所述第二监控任务,获取所述目标终端使用的系统资源;In response to the target terminal starting to execute the second monitoring task, acquiring system resources used by the target terminal;
    在所述目标终端使用的系统资源不满足第一预定条件的情况下,指示所述目标终端在下次要执行所述第二监控任务时,停止执行所述第二监控任务并执行所述第一监控任务。In the case that the system resources used by the target terminal do not meet the first predetermined condition, instruct the target terminal to stop executing the second monitoring task and execute the first monitoring task when the second monitoring task is to be executed next time. Monitoring tasks.
  20. 根据权利要求15所述的计算设备,其特征在于,所述在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,包括:The computing device according to claim 15, wherein, before the target terminal that is to perform the first monitoring task executes the first monitoring task, respond to the time when the target terminal executes the first monitoring task and the current When the time difference reaches the first predetermined time period, acquiring at least one time point between the current time and the target time includes:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined time period, the current time The time period from the target time is divided into a first predetermined number of time periods in chronological order;
    针对每一时间段,在该时间段内任取预定数目个时间点,作为在当前时间与目标时间之间获取的至少一个时间点。For each time period, a predetermined number of time points are arbitrarily selected within the time period as at least one time point acquired between the current time and the target time.
  21. 根据权利要求15所述的计算设备,其特征在于,所述在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,包括:The computing device according to claim 15, wherein, before the target terminal that is to perform the first monitoring task executes the first monitoring task, respond to the time when the target terminal executes the first monitoring task and the current When the time difference reaches the first predetermined time period, acquiring at least one time point between the current time and the target time includes:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined time period, the current time The time period between and the target time is divided into a first predetermined number of time periods in chronological order;
    从第一个时间段开始,按照时间先后顺序,针对每一时间段,每当判断所述目标终端在该时间段的两个端点处的时间点使用的系统资源都满足第二预定条件,就在该时间段内任取第二预定数目个时间点,并继续针对下一时间段进行判断,直至判断所述目标终端在所针对的时间段的两个端点处的时间点使用的系统资源不都满足第二预定条件或者针对所有的时间段都进行了判断;Starting from the first time period, in chronological order, for each time period, whenever it is determined that the system resources used by the target terminal at the two endpoints of the time period meet the second predetermined condition, Take any second predetermined number of time points within this time period, and continue to make judgments for the next time period until it is determined that the system resources used by the target terminal at the two end points of the targeted time period are not All meet the second predetermined condition or judge for all time periods;
    将针对每一时间段获取的第二预定数目个时间点作为在当前时间与目标时间之间获取的至少一个时间点。The second predetermined number of time points acquired for each time period are taken as at least one time point acquired between the current time and the target time.
  22. 一种存储有计算机可读指令的计算机非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行:A computer non-volatile readable storage medium storing computer readable instructions, which when executed by one or more processors, cause one or more processors to execute:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所 述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,所述目标终端执行所述第一监控任务的时间与所述目标时间的差值为第二预定时间段,所述第二预定时间段小于第一预定时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching the first predetermined time period, the current time and the target At least one time point is acquired between times, the difference between the time when the target terminal executes the first monitoring task and the target time is a second predetermined time period, and the second predetermined time period is less than the first predetermined time period ;
    获取所述目标终端在每一所述时间点使用的系统资源;Acquiring system resources used by the target terminal at each time point;
    在所述目标终端在各时间点使用的系统资源满足第一预定条件的情况下,根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务;In the case that the system resources used by the target terminal at each time point meet the first predetermined condition, it is determined that the first monitoring task is to be used according to the system resources used by the target terminal at each time point and the first monitoring task. The second monitoring task replaced by the monitoring task;
    指示所述目标终端停止执行第一监控任务并执行所述第二监控任务。Instruct the target terminal to stop performing the first monitoring task and perform the second monitoring task.
  23. 根据权利要求22所述的计算机非易失性可读存储介质,其特征在于,所述第一监控任务为每隔第三预定时间段重复执行的任务,所述系统资源包括CPU使用率和内存使用率,所述第一预定条件包括CPU使用率大于预定CPU使用率阈值或者内存使用率大于预定内存使用率阈值的时间点的数目与获取的时间点的总数的比值小于预定比值阈值,所述根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,确定要将所述第一监控任务替换为的第二监控任务,包括:The computer non-volatile readable storage medium according to claim 22, wherein the first monitoring task is a task that is repeatedly executed every third predetermined time period, and the system resources include CPU usage and memory Usage rate, the first predetermined condition includes that the ratio of the number of time points when the CPU usage rate is greater than a predetermined CPU usage rate threshold or the memory usage rate is greater than the predetermined memory usage rate threshold to the total number of time points acquired is less than the predetermined ratio threshold, the According to the system resources used by the target terminal at each point in time and the first monitoring task, determining the second monitoring task to be replaced by the first monitoring task includes:
    根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的执行间隔时间:According to the system resources used by the target terminal at each point in time and the first monitoring task, the following formula is used to determine the execution interval of the second monitoring task:
    T 2=T 1(e M+e C), T 2 = T 1 (e M + e C ),
    其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 1是所述第三预定时间段,T 2是所述第二监控任务的执行间隔时间; Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, T 1 Is the third predetermined time period, and T 2 is the execution interval of the second monitoring task;
    针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务。For the first monitoring task, a third predetermined period of time between repeated executions of the first monitoring task is set as the execution interval of the second monitoring task to obtain the second monitoring task.
  24. 根据权利要求23所述的计算机非易失性可读存储介质,其特征在于,所述第一监控任务包括:每隔第三预定时间段获取在第四预定时间段内对应的特征数据满足预定规则的待监控对象,所述第四预定时间段小于第三预定时间段,所述第四预定时间段与第三预定时间段有共同的时间段,在根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用公式确定所述第二监控任务的执行间隔时间之后,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器还执行:The computer non-volatile readable storage medium according to claim 23, wherein the first monitoring task comprises: acquiring, every third predetermined time period, corresponding characteristic data in a fourth predetermined time period that satisfies a predetermined The regular object to be monitored, the fourth predetermined time period is less than the third predetermined time period, the fourth predetermined time period and the third predetermined time period have a common time period, according to the target terminal at each time point After the execution interval of the second monitoring task is determined using a formula, the computer-readable instructions are executed by one or more processors, so that one or more processors are carried out:
    根据所述目标终端在各时间点使用的系统资源以及所述第一监控任务,利用如下公式确定所述第二监控任务的待监控对象获取时间范围:According to the system resources used by the target terminal at each point in time and the first monitoring task, the following formula is used to determine the acquisition time range of the object to be monitored for the second monitoring task:
    Figure PCTCN2019103606-appb-100004
    Figure PCTCN2019103606-appb-100004
    其中,M是所述目标终端在各时间点使用的系统资源中的内存使用率的平均值,C是所述目标终端在各时间点使用的系统资源中的CPU使用率的平均值,T 3是所述第四预定时间段,T 4是所述第二监控任务的待监控对象获取时间范围; Where, M is the average value of the memory usage rate in the system resources used by the target terminal at each time point, C is the average value of the CPU usage rate in the system resources used by the target terminal at each time point, and T 3 Is the fourth predetermined time period, and T 4 is the acquisition time range of the object to be monitored for the second monitoring task;
    所述针对所述第一监控任务,将所述第一监控任务重复执行任务所间隔的第三预定时间段置为所述第二监控任务的执行间隔时间,得到第二监控任务,包括:For the first monitoring task, setting the third predetermined period of time between repeated execution of the first monitoring task as the execution interval of the second monitoring task to obtain the second monitoring task includes:
    针对所述第一监控任务,将所述第一监控任务的第三预定时间段置为所述第二监控任务的执行间隔时间并且将所述第一监控任务的第四预定时间段置为所述第二监控任务的待监控对象获取时间范围,得到第二监控任务。For the first monitoring task, the third predetermined time period of the first monitoring task is set as the execution interval time of the second monitoring task and the fourth predetermined time period of the first monitoring task is set to all Obtain the second monitoring task by obtaining the time range of the object to be monitored for the second monitoring task.
  25. 根据权利要求22所述的计算机非易失性可读存储介质,其特征在于,所述第一监控任务为每隔第一预定时间段重复执行的任务,所述指示所述目标终端停止执行第一监控任务并执行所述第二监控任务,包括:The computer non-volatile readable storage medium according to claim 22, wherein the first monitoring task is a task that is repeatedly executed every first predetermined time period, and the instructing the target terminal to stop executing the first monitoring task A monitoring task and executing the second monitoring task includes:
    指示所述目标终端停止执行第一监控任务并在所述目标终端执行所述第一监控任务的时间开始执行所述第二监控任务。Instruct the target terminal to stop executing the first monitoring task and start executing the second monitoring task at the time when the target terminal executes the first monitoring task.
  26. 根据权利要求22所述的计算机非易失性可读存储介质,其特征在于,所述第二监控任务为每隔第五预定时间段重复执行的任务,在指示所述目标终端停止执行第一监控任务并执行所述第二监控任务之后,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器还执行:The computer non-volatile readable storage medium according to claim 22, wherein the second monitoring task is a task that is repeatedly executed every fifth predetermined time period, and the target terminal is instructed to stop executing the first After the monitoring task and the second monitoring task are executed, when the computer-readable instructions are executed by one or more processors, the one or more processors also execute:
    响应于所述目标终端开始执行所述第二监控任务,获取所述目标终端使用的系统资源;In response to the target terminal starting to execute the second monitoring task, acquiring the system resources used by the target terminal;
    在所述目标终端使用的系统资源不满足第一预定条件的情况下,指示所述目标终端在下次要执行所述第二监控任务时,停止执行所述第二监控任务并执行所述第一监控任务。In the case that the system resources used by the target terminal do not meet the first predetermined condition, instruct the target terminal to stop executing the second monitoring task and execute the first monitoring task when the second monitoring task is to be executed next time. Monitoring tasks.
  27. 根据权利要求22所述的计算机非易失性可读存储介质,其特征在于,所述在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,包括:The computer non-volatile readable storage medium according to claim 22, wherein before the target terminal that is to execute the first monitoring task executes the first monitoring task, respond to the target terminal executing the first monitoring task The difference between the time of a monitoring task and the current time reaches the first predetermined time period, and obtaining at least one time point between the current time and the target time includes:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined time period, the current time The time period between and the target time is divided into a first predetermined number of time periods in chronological order;
    针对每一时间段,在该时间段内任取预定数目个时间点,作为在当前时间与目标时间之间获取的至少一个时间点。For each time period, a predetermined number of time points are arbitrarily selected within the time period as at least one time point acquired between the current time and the target time.
  28. 根据权利要求22所述的计算机非易失性可读存储介质,其特征在于,所述在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,在当前时间与目标时间之间获取至少一个时间点,包括:The computer non-volatile readable storage medium according to claim 22, wherein before the target terminal that is to execute the first monitoring task executes the first monitoring task, respond to the target terminal executing the first monitoring task The difference between the time of a monitoring task and the current time reaches the first predetermined time period, and obtaining at least one time point between the current time and the target time includes:
    在要执行第一监控任务的目标终端执行第一监控任务之前,响应于所述目标终端执行所述第一监控任务的时间与当前时间的差值达到第一预定时间段,将所述当前时间与目标时间之间的时间段按照时间先后顺序划分为第一预定数目个时间段;Before the target terminal that is to perform the first monitoring task performs the first monitoring task, in response to the difference between the target terminal performing the first monitoring task and the current time reaching a first predetermined time period, the current time The time period between and the target time is divided into a first predetermined number of time periods in chronological order;
    从第一个时间段开始,按照时间先后顺序,针对每一时间段,每当判断所述目标终端在该时间段的两个端点处的时间点使用的系统资源都满足第二预定条件,就在该时间段内任取第二预定数目个时间点,并继续针对下一时间段进行判断,直至判断所述目标终端在所针对的时间段的两个端点处的时间点使用的系统资源不都满足第二预定条件或者针对所有的时间段都进行了判断;Starting from the first time period, in chronological order, for each time period, whenever it is determined that the system resources used by the target terminal at the two endpoints of the time period meet the second predetermined condition, Take any second predetermined number of time points in this time period, and continue to judge for the next time period until it is judged that the system resources used by the target terminal at the two end points of the targeted time period are not All meet the second predetermined condition or judge for all time periods;
    将针对每一时间段获取的第二预定数目个时间点作为在当前时间与目标时间之间获取的至少一个时间点。The second predetermined number of time points acquired for each time period are taken as at least one time point acquired between the current time and the target time.
PCT/CN2019/103606 2019-05-23 2019-08-30 Monitoring task dynamic adjustment method and apparatus, and computer device and storage medium WO2020232903A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910435802.8 2019-05-23
CN201910435802.8A CN110347546B (en) 2019-05-23 2019-05-23 Dynamic adjustment method, device, medium and electronic equipment for monitoring task

Publications (1)

Publication Number Publication Date
WO2020232903A1 true WO2020232903A1 (en) 2020-11-26

Family

ID=68174292

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103606 WO2020232903A1 (en) 2019-05-23 2019-08-30 Monitoring task dynamic adjustment method and apparatus, and computer device and storage medium

Country Status (2)

Country Link
CN (1) CN110347546B (en)
WO (1) WO2020232903A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124801B (en) * 2019-11-19 2023-06-13 平安科技(深圳)有限公司 Intelligent system resource monitoring method and device and computer readable storage medium
CN111562973B (en) * 2020-04-24 2024-02-06 蘑菇车联信息科技有限公司 Map data task execution method and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000049784A (en) * 1998-07-31 2000-02-18 Hitachi Cable Ltd Remote monitoring device and network management device
CN103246592A (en) * 2013-05-13 2013-08-14 北京搜狐新媒体信息技术有限公司 Monitoring acquisition system and method
CN104363282A (en) * 2014-11-17 2015-02-18 广联达软件股份有限公司 Cloud computing resource scheduling method and device
CN105791033A (en) * 2016-05-09 2016-07-20 浪潮电子信息产业股份有限公司 Method, device and system for regulating operating state of server

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5546686B2 (en) * 2011-06-28 2014-07-09 株式会社日立製作所 Monitoring system and monitoring method
US9400682B2 (en) * 2012-12-06 2016-07-26 Hewlett Packard Enterprise Development Lp Ranking and scheduling of monitoring tasks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000049784A (en) * 1998-07-31 2000-02-18 Hitachi Cable Ltd Remote monitoring device and network management device
CN103246592A (en) * 2013-05-13 2013-08-14 北京搜狐新媒体信息技术有限公司 Monitoring acquisition system and method
CN104363282A (en) * 2014-11-17 2015-02-18 广联达软件股份有限公司 Cloud computing resource scheduling method and device
CN105791033A (en) * 2016-05-09 2016-07-20 浪潮电子信息产业股份有限公司 Method, device and system for regulating operating state of server

Also Published As

Publication number Publication date
CN110347546B (en) 2022-05-17
CN110347546A (en) 2019-10-18

Similar Documents

Publication Publication Date Title
US11782989B1 (en) Correlating data based on user-specified search criteria
US10592522B2 (en) Correlating performance data and log data using diverse data stores
US10877987B2 (en) Correlating log data with performance measurements using a threshold value
US10877986B2 (en) Obtaining performance data via an application programming interface (API) for correlation with log data
US10614132B2 (en) GUI-triggered processing of performance data and log data from an information technology environment
US11119982B2 (en) Correlation of performance data and structure data from an information technology environment
US10997191B2 (en) Query-triggered processing of performance data and log data from an information technology environment
US9304687B1 (en) Virtual data storage service with sparse provisioning
US20140324862A1 (en) Correlation for user-selected time ranges of values for performance metrics of components in an information-technology environment with log data from that information-technology environment
US9965327B2 (en) Dynamically scalable data collection and analysis for target device
JP5324914B2 (en) Method and apparatus for allocating storage resources
WO2020232903A1 (en) Monitoring task dynamic adjustment method and apparatus, and computer device and storage medium
US10235062B1 (en) Selection of computer resources to perform file operations in a power-efficient manner
WO2021189949A1 (en) Information recommendation method and apparatus, and electronic device, and medium
US11297147B2 (en) Managed data export to a remote network from edge devices
US11226844B1 (en) Universal, proactive, and dynamic scaling of computing resources
US11627193B2 (en) Method and system for tracking application activity data from remote devices and generating a corrective action data structure for the remote devices
CN115038089B (en) Multi-terminal data monitoring and collecting method based on information extraction
Zhao et al. Performance evaluation and optimization for Android-based Web Server
KR20220055661A (en) Edge service processing system and control method thereof
CN115022094A (en) Monitoring system for computer service conditions
US20190155713A1 (en) Application performance monitoring
CN116909853A (en) Monitoring method and system of storage system, electronic equipment and readable storage medium
CN116955277A (en) Data processing method, device, equipment and storage medium
KR20140074645A (en) Method for reorganizing object, database management system performing the same and recording medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19930063

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19930063

Country of ref document: EP

Kind code of ref document: A1