CN110737560A - A service status detection method, apparatus, electronic device and medium - Google Patents
A service status detection method, apparatus, electronic device and medium Download PDFInfo
- Publication number
- CN110737560A CN110737560A CN201911007573.6A CN201911007573A CN110737560A CN 110737560 A CN110737560 A CN 110737560A CN 201911007573 A CN201911007573 A CN 201911007573A CN 110737560 A CN110737560 A CN 110737560A
- Authority
- CN
- China
- Prior art keywords
- service
- detected
- target object
- detection
- status
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
本申请实施例公开了一种服务状态检测方法、装置、电子设备和介质,涉及自动检测技术领域。具体实现方案为:从待检测服务的候选对象中选择目标对象;其中,所述候选对象包括端口、进程以及服务检测脚本;根据待检测服务的状态,探测所述目标对象的可用性;根据所述目标对象的探测结果,确定是否更新待检测服务的状态。通过本申请的技术方案,可对各种场景的服务的状态进行自动检测。
The embodiments of the present application disclose a service state detection method, device, electronic device and medium, which relate to the technical field of automatic detection. The specific implementation scheme is: selecting a target object from the candidate objects of the service to be detected; wherein, the candidate objects include ports, processes and service detection scripts; according to the status of the service to be detected, the availability of the target object is detected; The detection result of the target object determines whether to update the status of the service to be detected. Through the technical solutions of the present application, the status of services in various scenarios can be automatically detected.
Description
技术领域technical field
本申请实施例涉及计算机技术领域,尤其涉及自动检测技术领域,具体涉及一种服务状态检测方法、装置、电子设备和介质。The embodiments of the present application relate to the field of computer technologies, in particular to the field of automatic detection technologies, and in particular to a service status detection method, apparatus, electronic device, and medium.
背景技术Background technique
机器上会涉及各种各样的服务,在实际运行环境中通常会根据服务的健康状态进行流量屏蔽或解屏蔽等。由于服务启动后通常会启动进程,目前检测服务健康状态常用的方式是通过人工手动查看进程是否在运行。Various services are involved on the machine, and in the actual running environment, traffic is usually blocked or unblocked according to the health status of the services. Since a process is usually started after a service is started, a common way to detect the health status of a service is to manually check whether the process is running.
但是,这种方式依赖人工导致成本高,且只能覆盖部分对服务健康状态的检查。However, this method relies on manual labor, which leads to high costs, and can only cover part of the service health status check.
发明内容SUMMARY OF THE INVENTION
本申请实施例公开一种服务状态检测方法、装置、电子设备和介质,能够自动对服务状态进行检测,且能够覆盖各种场景。The embodiments of the present application disclose a service state detection method, apparatus, electronic device, and medium, which can automatically detect the service state and cover various scenarios.
第一方面,本申请实施例公开了一种服务状态检测方法,该方法包括:In a first aspect, an embodiment of the present application discloses a service state detection method, which includes:
从待检测服务的候选对象中选择目标对象;其中,所述候选对象包括端口、进程以及服务检测脚本;Select a target object from the candidate objects of the service to be detected; wherein, the candidate objects include ports, processes, and service detection scripts;
根据待检测服务的状态,探测所述目标对象的可用性;Detect the availability of the target object according to the status of the service to be detected;
根据所述目标对象的探测结果,确定是否更新待检测服务的状态。According to the detection result of the target object, it is determined whether to update the status of the service to be detected.
上述申请中的一个实施例具有如下优点或有益效果:通过从为待检测服务所配置的包括端口、进程以及服务检测脚本等多种类型候选对象中选择目标对象;之后根据待检测服务的状态,探测所选择的目标对象的可用性;进而根据所选择的目标对象的探测结果,确定是否更新待检测服务的状态。相比于现有技术,本方案降低了对人工的依赖性,可自动实现对服务状态的检测;而且通过设置进程、端口以及服务检测脚本等多种探测机制,可覆盖各种场景下服务状态的检测,进而避免了业务损失。An embodiment in the above application has the following advantages or beneficial effects: by selecting a target object from multiple types of candidate objects configured for the service to be detected, including ports, processes, and service detection scripts; and then according to the status of the service to be detected, The availability of the selected target object is detected; further, according to the detection result of the selected target object, it is determined whether to update the status of the service to be detected. Compared with the prior art, the solution reduces the dependence on manual labor, and can automatically detect the service status; and by setting various detection mechanisms such as processes, ports, and service detection scripts, it can cover the service status in various scenarios. detection, thereby avoiding business losses.
可选的,根据待检测服务的状态,探测所述目标对象的可用性,包括:Optionally, detecting the availability of the target object according to the status of the service to be detected, including:
根据待检测服务的状态,确定待检测服务的防抖动参数;Determine the anti-jitter parameters of the service to be detected according to the status of the service to be detected;
根据待检测服务的防抖动参数,探测所述目标对象的可用性。According to the anti-jitter parameters of the service to be detected, the availability of the target object is detected.
上述可选方式具有如下优点或有益效果:通过设置防抖动参数,可避免由于网络故障等因素的存在,导致目标对象的探测结果不准确的现象。The above optional manner has the following advantages or beneficial effects: by setting the anti-jitter parameter, the phenomenon that the detection result of the target object is inaccurate due to the existence of factors such as network failure can be avoided.
可选的,根据待检测服务的防抖动参数,探测所述目标对象的可用性,包括:Optionally, detecting the availability of the target object according to the anti-jitter parameters of the service to be detected, including:
根据待检测服务的防抖动参数中的探测次数,重复探测所述目标对象的可用性;Repeatedly detecting the availability of the target object according to the number of detections in the anti-jitter parameters of the service to be detected;
相应地,根据所述目标对象的探测结果,确定是否更新待检测服务的状态,包括:Correspondingly, according to the detection result of the target object, it is determined whether to update the status of the service to be detected, including:
若根据探测结果确定所述目标对象连续处于任一状态的次数达到待检测服务的防抖动参数中的阈值次数,则将该状态作为所述目标对象的检测状态;If it is determined according to the detection result that the number of times that the target object is in any state continuously reaches the threshold number of times in the anti-shake parameter of the service to be detected, the state is regarded as the detection state of the target object;
依据所述目标对象的检测状态,确定是否更新所述待检测服务的状态。According to the detection status of the target object, it is determined whether to update the status of the service to be detected.
上述可选方式具有如下优点或有益效果:通过防抖动参数中的探测次数和阈值次数相互配合使用,进一步增加了是否更新待检测服务的状态的准确度。The above optional manner has the following advantages or beneficial effects: the detection times and the threshold times in the anti-jitter parameters are used in cooperation with each other, which further increases the accuracy of whether to update the status of the service to be detected.
可选的,根据待检测服务的状态,探测所述目标对象的可用性,包括:Optionally, detecting the availability of the target object according to the status of the service to be detected, including:
通过代理服务,根据待检测服务的状态,探测所述目标对象的可用性。Through the proxy service, the availability of the target object is detected according to the state of the service to be detected.
上述方法还包括:The above method also includes:
若确定所述代理服务失效,则输出报警信息。If it is determined that the proxy service fails, alarm information is output.
上述可选方式具有如下优点或有益效果:提供了一种通过代理服务,自动对目标对象进行探测的方式;而且在确定代理服务失效的场景下,可输出报警信息,以便通过人工干预方式实现对服务状态的检测。The above-mentioned optional method has the following advantages or beneficial effects: it provides a method of automatically detecting the target object through the proxy service; and in the case of determining that the proxy service fails, alarm information can be output, so as to realize the detection of the target object through manual intervention. Service status detection.
第二方便,本申请实施例还公开了一种服务状态检测装置,该装置包括:For the second convenience, the embodiment of the present application also discloses a service state detection device, which includes:
目标对象选择模块,用于从待检测服务的候选对象中选择目标对象;其中,所述候选对象包括端口、进程以及服务检测脚本;a target object selection module for selecting a target object from candidate objects of the service to be detected; wherein, the candidate objects include ports, processes and service detection scripts;
可用性探测模块,用于根据待检测服务的状态,探测所述目标对象的可用性;an availability detection module, configured to detect the availability of the target object according to the state of the service to be detected;
服务状态更新模块,用于根据所述目标对象的探测结果,确定是否更新待检测服务的状态。The service status update module is configured to determine whether to update the status of the service to be detected according to the detection result of the target object.
第三方面,本申请实施例还公开了一种电子设备,包括:In a third aspect, the embodiment of the present application also discloses an electronic device, including:
至少一个处理器;以及at least one processor; and
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如本申请任一实施例所述的服务状态检测方法。the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a service as described in any embodiment of the present application Status detection method.
第四方面,本申请实施例还公开了一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使所述计算机执行如本申请任一实施例所述的服务状态检测方法。In a fourth aspect, an embodiment of the present application further discloses a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause the computer to perform the service status detection according to any embodiment of the present application method.
上述申请中的一个实施例具有如下优点或有益效果:通过从为待检测服务所配置的包括端口、进程以及服务检测脚本等多种类型候选对象中选择目标对象;之后根据待检测服务的状态,探测所选择的目标对象的可用性;进而根据所选择的目标对象的探测结果,确定是否更新待检测服务的状态。相比于现有技术,本方案降低了对人工的依赖性,可自动实现对服务状态的检测;而且通过采用进程、端口以及服务检测脚本等多种探测机制的技术手段,可覆盖各种场景下服务状态的检测,进而避免了业务损失。An embodiment in the above application has the following advantages or beneficial effects: by selecting a target object from multiple types of candidate objects configured for the service to be detected, including ports, processes, and service detection scripts; and then according to the status of the service to be detected, The availability of the selected target object is detected; further, according to the detection result of the selected target object, it is determined whether to update the status of the service to be detected. Compared with the prior art, this solution reduces the dependence on manual labor, and can automatically detect service status; and can cover various scenarios by using various detection mechanisms such as processes, ports, and service detection scripts. The detection of the service status under the lower level, thereby avoiding business loss.
上述可选方式所具有的其他效果将在下文中结合具体实施例加以说明。Other effects of the above-mentioned optional manners will be described below with reference to specific embodiments.
附图说明Description of drawings
附图用于更好地理解本方案,不构成对本申请的限定。其中:The accompanying drawings are used for better understanding of the present solution, and do not constitute a limitation to the present application. in:
图1是根据本申请第一实施例提供的一种服务状态检测方法的流程图;FIG. 1 is a flowchart of a service state detection method provided according to a first embodiment of the present application;
图2是根据本申请第二实施例提供的一种服务状态检测方法的流程图;2 is a flowchart of a service state detection method provided according to a second embodiment of the present application;
图3是根据本申请第三实施例提供的一种服务状态检测方法的流程图;3 is a flowchart of a service state detection method provided according to a third embodiment of the present application;
图4是根据本申请第四实施例提供的一种服务状态检测装置的结构示意图;4 is a schematic structural diagram of a service state detection apparatus provided according to a fourth embodiment of the present application;
图5是用来实现本申请实施例的服务状态检测方法的电子设备的框图。FIG. 5 is a block diagram of an electronic device used to implement the service state detection method according to the embodiment of the present application.
具体实施方式Detailed ways
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present application are described below with reference to the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
第一实施例first embodiment
图1是根据本申请第一实施例提供的一种服务状态检测方法的流程图,本实施例可适用于对机器上所涉及的各种服务状态进行检测的情况。该方法可以由服务状态检测装置来执行,该装置可以采用软件和/或硬件的方式实现,并可集成在任意的具有计算能力的设备上,例如服务器等。如图1所示,本实施例提供的服务状态检测方法可以包括:FIG. 1 is a flowchart of a service state detection method provided according to a first embodiment of the present application. This embodiment is applicable to the case of detecting various service states involved in a machine. The method may be performed by a service state detection apparatus, which may be implemented in software and/or hardware, and may be integrated on any device with computing capabilities, such as a server. As shown in FIG. 1 , the service state detection method provided by this embodiment may include:
S110、从待检测服务的候选对象中选择目标对象。S110. Select a target object from the candidate objects of the service to be detected.
本实施例中,待检测服务可以是机器上所部署的模块或软件等所提供的服务,还可以是机器人上的其他服务,如读数据、创建文件等。对于每一待检测服务,均可预先配置端口、进程以及服务检测脚本等多种类型的候选对象;其中,每一种类型的候选对象可以有一个或多个。例如,端口可以是待检测服务启动后所暴露的网络端口中的一个或多个;进程可以是待检测服务启动后所启动的进程;服务检测脚本可以是用户根据待检测服务所要实现的功能或用途等编写的一个脚本,或者可以是已编写的多个通用的脚本。In this embodiment, the service to be detected may be a service provided by a module or software deployed on the machine, or may be other services on the robot, such as reading data, creating files, and the like. For each service to be detected, various types of candidate objects such as ports, processes, and service detection scripts can be pre-configured; wherein, there can be one or more candidate objects of each type. For example, the port can be one or more of the network ports exposed after the service to be detected is started; the process can be the process that is started after the service to be detected is started; the service detection script can be the function to be implemented by the user according to the service to be detected or A script written for the purpose, etc., or it can be a number of generic scripts that have been written.
目标对象可以是端口、进程以及服务检测脚本多种类型的候选对象中的一种或多种。可选的,可以依据用户的选择,从待检测服务的候选对象中选择目标对象。进一步的,对于每一待检测服务,可在预先配置候选对象时,根据实际场景为每一种候选对象设置优先级,进而可以依据预先配置的候选对象的优先级,从待检测服务的多种候选对象中选择目标对象。此外,还可以随机从候选对象中选择目标对象,或者将默认对象作为目标对象,如默认对象可以是端口。The target object can be one or more of various types of candidates for port, process, and service detection scripts. Optionally, the target object may be selected from the candidate objects of the service to be detected according to the user's selection. Further, for each service to be detected, a priority can be set for each candidate object according to the actual scene when the candidate objects are pre-configured, and then the priority of each candidate object can be set according to the pre-configured priority of the candidate object. Select the target object from the candidate objects. In addition, the target object can also be randomly selected from the candidate objects, or the default object can be used as the target object, for example, the default object can be a port.
进一步的,还可以依据待检测服务的场景,灵活从端口、进程以及服务检测脚本多种类型的候选对象中的一种或多种。例如,对于机器上部署的软件所提供的服务(如微信应用所提供的语音服务),则可以选择端口和/或进程作为目标对象;对于特殊的场景,如读取数据或新建文件等,则可以选择服务检测脚本作为目标对象。Further, it is also possible to flexibly detect one or more of multiple types of candidate objects of scripts from ports, processes and services according to the scenario of the service to be detected. For example, for the service provided by the software deployed on the machine (such as the voice service provided by the WeChat application), the port and/or process can be selected as the target object; for special scenarios, such as reading data or creating a new file, the A service detection script can be selected as the target object.
示例性的,从待检测服务的候选对象中选择目标对象可以是:依据待检测服务的操作类型,从待检测服务的候选服务检测脚本中选择目标服务检测脚本;其中,操作类型包括读取、写入、增加或删除数据,以及新建或删除文件。Exemplarily, selecting the target object from the candidate objects of the service to be detected may be: selecting the target service detection script from the candidate service detection scripts of the service to be detected according to the operation type of the service to be detected; wherein the operation type includes reading, Write, add or delete data, and create or delete files.
本实施例中,候选服务检测脚本可以是本地存储的通用脚本。可选的,若确定待检测服务的操作类型为读取数据、写入数据、增加数据或删除数据的中的一种或多种操作,或者为新建文件或删除文件中的一种或多种操作等,则可以选择服务检测脚本作为目标对象。例如,若操作类型为读取数据,则可以从候选服务检测脚本中选择与读取数据相关的脚本,之后调整该脚本中的相关参数,如读取路径以及脚本输出结果存储路径等,并将调整之后的服务检测脚本作为目标对象。In this embodiment, the candidate service detection script may be a locally stored general script. Optionally, if it is determined that the operation type of the service to be detected is one or more operations of reading data, writing data, adding data or deleting data, or one or more of creating a file or deleting a file. operation, etc., you can select the service detection script as the target object. For example, if the operation type is reading data, you can select a script related to reading data from the candidate service detection scripts, and then adjust the relevant parameters in the script, such as the reading path and the script output result storage path, etc. The adjusted service detection script is used as the target object.
需要说明的是,通过设置通用脚本,对于操作类型包括读取、写入、增加或删除数据,以及新建或删除文件等的待检测服务,可直接对通用脚本进行调整并使用,增加了脚本检测的灵活度。It should be noted that, by setting a general script, for services to be detected whose operation types include reading, writing, adding or deleting data, and creating or deleting files, the general script can be directly adjusted and used, adding script detection. flexibility.
S120、根据待检测服务的状态,探测目标对象的可用性。S120. Detect the availability of the target object according to the state of the service to be detected.
本实施例中,待检测服务的状态可以有健康状态和故障状态两种状态。可选的,待检测服务的状态可以是上一次所记录的该待检测服务的状态,或者是当前时刻待检测服务的状态。与待检测服务的状态相对应的,目标对象的状态可以为正常状态或异常状态等。可选的,若目标对象的状态为正常状态,则确定目标对象是可用的;若目标对象的状态为异常状态,则确定目标对象是不可用的。In this embodiment, the state of the service to be detected may include two states: a healthy state and a faulty state. Optionally, the status of the service to be detected may be the status of the service to be detected recorded last time, or the status of the service to be detected at the current moment. Corresponding to the state of the service to be detected, the state of the target object may be a normal state or an abnormal state. Optionally, if the state of the target object is a normal state, it is determined that the target object is available; if the state of the target object is an abnormal state, it is determined that the target object is unavailable.
具体的,可以根据待检测服务的状态,对目标对象的可用性进行探测。例如,可以根据待检测服务的状态,确定探测参数;进而依据探测参数探测目标对象的可用性。其中,探测参数可以是防抖动参数。可选的,具体如何根据待检测服务的状态,对目标对象的可用性进行探测将在后续实施例中将详细介绍。Specifically, the availability of the target object can be detected according to the state of the service to be detected. For example, detection parameters can be determined according to the state of the service to be detected; and then the availability of the target object can be detected according to the detection parameters. The detection parameter may be an anti-jitter parameter. Optionally, how to detect the availability of the target object according to the state of the service to be detected will be described in detail in subsequent embodiments.
S130、根据目标对象的探测结果,确定是否更新待检测服务的状态。S130. According to the detection result of the target object, determine whether to update the status of the service to be detected.
可选的,若目标对象为端口、进程以及服务检测脚本中的一种,则在待检测服务的状态为故障状态下探测的目标对象的探测结果为目标对象可用时,可以将待检测服务的状态由故障状态更新为健康状态;在待检测服务的状态为故障状态下探测的目标对象的探测结果为目标对象不可用时,可以保持待检测服务的状态为故障状态。Optionally, if the target object is one of a port, a process, and a service detection script, when the detection result of the target object detected when the status of the service to be detected is a fault state is that the target object is available, the service to be detected can be detected. The state is updated from the fault state to the healthy state; when the detection result of the target object detected when the state of the service to be detected is the fault state is that the target object is unavailable, the state of the service to be detected can be kept as the fault state.
若目标对象为端口、进程以及服务检测脚本中的一种,则在待检测服务的状态为健康状态下探测的目标对象的探测结果为目标对象不可用时,可以将待检测服务的状态由健康状态更新为故障状态;在待检测服务的状态为健康状态下探测的目标对象的探测结果为目标对象可用时,可以保持待检测服务的状态为健康状态。If the target object is one of a port, a process, and a service detection script, when the detection result of the target object detected when the status of the service to be detected is healthy state is that the target object is unavailable, the status of the service to be detected can be changed from the health status Update to the fault state; when the detection result of the target object detected when the state of the service to be detected is the healthy state is that the target object is available, the state of the service to be detected can be kept as the healthy state.
若目标对象为端口、进程以及服务检测脚本中的至少两种,如端口和进程,则可以将端口的探测结果和进程的探测结果进行与运算,进而依据与运算结果,确定是否更新待检测服务的状态。例如,在待检测服务的状态为故障状态下探测的端口的探测结果为端口可用,同时在待检测服务的状态为故障状态下探测的进程的探测结果为进程可用,则可以将待检测服务的状态由故障状态更新为健康状态。若在待检测服务的状态为故障状态下探测的端口的探测结果为端口可用,同时在待检测服务的状态为故障状态下探测的进程的探测结果为进程不可用,则可以保持待检测服务的状态为故障状态。If the target object is at least two of the port, the process and the service detection script, such as the port and the process, the detection result of the port and the detection result of the process can be ANDed, and then based on the AND operation result, it is determined whether to update the service to be detected. status. For example, when the status of the service to be detected is faulty, the detection result of the port detected is that the port is available, and the detection result of the process detected when the status of the service to be detected is faulty is that the process is available. The state is updated from a fault state to a healthy state. If the detection result of the port detected when the status of the service to be detected is the fault state is that the port is available, and the detection result of the process detected when the status of the service to be detected is the fault state is that the process is unavailable, the service to be detected can be kept. The state is the fault state.
此外,在待检测服务的状态为健康状态下探测的端口的探测结果为端口不可用,同时在待检测服务的状态为健康状态下探测的进程的探测结果为进程可用,则可以将待检测服务的状态由健康状态更新为故障状态。若在待检测服务的状态为健康状态下探测的端口的探测结果为端口可用,同时在待检测服务的状态为健康状态下探测的进程的探测结果为进程可用,则可以保持待检测服务的状态为健康状态。In addition, the detection result of the port detected when the status of the service to be detected is healthy is that the port is unavailable, and the detection result of the process detected when the status of the service to be detected is healthy is that the process is available, then the service to be detected can be detected. The status is updated from healthy to faulty. If the detection result of the port detected when the status of the service to be detected is healthy is that the port is available, and the detection result of the process detected when the status of the service to be detected is healthy is that the process is available, the status of the service to be detected can be maintained. to a healthy state.
本申请实施例所提供的技术方案,通过从为待检测服务所配置的包括端口、进程以及服务检测脚本等多种类型候选对象中选择目标对象;之后根据待检测服务的状态,探测所选择的目标对象的可用性;进而根据所选择的目标对象的探测结果,确定是否更新待检测服务的状态。相比于现有技术,本方案降低了对人工的依赖性,可自动实现对服务状态的检测;而且通过设置进程、端口以及服务检测脚本等多种探测机制,可覆盖各种场景下服务状态的检测,进而避免了业务损失。In the technical solution provided by the embodiments of the present application, the target object is selected from various types of candidate objects configured for the service to be detected, including ports, processes, and service detection scripts; then, according to the status of the service to be detected, the selected Availability of the target object; further, according to the detection result of the selected target object, it is determined whether to update the status of the service to be detected. Compared with the prior art, the solution reduces the dependence on manual labor, and can automatically detect the service status; and by setting various detection mechanisms such as processes, ports, and service detection scripts, it can cover the service status in various scenarios. detection, thereby avoiding business losses.
第二实施例Second Embodiment
图2是根据本申请第二实施例提供的一种服务状态检测方法的流程图,本实施例在上述实施例的基础上,进一步对根据待检测服务的状态,探测所述目标对象的可用性进行解释说明。如图2所示,本实施例提供的服务状态检测方法可以包括:2 is a flowchart of a service status detection method provided according to a second embodiment of the present application. On the basis of the above-mentioned embodiments, this embodiment further detects the availability of the target object according to the status of the service to be detected. explain. As shown in FIG. 2 , the service status detection method provided by this embodiment may include:
S210、从待检测服务的候选对象中选择目标对象。S210. Select a target object from the candidate objects of the service to be detected.
S220、根据待检测服务的状态,确定待检测服务的防抖动参数。S220. Determine anti-jitter parameters of the service to be detected according to the state of the service to be detected.
本实施例考虑到实际场景中由于网络故障等因素的存在,单次探测可能会导致目标对象的探测结果不准确,进而引入防抖动参数,根据防抖动参数对目标对象的可用性进行探测。In this embodiment, considering the existence of factors such as network failures in the actual scene, a single detection may lead to inaccurate detection results of the target object, and then anti-jitter parameters are introduced to detect the availability of the target object according to the anti-jitter parameters.
可选的,防抖动参数与待检测服务的状态有关,待检测服务的状态不同,可设置不同的防抖动参数;例如若待检测服务的状态为故障状态,则可以选择健康防抖动参数;若待检测服务的状态为健康状态,则可以选择故障防抖动参数。其中,健康防抖动参数是一种可用于表征待检测服务的状态由故障状态转变为健康状态的参数;故障防抖动参数则是一种可用于表征待检测服务的状态由健康状态转变为故障状态的参数。Optionally, the anti-jitter parameter is related to the status of the service to be detected, and different anti-jitter parameters can be set depending on the status of the service to be detected; for example, if the status of the service to be detected is faulty, you can select healthy anti-jitter parameter; if the status of the service to be detected is healthy, you can select the fault anti-jitter parameter. Among them, the health anti-jitter parameter is a parameter that can be used to characterize the state of the service to be detected changes from a fault state to a healthy state; the fault anti-jitter parameter is a parameter that can be used to characterize the state of the service to be detected from a healthy state to a healthy state. Parameters for the fault state.
S230、根据待检测服务的防抖动参数,探测目标对象的可用性。S230. Detect the availability of the target object according to the anti-jitter parameters of the service to be detected.
本实施例中,防抖动参数中可以包括探测次数,探测次数是指对目标对象进行重复探测的次数,可根据实际情况进行调整。可选的,根据待检测服务的防抖动参数,探测目标对象的可用性可以是:根据待检测服务的防抖动参数中的探测次数,重复探测目标对象的可用性。例如,若待检测服务的状态为故障状态,且健康防抖动参数中的探测次数为2,则可以重复2次对目标对象的可用性进行探测。In this embodiment, the anti-jitter parameter may include the number of detections, and the number of detections refers to the number of repeated detections of the target object, which may be adjusted according to actual conditions. Optionally, according to the anti-jitter parameter of the service to be detected, detecting the availability of the target object may be: repeating the detection of the availability of the target object according to the number of detections in the anti-jitter parameter of the service to be detected. For example, if the state of the service to be detected is a fault state, and the number of detections in the healthy anti-jitter parameter is 2, the availability detection of the target object may be repeated twice.
可选的,若目标对象为进程,则每次探测目标对象可用性所采用的方式可以是:通过查看所配置的进程路径是否存在,若存在,则确定进程状态为正常状态,进而确定进程可用;若不存在,则确定进程状态为异常状态,进而确定进程不可用。还可以是查看进程日志来确定进程的可用性。Optionally, if the target object is a process, the method used to detect the availability of the target object each time may be: by checking whether the configured process path exists, if it exists, determine that the process state is normal, and then determine that the process is available; If it does not exist, it is determined that the process state is an abnormal state, and then it is determined that the process is unavailable. It is also possible to look at the process log to determine the availability of the process.
若目标对象为端口,则每次探测目标对象可用性所采用的方式可以是:通过查看端口是否存在;若存在,则确定端口状态为正常状态,进而确定端口可用;若不存在,则确定端口状态为异常状态,进而确定端口不可用。If the target object is a port, the method used to detect the availability of the target object each time can be: by checking whether the port exists; if it exists, determine that the port status is normal, and then determine that the port is available; if it does not exist, determine the port status It is in an abnormal state, and then it is determined that the port is unavailable.
若目标对象为服务检测脚本,则每次探测目标对象可用性所采用的方式可以是:执行服务检测脚本并采集脚本输出结果,进而可依据脚本输出结果确定脚本的可用性。例如,待检测服务为读取数据,则可以通过查看脚本输出结果中是否显示已读取,若否,则确定服务检测脚本状态为异常状态,进而确定服务检测脚本不可用;若是,则确定服务检测脚本状态为正常状态,进而确定服务检测脚本可用。If the target object is a service detection script, the method used to detect the availability of the target object each time may be: executing the service detection script and collecting the script output result, and then determining the availability of the script according to the script output result. For example, if the service to be detected is reading data, you can check whether the script output result shows that it has been read. If not, determine that the service detection script is in an abnormal state, and then determine that the service detection script is unavailable; if so, determine the service The status of the detection script is normal, so as to determine that the service detection script is available.
S240、根据目标对象的探测结果,确定是否更新待检测服务的状态。S240. According to the detection result of the target object, determine whether to update the status of the service to be detected.
进一步的,防抖动参数中还可以包括阈值次数,其中,阈值次数用于表征目标对象连续处于正常状态或异常状态的次数。具体的,若根据探测结果确定目标对象连续处于任一状态的次数达到待检测服务的防抖动参数中的阈值次数,则将该状态作为目标对象的检测状态;进而依据目标对象的检测状态,确定是否更新待检测服务的状态。Further, the anti-shake parameter may also include a threshold number of times, where the threshold number of times is used to represent the number of times the target object is in a normal state or an abnormal state continuously. Specifically, if it is determined according to the detection result that the number of times that the target object is in any state continuously reaches the threshold number of times in the anti-shake parameter of the service to be detected, the state is regarded as the detection state of the target object; and then according to the detection state of the target object, Determines whether to update the status of the service to be detected.
例如,若目标对象为端口、进程以及服务检测脚本中的一种,待检测服务的状态为故障状态,且健康防抖动参数中的探测次数为3,阈值次数为3,则可以重复3次对目标对象的可用性进行探测;如果根据重复3次的探测结果,确定目标对象连续3次均处于正常状态,则可以确定目标对象是可用的,进而可以将待检测服务的状态由故障状态更新为健康状态。如果根据重复3次的探测结果确定目标对象连续2次处于正常状态或只有1次处于正常状态,则可以确定目标对象是不可用的,进而可以保持待检测服务的状态为故障状态。For example, if the target object is one of ports, processes, and service detection scripts, the status of the service to be detected is faulty, and the number of detections in the healthy anti-jitter parameter is 3 and the number of thresholds is 3, it can be repeated 3 times Detect the availability of the target object; if it is determined that the target object is in a normal state for 3 consecutive times according to the detection results repeated 3 times, it can be determined that the target object is available, and then the status of the service to be detected can be updated from the fault state to health status. If it is determined that the target object is in the normal state for 2 consecutive times or only once in the normal state according to the detection results repeated 3 times, it can be determined that the target object is unavailable, and the state of the service to be detected can be kept as a fault state.
此外,目标对象为端口、进程以及服务检测脚本中的至少两种,如端口和进程,待检测服务的状态为故障状态,且健康防抖动参数中的探测次数为3,阈值次数为3,则可以重复3次同时对端口和进程的可用性进行探测;之后对于每次探测,将端口的探测结果和进程的探测结果进行与运算得到合并结果;如果依据3次的合并结果确定目标对象连续2次处于正常状态或只有1次处于正常状态,则可以确定目标对象是不可用的,进而可以保持待检测服务的状态为故障状态。如果依据3次的合并结果确定目标对象连续3次均处于正常状态,则可以确定目标对象是可用的,进而可以将待检测服务的状态由故障状态更新为健康状态。In addition, the target object is at least two of ports, processes, and service detection scripts, such as ports and processes, the status of the service to be detected is faulty, and the number of detections in the health anti-jitter parameter is 3, and the number of thresholds is 3. Then you can repeat 3 times to detect the availability of ports and processes at the same time; then for each detection, perform AND operation on the detection results of the port and the detection results of the process to obtain a combined result; if the target object is determined to be consecutive 2 If the target object is in the normal state only once or is in the normal state only once, it can be determined that the target object is unavailable, and then the state of the service to be detected can be kept as a fault state. If it is determined that the target object is in the normal state three times in a row according to the merging results of the three times, it can be determined that the target object is available, and then the state of the service to be detected can be updated from the fault state to the healthy state.
本申请实施例提供的技术方案,通过从为待检测服务所配置的包括端口、进程以及服务检测脚本等多种类型候选对象中选择目标对象;之后引入防抖动参数探测所选择的目标对象的可用性,可避免由于网络故障等因素的存在,导致目标对象的探测结果不准确的现象;进而根据所选择的目标对象的探测结果,可准确确定是否更新待检测服务的状态。相比于现有技术,本方案降低了对人工的依赖性,可自动实现对服务状态的检测;而且通过设置进程、端口以及服务检测脚本等多种探测机制,可覆盖各种场景下服务状态的检测,进而避免了业务损失。In the technical solution provided by the embodiments of the present application, a target object is selected from various types of candidate objects including ports, processes, and service detection scripts configured for the service to be detected; and then anti-jitter parameters are introduced to detect the selected target object Availability can avoid the phenomenon that the detection result of the target object is inaccurate due to the existence of factors such as network failure; and then according to the detection result of the selected target object, it can be accurately determined whether to update the status of the service to be detected. Compared with the prior art, the solution reduces the dependence on manual labor, and can automatically detect the service status; and by setting various detection mechanisms such as processes, ports, and service detection scripts, it can cover the service status in various scenarios. detection, thereby avoiding business losses.
第三实施例Third Embodiment
图3是根据本申请第三实施例提供的一种服务状态检测方法的流程图,本实施例在上述实施例的基础上,进一步对根据待检测服务的状态,探测所述目标对象的可用性进行解释说明。如图3所示,本实施例提供的服务状态检测方法可以包括:FIG. 3 is a flowchart of a service status detection method provided according to a third embodiment of the present application. On the basis of the above embodiments, this embodiment further detects the availability of the target object according to the status of the service to be detected. explain. As shown in FIG. 3 , the service state detection method provided by this embodiment may include:
S310、从待检测服务的候选对象中选择目标对象。S310. Select a target object from the candidate objects of the service to be detected.
S320、通过代理服务,根据待检测服务的状态,探测目标对象的可用性。S320. Through the proxy service, the availability of the target object is detected according to the state of the service to be detected.
其中,代理服务即为代理Agent,是一种可自动运行的软件或硬件实体。本实施例中,引入代理服务来探测目标对象,进一步增加了服务状态检测的自动化程度。Among them, the proxy service is the proxy agent, which is a software or hardware entity that can run automatically. In this embodiment, a proxy service is introduced to detect the target object, which further increases the degree of automation of service status detection.
可选的,若目标对象为端口,则通过代理服务探测目标对象可用性所采用的方式可以是:Agent根据端口类型,采用相应的协议与端口建立连接,以判断端口是否处于正常状态,进而确定端口是否可用。例如,对于TCP端口,Agent可与端口建立TCP连接,如果连接成功,则确定端口处于正常状态,进而确定端口可用;若连接不成功,则确定端口处于异常状态,进而确定端口不可用。还可以是Agent查看端口是否存在,以判断端口是否处于正常状态,进而确定端口是否可用等。本实施例对通过代理服务探测端口可用性的方式不做限定。Optionally, if the target object is a port, the method used by the proxy service to detect the availability of the target object may be: the Agent establishes a connection with the port using a corresponding protocol according to the port type, so as to determine whether the port is in a normal state, and then determine the port. it's usable or not. For example, for a TCP port, the Agent can establish a TCP connection with the port. If the connection is successful, it is determined that the port is in a normal state, and then the port is determined to be available; if the connection is unsuccessful, it is determined that the port is in an abnormal state, and then the port is determined to be unavailable. It can also be that the Agent checks whether the port exists, so as to determine whether the port is in a normal state, and then determine whether the port is available or not. This embodiment does not limit the manner in which the port availability is detected by the proxy service.
若目标对象为进程,则通过代理服务探测目标对象可用性所采用的方式可以是:Agent查看所配置的进程路径是否存在,以判断进程是否处于正常状态,进而确定进程是否可用。还可以是Agent查看进程日志来确定进程的可用性。本实施例对通过代理服务探测进程可用性的方式不做限定。If the target object is a process, the method used to detect the availability of the target object through the proxy service may be: Agent checks whether the configured process path exists, so as to judge whether the process is in a normal state, and then determine whether the process is available. It is also possible for the Agent to view the process log to determine the availability of the process. This embodiment does not limit the manner of detecting the availability of the process through the proxy service.
若目标对象为服务检测脚本,则通过代理服务探测目标对象可用性所采用的方式可以是:Agent根据所配置的服务检测脚本的路径执行对应的服务检测脚本,并采集脚本输出结果;之后依据脚本输出结果判断服务检测脚本是否处于正常状态,进而确定服务检测脚本是否可用。本实施例对通过代理服务探测服务检测脚本可用性的方式不做限定。If the target object is a service detection script, the method used to detect the availability of the target object through the proxy service may be: the Agent executes the corresponding service detection script according to the path of the configured service detection script, and collects the script output results; then output according to the script As a result, it is determined whether the service detection script is in a normal state, and then it is determined whether the service detection script is available. This embodiment does not limit the manner in which the script availability is detected by the proxy service detection service.
示例性的,若确定代理服务失效,即确定代理服务无法探测目标对象的可用性,则可以输出报警信息,以提醒用户采用人工干预方式确定是否更新待检测服务的状态。具体可以是,获取用户根据待检测服务的运行情况输入的自然数,进而根据该自然数,确定是否更新待检测服务的状态。可选的,自然数0可以表示健康状态,其他自然数表示故障状态。例如,若用户输入的自然数为0,且待检测服务的状态是故障状态,则将待检测服务的状态由故障状态更新为健康状态。Exemplarily, if it is determined that the proxy service fails, that is, it is determined that the proxy service cannot detect the availability of the target object, alarm information may be output to remind the user to determine whether to update the status of the service to be detected by manual intervention. Specifically, a natural number input by the user according to the operation status of the service to be detected is obtained, and then according to the natural number, it is determined whether to update the status of the service to be detected. Optionally, the natural number 0 can represent the healthy state, and other natural numbers represent the fault state. For example, if the natural number input by the user is 0, and the state of the service to be detected is a fault state, the state of the service to be detected is updated from the fault state to the healthy state.
需要说明的是,本实施例通过引入人工干预方式,可以及时解决自动检测机制失效无法检测服务状态的场景。It should be noted that, by introducing manual intervention in this embodiment, the scenario in which the automatic detection mechanism fails and cannot detect the service status can be solved in time.
S330、根据目标对象的探测结果,确定是否更新待检测服务的状态。S330. According to the detection result of the target object, determine whether to update the status of the service to be detected.
本申请实施例提供的技术方案,提供了一种通过代理服务,自动对目标对象进行探测的方式;而且在确定代理服务失效的场景下,可输出报警信息,以便通过人工干预方式实现对服务状态的检测。The technical solutions provided by the embodiments of the present application provide a method for automatically detecting a target object through a proxy service; and in a scenario where the proxy service is determined to be invalid, alarm information can be output, so as to realize the status of the service through manual intervention. detection.
第四实施例Fourth Embodiment
图4是根据本申请第四实施例提供的一种服务状态检测装置的结构示意图,该装置可执行本申请任意实施例所提供的服务状态检测方法,具备执行方法相应的功能模块和有益效果。可选的,该装置可以采用软件和/或硬件的方式实现,并可集成在任意的具有计算能力的设备上,例如服务器等。如图4所示,该装置可以包括:4 is a schematic structural diagram of a service status detection apparatus provided according to a fourth embodiment of the present application. The apparatus can execute the service status detection method provided by any embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method. Optionally, the apparatus may be implemented in software and/or hardware, and may be integrated on any device with computing capabilities, such as a server. As shown in Figure 4, the device may include:
目标对象选择模块410,用于从待检测服务的候选对象中选择目标对象;其中,候选对象包括端口、进程以及服务检测脚本;The target
可用性探测模块420,用于根据待检测服务的状态,探测目标对象的可用性;an
服务状态更新模块430,用于根据目标对象的探测结果,确定是否更新待检测服务的状态。The service
本申请实施例所提供的技术方案,通过从为待检测服务所配置的包括端口、进程以及服务检测脚本等多种类型候选对象中选择目标对象;之后根据待检测服务的状态,探测所选择的目标对象的可用性;进而根据所选择的目标对象的探测结果,确定是否更新待检测服务的状态。相比于现有技术,本方案降低了对人工的依赖性,可自动实现对服务状态的检测;而且通过设置进程、端口以及服务检测脚本等多种探测机制,可覆盖各种场景下服务状态的检测,进而避免了业务损失。In the technical solution provided by the embodiments of the present application, the target object is selected from various types of candidate objects configured for the service to be detected, including ports, processes, and service detection scripts; then, according to the status of the service to be detected, the selected Availability of the target object; further, according to the detection result of the selected target object, it is determined whether to update the status of the service to be detected. Compared with the prior art, the solution reduces the dependence on manual labor, and can automatically detect the service status; and by setting various detection mechanisms such as processes, ports, and service detection scripts, it can cover the service status in various scenarios. detection, thereby avoiding business losses.
示例性的,可用性探测模块420可以包括:Exemplarily, the
参数确定单元,用于根据待检测服务的状态,确定待检测服务的防抖动参数;a parameter determination unit, configured to determine anti-jitter parameters of the service to be detected according to the state of the service to be detected;
可用性探测单元,用于根据待检测服务的防抖动参数,探测目标对象的可用性。The availability detection unit is used for detecting the availability of the target object according to the anti-jitter parameters of the service to be detected.
示例性的,可用性探测单元具体可以用于:Exemplarily, the availability detection unit can be specifically used for:
根据待检测服务的防抖动参数中的探测次数,重复探测目标对象的可用性。According to the number of detections in the anti-jitter parameter of the service to be detected, the availability of the target object is repeatedly detected.
相应地,服务状态更新模块430具体可以用于:Correspondingly, the service
若根据探测结果确定所述目标对象连续处于任一状态的次数达到待检测服务的防抖动参数中的阈值次数,则将该状态作为目标对象的检测状态;If it is determined according to the detection result that the number of times that the target object is in any state continuously reaches the threshold number of times in the anti-shake parameter of the service to be detected, the state is regarded as the detection state of the target object;
依据目标对象的检测状态,确定是否更新所述待检测服务的状态。According to the detection status of the target object, it is determined whether to update the status of the service to be detected.
示例性的,待检测服务的状态为故障状态或健康状态时,待检测服务的防抖动参数不同。Exemplarily, when the state of the service to be detected is a fault state or a healthy state, the anti-jitter parameters of the service to be detected are different.
示例性的,可用性探测模块420还可以用于:Exemplarily, the
通过代理服务,根据待检测服务的状态,探测目标对象的可用性。Through the proxy service, the availability of the target object is detected according to the status of the service to be detected.
示例性的,上述装置还可以包括:Exemplarily, the above-mentioned apparatus may further include:
报警模块,用于若确定代理服务失效,则输出报警信息。The alarm module is used to output alarm information if it is determined that the proxy service is invalid.
示例性的,目标对象选择模块410具体可以用于:Exemplarily, the target
依据待检测服务的操作类型,从待检测服务的候选服务检测脚本中选择目标服务检测脚本;其中,操作类型包括读取、写入、增加或删除数据,以及新建或删除文件。According to the operation type of the service to be detected, the target service detection script is selected from the candidate service detection scripts of the service to be detected; wherein, the operation type includes reading, writing, adding or deleting data, and creating or deleting files.
根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。According to the embodiments of the present application, the present application further provides an electronic device and a readable storage medium.
如图5所示,是根据本申请实施例的服务状态检测方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。As shown in FIG. 5 , it is a block diagram of an electronic device according to a service state detection method according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are by way of example only, and are not intended to limit implementations of the application described and/or claimed herein.
如图4所示,该电子设备包括:一个或多个处理器501、存储器502,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示图形用户界面(Graphical User Interface,GUI)的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作,例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统。图5中以一个处理器501为例。As shown in FIG. 4, the electronic device includes: one or
存储器502即为本申请所提供的非瞬时计算机可读存储介质。其中,所述存储器存储有可由至少一个处理器执行的指令,以使所述至少一个处理器执行本申请所提供的服务状态检测方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的服务状态检测方法。The
存储器502作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的服务状态检测方法对应的程序指令/模块,例如,附图4所示的目标对象选择模块410、可用性探测模块420和服务状态更新模块430。处理器501通过运行存储在存储器502中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的服务状态检测方法。As a non-transitory computer-readable storage medium, the
存储器502可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据用来实现服务状态检测方法的电子设备的使用所创建的数据等。此外,存储器502可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器502可选包括相对于处理器501远程设置的存储器,这些远程存储器可以通过网络连接至用来实现服务状态检测方法的电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The
用来实现服务状态检测方法的电子设备还可以包括:输入装置503和输出装置504。处理器501、存储器502、输入装置503和输出装置504可以通过总线或者其他方式连接,图5中以通过总线连接为例。The electronic device used to implement the service state detection method may further include: an
输入装置503可接收输入的数字或字符信息,以及产生与用来实现服务状态检测方法的电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置504可以包括显示设备、辅助照明装置和触觉反馈装置等,其中,辅助照明装置例如发光二极管(Light Emitting Diode,LED),触觉反馈装置例如振动电机等。该显示设备可以包括但不限于,液晶显示器(Liquid Crystal Display,LCD)、LED显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。The
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用专用集成电路(Application Specific Integrated Circuit,ASIC)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein may be in digital electronic circuitry, integrated circuit systems, application specific integrated circuits (ASICs), computer hardware, firmware, software, and/or combinations thereof accomplish. These various embodiments may include being implemented in one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor that The processor, which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
这些计算程序也称作程序、软件、软件应用、或者代码,包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置,例如,磁盘、光盘、存储器、可编程逻辑装置(Programmable Logic Device,PLD),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。These computational programs, also referred to as programs, software, software applications, or codes, include machine instructions for programmable processors, and may utilize high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages to implement these computations program. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or apparatus for providing machine instructions and/or data to a programmable processor, For example, a magnetic disk, an optical disk, a memory, a Programmable Logic Device (PLD), including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置,例如,阴极射线管(Cathode Ray Tube,CRT)或者LCD监视器;以及键盘和指向装置,例如,鼠标或者轨迹球,用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式,包括声输入、语音输入或者、触觉输入,来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device, such as a cathode ray tube (CRT) or LCD monitor, for displaying information to the user ; and a keyboard and pointing device, such as a mouse or trackball, through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (eg, visual feedback, auditory feedback, or tactile feedback); and can be in any form, including acoustic feedback. Input, voice input, or tactile input to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统例如,作为数据服务器;或者实施在包括中间件部件的计算系统例如,应用服务器;或者实施在包括前端部件的计算系统例如具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互,或者实施在包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信,例如,通信网络,来将系统的部件相互连接。通信网络的示例包括:局域网(Local Area Network,LAN)、广域网(Wide Area Network,WAN)和互联网。The systems and techniques described herein can be implemented on a computing system that includes back-end components, for example, as a data server; or on a computing system that includes middleware components, such as an application server; or on a computing system that includes front-end components, such as with graphics. A user computer with a user interface or web browser through which a user may interact with implementations of the systems and techniques described herein, or implemented in a computer that includes such backend components, middleware components, or Any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication, eg, a communication network. Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。A computer system can include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.
根据本申请实施例的技术方案,通过从为待检测服务所配置的包括端口、进程以及服务检测脚本等多种类型候选对象中选择目标对象;之后根据待检测服务的状态,探测所选择的目标对象的可用性;进而根据所选择的目标对象的探测结果,确定是否更新待检测服务的状态。相比于现有技术,本方案降低了对人工的依赖性,可自动实现对服务状态的检测;而且通过设置进程、端口以及服务检测脚本等多种探测机制,可覆盖各种场景下服务状态的检测,进而避免了业务损失。According to the technical solutions of the embodiments of the present application, the target object is selected from various types of candidate objects configured for the service to be detected, including ports, processes, and service detection scripts; and then the selected target is detected according to the status of the service to be detected. Availability of the object; further, according to the detection result of the selected target object, it is determined whether to update the status of the service to be detected. Compared with the prior art, this solution reduces the dependence on manual labor, and can automatically detect the service status; and by setting various detection mechanisms such as processes, ports, and service detection scripts, it can cover the service status in various scenarios. detection, thereby avoiding business losses.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that steps may be reordered, added or deleted using the various forms of flow shown above. For example, the steps described in the present application can be performed in parallel, sequentially or in different orders, and as long as the desired results of the technical solutions disclosed in the present application can be achieved, no limitation is imposed herein.
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the protection scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911007573.6A CN110737560B (en) | 2019-10-22 | 2019-10-22 | Service state detection method and device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911007573.6A CN110737560B (en) | 2019-10-22 | 2019-10-22 | Service state detection method and device, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110737560A true CN110737560A (en) | 2020-01-31 |
CN110737560B CN110737560B (en) | 2023-10-20 |
Family
ID=69270835
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911007573.6A Active CN110737560B (en) | 2019-10-22 | 2019-10-22 | Service state detection method and device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110737560B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111770154A (en) * | 2020-06-24 | 2020-10-13 | 百度在线网络技术(北京)有限公司 | Service detection method, device, equipment and storage medium |
CN111897698A (en) * | 2020-08-17 | 2020-11-06 | 杭州安恒信息安全技术有限公司 | A port service identification method, apparatus, device and readable storage medium |
CN113448640A (en) * | 2020-03-10 | 2021-09-28 | 腾讯科技(深圳)有限公司 | WEB application configuration detection method, device, storage medium and computer equipment |
CN114064208A (en) * | 2021-11-10 | 2022-02-18 | 北京百度网讯科技有限公司 | Method and device for detecting application service state, electronic equipment and storage medium |
CN114328156A (en) * | 2021-12-28 | 2022-04-12 | 苏州万店掌网络科技有限公司 | Health detection method, device and equipment of protocol port and readable storage medium |
CN115174434B (en) * | 2022-07-08 | 2023-07-25 | 广州市百果园信息技术有限公司 | Method, device, equipment, storage medium and product for executing detection task |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106445754A (en) * | 2016-09-13 | 2017-02-22 | 郑州云海信息技术有限公司 | Method and system for inspecting cluster health status and cluster server |
WO2017063505A1 (en) * | 2015-10-16 | 2017-04-20 | 中兴通讯股份有限公司 | Method for detecting hardware fault of server, apparatus thereof, and server |
CN107483277A (en) * | 2017-09-28 | 2017-12-15 | 北京小米移动软件有限公司 | Port management method and device |
CN107612727A (en) * | 2017-09-14 | 2018-01-19 | 掌阅科技股份有限公司 | Distributed health examination method, computing device and computer-readable storage medium |
CN108595333A (en) * | 2018-04-26 | 2018-09-28 | Oppo广东移动通信有限公司 | The health examination method and device of application process in PaaS platform |
CN108769124A (en) * | 2018-04-28 | 2018-11-06 | Oppo广东移动通信有限公司 | Application deployment method, device, server and storage medium of PaaS platform |
CN109815110A (en) * | 2018-12-11 | 2019-05-28 | 北京城市网邻信息技术有限公司 | A kind of network port management method, device, terminal device and storage medium |
US20190179726A1 (en) * | 2016-12-08 | 2019-06-13 | Tencent Technology (Shenzhen) Company Limited | Monitoring method and apparatus of server, and storage medium |
-
2019
- 2019-10-22 CN CN201911007573.6A patent/CN110737560B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017063505A1 (en) * | 2015-10-16 | 2017-04-20 | 中兴通讯股份有限公司 | Method for detecting hardware fault of server, apparatus thereof, and server |
CN106445754A (en) * | 2016-09-13 | 2017-02-22 | 郑州云海信息技术有限公司 | Method and system for inspecting cluster health status and cluster server |
US20190179726A1 (en) * | 2016-12-08 | 2019-06-13 | Tencent Technology (Shenzhen) Company Limited | Monitoring method and apparatus of server, and storage medium |
CN107612727A (en) * | 2017-09-14 | 2018-01-19 | 掌阅科技股份有限公司 | Distributed health examination method, computing device and computer-readable storage medium |
CN107483277A (en) * | 2017-09-28 | 2017-12-15 | 北京小米移动软件有限公司 | Port management method and device |
CN108595333A (en) * | 2018-04-26 | 2018-09-28 | Oppo广东移动通信有限公司 | The health examination method and device of application process in PaaS platform |
CN108769124A (en) * | 2018-04-28 | 2018-11-06 | Oppo广东移动通信有限公司 | Application deployment method, device, server and storage medium of PaaS platform |
CN109815110A (en) * | 2018-12-11 | 2019-05-28 | 北京城市网邻信息技术有限公司 | A kind of network port management method, device, terminal device and storage medium |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113448640A (en) * | 2020-03-10 | 2021-09-28 | 腾讯科技(深圳)有限公司 | WEB application configuration detection method, device, storage medium and computer equipment |
CN111770154A (en) * | 2020-06-24 | 2020-10-13 | 百度在线网络技术(北京)有限公司 | Service detection method, device, equipment and storage medium |
CN111770154B (en) * | 2020-06-24 | 2023-12-05 | 百度在线网络技术(北京)有限公司 | Service detection method, device, equipment and storage medium |
CN111897698A (en) * | 2020-08-17 | 2020-11-06 | 杭州安恒信息安全技术有限公司 | A port service identification method, apparatus, device and readable storage medium |
CN114064208A (en) * | 2021-11-10 | 2022-02-18 | 北京百度网讯科技有限公司 | Method and device for detecting application service state, electronic equipment and storage medium |
CN114328156A (en) * | 2021-12-28 | 2022-04-12 | 苏州万店掌网络科技有限公司 | Health detection method, device and equipment of protocol port and readable storage medium |
CN115174434B (en) * | 2022-07-08 | 2023-07-25 | 广州市百果园信息技术有限公司 | Method, device, equipment, storage medium and product for executing detection task |
Also Published As
Publication number | Publication date |
---|---|
CN110737560B (en) | 2023-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110737560A (en) | A service status detection method, apparatus, electronic device and medium | |
CN111708653B (en) | Memory fault processing method and device, electronic equipment and storage medium | |
CN111756579A (en) | Abnormal early warning method, device, equipment and storage medium | |
CN112270399B (en) | Operator registration processing method, device and electronic device based on deep learning | |
CN111835592B (en) | Method, apparatus, electronic device and readable storage medium for determining robustness | |
CN111582375A (en) | Data enhancement strategy searching method, device, equipment and storage medium | |
KR20220043818A (en) | Service information processing method, device, equipment and computer storage medium | |
CN113449298B (en) | Detection method, device, equipment and medium for rebound shell process | |
EP3869377A1 (en) | Method and apparatus for data processing based on smart contract, device and storage medium | |
CN111475164B (en) | Component dependency detection method, device and electronic device | |
CN111597192A (en) | Database switching control method and device and electronic equipment | |
CN111770154A (en) | Service detection method, device, equipment and storage medium | |
CN111835857B (en) | Method and apparatus for accessing data | |
CN110659184A (en) | Health state check method, device and system | |
CN112565356B (en) | Data storage method and device and electronic equipment | |
CN111581049B (en) | Distributed system running state monitoring method, device, equipment and storage medium | |
CN110750419A (en) | Offline task processing method and device, electronic equipment and storage medium | |
CN111258954B (en) | Data migration method, device, equipment and storage medium | |
CN114416578A (en) | Test method and apparatus | |
CN111966421A (en) | Page component operation monitoring method, device, equipment and storage medium | |
CN111694608A (en) | System upgrading method and device for terminal equipment, electronic equipment and terminal equipment | |
CN111831319B (en) | Method, device, equipment and storage medium for posterior difference data | |
CN111459887B (en) | Resource screening method and device, electronic equipment and storage medium | |
CN111930748B (en) | Method, device, equipment and storage medium for tracking data of streaming computing system | |
CN111506499B (en) | Method and device for detecting availability of parameters in applet and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |