Method, device, electronic device and storage medium for detecting application service status

By using preset batch type scripts in the K8S cluster to automatically detect services, the problem of low efficiency of manual detection is solved, fast and accurate service status detection is achieved, and labor costs are reduced.

CN114064208BActive Publication Date: 2025-09-05BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111329393.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-10
Publication Date
2025-09-05
Estimated Expiration
2041-11-10

AI Technical Summary

Technical Problem

In the existing technology, detecting services deployed in the K8S cluster through manual commands is inefficient and error-prone, especially when checking the availability of multiple environments and multiple different types of services, which consumes a lot of manpower costs.

Method used

Use preset batch type scripts to detect the service deployment of the target application service on the target cluster, obtain the detection results, and determine the service status based on the results to achieve automated detection.

Benefits of technology

It improves detection efficiency, reduces labor costs, and ensures the accuracy and speed of detection, especially in the K8S cluster environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064208B_ABST
    Figure CN114064208B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, electronic device, and storage medium for detecting the status of an application service, relating to the fields of computer technology and, more specifically, cloud computing, to at least address the technical issue of low efficiency in detecting deployed services through manual commands in related technologies. The specific implementation scheme comprises: obtaining a target cluster corresponding to a target application service; using a preset batch-type script to detect the service deployment of the target application service on the target cluster, obtaining a detection result; and determining the service status of the target application service based on the detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to computer technology and further to cloud computing, and can be applied in, but not limited to, smart customer scenarios. In particular, it relates to a method, device, electronic device, and storage medium for detecting the status of an application service. Background Art

[0002] Currently, services deployed in Kubernetes clusters are checked manually, one by one, by typing commands. This process is time-consuming, requiring multiple environments to be checked concurrently and for the availability of multiple services of different categories. When there are many services, manual testing is labor-intensive and error-prone, resulting in low testing efficiency. Summary of the Invention

[0003] The present disclosure provides a method, device, electronic device, and storage medium for detecting the status of an application service, so as to at least solve the technical problem in the related art of detecting deployed services by manual commands, resulting in low detection efficiency.

[0004] According to one aspect of the present disclosure, a method for detecting the status of an application service is provided, comprising: obtaining a target cluster corresponding to a target application service; detecting the service deployment of the target application service on the target cluster using a preset batch type script to obtain a detection result; and determining the service status of the target application service based on the detection result.

[0005] According to another aspect of the present disclosure, a device for detecting the status of an application service is provided, including: an acquisition module for obtaining a target cluster corresponding to a target application service; a detection module for detecting the service deployment of the target application service on the target cluster using a preset batch type script to obtain a detection result; and determining the service status of the target application service based on the detection result.

[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for detecting the application service status proposed in the present disclosure.

[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method for detecting the application service status proposed in the present disclosure.

[0008] According to another aspect of the present disclosure, a computer program product is provided, including a computer program. When a processor executes the computer program, the method for detecting the application service status proposed in the present disclosure is executed.

[0009] In this disclosure, the target cluster corresponding to the target application service is first obtained. A preset batch-type script is then used to detect the service deployment of the target application service on the target cluster, obtaining a detection result. Finally, the service status of the target application service is determined based on the detection result. This achieves the purpose of quickly detecting the application service status. The preset batch-type script can automatically detect the services deployed on the target cluster, reducing the detection cost of the target application service and improving the detection efficiency. This solves the technical problem in the related art of using manual commands to detect deployed services, resulting in low detection efficiency.

[0010] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0012] Figure 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for detecting an application service status according to an embodiment of the present disclosure;

[0013] Figure 2 is a flow chart of a method for detecting application service status according to an embodiment of the present disclosure;

[0014] Figure 3 is a flow chart of another method for detecting application service status according to an embodiment of the present disclosure;

[0015] Figure 4 It is a structural block diagram of a device for detecting application service status according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0016] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0017] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0018] According to an embodiment of the present disclosure, a method for detecting the status of an application service is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0019] The method embodiments provided in the embodiments of the present disclosure can be executed in a mobile terminal, a computer terminal or a similar electronic device. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can 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 merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein. Figure 1 The present invention shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for detecting application service status.

[0020] like Figure 1 As shown, the computer terminal 100 includes a computing unit 101, which 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. Various programs and data required for the operation of the computer terminal 100 can also be stored in the RAM 103. 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 the bus 104.

