CN114064208A - Method and device for detecting application service state, electronic equipment and storage medium - Google Patents

Method and device for detecting application service state, electronic equipment and storage medium Download PDF

Info

Publication number
CN114064208A
CN114064208A CN202111329393.7A CN202111329393A CN114064208A CN 114064208 A CN114064208 A CN 114064208A CN 202111329393 A CN202111329393 A CN 202111329393A CN 114064208 A CN114064208 A CN 114064208A
Authority
CN
China
Prior art keywords
service
detection
detecting
application service
target
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.)
Pending
Application number
CN202111329393.7A
Other languages
Chinese (zh)
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 CN202111329393.7A priority Critical patent/CN114064208A/en
Publication of CN114064208A publication Critical patent/CN114064208A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Abstract

The present disclosure provides a method, an apparatus, an electronic device and a storage medium for detecting an application service state, relates to the technical field of computers, and further relates to cloud computing, so as to at least solve the technical problem of low detection efficiency caused by detecting a deployed service in a manual command manner in the related art. The specific implementation scheme is as follows: acquiring a target cluster corresponding to a target application service; detecting service deployment of the target application service on the target cluster by adopting a preset batch type script to obtain a detection result; and determining the service state of the target application service based on the detection result.

Description

Method and device for detecting application service state, electronic equipment and storage medium
Technical Field
The present disclosure relates to computer technologies, and further relates to cloud computing, which may be applied to, but not limited to, smart client scenarios, and in particular, to a method and an apparatus for detecting an application service state, an electronic device, and a storage medium.
Background
At present, service inspection for service deployed in a K8S cluster is performed by means of manual tap commands to detect multiple services one by one, and a great deal of time is consumed for parallel viewing of multiple sets of environments and availability inspection of multiple different types of services. When the service is more, the manual detection consumes a large amount of labor cost and is easy to make mistakes, so that the detection efficiency is low.
Disclosure of Invention
The disclosure provides a method, a device, an electronic device and a storage medium for detecting application service states, which at least solve the technical problem of low detection efficiency caused by detecting deployed services in a manual command mode in the related art.
According to an aspect of the present disclosure, there is provided a method of detecting an application service state, including: acquiring a target cluster corresponding to a target application service; detecting service deployment of the target application service on the target cluster by adopting a preset batch type script to obtain a detection result; and determining the service state of the target application service based on the detection result.
According to another aspect of the present disclosure, there is provided an apparatus for detecting an application service state, including: the acquisition module is used for acquiring a target cluster corresponding to the target application service; the detection module is used for detecting the service deployment of the target application service on the target cluster by adopting a preset batch processing type script to obtain a detection result; and determining the service state of the target application service based on the detection result.
According to still another aspect of the present disclosure, there is provided 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 to enable the at least one processor to perform the method for detecting application service status as set forth in the present disclosure.
According to yet another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of detecting application service state proposed by the present disclosure.
According to yet another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the method of detecting application service status as set forth in the present disclosure.
According to the method and the device, the target cluster corresponding to the target application service is obtained firstly, then the preset batch processing type script is adopted to detect the service deployment of the target application service on the target cluster, the detection result is obtained, finally the service state of the target application service is determined based on the detection result, the purpose of rapidly detecting the application service state is achieved, the preset batch processing type script can be used for automatically detecting the service deployed on the target cluster, the detection cost of the target application service can be reduced, and the detection efficiency is improved. The technical problem of low detection efficiency caused by detection of the deployed service in a manual command mode in the related technology is solved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a block diagram of a hardware structure of a computer terminal (or mobile device) for implementing a method of detecting an application service state according to an embodiment of the present disclosure;
FIG. 2 is a flow diagram of a method of detecting application service status according to an embodiment of the present disclosure;
FIG. 3 is a flow diagram of another method of detecting application service status according to an embodiment of the present disclosure;
fig. 4 is a block diagram of an apparatus for detecting an application service status according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. 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 disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present disclosure, there is provided a method of detecting application service status, it should be noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The method embodiments provided by the embodiments of the present disclosure may be executed in a mobile terminal, a computer terminal or similar electronic devices. 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 disclosure described and/or claimed herein. Fig. 1 shows a hardware configuration block diagram of a computer terminal (or mobile device) for implementing a method of detecting an application service state.
As shown in fig. 1, the computer terminal 100 includes a computing unit 101 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)102 or a computer program loaded from a storage unit 108 into a Random Access Memory (RAM) 103. In the RAM 103, various programs and data necessary for the operation of the computer terminal 100 can also be stored. The computing unit 101, the ROM 102, and the RAM 103 are connected to each other via a bus 104. An input/output (I/O) interface 105 is also connected to bus 104.
A number of components in the computer terminal 100 are connected to the I/O interface 105, including: an input unit 106 such as a keyboard, a mouse, and the like; an output unit 107 such as various types of displays, speakers, and the like; a storage unit 108, such as a magnetic disk, optical disk, or the like; and a communication unit 109 such as a network card, modem, wireless communication transceiver, etc. The communication unit 109 allows the computer terminal 100 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 101 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 101 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 101 performs the methods described herein to detect application service status. For example, in some embodiments, the method of detecting application service status may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 108. In some embodiments, part or all of the computer program may be loaded and/or installed onto the computer terminal 100 via the ROM 102 and/or the communication unit 109. When the computer program is loaded into RAM 103 and executed by computing unit 101, one or more steps of the method of detecting application service states described herein may be performed. Alternatively, in other embodiments, the computing unit 101 may be configured by any other suitable means (e.g., by means of firmware) to perform the method of detecting the application service state.
Various implementations of the systems and techniques described here can be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
It should be noted here that in some alternative embodiments, the electronic device shown in fig. 1 may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that fig. 1 is only one example of a particular specific example and is intended to illustrate the types of components that may be present in the electronic device described above.
In the above operating environment, the present disclosure provides a method of detecting an application service state as shown in fig. 2, which may be performed by a computer terminal or similar electronic device as shown in fig. 1. Fig. 2 is a flowchart of a method for detecting an application service state according to an embodiment of the present disclosure. As shown in fig. 2, the method may include the steps of:
step S202, a target cluster corresponding to the target application service is obtained.
The target application service may be composed of a plurality of node services (nodes), and a target cluster corresponding to the target application service may include sub-services with different namespaces, where the sub-services include a micro service (svc), a container service (pod), and the like.
The target cluster described above may be a kubernets cluster, i.e. a K8s cluster.
In an optional embodiment, the target application service is a service to be detected, and a target cluster corresponding to the target application service may be obtained first, and deployment of the target application service in the target cluster is detected, so as to detect whether the target application service can normally operate.
And step S204, detecting the service deployment of the target application service on the target cluster by adopting a preset batch processing type script to obtain a detection result.
The preset batch type script is a Shell script (a script program written for execution).
In an alternative embodiment, a separate namespace may be set for each application service to detect services deployed in the namespace by invoking Shell scripts. The namespaces corresponding to each application service may be independent and non-interfering spaces.
In another optional embodiment, when the name space corresponding to the target application service in the target cluster is detected through the preset batch type script, the detection result is obtained by detecting the service deployed in the name space. It should be noted that, in the detection process, the execution state, the access state, and the like of each sub-service in the target application service may be detected, and if there is a sub-service detection failure, the target application service detection failure is described; and if all the sub-services are successfully detected, the target application service is successfully detected.
Step S206, determining the service state of the target application service based on the detection result.
The service state of the target application service may be stability of a target cluster where the target application service is located, whether a sub-service in the target application service can be accessed for checking, and whether the sub-service in the target application service can meet an operation requirement.
The detection result can be the service deployment condition of the target application service on the target cluster, if the deployed service has a problem, the service state of the target application service can be determined to have a problem, at the moment, the problem can be fed back, and related personnel can be reminded to process the problem in time; and if no problem occurs in the deployed services, determining that the service state of the target application service is a normal state.
In an optional embodiment, if the detection result is that the stability of the target cluster where the target application service is located is poor, the node corresponding to the target cluster needs to be detected, so as to improve the stability of the target cluster; when the detection result is that the svc in the target application service cannot be accessed for inspection, reminding a tester to detect the svc, and eliminating faults; when the detection result is that the pod can not meet the operation requirement, the testing personnel can be reminded to detect the pod, and the fault can be eliminated, so that the pod can meet the operation requirement.
Through the steps, the target cluster corresponding to the target application service is obtained firstly, then the service deployment of the target application service on the target cluster is detected by adopting the preset batch processing type script, the detection result is obtained, finally the service state of the target application service is determined based on the detection result, the purpose of rapidly detecting the application service state is achieved, the service deployed on the target cluster can be automatically detected by the preset batch processing type script, the detection cost of the target application service can be reduced, and the detection efficiency is improved. The technical problem of low detection efficiency caused by detection of the deployed service in a manual command mode in the related technology is solved.
Optionally, the obtaining of the target cluster corresponding to the target application service includes: acquiring a name space where a target application service is located; the target cluster is determined by the namespace.
The name space is used for isolating different application services, so that the test processes of the application services cannot influence each other.
The target application service may include a plurality of sub-services, and the plurality of sub-services may be stored in a namespace.
In an optional embodiment, for different application services, one namespace may be respectively set for storage, so that when different application services are tested, a target cluster corresponding to the target application service may be determined through the namespace, and by setting the namespaces for different application services, the efficiency of testing the target application service may be improved.
Optionally, the detecting, by using a preset batch type script, the service deployment of the target application service on the target cluster, and obtaining a detection result includes: detecting the running state of each node in the target cluster by adopting a preset batch processing type script; responding to the passing of the running state detection, and detecting the access state of each service port provided by the target cluster by adopting a preset batch processing type script; and responding to the access state detection pass, and detecting the service function of the target application service by adopting a preset batch processing type script to obtain a detection result.
In an optional embodiment, the running state of each node in the target cluster may be detected in a way of using a kubecect get nodes (to view the node state), specifically, whether the state of each node in the target cluster is a running state is queried through the node, and if all the nodes are running states, the state of the target cluster itself is stable.
Further, under the condition that the running state detection of each node in the target cluster passes, the shell script can be used for detecting the access state of each service port provided by the target cluster by adopting a curl (command type tool for opening source codes), if the access state detection fails, the fact that the service has a problem on the access level is indicated, and a tester can be informed to correct the problem on the access level; if the access state detection is successful, it indicates that there is no problem in the function of each service on the access layer, and at this time, the next service function detection step may be performed.
Further, under the condition that the access state of each service port provided by the target cluster is successfully detected by adopting the preset batch processing type script, the service function of the target application service can be detected in batches by adopting the preset batch processing type script, and when a problem occurs in detection, a tester can be informed to correct the problem existing in the service function; if no problem occurs in the detection, the target application service detection is successful, and the detection task is ended.
As can be seen from the above, in the process of detecting service deployment of a target application service on a target cluster by using a preset batch type script, a certain type of content to be detected is uniformly detected by using the preset batch type script; compared with the problem that detection is complex in flow and low in efficiency caused by manual detection of each stage of each service in the related art, the detection efficiency can be improved to the maximum extent by the unified detection mode.
Optionally, the detecting the running state of each node in the target cluster by using a preset batch type script includes: detecting whether each node in the target cluster is in a preparation state or not by adopting a preset batch processing type script; in response to each node in the target cluster being in a ready state, detecting whether a container service deployed in the target cluster is complete, wherein the container service comprises: basic services and application services; and responding to the container service deployment completeness, and detecting whether the container services are all in a running state, wherein the running state of the container services indicates that the running state detection is passed.
In an optional embodiment, whether each node in the target cluster is in a ready state (ready state) or not can be detected through the shell script, and if each node is in the ready state, it is indicated that the state of each node is correct, that is, the application environment state of the target application service is normal.
Further, in a case that the application environment level is normal, it may be detected whether the container service deployed in the target cluster is complete, where the basic service in the container service includes, but is not limited to, mysql service (database service), kafka service (open source streaming platform), es (elastic search server), and the like. When detecting whether container services deployed in a target cluster are complete, svc services, ip services (address services), port services (port services), and the like of each service in the container services can be detected, specifically, whether the container services are all in an operating state can be detected in a curl mode, and when the container services are all in the operating state, the detection of the operating state is passed; if any container service is not in the running state, the running state is not detected to pass.
Through the steps, the running state of each node in the target cluster, the deployment of the container service and the running state of the container service can be detected in a centralized mode, if one layer has problems, a tester can be informed to detect and correct the layer, after the correction is successful, the detection can be carried out again or continuously, compared with the manual detection of each sub-service in the target application service, the detection of the content in the same layer is carried out through each sub-service, and the detection efficiency of the target application service is higher.
Optionally, the detecting, by using a preset batch type script, an access state of each service port provided by the target cluster includes: acquiring each service port provided by the target cluster by adopting a preset batch type script; and detecting the access state of each service port provided by the target cluster by sending an access request to each service port provided by the target cluster, wherein each service port provided by the target cluster is accessible to indicate that the access state is detected to pass.
In an optional embodiment, a shell script may be adopted to obtain all service ports in a target cluster, and perform unified detection on all service ports, specifically, unified detection on an access state of each service port provided by the target cluster may be implemented by providing each service port to the target cluster and sending an access request, and detection on detection contents of the same type may improve detection efficiency, and meanwhile, when a problem occurs in detection, a detector may also quickly correct the problem of the same type, thereby improving detection efficiency on a target application service. If it is detected that each service port provided by the target cluster is accessible, it indicates that the access state detection of each service port passes, and at this time, the detection process of each service port provided by the target cluster can be completed, and the detection of the next layer can be performed.
Optionally, the detecting the service function of the target application service by using the preset batch type script includes: and running a main flow automation interface test task of the target application service by adopting a preset batch processing type script to detect a main flow function layer.
In an optional embodiment, after the operation state of the target application service corresponding to the target cluster and the detection of each service port in the target cluster are completed, a main process automation interface tester operating the target application service can be used for detecting a functional layer of the target application service so as to detect whether the function of the target application service is normal, and if the function corresponding to the target application service is normal, the detection is completed; and if the function corresponding to the target application service is abnormal in operation, notifying a tester to detect and correct the function corresponding to the target application service.
In another optional embodiment, after the target application service is successfully detected, the application services of other namespaces may be detected according to the detection result of the target application program, specifically, the target application service in the namespace successfully detected may be compared with the target application service in the namespace not detected, if the same problem exists, the problem may be directly corrected according to the correction result of the tester, when the application service corresponding to the namespace is detected subsequently, the problem that has been corrected does not need to be corrected again, and the detection efficiency may be further improved.
Optionally, the determining the service state of the target application service based on the detection result includes: determining that there is a detection failure based on the detection result, wherein the detection failure comprises at least one of: failure in detection of running state, failure in detection of access state, and failure in detection of service function; and displaying abnormal information through detection failure, wherein the abnormal information is used for indicating that the target application service has deployment abnormality.
In an alternative embodiment, in the case that it is determined that there is a detection failure according to the detection result, the tester may be notified to perform the correction, and perform the detection again after the correction is completed until the detection is successful.
In another optional embodiment, when the detection failure is the detection failure of the operation state, after the tester finishes detecting each node and corrects the existing problems, the operation state can be detected again until the detection is successful, and the subsequent access state detection is carried out; when the access state detection fails, the tester can be informed to correct the port of each service in the target application service, and after the correction is completed, the port of each service can be detected again until the detection is successful, and subsequent service function detection is carried out; when the service function detection fails, a tester can be informed to detect the service function corresponding to each service in the target application service, in the detection process, if the detection fails, the same problem existing before and a solution corresponding to the problem can be obtained, the problem existing at this time can be processed based on the solution, and if the same problem does not exist, the tester is informed to process the problem.
In yet another optional embodiment, a detection database may be preset, where the detection database may include problems existing in the detection process and processing schemes corresponding to the testers, and when the same problem is detected subsequently, a solution corresponding to the same problem may be called from the detection database, and at this time, the testers do not need to be notified manually, so as to reduce the labor cost.
The method for detecting the application service state provided by the embodiment of the disclosure is described below with reference to schematic diagrams.
Fig. 3 is another flow diagram for detecting application service status according to an embodiment of the present disclosure.
Step S301, detecting the state of the K8S cluster to obtain a detection result;
step S302, judging whether the state of the K8S cluster is normal or not based on the detection result, if so, executing step S303, and if not, executing step S10;
step S303, determining whether the container service deployed in the K8S cluster is complete, if yes, performing step S304, and if no, performing step S10;
step S304, determining whether the container service is in an operating state, if so, performing step S305, and if not, performing step S310;
step S305, whether the container service can be accessed is judged, if yes, step S306 is executed, and if not, step S310 is executed;
step S306, running the main process automation to detect the main process function layer;
step S307, detecting whether the operation state of the container service is normal, if so, executing step S308, otherwise, executing step S310;
step S308, judging whether the main flow automation is normal, if not, executing step S309, and if not, executing step S310;
step S309, the service deployment is verified to pass;
step S310, the service deployment verification fails.
The method comprises the steps of detecting the service state of the application service through an automatic script checking process, specifically, checking whether the state of each node in a cluster is correct or not according to a name space where the application service is located, if so, detecting whether each service port can be accessed or not, if so, testing a service function, and in the whole process, if one layer check fails, directly displaying the problem of the application service. Compared with manual detection in the prior art, the automatic flow has higher efficiency and saves labor cost.
In addition, the steps can effectively reduce the waste of labor cost caused by the deployment implementation problem of the service, for the whole project, the testing efficiency of the delivery can be improved, the labor cost is reduced, the delivery cycle is reduced, the profit margin of the whole delivery project is improved by deploying and developing the K8S, the waste of the whole delivery project caused by the real-time deployment problem and the test waiting is avoided, and the utilization rate of testing human resources is greatly improved. In the test process of the project, the labor cost of 1-2 days can be saved by detecting the problems in the deployment process.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the methods of the embodiments of the present disclosure.
The present disclosure further provides a device for detecting an application service state, where the device is used to implement the foregoing embodiments and preferred embodiments, and the description of the device that has been already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of an apparatus for detecting an application service status according to an embodiment of the present disclosure, and as shown in fig. 4, an apparatus 400 for detecting an application service status includes:
an obtaining module 402, configured to obtain a target cluster corresponding to a target application service;
the detection module 404 is configured to detect service deployment of the target application service on the target cluster by using a preset batch type script to obtain a detection result;
a determining module 406, configured to determine a service status of the target application service based on the detection result.
Optionally, the obtaining module includes: the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a name space where a target application service is located; the first determining unit is used for determining the target cluster through the name space.
Optionally, the detection module includes: the first detection unit is used for detecting the running state of each node in the target cluster by adopting a preset batch processing type script; the second detection unit is used for responding to the passing of the running state detection and detecting the access state of each service port provided by the target cluster by adopting a preset batch processing type script; and the third detection unit is used for responding to the passing of the access state detection and detecting the service function of the target application service by adopting a preset batch processing type script to obtain a detection result.
Optionally, the second detection unit includes: the first detection subunit is used for detecting whether each node in the target cluster is in a preparation state or not by adopting a preset batch processing type script; a second detecting subunit, configured to detect whether a container service deployed in the target cluster is complete in response to each node in the target cluster being in a ready state, where the container service includes: basic services and application services; and the third detection subunit is used for responding to the container service deployment completeness and detecting whether the container services are all in the running state, wherein the running state of the container services indicates that the running state detection is passed.
Optionally, the first detection subunit includes: the acquisition subunit is used for acquiring each service port provided by the target cluster by adopting a preset batch type script; and the fourth detection subunit is configured to detect an access status of each service port provided by the target cluster by sending an access request to each service port provided by the target cluster, where each service port provided by the target cluster is accessible and indicates that the access status is detected to pass.
Optionally, the third detection unit includes: and the operation subunit is used for operating the main process automation interface test task of the target application service by adopting a preset batch processing type script and carrying out main process function layer detection.
Optionally, the determining module includes: a second determination unit configured to determine that there is a detection failure based on the detection result, wherein the detection failure includes at least one of: failure in detection of running state, failure in detection of access state, and failure in detection of service function; and the display unit is used for displaying abnormal information through detection failure, wherein the abnormal information is used for indicating that the target application service has abnormal deployment.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
According to an embodiment of the present disclosure, there is also provided an electronic device including a memory having stored therein computer instructions and at least one processor configured to execute the computer instructions to perform the steps in any of the above method embodiments.
Optionally, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present disclosure, the processor may be configured to execute the following steps by a computer program:
s1, acquiring a target cluster corresponding to the target application service;
s2, detecting the service deployment of the target application service on the target cluster by adopting a preset batch processing type script to obtain a detection result;
and S3, determining the service state of the target application service based on the detection result.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
According to an embodiment of the present disclosure, there is also provided a non-transitory computer readable storage medium having stored therein computer instructions, wherein the computer instructions are arranged to perform the steps in any of the above method embodiments when executed.
Alternatively, in the present embodiment, the above-mentioned non-transitory computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring a target cluster corresponding to the target application service;
s2, detecting the service deployment of the target application service on the target cluster by adopting a preset batch processing type script to obtain a detection result;
and S3, determining the service state of the target application service based on the detection result.
Alternatively, in the present embodiment, the non-transitory computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The present disclosure also provides a computer program product according to an embodiment of the present disclosure. Program code for implementing the audio processing methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the above embodiments of the present disclosure, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present disclosure, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit may be a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or may not be executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
The foregoing is merely a preferred embodiment of the present disclosure, and it should be noted that modifications and embellishments could be made by those skilled in the art without departing from the principle of the present disclosure, and these should also be considered as the protection scope of the present disclosure.

