CN110737560A - service state detection method, device, electronic equipment and medium - Google Patents

service state detection method, device, electronic equipment and medium Download PDF

Info

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
state
target object
detection
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
Application number
CN201911007573.6A
Other languages
Chinese (zh)
Other versions
CN110737560B (en
Inventor
郭晓敏
刘冰冰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201911007573.6A priority Critical patent/CN110737560B/en
Publication of CN110737560A publication Critical patent/CN110737560A/en
Application granted granted Critical
Publication of CN110737560B publication Critical patent/CN110737560B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test 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 embodiment of the application discloses service state detection methods, devices, electronic equipment and media, and relates to the technical field of automatic detection.

Description

service state detection method, device, electronic equipment and medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to the technical field of automatic detection, and specifically relates to service state detection methods, devices, electronic equipment and media.
Background
Various services are involved on a machine, and in an actual operating environment, traffic shielding, unblocking and the like are generally performed according to the health state of the services. Since a process is usually started after a service is started, a common way for detecting the health status of the service at present is to manually check whether the process is running.
However, this approach is labor-dependent, costly, and only covers a partial check of the health status of the service.
Disclosure of Invention
The embodiment of the application discloses service state detection methods, devices, electronic equipment and media, which can automatically detect service states and cover various scenes.
, the embodiment of the application discloses a service state detection method, which comprises:
selecting a target object from candidate objects of a service to be detected; wherein the candidate objects comprise ports, processes and service detection scripts;
detecting the availability of the target object according to the state of the service to be detected;
and determining whether to update the state of the service to be detected according to the detection result of the target object.
Compared with the prior art, the embodiments in the application have the advantages that the method and the device can reduce dependence on manual work, can automatically realize detection on the service state, can cover detection on the service state under various scenes by setting various detection mechanisms such as the process, the port and the service detection script, and further avoid service loss.
Optionally, detecting the availability of the target object according to the state of the service to be detected includes:
determining anti-jitter parameters of the service to be detected according to the state of the service to be detected;
and detecting the availability of the target object according to the anti-jitter parameters of the service to be detected.
The above alternative has the following advantages or benefits: by setting the anti-jitter parameters, the phenomenon that the detection result of the target object is inaccurate due to the existence of factors such as network faults and the like can be avoided.
Optionally, detecting the availability of the target object according to the anti-jitter parameter of the service to be detected includes:
repeatedly detecting the availability of the target object according to the detection times in the anti-jitter parameters of the service to be detected;
correspondingly, determining whether to update the state of the service to be detected according to the detection result of the target object comprises the following steps:
if the frequency that the target object is continuously in any state is determined to reach the threshold frequency in the anti-shaking parameters of the service to be detected according to the detection result, taking the state as the detection state of the target object;
and determining whether to update the state of the service to be detected according to the detection state of the target object.
The alternative mode has the advantage or beneficial effect that the accuracy of whether to update the state of the service to be detected is further increased by the mutual cooperation of the detection times and the threshold times in the anti-jitter parameters.
Optionally, detecting the availability of the target object according to the state of the service to be detected includes:
and detecting the availability of the target object through the proxy service according to the state of the service to be detected.
The method further comprises the following steps:
and if the agent service is determined to be invalid, outputting alarm information.
The alternative mode has the advantages or beneficial effects that modes of automatically detecting the target object through the proxy service are provided, and in the scene of determining the proxy service failure, alarm information can be output so as to realize the detection of the service state through a manual intervention mode.
The second convenience, this application embodiment also discloses kinds of service status detection devices, and the device includes:
the target object selection module is used for selecting a target object from candidate objects of the service to be detected; wherein the candidate objects comprise ports, processes and service detection scripts;
the availability detection module is used for detecting the availability of the target object according to the state of the service to be detected;
and the service state updating module is used for determining whether to update the state of the service to be detected according to the detection result of the target object.
In a third aspect, an embodiment of the present application further discloses kinds of electronic devices, including:
at least processors, and
a memory communicatively coupled to the at least processors, wherein,
the memory stores instructions executable by the at least processors, the instructions being executable by the at least processors to enable the at least processors to perform a service status detection method as described in any embodiment of the present application.
In a fourth aspect, this application further discloses non-transitory computer-readable storage media storing computer instructions for causing a computer to perform the service status detection method according to any embodiment of this application.
Compared with the prior art, the method and the device have the advantages that the dependency on manual work is reduced, the service state can be automatically detected, the detection of the service state can be achieved, the detection of the service state under various scenes can be covered by adopting technical means of various detection mechanisms such as the process, the port and the service detection script, and further the service loss is avoided.
Other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a flow chart of a service status detection method according to an embodiment of the present application;
fig. 2 is a flowchart of service status detection methods according to a second embodiment of the present application;
fig. 3 is a flowchart of service status detection methods according to a third embodiment of the present application;
fig. 4 is a schematic structural diagram of service status detection devices according to a fourth embodiment of the present application;
fig. 5 is a block diagram of an electronic device for implementing a service status detection method according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered 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 in the following description for clarity and conciseness.
th embodiment
FIG. 1 is a flow chart of a service state detection method provided according to an embodiment of the present application, which is applicable to a case of detecting various service states involved on a machine, and the method can be executed by a service state detection apparatus, which can be implemented in software and/or hardware, and can be integrated on any device with computing capability, such as a server, etc. as shown in FIG. 1, the service state detection method provided by the present embodiment can include:
s110, selecting 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 a machine, or may also be other services on a robot, such as reading data, creating a file, and the like, for each service to be detected, multiple types of candidate objects, such as ports, processes, service detection scripts, and the like, may be preconfigured, where each type of candidate objects may have or more candidate objects, for example, the ports may be or more of network ports exposed after the service to be detected is started, the process may be a process started after the service to be detected is started, and the service detection script may be scripts written by a user according to functions or purposes to be implemented by the service to be detected, or may be multiple general scripts written.
The target objects may be or more of a plurality of types of candidate objects of the port, process and service detection script, optionally, the target objects may be selected from the candidate objects of the service to be detected according to the selection of the user, step , for each service to be detected, a priority may be set for each candidate objects according to the actual scene when the candidate objects are pre-configured, and further, the target objects may be selected from the plurality of candidate objects of the service to be detected according to the priority of the pre-configured candidate objects.
, it can flexibly detect or more of the multiple types of candidate objects from the port, process and service detection script according to the service scene 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, and for the special scene, such as reading data or creating a new file, the service detection script can be selected as the target object.
For example, selecting the target object from the candidate objects of the service to be detected may be: selecting a target service detection script from candidate service detection scripts of the service to be detected according to the operation type of the service to be detected; the operation types include reading, writing, adding or deleting data, and creating or deleting files.
For example, if the operation type is read data, a script related to the read data can be selected from the candidate service detection scripts, then relevant parameters in the script, such as a read path, a script output result storage path and the like, are adjusted, and the adjusted service detection script is used as a target object.
It should be noted that by setting the universal script, the universal script can be directly adjusted and used for the service to be detected whose operation type includes reading, writing, adding or deleting data, and creating or deleting a file, and the flexibility of script detection is increased.
And S120, detecting 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 a healthy state and a fault state, alternatively, the state of the service to be detected may be the state of the service to be detected recorded for times, or the state of the service to be detected at the current time.
Specifically, the availability of the target object may be detected according to the state of the service to be detected. For example, the detection parameters may be determined according to the state of the service to be detected; and then detecting the availability of the target object according to the detection parameters. Wherein 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 the following embodiments.
S130, determining whether to update the state of the service to be detected according to the detection result of the target object.
Optionally, if the target object is types in the port, the process, and the service detection script, when the detection result of the target object detected in the state of the service to be detected is that the target object is available, the state of the service to be detected may be updated from the fault state to the healthy state, and when the detection result of the target object detected in the state of the service to be detected is that the target object is unavailable, the state of the service to be detected may be maintained as the fault state.
If the target object is types in the port, process and service detection script, the state of the service to be detected can be updated from the healthy state to the fault state when the detection result of the target object detected under the condition that the state of the service to be detected is the healthy state is that the target object is unavailable, and the state of the service to be detected can be kept as the healthy state when the detection result of the target object detected under the condition that the state of the service to be detected is the healthy state is that the target object is available.
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 subjected to and operation, and whether the state of the service to be detected is updated or not is determined according to the and operation result. For example, if the detection result of the port detected when the state 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 state of the service to be detected is the fault state is that the process is available, the state of the service to be detected can be updated from the fault state to the healthy state. If the detection result of the port detected when the state of the service to be detected is the fault state is that the port is available, and meanwhile, the detection result of the process detected when the state of the service to be detected is the fault state is that the process is unavailable, the state of the service to be detected can be kept as the fault state.
In addition, if the detection result of the port detected when the state of the service to be detected is the healthy state is that the port is unavailable, and the detection result of the process detected when the state of the service to be detected is the healthy state is that the process is available, the state of the service to be detected can be updated from the healthy state to the fault state. If the detection result of the port detected when the state of the service to be detected is the healthy state is that the port is available, and meanwhile, the detection result of the process detected when the state of the service to be detected is the healthy state is that the process is available, the state of the service to be detected can be kept as the healthy state.
According to the technical scheme provided by the embodiment of the application, a target object is selected from multiple types of candidate objects including a port, a process, a service detection script and the like configured for the service to be detected; then, detecting the availability of the selected target object according to the state of the service to be detected; and then determining whether to update the state of the service to be detected according to the detection result of the selected target object. Compared with the prior art, the scheme reduces the dependence on manpower and can automatically realize the detection of the service state; and by setting multiple detection mechanisms such as a process, a port and a service detection script, the detection of the service state in various scenes can be covered, and further, the service loss is avoided.
Second embodiment
Fig. 2 is a flowchart of service status detection methods provided according to a second embodiment of the present application, and this embodiment further explains availability of detecting the target object according to the status of the service to be detected based on the above embodiments, as shown in fig. 2, the service status detection method provided by this embodiment may include:
s210, selecting a target object from the candidate objects of the service to be detected.
S220, determining anti-jitter parameters of the service to be detected according to the state of the service to be detected.
In the embodiment, the fact that the detection result of the target object is inaccurate due to the existence of factors such as network faults in an actual scene is considered, and then the anti-jitter parameter is introduced to detect the availability of the target object according to the anti-jitter parameter.
Optionally, the anti-jitter parameters are related to states of the services to be detected, different anti-jitter parameters may be set for different states of the services to be detected, for example, if the states of the services to be detected are fault states, the health anti-jitter parameters may be selected, and if the states of the services to be detected are health states, the fault anti-jitter parameters may be selected, where the health anti-jitter parameters are parameters that can be used to represent that the states of the services to be detected are changed from fault states to health states, and the fault anti-jitter parameters are parameters that can be used to represent that the states of the services to be detected are changed from health states to fault states.
And S230, detecting the availability of the target object according to the anti-jitter parameters of the service to be detected.
In this embodiment, the anti-shake parameter may include a detection frequency, where the detection frequency refers to a frequency of repeatedly detecting the target object, and may be adjusted according to an actual situation. Optionally, according to the anti-jitter parameter of the service to be detected, the availability of the detection target object may be: and repeatedly detecting the availability of the target object according to the detection times in the anti-jitter parameters 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 health anti-jitter parameter is 2, the detection of the availability of the target object may be repeated 2 times.
Optionally, if the target object is a process, the method for detecting the availability of the target object each time may be: whether the configured process path exists or not is checked, if yes, the process state is determined to be a normal state, and then the process is determined to be available; and if the process state does not exist, determining that the process state is an abnormal state, and further determining that the process is unavailable. It is also possible to look at a process log to determine the availability of a process.
If the target object is a port, the method for detecting the availability of the target object each time may be as follows: by checking whether a port exists; if the port is available, determining that the port state is a normal state, and further determining that the port is available; if not, determining that the port state is an abnormal state, and further determining that the port is unavailable.
If the target object is a service detection script, the method for detecting the availability of the target object each time may be as follows: and executing the service detection script and collecting the script output result, and further determining the usability of the script according to the script output result. For example, if the service to be detected is read data, whether the read data is displayed in the script output result can be checked, if not, the service detection script state is determined to be an abnormal state, and then the service detection script is determined to be unavailable; if so, determining that the service detection script is in a normal state, and further determining that the service detection script is available.
S240, determining whether to update the state of the service to be detected according to the detection result of the target object.
, the anti-shake parameter may further include a threshold number of times, where the threshold number of times is used to represent a number of times that the target object is continuously in a normal state or an abnormal state, and specifically, if it is determined according to the detection result that the number of times that the target object is continuously in any state reaches the threshold number of times in the anti-shake parameter of the service to be detected, the state is used as a detection state of the target object, and further, whether to update the state of the service to be detected is determined according to the detection state of the target object.
For example, if the target object is types of ports, processes and service detection scripts, the state of the service to be detected is a fault state, the detection frequency in the health anti-jitter parameter is 3, and the threshold frequency is 3, the detection of the availability of the target object can be repeated 3 times, if the target object is determined to be in a normal state for 3 consecutive times according to the detection result repeated 3 times, the target object can be determined to be available, and then the state of the service to be detected can be updated from the fault state to the health state, if the target object is determined to be in the normal state for 2 consecutive times or only 1 time according to the detection result repeated 3 times, the target object can be determined to be unavailable, and then the state of the service to be detected can be maintained as the fault state.
In addition, the target objects are at least two of a port, a process and a service detection script, such as the port and the process, the state of the service to be detected is a fault state, the detection times in the health anti-jitter parameter are 3, and the threshold times are 3, so that the availability of the port and the process can be repeatedly detected for 3 times; then, for each detection, carrying out AND operation on the detection result of the port and the detection result of the process to obtain a combined result; if the target object is determined to be in the normal state for 2 times or only in the normal state for 1 time according to the merging result of 3 times, the target object can be determined to be unavailable, and further the state of the service to be detected can be kept to be in the fault state. If the target object is determined to be in the normal state for 3 times continuously according to the merging result of 3 times, the target object can be determined to be available, and further the state of the service to be detected can be updated from the fault state to the healthy state.
According to the technical scheme provided by the embodiment of the application, a target object is selected from multiple types of candidate objects including a port, a process, a service detection script and the like configured for the service to be detected; then, anti-jitter parameters are introduced to detect the availability of the selected target object, so that the phenomenon that the detection result of the target object is inaccurate due to the existence of factors such as network faults and the like can be avoided; and then according to the detection result of the selected target object, whether the state of the service to be detected is updated or not can be accurately determined. Compared with the prior art, the scheme reduces the dependence on manpower and can automatically realize the detection of the service state; and by setting multiple detection mechanisms such as a process, a port and a service detection script, the detection of the service state in various scenes can be covered, and further, the service loss is avoided.
Third embodiment
Fig. 3 is a flowchart of service status detection methods provided according to a third embodiment of the present application, and this embodiment further explains availability of detecting the target object according to the status of the service to be detected based on the above embodiments, as shown in fig. 3, the service status detection method provided by this embodiment may include:
s310, selecting a target object from the candidate objects of the service to be detected.
And S320, detecting the availability of the target object through the proxy service according to the state of the service to be detected.
In the embodiment, the proxy service is introduced to detect the target object, and the automation degree of service state detection is further increased .
Optionally, if the target object is a port, the method for detecting availability of the target object through the proxy service may be: and the Agent establishes connection with the port by adopting a corresponding protocol according to the port type so as to judge whether the port is in a normal state and further determine whether the port is available. For example, for a TCP port, an Agent can establish a TCP connection with the port, and if the connection is successful, the port is determined to be in a normal state, and then the port is determined to be available; and if the connection is unsuccessful, determining that the port is in an abnormal state, and further determining that the port is unavailable. The Agent can also check whether the port exists or not to judge whether the port is in a normal state or not, further determine whether the port is available or not, and the like. The present embodiment does not limit the manner in which port availability is detected by proxy services.
If the target object is a process, the method for detecting the availability of the target object through the proxy service may be as follows: and the Agent checks whether the configured process path exists or not to judge whether the process is in a normal state or not so as to determine whether the process is available or not. It is also possible for the Agent to look at a process log to determine the availability of a process. The present embodiment does not limit the manner of detecting the availability of the process through the proxy service.
If the target object is a service detection script, the method for detecting the availability of the target object through the proxy service may be as follows: the Agent executes the corresponding service detection script according to the configured path of the service detection script, and collects the script output result; and then judging whether the service detection script is in a normal state according to the script output result, and further determining whether the service detection script is available. The present embodiment does not limit the manner in which the service probe service detects the availability of the script through the proxy service.
For example, 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 prompt the user to determine whether to update the state of the service to be detected in a manual intervention manner. Specifically, the natural number input by the user according to the running condition of the service to be detected is obtained, and whether to update the state of the service to be detected is determined according to the natural number. Alternatively, a natural number of 0 may represent a healthy state, and other natural numbers represent a 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 a healthy state.
It should be noted that, by introducing a manual intervention mode, a scenario that an automatic detection mechanism fails and a service state cannot be detected can be solved in time.
S330, determining whether to update the state of the service to be detected according to the detection result of the target object.
The technical scheme provided by the embodiment of the application provides modes of automatically detecting the target object through the proxy service, and can output alarm information under the condition of determining the failure of the proxy service so as to realize the detection of the service state through a manual intervention mode.
Fourth embodiment
Fig. 4 is a schematic structural diagram of service status detection apparatuses according to a fourth embodiment of the present application, which can execute the service status detection method provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method.
A target object selection module 410, configured to select a target object from candidate objects of a service to be detected; the candidate objects comprise ports, processes and service detection scripts;
an availability detection module 420, configured to detect availability of a target object according to a state of a service to be detected;
and a service status updating module 430, configured to determine whether to update the status of the service to be detected according to the detection result of the target object.
According to the technical scheme provided by the embodiment of the application, a target object is selected from multiple types of candidate objects including a port, a process, a service detection script and the like configured for the service to be detected; then, detecting the availability of the selected target object according to the state of the service to be detected; and then determining whether to update the state of the service to be detected according to the detection result of the selected target object. Compared with the prior art, the scheme reduces the dependence on manpower and can automatically realize the detection of the service state; and by setting multiple detection mechanisms such as a process, a port and a service detection script, the detection of the service state in various scenes can be covered, and further, the service loss is avoided.
Illustratively, the availability detection module 420 may include:
the parameter determining unit is used for determining anti-jitter parameters of the service to be detected according to the state of the service to be detected;
and 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.
Illustratively, the availability detection unit may be specifically configured to:
and repeatedly detecting the availability of the target object according to the detection times in the anti-jitter parameters of the service to be detected.
Accordingly, the service status update module 430 may be specifically configured to:
if the frequency that the target object is continuously in any state is determined to reach the threshold frequency in the anti-shaking parameters of the service to be detected according to the detection result, taking the state as the detection state of the target object;
and determining whether to update the state of the service to be detected according to the detection state of the target object.
Illustratively, when the state of the service to be detected is a fault state or a health state, the anti-jitter parameters of the service to be detected are different.
Illustratively, the availability detection module 420 may also be configured to:
and detecting the availability of the target object through the proxy service according to the state of the service to be detected.
Illustratively, the apparatus may further include:
and the alarm module is used for outputting alarm information if the agent service is determined to be invalid.
Illustratively, the target object selection module 410 may be specifically configured to:
selecting a target service detection script from candidate service detection scripts of the service to be detected according to the operation type of the service to be detected; the operation types include reading, writing, adding or deleting data, and creating or deleting files.
electronic devices and readable storage media are also provided according to embodiments of the present application.
Fig. 5 is a block diagram of an electronic device according to the service status detection method of the 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, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in FIG. 4, the electronic device includes or more processors 501, memory 502, and interfaces for connecting the various components, including a high speed Interface and a low speed Interface, the various components are interconnected using different buses and may be mounted on a common motherboard or otherwise as desired.
The memory 502 is a non-transitory computer readable storage medium provided herein, wherein the memory stores instructions executable by at least processors to cause the at least processors to perform the service state detection method provided herein.
The memory 502, as non-transitory computer readable storage media, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions/modules corresponding to the service status detection method in the embodiment of the present application, for example, the target object selection module 410, the availability detection module 420 and the service status update module 430 shown in fig. 4, the processor 501 executes various functional applications and data processing of the server by executing the non-transitory software programs, instructions and modules stored in the memory 502, that is, implements the service status detection method in the above method embodiment.
The memory 502 may include a stored program area that may store an operating system, at least applications needed for functionality, and a stored data area that may store data created from use of the electronic device used to implement the service status detection method, etc. additionally, the memory 502 may include high speed random access memory and may also include non-transitory memory, such as at least disk storage devices, flash memory devices, or other non-transitory solid state storage devices in embodiments, the memory 502 may optionally include memory located remotely from the processor 501 that may be connected to the electronic device used to implement the service status detection method via a network.
The electronic device for implementing the service status detection method may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected by a bus or other means, and fig. 5 illustrates the connection by a bus as an example.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of an electronic apparatus for implementing the service state detection method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, or more mouse buttons, a track ball, a joystick, and the like, the output device 504 may include a Display device, an auxiliary lighting device such as a Light Emitting Diode (LED), a tactile feedback device such as a vibration motor, and the like, and a tactile feedback device, and the like.
Various embodiments of the systems and techniques described here can be implemented in digital electronic circuitry, Integrated circuitry, an Application Specific Integrated Circuit (ASIC), computer hardware, firmware, software, and/or combinations thereof, including in or more computer programs that are executable and/or interpretable on a programmable system including at least programmable processors, which may be special or general purpose programmable processors, that receive data and instructions from, and transmit data and instructions to, a storage system, at least input devices, and at least output devices.
These computer programs, also known as programs, software applications, or code, include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or Device for providing machine instructions and/or data to a Programmable processor, such as a magnetic disk, optical disk, memory, 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device for displaying information to a user, for example, a Cathode Ray Tube (CRT) or an LCD monitor; and a keyboard and a pointing device, such as a mouse or a trackball, by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here, or in a computing system that includes any combination of such back-end, middleware, or front-end components.
The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, a target object is selected from multiple types of candidate objects which are configured for the service to be detected and comprise a port, a process, a service detection script and the like; then, detecting the availability of the selected target object according to the state of the service to be detected; and then determining whether to update the state of the service to be detected according to the detection result of the selected target object. Compared with the prior art, the scheme reduces the dependence on manpower and can automatically realize the detection of the service state; and by setting multiple detection mechanisms such as a process, a port and a service detection script, the detection of the service state in various scenes can be covered, and further, the service loss is avoided.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1, service status detection method, comprising:
selecting a target object from candidate objects of a service to be detected; wherein the candidate objects comprise ports, processes and service detection scripts;
detecting the availability of the target object according to the state of the service to be detected;
and determining whether to update the state of the service to be detected according to the detection result of the target object.
2. The method of claim 1, wherein detecting the availability of the target object based on the status of the service to be detected comprises:
determining anti-jitter parameters of the service to be detected according to the state of the service to be detected;
and detecting the availability of the target object according to the anti-jitter parameters of the service to be detected.
3. The method according to claim 2, wherein detecting the availability of the target object based on anti-jitter parameters of the service to be detected comprises:
repeatedly detecting the availability of the target object according to the detection times in the anti-jitter parameters of the service to be detected;
correspondingly, determining whether to update the state of the service to be detected according to the detection result of the target object comprises the following steps:
if the frequency that the target object is continuously in any state is determined to reach the threshold frequency in the anti-shaking parameters of the service to be detected according to the detection result, taking the state as the detection state of the target object;
and determining whether to update the state of the service to be detected according to the detection state of the target object.
4. The method according to claim 2, wherein the anti-jitter parameters of the services to be detected are different when the status of the services to be detected is a fault status or a health status.
5. The method of claim 1, wherein detecting the availability of the target object based on the status of the service to be detected comprises:
and detecting the availability of the target object through the proxy service according to the state of the service to be detected.
6. The method of claim 5, further comprising:
and if the agent service is determined to be invalid, outputting alarm information.
7. The method of claim 1, wherein selecting the target object from the candidate objects of the service to be detected comprises:
selecting a target service detection script from candidate service detection scripts of the service to be detected according to the operation type of the service to be detected; the operation types comprise reading, writing, adding or deleting data and creating or deleting files.
The service status detection device of 8, kinds, characterized by comprising:
the target object selection module is used for selecting a target object from candidate objects of the service to be detected; wherein the candidate objects comprise ports, processes and service detection scripts;
the availability detection module is used for detecting the availability of the target object according to the state of the service to be detected;
and the service state updating module is used for determining whether to update the state of the service to be detected according to the detection result of the target object.
An electronic device of the type , comprising:
at least processors, and
a memory communicatively coupled to the at least processors, wherein,
the memory stores instructions executable by the at least processors to enable the at least processors to perform the service state detection method of any of claims 1-7 .
A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the service state detection method of any of claims 1-7 .
CN201911007573.6A 2019-10-22 2019-10-22 Service state detection method and device, electronic equipment and medium Active CN110737560B (en)

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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770154A (en) * 2020-06-24 2020-10-13 百度在线网络技术(北京)有限公司 Service detection method, device, 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)