[0021] Multiple 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, etc.; an output unit 107, such as various types of displays, speakers, etc.; a storage unit 108, such as a magnetic disk, an optical disk, etc.; and a communication unit 109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 109 allows the computer terminal 100 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0022] The computing unit 101 can be a variety of general-purpose and / or specialized processing components with 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 dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 101 performs the method for detecting the application service status described herein. For example, in some embodiments, the method for detecting the application service status can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 108. In some embodiments, part or all of the computer program can be loaded and / or installed on the computer terminal 100 via the ROM 102 and / or the communication unit 109. When the computer program is loaded into the RAM 103 and executed by the computing unit 101, one or more steps of the method for detecting the application service status described herein can be performed. Alternatively, in other embodiments, the computing unit 101 can be configured to perform the method for detecting the application service status by any other appropriate means (e.g., by means of firmware).

[0023] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0024] It should be noted that, in some optional embodiments, the above Figure 1The electronic device shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the electronic device described above.

[0025] Under the above operating environment, the present disclosure provides the following Figure 2 The method for detecting the application service status shown in FIG. Figure 1 The computer terminal or similar electronic device shown is used for execution. Figure 2 This is a flow chart of a method for detecting application service status according to an embodiment of the present disclosure. Figure 2 As shown, the method may include the following steps:

[0026] Step S202: Obtain the target cluster corresponding to the target application service.

[0027] The target application service mentioned above may be composed of multiple node services (node), and the target cluster corresponding to the target application service may include sub-services with different namespaces, wherein the sub-services include microservices (svc), container services (pod), etc.

[0028] The target cluster mentioned above can be a Kubernetes cluster, that is, a K8s cluster.

[0029] In an optional embodiment, the target application service is a service to be tested. The target cluster corresponding to the target application service can be obtained first, and the deployment of the target application service can be tested in the target cluster to detect whether the target application service can operate normally.

[0030] Step S204 : Using a preset batch processing type script to detect the service deployment of the target application service on the target cluster, and obtaining a detection result.

[0031] The aforementioned default batch processing type script is a Shell script (a script program written for execution).

[0032] In an optional embodiment, a separate namespace can be set for each application service so that the services deployed in the namespace can be detected by calling a shell script. The namespaces corresponding to each application service can be independent of each other and do not affect each other.

[0033] In another optional embodiment, when a preset batch-type script detects the namespace corresponding to the target application service in the target cluster, the service deployed in the namespace can be tested to obtain a test result. It should be noted that during the test process, the execution status and access status of each subservice in the target application service can be tested. If any subservice fails to be tested, it indicates that the target application service has failed to be tested; if all subservices are tested successfully, it indicates that the target application service has been tested successfully.

[0034] Step S206: Determine the service status of the target application service based on the detection result.

[0035] The service status of the target application service may include the stability of the target cluster where the target application service is located, whether the subservices in the target application service can be accessed, and whether the subservices in the target application service can meet the operation requirements.

[0036] The above detection results can be the service deployment status of the target application service on the target cluster. If there is a problem with the deployed service, it can be determined that there is a problem with the service status of the target application service. At this time, the problem can be fed back and relevant personnel can be reminded to handle it in time; if there is no problem with the deployed service, it is determined that the service status of the target application service is normal.

[0037] In an optional embodiment, when the detection result shows that the stability of the target cluster where the target application service is located is poor, it is necessary to detect the nodes corresponding to the target cluster in order to improve the stability of the target cluster; when the detection result shows that the svc in the target application service cannot be accessed for inspection, the tester is reminded to detect the svc and troubleshoot; when the detection result shows that the pod cannot meet the operating requirements, the tester can be reminded to detect the pod and troubleshoot so that the pod can meet the operating requirements.

[0038] Through the above steps, the target cluster corresponding to the target application service is first obtained. Then, a preset batch-type script is used to detect the service deployment of the target application service on the target cluster, obtaining a detection result. Finally, the service status of the target application service is determined based on the detection result. This achieves the purpose of quickly detecting the application service status. The preset batch-type script can automatically detect the services deployed on the target cluster, reducing the detection cost of the target application service and improving detection efficiency. This solves the technical problem in related technologies that often results in low detection efficiency when deploying services through manual commands.

[0039] Optionally, obtaining the target cluster corresponding to the target application service includes: obtaining a namespace where the target application service is located; and determining the target cluster through the namespace.