Claims (17)

1. A method of detecting application service status, comprising:
acquiring a target cluster corresponding to a target application service;
detecting the service deployment of the target application service on the target cluster by adopting a preset batch type script to obtain a detection result;
determining a service state of the target application service based on the detection result.
2. The method of claim 1, wherein obtaining the target cluster corresponding to the target application service comprises:
acquiring a name space where the target application service is located;
determining the target cluster through the namespace.
3. The method of claim 1, wherein detecting the service deployment of the target application service on the target cluster by using the preset batch type script, and obtaining the detection result comprises:
detecting the running state of each node in the target cluster by adopting the preset batch processing type script;
responding to the running state detection, and detecting the access state of each service port provided by the target cluster by adopting the preset batch processing type script;
and responding to the access state detection pass, and detecting the service function of the target application service by adopting the preset batch processing type script to obtain the detection result.
4. The method of claim 3, wherein detecting the operational state of each node within the target cluster using the preset batch type script comprises:
detecting whether each node in the target cluster is in a preparation state or not by adopting the preset batch processing type script;
in response to each node within the target cluster being in the ready state, detecting whether a container service deployed within the target cluster is complete, wherein the container service comprises: basic services and application services;
and responding to the container service deployment completeness, and detecting whether the container services are all in a running state, wherein the container services are all in the running state, and the running state detection is passed.
5. The method of claim 4, wherein detecting the access status of each service port provided by the target cluster using the preset batch type script comprises:
acquiring each service port provided by the target cluster by adopting the preset batch processing type script;
and detecting the access state of each service port provided by the target cluster by sending an access request to each service port provided by the target cluster, wherein each service port provided by the target cluster is accessible to indicate that the access state is detected to pass.
6. The method of claim 3, wherein detecting the service function of the target application service using the preset batch type script comprises:
and running a main flow automation interface test task of the target application service by adopting the preset batch processing type script to detect a main flow function layer.
7. The method of claim 3, wherein determining a service state of the target application service based on the detection result comprises:
determining that there is a detection failure based on the detection result, wherein the detection failure comprises at least one of: failure in detection of running state, failure in detection of access state, and failure in detection of service function;
and displaying abnormal information through the detection failure, wherein the abnormal information is used for indicating that the target application service has deployment abnormality.
8. An apparatus for detecting application service status, comprising:
the acquisition module is used for acquiring a target cluster corresponding to the target application service;
the detection module is used for detecting the service deployment of the target application service on the target cluster by adopting a preset batch processing type script to obtain a detection result;
a determining module for determining a service status of the target application service based on the detection result.
9. The apparatus of claim 8, wherein the means for obtaining comprises:
the acquisition unit is used for acquiring a name space where the target application service is located;
a first determining unit, configured to determine the target cluster through the namespace.
10. The apparatus of claim 8, wherein the detection module comprises:
the first detection unit is used for detecting the running state of each node in the target cluster by adopting the preset batch processing type script;
the second detection unit is used for responding to the passing of the running state detection and detecting the access state of each service port provided by the target cluster by adopting the preset batch processing type script;
and the third detection unit is used for responding to the passing of the access state detection and detecting the service function of the target application service by adopting the preset batch processing type script to obtain the detection result.
11. The apparatus of claim 10, wherein the second detection unit comprises:
the first detection subunit is used for detecting whether each node in the target cluster is in a preparation state or not by adopting the preset batch processing type script;
a second detecting subunit, configured to detect whether a container service deployed in the target cluster is complete in response to each node in the target cluster being in the ready state, where the container service includes: basic services and application services;
and the third detection subunit is configured to detect, in response to that the container service is completely deployed, whether the container services are all in an operating state, where the container services are all in the operating state and the operating state indicates that the detection of the operating state passes.
12. The apparatus of claim 11, wherein the first detection subunit comprises:
the acquisition subunit is used for acquiring each service port provided by the target cluster by adopting the preset batch processing type script;
a fourth detecting subunit, configured to detect an access status of each service port provided by the target cluster by sending an access request to each service port provided by the target cluster, where each service port provided by the target cluster is accessible and indicates that the access status is detected to pass.
13. The apparatus of claim 10, wherein the third detection unit comprises:
and the running subunit is used for running the main process automation interface test task of the target application service by adopting the preset batch processing type script to detect the main process function layer.
14. The apparatus of claim 10, wherein the means for determining comprises:
a second determining unit configured to determine that there is a detection failure based on the detection result, wherein the detection failure includes at least one of: failure in detection of running state, failure in detection of access state, and failure in detection of service function;
and the display unit is used for displaying abnormal information through the detection failure, wherein the abnormal information is used for representing that the target application service has deployment abnormality.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-7.
CN202111329393.7A 2021-11-10 2021-11-10 Method and device for detecting application service state, electronic equipment and storage medium Pending CN114064208A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111329393.7A CN114064208A (en) 2021-11-10 2021-11-10 Method and device for detecting application service state, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111329393.7A CN114064208A (en) 2021-11-10 2021-11-10 Method and device for detecting application service state, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114064208A true CN114064208A (en) 2022-02-18