* Cited by examiner, † Cited by third party
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 dispositions method, device, server and the 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

Patent Citations (8)

* Cited by examiner, † Cited by third party
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 dispositions method, device, server and the 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 (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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
US9280451B2 (en) Testing device
EP3916560A1 (en) Fault injection method and apparatus, electronic device and storage medium to test microservices in the cloud
EP3940538A2 (en) Method and device for operator registration processing based on deep learning and electronic device
CN112015665B (en) Test verification backtracking method and device, electronic equipment and storage medium
CN111309574B (en) Information processing method, device and equipment
CN111475164B (en) Component dependency relationship detection method and device and electronic equipment
CN111984476A (en) Test method and device
CN111831512B (en) Method and device for detecting operation and maintenance abnormality, electronic equipment and storage medium
CN110737560B (en) Service state detection method and device, electronic equipment and medium
CN112037332B (en) Display verification method and device for browser, computer equipment and storage medium
CN112052185B (en) Exception handling method and device for applet, electronic equipment and storage medium
CN112269706A (en) Interface parameter checking method and device, electronic equipment and computer readable medium
US11055207B2 (en) Automatic generation of integration tests from unit tests
CN111885145A (en) Switching method, device, equipment and computer storage medium
CN111611767A (en) Verification method and device
CN111708653B (en) Memory fault processing method and device, electronic equipment and storage medium
US10970093B2 (en) Information processing apparatus for displaying a software screen on a foreground of a display based on a setting
CN111190761A (en) Log output method and device, storage medium and electronic equipment
CN112182581B (en) Application testing method, device, application testing equipment and storage medium
CN112527635B (en) Fault injection method and device, electronic equipment and storage medium
CN112735601B (en) Test method, device and equipment for determining infectious disease close-contact population by using Bluetooth
CN111338937B (en) Method, device, equipment and medium for downloading small program intervention
CN111506499B (en) Method and device for detecting availability of parameters in applet and electronic equipment
CN111522599B (en) Method and device for transmitting information
CN110908701B (en) Firmware version switching method and device, storage medium 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