[0040] The above namespace is used to isolate different application services so that the testing processes of different application services will not affect each other.

[0041] The above target application service may include multiple sub-services, and multiple sub-services can be stored in one namespace.

[0042] In an optional embodiment, a namespace can be set up for storage of different application services, so that when testing different application services, the target cluster corresponding to the target application service can be determined through the namespace. By setting namespaces for different application services, the efficiency of testing the target application service can be improved.

[0043] Optionally, a preset batch type script is used to detect the service deployment of the target application service on the target cluster, and the detection results obtained include: using a preset batch type script to detect the operating status of each node in the target cluster; in response to the operating status detection passing, using a preset batch type script to detect the access status of each service port provided by the target cluster; in response to the access status detection passing, using a preset batch type script to detect the service function of the target application service to obtain the detection results.

[0044] In an optional embodiment, the running status of each node in the target cluster can be checked by using kubectl get nodes (checking node status). Specifically, the node query is used to check whether the status of each node in the target cluster is running. If all nodes are running, it means that the status of the target cluster itself is stable.

[0045] Furthermore, when the running status test of each node in the target cluster passes, the access status of each service port provided by the target cluster can be tested through a shell script using curl (an open source command tool). If the access status test fails, it means that there is a problem with the service at the access level, and the tester can be notified to correct the problem at the access level; if the access status test is successful, it means that there is no problem with the function of each service at the access level, and at this time, the next step of service function test can be carried out.

[0046] Furthermore, when the access status detection of each service port provided by the target cluster is successful using the preset batch type script, the preset batch type script can be used to batch detect the service functions of the target application service. When problems occur during the detection, the tester can be notified to correct the problems in the service functions; if no problems occur during the detection, it means that the target application service detection is successful and the detection task is completed.

[0047] From the above, it can be seen that in the process of using preset batch type scripts to detect the service deployment of the target application service on the target cluster, a certain type of content to be detected is uniformly detected through the preset batch type script; compared with the problem of manual detection of each stage of each service in the related technology, which leads to complex and inefficient detection process, the above unified detection method can maximize the efficiency of detection.

[0048] Optionally, using a preset batch type script to detect the operating status of each node in the target cluster includes: using a preset batch type script to detect whether each node in the target cluster is in a ready state; in response to each node in the target cluster being in a ready state, detecting whether the container services deployed in the target cluster are complete, wherein the container services include: basic services and application services; in response to the container services being deployed completely, detecting whether all container services are in a running state, wherein all container services being in a running state indicates that the operating status detection has passed.

[0049] In an optional embodiment, a shell script may be used to detect whether each node in the target cluster is in a ready state. If each node is in the ready state, it indicates that the state of each node is correct, that is, the application environment of the target application service is normal.

[0050] Furthermore, if the application environment is normal, the completeness of the container services deployed in the target cluster can be detected. The basic services in the container services include but are not limited to the MySQL service (database service), the Kafka service (open source stream processing platform), and the ES (elasticsearch, search server). When detecting the completeness of the container services deployed in the target cluster, the svc service, ip service (address service), and port service (port service) of each service in the container service can be tested. Specifically, curl can be used to detect whether all container services are in the running state. If all container services are in the running state, the running state test has passed; if any container service is not in the running state, the running state test has failed.

[0051] Through the above steps, the operating status of each node in the target cluster, the deployment of the container service, and the operating status of the container service can be centrally tested. If a problem occurs at one level, the tester can be notified to test and correct the level. After the correction is successful, the test can be retested or continued. Compared with manual testing of each sub-service in the target application service, testing the content at the same level in the above sub-services is more efficient in testing the target application service.

[0052] Optionally, using a preset batch type script to detect the access status of each service port provided by the target cluster includes: using a preset batch type script to obtain each service port provided by the target cluster; by sending an access request to each service port provided by the target cluster, detecting the access status of each service port provided by the target cluster, wherein each service port provided by the target cluster is accessible, indicating that the access status detection has passed.

[0053] In an optional embodiment, a shell script can be used to obtain all service ports in the target cluster and perform a unified test on all service ports. Specifically, the access status of each service port provided by the target cluster can be uniformly tested by sending an access request to each service port provided by the target cluster. By testing the same type of test content, the efficiency of the test can be improved. At the same time, when problems occur during the test, the test personnel can also quickly correct the same type of problems, thereby improving the efficiency of the test of the target application service. If it is detected that each service port provided by the target cluster is accessible, it means that the access status test of each service port has passed. At this time, the test process for each service port provided by the target cluster can be completed and the next level of detection can be carried out.