Family

ID=80274726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111329393.7A Pending CN114064208A (en) 2021-11-10 2021-11-10 Method and device for detecting application service state, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114064208A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114566148A (en) * 2022-04-02 2022-05-31 北京百度网讯科技有限公司 Cluster voice recognition service, detection method and device thereof, and electronic equipment
CN114884840A (en) * 2022-03-21 2022-08-09 新华三大数据技术有限公司 Application health state checking method and electronic equipment
CN115174644A (en) * 2022-06-28 2022-10-11 武汉烽火技术服务有限公司 Container cluster service start-stop control method, device, equipment and storage medium
CN115185813A (en) * 2022-06-09 2022-10-14 深圳价值网络科技有限公司 State detection method and system during application starting

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884840A (en) * 2022-03-21 2022-08-09 新华三大数据技术有限公司 Application health state checking method and electronic equipment
CN114884840B (en) * 2022-03-21 2024-01-19 新华三大数据技术有限公司 Application health state checking method and electronic equipment
CN114566148A (en) * 2022-04-02 2022-05-31 北京百度网讯科技有限公司 Cluster voice recognition service, detection method and device thereof, and electronic equipment
CN115185813A (en) * 2022-06-09 2022-10-14 深圳价值网络科技有限公司 State detection method and system during application starting
CN115174644A (en) * 2022-06-28 2022-10-11 武汉烽火技术服务有限公司 Container cluster service start-stop control method, device, equipment and storage medium
CN115174644B (en) * 2022-06-28 2023-09-12 武汉烽火技术服务有限公司 Container cluster service start-stop control method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN114064208A (en) Method and device for detecting application service state, electronic equipment and storage medium
CN109302522B (en) Test method, test device, computer system, and computer medium
US11269705B2 (en) Method and apparatus for outputting information
CN111258913A (en) Automatic algorithm testing method and device, computer system and readable storage medium
CN111897724A (en) Automatic testing method and device suitable for cloud platform
CN110851471A (en) Distributed log data processing method, device and system
CN114168471A (en) Test method, test device, electronic equipment and storage medium
CN111159029B (en) Automated testing method, apparatus, electronic device and computer readable storage medium
CN116599881A (en) Cloud platform tenant modeling test method, device, equipment and storage medium
CN112596750B (en) Application testing method and device, electronic equipment and computer readable storage medium
CN108845932B (en) Unit testing method and device of network library, storage medium and terminal
CN112445860B (en) Method and device for processing distributed transaction
CN111737130B (en) Public cloud multi-tenant authentication service testing method, device, equipment and storage medium
CN114003497A (en) Method, device and equipment for testing service system and storage medium
CN113238940A (en) Interface test result comparison method, device, equipment and storage medium
CN110618943A (en) Security service test method and device, electronic equipment and readable storage medium
CN115545677B (en) Online process specification detection method and system based on automatic case execution condition
CN111090574B (en) Regression testing method, device and storage medium
CN115629989A (en) Test data determination method and device, computer equipment and storage medium
CN115599682A (en) Environment availability detection method, device, equipment and storage medium
CN116909599A (en) Method, device, equipment and storage medium for upgrading engine offline software
CN113656296A (en) Code testing method and device, electronic equipment and storage medium
CN117389866A (en) Full-flow test method, device, equipment and storage medium
CN117520200A (en) Object testing method based on test adaptation system
CN115687109A (en) Interface test method and device, electronic equipment and storage medium

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