Availability monitoring method, system, terminal and storage medium based on claim mode
By adopting a claim mode-based approach in website availability monitoring, periodically pulling scheduled tasks from the database and performing them when the probe allows, the pressure problem caused by centralized monitoring tasks is solved, and the availability of monitoring tasks and the stability of probes is improved.
Patent Information
- Application Number
- CN202111278360.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-30
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-10-30
AI Technical Summary
When existing website availability monitoring solutions create tasks in batches, centralized monitoring tasks will occur in probes, increasing the pressure on probe processing tasks, and even causing probe avalanches.
The availability monitoring method based on claim mode is adopted. By obtaining the basic information of the monitoring task and the operation information of the probe, the dispatch task periodically pulls the scheduling task from the database, so that the probe can perform the task at the allowed time, and avoid directly issuing monitoring tasks.
Relieve the pressure on the probe, improve the availability of monitoring task scheduling, reduce the load on the server and probes, and protect the stability of the probe.
Smart Images

Figure CN114035914B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of website monitoring, and in particular to a method, system, terminal and storage medium for monitoring availability based on a claiming mode. Background Art
[0002] Website availability is an important indicator for website performance monitoring, and high availability of underlying probes is the top priority of website performance monitoring.
[0003] In the existing website availability monitoring solution, when creating tasks in batches, the server directly sends tasks to the probe end. When the remote probe end executes periodic tasks and the strategy is concentrated at one point, the probe will have centralized monitoring tasks due to the large number of tasks and short cycles.
[0004] With respect to the above-mentioned related technologies, the inventors believe that when the probes have concentrated monitoring tasks, the pressure on the probes to process tasks will increase, and even cause a probe avalanche, and therefore improvements are needed. Summary of the invention
[0005] In order to relieve the pressure on the probe and protect the probe, the present application provides an availability monitoring method, system, terminal and storage medium based on a claim mode.
[0006] In a first aspect, the present application provides an availability monitoring method based on a claim mode, which adopts the following technical solution:
[0007] A method for monitoring availability based on a claiming mode includes the following steps:
[0008] Acquire a monitoring task for a monitoring object issued by a user, and acquire basic information of the monitoring task, the basic information including a task cycle, an execution time, and probe information, and analyze the basic information to obtain a first analysis result;
[0009] Creating different types of scheduling tasks based on the basic information and the first analysis result period, and storing the scheduling tasks in a preset database;
[0010] Acquire a probe and operation information of the probe based on the probe information, analyze the operation information of the probe to obtain a second analysis result, wherein the operation information includes a probe cycle and a probe capability;
[0011] Based on the second analysis result and the basic information, periodically pulling the scheduled tasks from the database through the probe, so that the probe executes the pulled scheduled tasks;
[0012] The monitoring data obtained by the probe executing the scheduling task is periodically acquired, and a monitoring result is obtained based on the monitoring data.
[0013] By adopting the above technical solution, the basic information of the monitoring task is analyzed, different types of scheduling tasks are created according to the task cycle of the monitoring task, and the scheduling tasks are stored in the database. The monitoring tasks concentrated at the same time point are decentralized and processed to relieve the pressure on the server; the probe cycle and probe capability of the probe are analyzed, and the scheduling tasks in the database are pulled for processing when the probe allows, avoiding directly issuing monitoring tasks to the probe, thereby improving the availability of monitoring task scheduling, alleviating the pressure on the probe, and protecting the probe.
[0014] Optionally, analyzing the basic information to obtain a first analysis result includes the following steps:
[0015] Determine whether the task period is less than the set duration;
[0016] If the task period is greater than or equal to the set duration, determining the processing type of the monitoring task to be a timing type;
[0017] If the task cycle is less than the set duration, it is determined that the processing type of the monitoring task is a fault-tolerant type.
[0018] By adopting the above technical solution, the monitoring tasks are divided into timing type and fault-tolerant type according to the task cycle, which makes it convenient to distinguish the monitoring tasks with high cycle frequency from the monitoring tasks with small cycle frequency, thereby facilitating allocation.
[0019] Optionally, the step of periodically creating different types of scheduling tasks based on the basic information and the first analysis result, and storing the scheduling tasks and scheduling information in a preset database includes the following steps:
[0020] According to the processing type of the monitoring task and the creation of a scheduling task, the scheduling task includes a first scheduling task and a second scheduling task;
[0021] If the processing type of the monitoring task is a timing type, a first scheduling task is created based on the execution time, the actual execution time of the first scheduling task is the same as the execution time, and the first scheduling task and the corresponding first scheduling information are stored in a preset database, the first scheduling information includes the actual execution time and probe information;
[0022] If the processing type of the monitoring task is a fault-tolerant type, a second scheduling task is created based on the execution time and the preset scheduling offset time. The actual execution time of the second scheduling task is set to the scheduling offset time offset before and after the execution time. The scheduling offset time is less than the task cycle. The second scheduling task and the corresponding second scheduling information are stored in a preset database. The second scheduling information includes the actual execution time and probe information.
[0023] By adopting the above technical solution, the first scheduling task and the second scheduling task are created according to the processing type of the monitoring task. The actual execution time of the second scheduling task can be flexibly set according to the scheduling offset time, thereby reducing the occurrence of concentrated processing of monitoring tasks at the same time node, improving the high availability of the service, and alleviating the pressure on the server.
[0024] Optionally, analyzing the operation information of the probe to obtain a second analysis result comprises the following steps:
[0025] Determine whether the probe reaches a time node for pulling a monitoring task based on the probe cycle;
[0026] If the probe does not reach the time node for pulling the monitoring task, it is determined that the probe cannot pull the monitoring task;
[0027] If the probe has reached the time node for pulling the monitoring task, it is determined that the probe can pull the monitoring task. At this time, the probe capability is analyzed to obtain a third analysis result, which is used as the second analysis result.
[0028] By adopting the above technical solution, the pull task operation of the probe is standardized according to the probe cycle of the probe, which reduces the blind sending of monitoring tasks to the probe and alleviates the processing pressure of the probe.
[0029] Optionally, analyzing the probe capability to obtain a third analysis result comprises the following steps:
[0030] Determining whether the probe has free space based on the probe capability;
[0031] If the probe has no free space, determining that the probe cannot pull the monitoring task;
[0032] If the probe has free space, it is determined that the probe can pull the monitoring task.
[0033] By adopting the above technical solution, after determining that the probe has free space, the probe pulls the monitoring task and executes it, so that the processing quantity of the probe is kept within its maximum processing range, so that the monitoring task is carried out in an orderly manner and the probe is protected.
[0034] Optionally, based on the second analysis result and the basic information, periodically pulling the scheduled task from the database through the probe includes the following steps:
[0035] If the probe cannot pull the monitoring task, continue to wait until the probe reaches the time node for pulling the monitoring task again, and analyze the probe capability of the probe again;
[0036] If the probe can pull the monitoring task, the number of the monitoring tasks that the probe can pull is obtained based on the operation information, and the scheduling task is pulled from the database based on the number of the monitoring tasks and the execution time.
[0037] By adopting the above technical solution, the scheduling tasks are pulled from the database within the capability of the probe, avoiding directly sending monitoring tasks to the probe and alleviating the pressure on the probe.
[0038] Optionally, analyzing the monitoring data to obtain monitoring results includes the following steps:
[0039] Determining whether the monitoring data is abnormal;
[0040] If the monitoring data is normal, the monitoring object is determined to be normal, the monitoring data is saved, and waiting is made to obtain the monitoring data again;
[0041] If the monitored object is abnormal, the monitored object is determined to be abnormal, the monitoring data is saved, and an alarm is issued.
[0042] In a second aspect, the present application further discloses an availability monitoring system based on a claiming mode, comprising:
[0043] A preprocessing module, the preprocessing module includes a first acquisition unit, a first analysis unit and a creation unit, the acquisition unit is used to acquire a monitoring task for a monitoring object issued by a user and basic information of the monitoring task, the first analysis unit is used to analyze the basic information to obtain a first analysis result, and the creation unit creates different types of scheduling tasks according to the first analysis result and the monitoring task;
[0044] An execution module, wherein the analysis module includes a second acquisition unit, a second analysis unit, a pulling unit and an execution unit, wherein the second acquisition unit is used to acquire the probe and probe information corresponding to the monitoring task, the second analysis unit analyzes the probe information to obtain a second analysis result, the pulling unit pulls the scheduling task according to the second analysis result, and the execution unit is used to execute the pulled scheduling task;
[0045] A database module, the database module is used to store the mutually related scheduling tasks and probe information of the probes corresponding to the scheduling tasks;
[0046] And a general processing module, the general processing module includes a third acquisition unit, a processing unit, a storage unit and an alarm unit, the third acquisition unit is used to obtain the monitoring data of the execution unit executing the scheduling task, the processing unit is used to obtain the monitoring result according to the monitoring data, the storage unit is used to store the monitoring data, and the alarm unit is used to perform an alarm operation according to the monitoring result.
[0047] By adopting the above technical solution, the preprocessing module analyzes the basic information of the monitoring task and creates different types of second scheduling tasks according to the task cycle of the monitoring task; the execution module analyzes the operation information of the probe to determine whether the probe can pull the scheduling task in the database. If so, the probe pulls and executes the scheduling task from the database module. If not, it waits for the next probe cycle. After the probe pulls the scheduling task, the execution module executes the scheduling task and outputs the monitoring data. The processing unit processes the monitoring data to obtain the monitoring result. If the monitoring result is abnormal, the alarm unit sounds an alarm. According to the probe's capabilities, the scheduling tasks that the probe can handle are pulled from the database module to avoid directly sending monitoring tasks to the probe, reduce the possibility of the probe centrally processing monitoring tasks, relieve the pressure on the probe, and protect the probe.
[0048] In a third aspect, the present application provides a terminal device, which adopts the following technical solution:
[0049] A terminal device comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor. When the processor loads and executes the computer program, the above-mentioned availability monitoring method based on the claim mode is adopted.
[0050] By adopting the above technical solution, the above-mentioned availability monitoring method based on the claim mode is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.
[0051] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:
[0052] A computer-readable storage medium stores a computer program, and when the computer program is loaded and executed by a processor, the above-mentioned availability monitoring method based on the claim mode is adopted.
[0053] By adopting the above technical solution, the above-mentioned availability monitoring method based on the claim mode is generated into a computer program and stored in a computer-readable storage medium so as to be loaded and executed by a processor. The computer-readable storage medium facilitates the reading and storage of the computer program. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a schematic diagram of the overall process of an availability monitoring method based on a claim mode in an embodiment of the present application.
[0055] Figure 2 It is a flowchart of steps S201 to S203 in an availability monitoring method based on a claim mode in an embodiment of the present application.
[0056] Figure 3 It is a flowchart of steps S301 to S303 in an availability monitoring method based on a claim mode in an embodiment of the present application.
[0057] Figure 4 It is a flowchart of steps S401 to S403 in an availability monitoring method based on a claim mode in an embodiment of the present application.
[0058] Figure 5 It is a flowchart of steps S501 to S503 in an availability monitoring method based on a claim mode in an embodiment of the present application.
[0059] Figure 6 It is a flowchart of step S601-step S602 in an availability monitoring method based on a claim mode in an embodiment of the present application.
[0060] Figure 7 It is a flowchart of steps S701 to S703 in an availability monitoring method based on a claim mode in an embodiment of the present application.
[0061] Figure 8 It is a schematic diagram of the overall modules of an availability monitoring system based on the claim mode according to an embodiment of the present application.
[0062] Description of reference numerals:
[0063] 1. Preprocessing module; 11. First acquisition unit; 12. First analysis unit; 13. Creation unit; 2. Execution module; 21. Second acquisition unit; 22. Second analysis unit; 23. Pull unit; 24. Execution unit; 3. Database module; 4. General processing module; 41. Third acquisition unit; 42. Processing unit; 43. Storage unit; 44. Alarm unit. DETAILED DESCRIPTION
[0064] The following is combined with Figure 1-8 This application is described in further detail.
[0065] The present application embodiment discloses a method for monitoring availability based on a claim mode, referring to Figure 1 , including the following steps:
[0066] S101, obtaining a monitoring task for a monitoring object issued by a user, and obtaining basic information of the monitoring task, the basic information including a task cycle, an execution time, and probe information, and analyzing the basic information to obtain a first analysis result;
[0067] S102, creating different types of scheduling tasks based on the basic information and the first analysis result period, and storing the scheduling tasks and scheduling information in a preset database;
[0068] S103, acquiring a probe and operation information of the probe based on the probe information, analyzing the operation information of the probe to obtain a second analysis result, wherein the operation information includes a probe cycle and a probe capability;
[0069] S104, based on the second analysis result and the basic information, periodically pulling the scheduling task from the database through the probe, so that the probe executes the pulled scheduling task;
[0070] S105 : Periodically acquire monitoring data obtained by the probe executing the scheduling task, and obtain a monitoring result based on the monitoring data.
[0071] Among them, in step S101, the monitoring object is a website, and the monitoring task of the website issued by the user is obtained, and the basic information of the monitoring task is obtained. The basic information of the monitoring task is different for different monitoring objects.
[0072] Specifically, the basic information includes task cycle, execution time and probe information. In this embodiment, the availability monitoring task of the website is obtained, and the task cycle and execution time are determined by the user. For example, for the availability monitoring task of the Baidu main website, the user requires the task cycle to be 10 seconds, that is, the availability monitoring task is executed on the Baidu main website every ten seconds. If the first execution time is 14:00:00 on February 22, 2022, the execution time of the second availability monitoring task is 14:00:10 on February 22, 2022. The probe information is the probe ID.
[0073] Specifically, after obtaining the basic information of the monitoring task, the basic information is analyzed and the monitoring tasks are classified to facilitate the scheduling of the monitoring tasks. For details, refer to Figure 2 Steps S201 to S203 in:
[0074] S201, determining whether the task period is less than a set duration;
[0075] S202: If the task period is greater than or equal to the set duration, determining that the processing type of the monitoring task is a timing type;
[0076] S203: If the task cycle is less than the set duration, determine that the processing type of the monitoring task is a fault-tolerant type.
[0077] Specifically, in step S201-step S203, the task cycle of the monitoring task is compared with the set duration to determine the processing type of the monitoring task. In fact, the monitoring tasks are classified according to the frequency of the monitoring tasks: if the task cycle is short, it means that the cycle frequency is high, and the processing type of the monitoring task is determined to be a fault-tolerant type; if the task cycle is long, it means that the cycle frequency is low, and the processing type of the monitoring task is determined to be a timing type.
[0078] For example, if the set duration is 3 hours, the task cycle of the monitoring task of Baidu's main website is 10 seconds, and the task cycle is less than the set duration, then the processing type of the monitoring task of Baidu's main website is determined to be a fault-tolerant task; if the task cycle of the monitoring task of Sina's main website is 4 hours, and the task cycle is greater than the set duration, then the processing type of the monitoring task of Sina's main website is determined to be a scheduled task.
[0079] Among them, in step S102, according to the processing type and execution time of the monitoring task, the scheduling task is created in a chronological order, and the created scheduling task is stored in a preset database to reduce the situation where the monitoring tasks are concentrated at one time point. For details, refer to Figure 3 Steps S301 to S303 in:
[0080] S301, creating a scheduling task according to the processing type of the monitoring task, the scheduling task including a first scheduling task and a second scheduling task;
[0081] S302: If the processing type of the monitoring task is a timing type, a first scheduling task is created based on the execution time, the actual execution time of the first scheduling task is the same as the execution time, and the first scheduling task and the corresponding first scheduling information are stored in a preset database, wherein the first scheduling information includes the actual execution time and probe information;
[0082] S303. If the processing type of the monitoring task is a fault-tolerant type, a second scheduling task is created based on the execution time and the preset scheduling offset time. The actual execution time of the second scheduling task is set to the scheduling offset time offset before and after the execution time. The scheduling offset time is less than the task cycle. The second scheduling task and the corresponding second scheduling information are stored in a preset database. The second scheduling information includes the actual execution time and probe information.
[0083] Specifically, in step S301-step S303, in this embodiment, since the created scheduling task is encapsulated based on basic information, probe information and its own scheduling parameters, the first scheduling information and the second scheduling information both include corresponding probe information, namely, probe ID, which facilitates probe identification and pulling.
[0084] More specifically, generally speaking, the scheduling offset time of the monitoring task cannot exceed its own task cycle, so as to avoid causing system disorder and adverse effects.
[0085] More specifically, setting the scheduling offset time can disperse the monitoring tasks concentrated at a certain time node in chronological order, alleviating the pressure on the probes. For example, the scheduling offset time of the Baidu main website availability monitoring task is set to 5 seconds, that is, the execution time of the second scheduling task of the Baidu main website can be executed 5 seconds forward or backward based on the original execution time. For example, if the execution time of the Baidu main website monitoring task is 14:00:00 on February 22, 2022, there are still some websites, such as the Ali main website monitoring task, whose execution time is also 14:00:00 on February 22, 2022. In order to reduce the occurrence of concentrated processing of detection tasks at the same time, the execution time of the Baidu main website can be adjusted to create a second scheduling task. Combined with the scheduling offset time, the actual execution time of the second scheduling task can be set to February 22, 2022 13:59:55-14:00:05. Compared with the unlimited distribution of monitoring tasks in the prior art, which leads to a more concentrated monitoring task, the execution time of the monitoring tasks is decentralized, which improves the high availability of the service and relieves the pressure on the server.
[0086] Among them, in step S103, the corresponding probe and the operation information of the probe are obtained according to the probe information, and the operation information includes the probe cycle and the probe capacity. The probe cycle refers to the time period of the pull task configured by the probe itself, and the probe capacity indicates the maximum number of monitoring tasks that the probe can execute simultaneously. For example, the probe cycle of the availability probe is 5 seconds, which means that the availability probe pulls a task every 5 seconds; the availability probe capacity is 20, which means that the maximum number of availability monitoring tasks that the availability probe can execute simultaneously is 20.
[0087] Specifically, after obtaining the probe's running information, you need to analyze the probe's running information to determine whether the probe can pull tasks. For details, refer to Figure 4 Steps S401 to S403 in:
[0088] S401, judging whether the probe reaches a time node for pulling a monitoring task based on the probe cycle;
[0089] S402: If the probe does not reach the time node for pulling the monitoring task, it is determined that the probe cannot pull the monitoring task;
[0090] S403: If the probe has reached the time node for pulling the monitoring task, it is determined that the probe can pull the monitoring task. At this time, the probe capability is analyzed to obtain a third analysis result, and the third analysis result is used as the second analysis result.
[0091] More specifically, in step S401-step S403, the probe cycle of the probe is analyzed. If the probe has not reached the time node for pulling the monitoring task, that is, the probe cycle has not ended at this time, it is determined that the probe cannot pull the monitoring task; if the probe has reached the time node for pulling the monitoring task, the probe capability of the probe is analyzed to determine whether the probe has free space to pull the monitoring task. For details, refer to Figure 5 Steps S501-S503 in:
[0092] S501, judging whether the probe has free space based on the probe capability;
[0093] S502: If the probe has no free space, determine that the probe cannot pull the monitoring task;
[0094] S503: If the probe has free space, determine that the probe can pull the monitoring task.
[0095] More specifically, in step S501-step S503, the probe capacity of the probe is analyzed. If the probe still has free space, it is determined that the probe can pull the monitoring task; if the probe does not have free space, it is determined that the probe cannot pull the monitoring task. For example, the probe capacity of the availability probe is 20. After the probe cycle of the availability probe ends, the availability probe is currently executing 15 monitoring tasks. It is determined that the availability probe still has free space and can continue to pull 5 monitoring tasks. If the availability probe is currently executing 20 monitoring tasks, it is determined that the availability probe has no free space and can no longer pull monitoring tasks.
[0096] In step S104, when it is determined that the probe can pull the monitoring task, the probe pulls the scheduling task in the database according to the time sequence and the probe cycle and executes it. Figure 6 Step S601-step S602 in:
[0097] S601: If the probe cannot pull the monitoring task, continue to wait until the probe reaches the time node for pulling the monitoring task again, and analyze the probe capability of the probe again;
[0098] S602: If the probe can pull the monitoring task, the number of the monitoring tasks that the probe can pull is obtained based on the operation information, and the scheduling task is pulled from the database based on the probe information, the actual execution time and the number of the monitoring tasks.
[0099] More specifically, if the probe cannot pull the monitoring task, it waits for the next time node to pull the monitoring task; if the probe can pull the monitoring task, it determines the number of tasks that can be pulled, searches the database according to the probe, finds the probe information corresponding to the probe, and pulls the scheduled task with the earliest actual execution time.
[0100] For example, the probe capacity of the availability probe is 20. When the probe cycle of the availability probe ends, if the availability probe is executing 15 monitoring tasks, it is determined that there is still free space in the availability probe, and the number of monitoring tasks that can continue to be pulled is 5. If the availability probe is executing 20 monitoring tasks, it is determined that there is no free space in the availability probe, and no more monitoring tasks can be pulled. At this time, wait for the time node when the probe pulls the next monitoring task, and analyze the probe capacity of the probe again.
[0101] Among them, in step S105, after the probe performs the scheduling task on the website, it obtains monitoring data for indicating the monitoring status of the website, analyzes the monitoring data, obtains whether the website availability is abnormal, and performs corresponding operations. Figure 7 Steps S701 to S703 in:
[0102] S701, determining whether the monitoring data is abnormal;
[0103] S702: If the monitoring data is normal, determine that the monitoring object is normal, save the monitoring data, and wait to obtain the monitoring data again;
[0104] S703: If the monitored object is abnormal, determine that the monitored object is abnormal, save the monitoring data, and issue an alarm.
[0105] Specifically, the monitoring data of the website is analyzed. If the monitoring data is normal, it is determined that the website is operating normally, and the monitoring data is stored to facilitate users to understand historical monitoring data; if the monitoring data is abnormal, it is determined that the website is operating abnormally, and the monitoring data is stored to facilitate users to understand the cause of the abnormality, and an alarm is issued at the same time.
[0106] The implementation principle of an availability monitoring method based on a claim mode in an embodiment of the present application is as follows: analyzing the basic information of the monitoring task, creating a first scheduling task according to the task cycle of the monitoring task, creating a second scheduling task according to the task cycle of the monitoring task and a preset scheduling offset time, and storing the first scheduling task and the second scheduling task in a database, dispersing the monitoring tasks concentrated at the same time point to relieve the pressure on the server; analyzing the probe cycle and probe capability of the probe, and pulling the scheduling task in the database for processing when the probe has free space, avoiding directly issuing the monitoring task to the probe, thereby improving the availability of monitoring task scheduling, relieving the pressure on the probe, and protecting the probe.
[0107] This application discloses an availability monitoring system based on a claim mode, referring to Figure 8 , including a preprocessing module 1, an execution module 2, a database module 3 and a general processing module 4, wherein the preprocessing module 1 preprocesses the monitoring tasks issued by the user, creates different types of scheduling tasks according to the basic information of the monitoring tasks, the execution module 2 pulls the monitoring tasks through the probes corresponding to the monitoring tasks and executes them, and outputs the monitoring data, the database module 3 is used to store the mutually related scheduling tasks and probe information, and the general processing module 4 is used to obtain the monitoring results according to the monitoring data.
[0108] Specifically, the preprocessing module 1 includes a first acquisition unit 11, a first analysis unit 12 and a creation unit 13. The first acquisition unit 11 is used to obtain the monitoring tasks and basic information of the monitoring tasks issued by the user for the monitoring objects. The first analysis unit 12 analyzes the basic information to obtain a first analysis result. The creation unit 13 creates a first scheduling task and a second scheduling task according to the first analysis result.
[0109] More specifically, the monitoring object is a website. The first acquisition unit 11 acquires the monitoring task of the website issued by the user, and acquires the basic information of the monitoring task. The basic information includes the task type, task cycle and execution time. The basic information of the monitoring task is different for different monitoring objects. In this embodiment, the availability monitoring task of the website is acquired. The task cycle and execution time are determined by the user. For example, for the availability monitoring task of the Baidu main website, the user requires the task cycle to be 10 seconds, that is, the availability monitoring task is executed on the Baidu main website every ten seconds. If the first execution time is 14:00:00 on February 22, 2022, the execution time of the second availability monitoring task is 14:00:10 on February 22, 2022.
[0110] More specifically, after the first acquisition unit 11 acquires the basic information, it compares the task cycle of the monitoring task with the set duration to determine the processing type of the monitoring task. In fact, the monitoring tasks are classified according to the frequency of the monitoring tasks: if the task cycle is short, it means that the cycle frequency is high, then the first analysis unit 12 determines that the processing type of the monitoring task is a fault-tolerant type; if the task cycle is long, it means that the cycle frequency is low, then the first analysis unit 12 determines that the processing type of the monitoring task is a timing type.
[0111] For example, the set duration is 3 hours, the task cycle of the monitoring task of Baidu's main website is 10 seconds, and the task cycle is less than the set duration, then the first analysis unit 12 determines that the processing type of the monitoring task of Baidu's main website is a fault-tolerant task; the task cycle of the monitoring task of Sina's main website is 4 hours, and the task cycle is greater than the set duration, then the first analysis unit 12 determines that the processing type of the monitoring task of Sina's main website is a scheduled task.
[0112] More specifically, the creation unit 13 creates the first scheduling task and the second scheduling task according to the monitoring task and the processing type of the monitoring task. In this embodiment, if the processing type of the monitoring task is a timed task, the creation unit 13 creates the first scheduling task according to the execution time and task cycle of the monitoring task, and stores the first scheduling task and the first scheduling information of the first scheduling task in the database module 3, and the first scheduling information includes the actual execution time and probe information; if the processing type of the monitoring task is a timed task, the creation unit 13 can modify the execution time of the type of monitoring task within the scheduling offset time, and create the second scheduling task according to the modified execution time and task cycle, and store the second scheduling task and the second scheduling information of the second scheduling task in the database module 3, and the second scheduling information includes the actual execution time and probe information. Generally speaking, the scheduling offset time of the monitoring task cannot exceed its own task cycle, so as not to cause system disorder and produce adverse effects. Since the created scheduling task is encapsulated based on the basic information, probe information and its own scheduling parameters, the first scheduling information and the second scheduling information both include corresponding probe information, i.e., probe ID, which is convenient for the probe to identify and pull.
[0113] More specifically, the creation unit sets the scheduling offset time, which can disperse the monitoring tasks concentrated at a certain time node in chronological order to relieve the pressure on the probe. For example, the scheduling offset time of the Baidu main website availability monitoring task is set to 5 seconds, that is, the execution time of the second scheduling task of the Baidu main website can be executed 5 seconds forward or backward based on the original execution time. For example, if the execution time of the Baidu main website monitoring task is 14:00:00 on February 22, 2022, there are still some websites, such as the Ali main website monitoring task. The execution time is also 14:00:00 on February 22, 2022. In order to reduce the occurrence of concentrated processing of detection tasks at the same time, the execution time of the Baidu main website can be adjusted to create a second scheduling task. Combined with the scheduling offset time, the execution time of the second scheduling task can be set to February 22, 2022 13:59:55-14:00:05. Compared with the unlimited distribution of monitoring tasks in the prior art, which leads to a more concentrated monitoring task, the execution time of the monitoring tasks is decentralized, which improves the high availability of the service and relieves the pressure on the server.
[0114] Among them, the execution module 2 includes a second acquisition unit 21, a second analysis unit 22, a pulling unit 23 and an execution unit 24. The second acquisition unit 21 is used to obtain the probe and probe information corresponding to the monitoring task. The second analysis unit 22 is used to analyze the probe information to obtain a second analysis result. The pulling unit 23 pulls the scheduling task from the database module 3 according to the second analysis result, and the execution unit 24 executes the scheduling task.
[0115] Specifically, the second acquisition unit 21 acquires probe information corresponding to the task type according to the basic information of the monitoring task, and the probe information is the probe name. In this embodiment, if the task type of the monitoring task is an availability monitoring task, the probe type is determined to be an availability probe. After the second acquisition unit 21 acquires the probe information of the probe, it also associates the probe information with the scheduling task and stores it in the preset database module 3.
[0116] Specifically, the second acquisition unit 21 also acquires the operation information of the probe, and the operation information includes the probe cycle and the probe capacity. The probe cycle refers to the time period of the pull task configured by the probe itself, and the probe capacity refers to the maximum number of monitoring tasks that the probe can execute simultaneously. For example, the probe cycle of the availability probe is 5 seconds, which means that the availability probe pulls a task every 5 seconds; the availability probe capacity is 20, which means that the maximum number of availability monitoring tasks that the availability probe can execute simultaneously is 20.
[0117] Specifically, the second analyzing unit 22 analyzes the operation information of the probe to determine whether the probe can pull the task.
[0118] More specifically, the second analysis unit 22 first analyzes the probe cycle. If the probe has not reached the time node for pulling the monitoring task, it is determined that the probe cannot pull the monitoring task. If the probe has reached the time node for pulling the monitoring task, it is determined that the probe can pull the monitoring task. At this time, the second analysis unit 22 analyzes the probe capability again to obtain a third analysis result, and uses the third analysis result as the second analysis result.
[0119] More specifically, the second analysis unit 22 analyzes the probe capacity of the probe. If the probe still has free space, the second analysis unit 22 determines that the probe can pull the monitoring task; if the probe does not have free space, the second analysis unit 22 determines that the probe cannot pull the monitoring task. For example, the probe capacity of the availability probe is 20. After the probe cycle of the availability probe ends, the availability probe is currently executing 15 monitoring tasks. The second analysis unit 22 determines that the availability probe still has free space and can continue to pull 5 monitoring tasks. If the availability probe is currently executing 20 monitoring tasks, the second analysis unit 22 determines that the availability probe has no free space and can no longer pull monitoring tasks.
[0120] Specifically, the pulling unit 23 pulls the scheduled tasks in the database module 3 according to the second analysis result. If the second analysis unit 22 determines that the probe cannot pull the monitoring task, it continues to wait until the probe reaches the time node for pulling the monitoring task again, and the second analysis unit 22 analyzes the probe capability of the probe again; if the second analysis unit 22 determines that the probe can pull the monitoring task, it determines the number of tasks that can be pulled, searches the database module according to the probe, finds the probe information corresponding to the probe, and pulls the scheduled task with the earliest actual execution time.
[0121] More specifically, for example, the probe capacity of the availability probe is 20. When the probe cycle of the availability probe ends, the availability probe is currently executing 15 monitoring tasks. The second analysis unit 22 determines that there is still free space in the availability probe, and the pulling unit 23 can continue to pull 5 monitoring tasks. If the availability probe is currently executing 20 monitoring tasks, the second analysis unit 22 determines that there is no free space in the availability probe, and the pulling unit 23 no longer pulls monitoring tasks. At this time, the second analysis unit 22 waits for the next time node for the probe to pull a monitoring task, and analyzes the probe capacity of the probe again.
[0122] More specifically, the execution unit 24 executes the scheduling task of the probe pull to obtain monitoring data, and the monitoring data is used to represent the monitoring status of the website.
[0123] Among them, the general processing module 4 includes a third acquisition unit 41, a processing unit 42, a storage unit 43 and an alarm unit 44. The third acquisition unit 41 is used to obtain the monitoring data obtained by the execution unit 24, the processing unit 42 analyzes the monitoring data to obtain the monitoring results, the storage unit 43 is used to store the monitoring data, and the alarm unit 44 performs an alarm operation according to the monitoring results.
[0124] Specifically, the processing unit 42 analyzes the monitoring data of the website. If the monitoring data is normal, the processing unit 42 determines that the website is running normally; if the monitoring data is abnormal, the processing unit 42 determines that the website is running abnormally.
[0125] Specifically, when the processing unit 42 determines that the website is operating abnormally, the alarm unit 44 performs an alarm operation.
[0126] The implementation principle of the availability monitoring system based on the claim mode of the present application is as follows: the pre-processing module 1 analyzes the basic information of the monitoring task, creates a first scheduling task according to the task cycle of the monitoring task, and creates a second scheduling task according to the task cycle of the monitoring task and the preset scheduling offset time. The execution module 2 analyzes the operation information of the probe to determine whether the probe can pull the scheduling task in the database. If it can, the probe pulls and executes the scheduling task from the database module 3. If not, it waits for the next probe cycle. After the probe pulls the scheduling task, the execution module 2 executes the scheduling task and outputs the monitoring data. The general processing module 4 processes the monitoring data to obtain the monitoring result. If the monitoring result is abnormal, the alarm unit 44 alarms. The setting of the present application reduces the possibility of monitoring tasks being concentrated at the same time node, alleviating the pressure on the server; according to the probe capability, the scheduling task that the probe can handle is pulled from the database module 3 to avoid directly sending the monitoring task to the probe, reducing the possibility of the probe centrally processing the monitoring task, alleviating the pressure on the probe, and protecting the probe.
[0127] An embodiment of the present application also discloses a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein when the processor executes the computer program, the availability monitoring method based on the claim mode in the above embodiment is adopted.
[0128] The terminal device may be a computer device such as a desktop computer, a laptop computer or a cloud server, and the terminal device includes but is not limited to a processor and a memory. For example, the terminal device may also include input and output devices, a network access device and a bus.
[0129] Among them, the processor can adopt a central processing unit (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.
[0130] Among them, the memory can be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device, or it can be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital card (SD) or a flash memory card (FC) equipped on the terminal device, and the memory can also be a combination of an internal storage unit and an external storage device of the terminal device. The memory is used to store computer programs and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or is to be output, and this application does not impose any restrictions on this.
[0131] Among them, through this terminal device, the availability monitoring method based on the claim mode in the above embodiment is stored in the memory of the terminal device, and is loaded and executed on the processor of the terminal device for easy use.
[0132] The embodiment of the present application further discloses a computer-readable storage medium, and the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the availability monitoring method based on the claim mode in the above embodiment is adopted.
[0133] Among them, the computer program can be stored in a computer-readable medium, the computer program includes computer program code, the computer program code can be in the form of source code, object code, executable file or certain middleware, etc. The computer-readable medium includes any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer-readable medium includes but is not limited to the above-mentioned components.
[0134] Among them, through this computer-readable storage medium, the availability monitoring method based on the claim mode in the above embodiment is stored in the computer-readable storage medium, and is loaded and executed on the processor to facilitate the storage and application of the above method.
[0135] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. A method for monitoring availability based on claim mode, characterized in that: The following steps are involved: Acquire a monitoring task for a monitoring object issued by a user, and acquire basic information of the monitoring task, the basic information including a task cycle, an execution time, and probe information, and analyze the basic information to obtain a first analysis result; Analyzing the basic information to obtain a first analysis result comprises the following steps: Determine whether the task period is less than the set duration; If the task period is greater than or equal to the set duration, determining the processing type of the monitoring task to be a timing type; If the task cycle is less than the set duration, determining the processing type of the monitoring task as a fault-tolerant type; creating different types of scheduling tasks based on the basic information and the first analysis result cycle, and storing the scheduling tasks and scheduling information in a preset database; The step of creating different types of scheduling tasks based on the basic information and the first analysis result period, and storing the scheduling tasks in a preset database includes the following steps: Creating a scheduling task according to the processing type of the monitoring task, the scheduling task comprising a first scheduling task and a second scheduling task; If the processing type of the monitoring task is a timing type, a first scheduling task is created based on the execution time, the actual execution time of the first scheduling task is the same as the execution time, and the first scheduling task and the corresponding first scheduling information are stored in a preset database, the first scheduling information includes the actual execution time and probe information; If the processing type of the monitoring task is a fault-tolerant type, a second scheduling task is created based on the execution time and the preset scheduling offset time, the actual execution time of the second scheduling task is set to be offset by the scheduling offset time before and after the execution time, the scheduling offset time is less than the task period, and the second scheduling task and the corresponding second scheduling information are stored in a preset database, the second scheduling information includes the actual execution time and probe information; Acquire a probe and operation information of the probe based on the probe information, analyze the operation information of the probe to obtain a second analysis result, wherein the operation information includes a probe cycle and a probe capability; The step of analyzing the operation information of the probe to obtain a second analysis result comprises the following steps: Determine whether the probe reaches a time node for pulling a monitoring task based on the probe cycle; If the probe does not reach the time node for pulling the monitoring task, it is determined that the probe cannot pull the monitoring task; If the probe has reached the time node for pulling the monitoring task, it is determined that the probe can pull the monitoring task, and the probe capability is analyzed to obtain a third analysis result, which is used as the second analysis result; Analyzing the probe capability to obtain a third analysis result comprises the following steps: Determining whether the probe has free space based on the probe capability; If the probe has no free space, determining that the probe cannot pull the monitoring task; If the probe has free space, determining that the probe can pull the monitoring task; Based on the second analysis result and the basic information, periodically pulling the scheduled tasks from the database through the probe, so that the probe executes the pulled scheduled tasks; The monitoring data obtained by the probe executing the scheduling task is periodically acquired, and a monitoring result is obtained based on the monitoring data.
2. The method for monitoring availability based on claiming mode according to claim 1, characterized in that: The periodically pulling the scheduled task from the database through the probe based on the second analysis result and the basic information comprises the following steps: If the probe cannot pull the monitoring task, continue to wait until the probe reaches the time node for pulling the monitoring task again, and analyze the probe capability of the probe again; If the probe can pull the monitoring task, the number of the monitoring tasks that the probe can pull is obtained based on the operation information, and the scheduling task is pulled from the database based on the probe information, the actual execution time and the number of the monitoring tasks.
3. The method for monitoring availability based on claiming mode according to claim 2, characterized in that: The obtaining of monitoring results based on monitoring data comprises the following steps: Determining whether the monitoring data is abnormal; If the monitoring data is normal, the monitoring object is determined to be normal, the monitoring data is saved, and waiting is made to obtain the monitoring data again; If the monitored object is abnormal, the monitored object is determined to be abnormal, the monitoring data is saved, and an alarm is issued.
4. An availability monitoring system based on claim mode, characterized in that: include: A preprocessing module (1), the preprocessing module (1) comprising a first acquisition unit (11), a first analysis unit (12) and a creation unit (13), the first acquisition unit (11) being used to acquire a monitoring task for a monitoring object issued by a user and basic information of the monitoring task, the basic information comprising a task cycle, an execution time and probe information, the first analysis unit (12) being used to analyze the basic information to obtain a first analysis result, and the creation unit (13) creating different types of scheduling tasks according to the first analysis result and the monitoring task; The first analysis unit (12) analyzes the basic information to obtain a first analysis result, comprising the following steps: Determine whether the task period is less than the set duration; If the task period is greater than or equal to the set duration, determining the processing type of the monitoring task to be a timing type; If the task cycle is less than the set duration, determining the processing type of the monitoring task to be a fault-tolerant type; The creation unit (13) creates different types of scheduling tasks according to the first analysis result and the monitoring task, comprising the following steps: Creating a scheduling task according to the processing type of the monitoring task, the scheduling task comprising a first scheduling task and a second scheduling task; If the processing type of the monitoring task is a timing type, a first scheduling task is created based on the execution time, the actual execution time of the first scheduling task is the same as the execution time, and the first scheduling task and the corresponding first scheduling information are stored in a preset database, the first scheduling information includes the actual execution time and probe information; If the processing type of the monitoring task is a fault-tolerant type, a second scheduling task is created based on the execution time and the preset scheduling offset time, the actual execution time of the second scheduling task is set to be offset by the scheduling offset time before and after the execution time, the scheduling offset time is less than the task cycle, and the second scheduling task and the corresponding second scheduling information are stored in a preset database, the second scheduling information includes the actual execution time and probe information; an execution module (2), the execution module (2) includes a second acquisition unit (21), a second analysis unit (22), a pulling unit (23) and an execution unit (24), the second acquisition unit (21) is used to obtain the probe and probe information corresponding to the monitoring task, the second analysis unit (22) analyzes the operation information of the probe to obtain a second analysis result, the operation information includes the probe cycle and probe capability; The second analysis unit (22) analyzes the operation information of the probe to obtain a second analysis result, comprising the following steps: Determine whether the probe reaches a time node for pulling a monitoring task based on the probe cycle; If the probe does not reach the time node for pulling the monitoring task, it is determined that the probe cannot pull the monitoring task; If the probe has reached the time node for pulling the monitoring task, it is determined that the probe can pull the monitoring task, and the probe capability is analyzed to obtain a third analysis result, which is used as the second analysis result; Analyzing the probe capability to obtain a third analysis result comprises the following steps: Determining whether the probe has free space based on the probe capability; If the probe has no free space, determining that the probe cannot pull the monitoring task; If the probe has free space, determining that the probe can pull the monitoring task; The pulling unit (23) pulls the scheduling task according to the second analysis result, and the execution unit (24) is used to execute the pulled scheduling task; A database module (3), the database module (3) being used to store the mutually related scheduling tasks and probe information of probes corresponding to the scheduling tasks; and a general processing module (4), the general processing module (4) comprising a third acquisition unit (41), a processing unit (42), a storage unit (43) and an alarm unit (44), the third acquisition unit (41) being used to acquire monitoring data of the execution unit (24) executing the scheduling task, the processing unit (42) being used to acquire monitoring results based on the monitoring data, the storage unit (43) being used to store the monitoring data, and the alarm unit (44) being used to perform an alarm operation based on the monitoring results.
5. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor loads and executes the computer program, the method according to any one of claims 1 to 3 is adopted.
6. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, characterized in that: When the computer program is loaded and executed by a processor, the method according to any one of claims 1 to 3 is adopted.
Citation Information
Patent Citations
Network monitoring method and monitoring platform
CN108011774A
Network quality detection method and device
CN109714220A