[0054] Optionally, using a preset batch type script to detect the service function of the target application service includes: using a preset batch type script to run a main process automation interface test task of the target application service to perform main process function level detection.

[0055] In an optional embodiment, after the operating status of the target cluster corresponding to the target application service and the various service ports in the target cluster are detected, the target application service can be tested at the functional level by running the main process automation interface tester of the target application service to detect whether the function of the target application service is normal. If the function corresponding to the target application service runs normally, the detection is completed; if the function corresponding to the target application service runs abnormally, the tester is notified to detect and correct the function corresponding to the target application service.

[0056] In another optional embodiment, after the target application service is successfully detected, the application services of other namespaces can be detected based on the detection results of the target application. Specifically, the target application service in the successfully detected namespace can be compared with the target application service in the undetected namespace. If the same problem exists, the problem can be directly corrected according to the correction results of the tester. When the application service corresponding to the namespace is subsequently detected, the problem that has been corrected does not need to be corrected again, which can further improve the efficiency of detection.

[0057] Optionally, determining the service status of the target application service based on the detection results includes: determining the existence of a detection failure based on the detection results, wherein the detection failure includes at least one of the following: running status detection failure, access status detection failure and service function detection failure; displaying exception information through the detection failure, wherein the exception information is used to indicate that there is a deployment exception in the target application service.

[0058] In an optional embodiment, when it is determined based on the test results that a test failure exists, the tester may be notified to make corrections, and the test may be re-performed after the corrections are completed until the test is successful.

[0059] In another optional embodiment, when the detection failure is a failure in the operation status detection, after the tester completes the detection of each node and corrects the existing problems, the operation status can be re-tested until the detection is successful, and subsequent access status detection can be performed; when the access status detection fails, the tester can be notified to correct the port of each service in the target application service. After the correction, the port of each service can be re-tested until the detection is successful, and subsequent service function detection can be performed; when the service function detection fails, the tester can be notified to detect the service function corresponding to each service in the target application service. During the detection process, if a detection failure occurs, the same problem and its corresponding solution that existed before can be obtained, and the problem that exists this time can be processed based on the solution. If the same problem does not exist, the tester will be notified to process it.

[0060] In another optional embodiment, a detection database can be set up in advance, wherein the detection database may include problems existing in the detection process and the corresponding treatment solutions of the testers. When the same problem is detected subsequently, the solution corresponding to the same problem can be called from the detection database. At this time, there is no need to notify the testers manually, so as to reduce labor costs.

[0061] The following describes the method for detecting the application service status provided by the embodiment of the present disclosure with reference to a schematic diagram.

[0062] Figure 3 This is another flowchart for detecting the application service status according to an embodiment of the present disclosure.

[0063] Step S301: Detect the status of the K8s cluster and obtain the detection result;

[0064] Step S302: Determine whether the status of the K8s cluster is normal based on the detection result. If so, execute step S303; if not, execute step S10;

[0065] Step S303: Check whether the container service deployed in the K8s cluster is complete. If so, execute step S304; if not, execute step S10.

[0066] Step S304: Check whether the container service is in running state. If so, execute step S305; if not, execute step S310;

[0067] Step S305: Check whether the container service is accessible. If yes, go to step S306; if no, go to step S310.

[0068] Step S306: Run the main process automation to perform a main process function level test;

[0069] Step S307: Check whether the running status of the container service is normal. If so, execute step S308; if not, execute step S310;

[0070] Step S308, determine whether the main process automation is normal, if not, execute step S309, if not, execute step S310;

[0071] Step S309: Service deployment verification is passed;

[0072] Step S310: Service deployment verification fails.

[0073] The script's automated check process verifies the status of application services. Specifically, it first checks the status of each node in the cluster based on the namespace where the application service resides. If correct, it then verifies that each service port is accessible. If so, it then tests the service functionality. If any check fails at any level during this process, it directly indicates a problem with the application service. Compared to manual testing in existing technologies, this automated process is more efficient and saves labor costs.

[0074] Furthermore, the above steps can effectively reduce labor costs caused by service deployment and implementation issues. For the entire project, deploying and developing on Kubernetes can improve delivery testing efficiency, reduce labor costs, shorten delivery cycles, and increase the profit margin of the entire delivery project. This eliminates the waste of time and testing waits caused by real-time deployment issues and significant improvements in testing resource utilization. During project testing, detecting deployment issues can save one to two days of labor costs.

[0075] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0076] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, or of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present disclosure.

[0077] The present disclosure also provides a device for detecting the status of an application service, which is used to implement the above-mentioned embodiments and preferred embodiments. Details that have already been described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0078] Figure 4 is a structural block diagram of a device for detecting application service status according to one embodiment of the present disclosure, such as Figure 4 As shown, a device 400 for detecting an application service status includes:

[0079] Acquisition module 402, used to acquire the target cluster corresponding to the target application service;

[0080] A detection module 404 is configured to detect the service deployment of the target application service on the target cluster using a preset batch processing type script to obtain a detection result;

[0081] The determination module 406 is configured to determine the service status of the target application service based on the detection result.

[0082] Optionally, the acquisition module includes: an acquisition unit, configured to acquire a namespace where a target application service is located; and a first determination unit, configured to determine a target cluster through the namespace.

[0083] Optionally, the detection module includes: a first detection unit, used to use a preset batch type script to detect the operating status of each node in the target cluster; a second detection unit, used to use a preset batch type script to detect the access status of each service port provided by the target cluster in response to the operating status detection being passed; a third detection unit, used to use a preset batch type script to detect the service function of the target application service in response to the access status detection being passed to obtain a detection result.

[0084] Optionally, the second detection unit includes: a first detection sub-unit, used to use a preset batch type script to detect whether each node in the target cluster is in a ready state; a second detection sub-unit, used to detect whether the container services deployed in the target cluster are complete in response to each node in the target cluster being in a ready state, wherein the container services include: basic services and application services; a third detection sub-unit, used to detect whether all container services are in a running state in response to the container service deployment being complete, wherein all container services are in a running state indicating that the running state detection has passed.

[0085] Optionally, the first detection subunit includes: an acquisition subunit, used to obtain each service port provided by the target cluster using a preset batch type script; a fourth detection subunit, used to detect the 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, wherein each service port provided by the target cluster is accessible, indicating that the access status detection has passed.

[0086] Optionally, the third detection unit includes: an operation sub-unit, which is used to use a preset batch type script to run the main process automation interface test task of the target application service to perform main process function level detection.

[0087] Optionally, the determination module includes: a second determination unit, used to determine whether there is a detection failure based on the detection results, wherein the detection failure includes at least one of the following: operation status detection failure, access status detection failure and service function detection failure; a display unit, used to display exception information through detection failure, wherein the exception information is used to indicate that there is a deployment exception in the target application service.

[0088] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0089] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device, including a memory and at least one processor, wherein the memory stores computer instructions, and the processor is configured to execute the computer instructions to perform the steps in any of the above method embodiments.

[0090] 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.

[0091] Optionally, in the present disclosure, the processor may be configured to execute the following steps through a computer program:

[0092] S1, obtain the target cluster corresponding to the target application service;

[0093] S2, using a preset batch type script to detect the service deployment of the target application service on the target cluster and obtain the detection result;

[0094] S3: Determine the service status of the target application service based on the detection result.

[0095] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0096] According to an embodiment of the present disclosure, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are configured to execute the steps of any of the above method embodiments during runtime.

[0097] Optionally, in this embodiment, the non-transitory computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0098] S1, obtain the target cluster corresponding to the target application service;

[0099] S2, using a preset batch type script to detect the service deployment of the target application service on the target cluster and obtain the detection result;

[0100] S3: Determine the service status of the target application service based on the detection result.

[0101] Alternatively, in this embodiment, the non-transitory computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any suitable combination of the above. More specific examples of readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0102] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product. The program code for implementing the audio processing method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0103] In the above embodiments of the present disclosure, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0104] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0105] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.

[0106] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0107] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0108] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present disclosure. These improvements and modifications should also be regarded as within the scope of protection of the present disclosure.

Claims

1. A method for detecting an application service status, comprising: Get the target cluster corresponding to the target application service; Using a preset batch type script to detect the service deployment of the target application service on the target cluster to obtain a detection result; Determine the service status of the target application service based on the detection result; The method comprises: detecting the service deployment of the target application service on the target cluster using the preset batch processing type script to obtain the detection result, including: detecting the operating status of each node in the target cluster using the preset batch processing type script; in response to the operating status detection passing, detecting the access status of each service port provided by the target cluster using the preset batch processing type script; in response to the access status detection passing, detecting the service function deployed in the corresponding namespace of the target application service in the target cluster using the preset batch processing type script to obtain the detection result, wherein the namespace is used to isolate different target application services; The method further includes: after the target application service is successfully detected, detecting application services in an undetected namespace according to the detection result of the target application service.

2. The method according to claim 1, wherein Obtaining the target cluster corresponding to the target application service includes: Obtain the namespace where the target application service is located; The target cluster is determined by the namespace.

3. The method according to claim 1, wherein Using the preset batch processing type script to detect the operating status of each node in the target cluster includes: Using the preset batch processing type script to detect whether each node in the target cluster is in a ready state; In response to each node in the target cluster being in the ready state, detecting whether the container service deployed in the target cluster is complete, wherein the container service includes: basic services and application services; In response to the container service being fully deployed, it is detected whether the container services are all in a running state, wherein if the container services are all in the running state, it indicates that the running state detection has passed.

4. The method according to claim 3, wherein: Using the preset batch processing type script to detect the access status of each service port provided by the target cluster includes: Using the preset batch processing type script to obtain each service port provided by the target cluster; An access status of each service port provided by the target cluster is detected by sending an access request to each service port provided by the target cluster, wherein if each service port provided by the target cluster is accessible, it means that the access status detection passes.

5. The method according to claim 1, wherein Using the preset batch processing type script to detect the service function of the target application service includes: The preset batch type script is used to run the main process automation interface test task of the target application service to perform main process function level detection.

6. The method according to claim 1, wherein Determining the service status of the target application service based on the detection result includes: Determining the presence of a detection failure based on the detection result, wherein the detection failure includes at least one of the following: a running state detection failure, an access state detection failure, and a service function detection failure; Exception information is displayed through the detection failure, wherein the exception information is used to indicate that a deployment exception exists in the target application service.

7. A device for detecting an application service status, comprising: The acquisition module is used to obtain the target cluster corresponding to the target application service; A detection module is used to detect the service deployment of the target application service on the target cluster using a preset batch type script to obtain a detection result; A determination module, configured to determine a service status of the target application service based on the detection result; The detection module includes: a first detection unit, configured to detect the operating status of each node in the target cluster using the preset batch processing type script; a second detection unit, configured to detect the access status of each service port provided by the target cluster using the preset batch processing type script in response to the operating status detection being passed; a third detection unit, configured to detect the service function deployed in the namespace corresponding to the target application service in the target cluster using the preset batch processing type script in response to the access status detection being passed, to obtain the detection result, wherein the namespace is used to isolate different target application services; The device is further configured to: after the target application service is successfully detected, detect application services in an undetected namespace according to the detection result of the target application service.

8. The device according to claim 7, wherein Get modules, including: An acquisition unit, configured to acquire the namespace where the target application service is located; A first determining unit is configured to determine the target cluster through the namespace.

9. The device according to claim 7, wherein The second detection unit includes: A first detection subunit, configured to detect whether each node in the target cluster is in a ready state using the preset batch processing type script; A second detection subunit is configured to detect, in response to each node in the target cluster being in the ready state, whether the container service deployed in the target cluster is complete, wherein the container service includes: a basic service and an application service; The third detection subunit is configured to detect, in response to the container service being completely deployed, whether all the container services are in a running state, wherein if all the container services are in the running state, it indicates that the running state detection has passed.

10. The device according to claim 9, wherein The first detection subunit includes: an acquisition subunit, configured to acquire each service port provided by the target cluster using the preset batch processing type script; The fourth detection subunit is configured to detect the 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, wherein if each service port provided by the target cluster is accessible, it indicates that the access status detection has passed.

11. The device according to claim 7, wherein The third detection unit includes: The running subunit is used to use the preset batch type script to run the main process automation interface test task of the target application service to perform main process function level detection.

12. The device according to claim 7, wherein Identify modules, including: a second determining unit, configured to determine, based on the detection result, whether a detection failure exists, wherein the detection failure includes at least one of the following: a running state detection failure, an access state detection failure, and a service function detection failure; A display unit is used to display abnormal information through the detection failure, wherein the abnormal information is used to indicate that the target application service has a deployment abnormality.

13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.

15. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and apparatus for monitoring running state of service item

    CN107483274A