Application detection method, system and device
The client receives application detection requests and forwards them to the first processing server, solving the problem of low troubleshooting and performance diagnosis efficiency in distributed clusters, and achieving rapid and real-time detection and diagnosis of distributed systems.
Patent Information
- Application Number
- CN202510125579.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-05-27
AI Technical Summary
In distributed clusters, it is difficult for the existing technology to achieve fast and real-time troubleshooting and performance diagnosis, especially in the case of distributed systems, where traditional methods are inefficient and cannot penetrate into the code.
The application detection request is received through the client and sent to the first processing server, which determines the target server based on the detection request. If it is the target server, the detection program will be called directly for detection; if it is not, the request will be forwarded to the target server.
It realizes unified management and maintenance of multiple servers in a distributed structure, and conducts in-depth application detection without the system being shut down, improving detection efficiency and real-timeness.
Smart Images

Figure CN120045459A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and particularly to an application detection method, system and device. Background Art
[0002] With the rapid development of cloud computing technology, the application of distributed clusters has received more and more attention. For a distributed cluster, the stability and reliability of the cluster are crucial. In modern distributed systems, especially application programs based on the microservices architecture, the operation and maintenance team faces increasingly complex challenges. Once a certain link or node in the system fails or has a performance bottleneck, one troubleshooting method is to first shut down the running system, and then the operation and maintenance personnel collect logs on multiple machines to troubleshoot the problem. This troubleshooting method relies on manual operation, has low efficiency, and is based on log-based troubleshooting, unable to penetrate deep into the code. Another troubleshooting method is that the operation and maintenance personnel use a Java program diagnostic tool to diagnose the application service deployed on the faulty node at the code level. By intercepting and outputting the parameter information of method calls through the method of inserting bytecode stubs, it is possible to penetrate deep into the Java code for troubleshooting. Although this method can perform troubleshooting without shutting down the system, this method only supports single-machine diagnosis. In the scenario of a distributed system, the operation and maintenance personnel need to diagnose each of the multiple servers one by one through the client, and the same problems of being unable to troubleshoot faults in real time, spending a lot of time and manpower costs resulting in low troubleshooting efficiency will occur. Therefore, how to avoid the low efficiency of the offline problem analysis method, facilitate the operation and maintenance team to quickly locate faults, and improve the troubleshooting efficiency is an urgent problem to be solved at present. Summary of the Invention
[0003] In view of this, the embodiments of this specification provide an application detection method. One or more embodiments of this specification also relate to an application detection system, an application detection device, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects existing in the prior art.
[0004] According to the first aspect of the embodiments of this specification, an application detection method is provided, including:
[0005] Receiving an application detection request for a target application through a client, and sending the application detection request to a first processing server, where the client is used to detect applications deployed on at least two servers;
[0006] Determining a target server from at least two servers by the first processing server based on the application detection request;
[0007] When the first processing server is the target server, the first processing server calls a detection program in response to the application detection request to detect the target application, where the detection program has the same operating environment as the target application;
[0008] When the first processing server is not the target server, the first processing server forwards the application detection request to the target server, where the target server is used to call the detection program to detect the target application.
[0009] According to a second aspect of the embodiments of the present specification, an application detection system is provided. The system includes a client and at least two servers, where,
[0010] The client is configured to receive an application detection request for a target application and send the application detection request to a first processing server, where the client is used to detect the applications deployed on the at least two servers;
[0011] The first processing server is configured to determine a target server among the at least two servers based on the application detection request;
[0012] When the first processing server is the target server, it calls a detection program in response to the application detection request to detect the target application, where the detection program has the same operating environment as the target application;
[0013] When the first processing server is not the target server, it forwards the application detection request to the target server, where the target server is used to call the detection program to detect the target application.
[0014] According to a third aspect of the embodiments of the present specification, an application detection device is provided, including:
[0015] A sending module, configured to receive an application detection request for a target application through a client and send the application detection request to a first processing server, where the client is used to detect the applications deployed on at least two servers;
[0016] A determining module, configured to determine a target server among the at least two servers through the first processing server based on the application detection request;
[0017] A detection module, configured to, when the first processing server is the target server, detect the target application by calling a detection program in response to the application detection request through the first processing server, wherein the detection program has the same running environment as the target application;
[0018] A forwarding module, configured to, when the first processing server is not the target server, forward the application detection request to the target server through the first processing server, wherein the target server is used to call the detection program to detect the target application.
[0019] According to a fourth aspect of the embodiments of the present specification, a computing device is provided, including:
[0020] A memory and a processor;
[0021] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the above application detection method are implemented.
[0022] According to a fifth aspect of the embodiments of the present specification, a computer-readable storage medium is provided, which stores computer-executable instructions. When the instructions are executed by a processor, the steps of the above application detection method are implemented.
[0023] According to a sixth aspect of the embodiments of the present specification, a computer program product is provided, including a computer program or instructions. When the computer program or instructions are executed by a processor, the steps of the above application detection method are implemented.
[0024] One embodiment of the present specification realizes receiving an application detection request for a target application through a client. An operation and maintenance personnel can perform application detection on applications deployed on multiple servers through a uniformly managed client. During the application detection process, the client will send the application detection request to one of the multiple servers as the first processing server. The first processing server will determine whether it is the target server according to the application detection request. When the first processing server is the target server, it directly responds to the application detection request and calls the detection program to detect the target application. When the first processing server is not the target server, it forwards the application detection request to the target server, and the target server responds to the application detection request. Thus, not only can multiple servers with a distributed structure be uniformly managed and maintained, but also, on the premise that the system does not shut down, the target application can be deeply detected through a detection program with the same running environment as the target application, improving the application detection efficiency and detection real-time rate. Description of the Drawings
[0025] Figure 1AIt is a schematic diagram of the scenario of an application detection method provided by an embodiment of this specification;
[0026] Figure 1B It is a schematic diagram of the management page of an application detection method provided by an embodiment of this specification;
[0027] Figure 2 It is a flowchart of an application detection method provided by an embodiment of this specification;
[0028] Figure 3 It is a system flowchart of an application detection system provided by an embodiment of this specification;
[0029] Figure 4 It is a processing procedure flowchart of an application detection method provided by an embodiment of this specification;
[0030] Figure 5 It is a schematic structural diagram of an application detection device provided by an embodiment of this specification;
[0031] Figure 6 It is a structural block diagram of a computing device provided by an embodiment of this specification. Detailed implementation manners
[0032] Many specific details are set forth in the following description in order to provide a thorough understanding of this specification. However, this specification can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the connotation of this specification. Therefore, this specification is not limited by the specific implementations disclosed below.
[0033] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a", "the", and "said" used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more of the associated listed items.
[0034] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein can be interpreted as "when" or "while" or "in response to determining".
[0035] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject.
[0036] First, the noun terms involved in one or more embodiments of this specification are explained.
[0037] Operation and maintenance diagnosis tool: An operation and maintenance diagnosis tool is software or a toolset used to analyze and solve problems in the operation of an information system to ensure the stability and performance of the system.
[0038] Arthas: Arthas is an online monitoring and diagnosis tool designed specifically for Java applications, mainly used to troubleshoot problems in Java programs during online operation and for debugging in daily development. It provides a global perspective that enables developers and operation and maintenance personnel to view key performance indicators such as the load of the application, memory usage, garbage collection (GC) behavior, and thread status in real time. In one embodiment of this specification, based on Arthas, it is possible to dynamically monitor and diagnose application programs running on the JVM (Java Virtual Machine) without modifying the code or restarting the application.
[0039] WebSocket protocol: The WebSocket is a protocol for full-duplex communication over a single TCP connection, which allows the browser and the server to directly create a persistent connection and perform two-way data transmission only after completing a single handshake. In one embodiment of this specification, message interaction between servers is achieved through the WebSocket protocol, enabling the server to act as a relay to forward requests to other servers.
[0040] Java bytecode instrumentation technology: A method of inserting additional instructions into the bytecode of a Java class, used to collect data or change program behavior at runtime without modifying the source code. In one embodiment of this specification, based on Arthas, Java bytecode instrumentation technology is used for aspects such as thread monitoring and method execution time statistics of application services.
[0041] Currently, during the routine system operation and maintenance process, if an application service fails, open-source program diagnostic tools such as btrace or arthas can be installed into the container where the Java application process is located. By means of Java Virtual Machine (JVM) bytecode instrumentation, information such as the input and output parameters of method calls can be intercepted and output, improving the code-level diagnostic ability. However, this method can only provide single-machine diagnostic capabilities. It is necessary to first enter the container to install programs such as arthas, and then operate in the container's webshell (command execution environment), and it is impossible to diagnose multiple machines in an environment distributively through a unified management interface.
[0042] Based on this, in this specification, an application detection method is provided. This specification also relates to an application detection system, an application detection device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail one by one in the following embodiments.
[0043] See Figure 1A , Figure 1A FIG. is a schematic diagram of the scenario of an application detection method provided by an embodiment of this specification. Among them, the client can be understood as the terminal used by the operation and maintenance personnel. Through the client, centralized operation and maintenance and management of multiple servers can be carried out. The operation and maintenance personnel can perform centralized application service management on multiple clients, and code diagnosis of the application services deployed on each server under the distributed cluster can be performed through any one of the clients. For example Figure 1A in FIG., the application service deployed on server A can be diagnosed and detected through client A, or the application service deployed on server A can be diagnosed and detected through client Z. Each server can be understood as a terminal on which an application service is deployed. For example Figure 1A in FIG., an application service is deployed on server A, and an application service is deployed on server Z. It should be noted that the number of clients and the number of servers can be distributed according to the actual situation.
[0044] When the operation and maintenance personnel find that there are faults or performance bottlenecks in the system, they can perform application diagnosis on each server through the client. For example, when diagnosing application service A, the client needs to send an application detection request to server A. Due to the existence of the load-balancing server, the client will send the application detection request to the load-balancing server, and the load-balancing server will send the application detection request to one of the multiple servers according to the load-balancing policy. This server serves as the first processing server. Therefore, the application detection request sent by client A for server A may be sent to server A or other servers through the load-balancing server. In the case where server A receives it, server A is the first processing server and recognizes itself as the target server, then server A will respond to the application detection request to diagnose the application service; in the case where other servers such as server B receive it, at this time server B is the first processing server, and server B will determine the target server that actually needs to be detected according to the application detection request. After determining that server A is the target server, it will forward the application detection request to server A, and server A will call the detection program to detect application server A. Thus, centralized unified operation and maintenance management of multiple servers is achieved through the client, enabling the operation and maintenance personnel to remotely perform application detection on multiple servers through the client, improving the detection efficiency. And through the message relay between multiple servers, the drawback of only being able to perform single-machine diagnosis in the past is solved, achieving the purpose of distributed diagnosis.
[0045] See Figure 1B , Figure 1B FIG. Figure 1B is a schematic diagram of the management page of an application detection method provided by an embodiment of this specification. Among them, through the graphical management page on the client, each container and its corresponding deployed application instances can be browsed, and the status information of each application can be viewed, which is convenient for the operation and maintenance personnel to understand the running status of the application. In addition, the host machine where each application is located can be determined through the management page, so as to facilitate online troubleshooting of the host machine where the problem application is located.
[0046] See Figure 2 , Figure 2 FIG. Figure 2 is a flowchart of an application detection method provided by an embodiment of this specification, which specifically includes the following steps.
[0047] Step 202: Receive an application detection request for a target application through the client and send the application detection request to the first processing server, where the client is used to detect applications deployed on at least two servers.
[0048] Among them, the client can be understood as the terminal for operation and maintenance detection. The operation and maintenance personnel can use the client to perform application detection on any server under the distributed architecture. The target application can be understood as the application to be detected this time. Specifically, the target application can be a microservice instance or a Java application program, and the target application can run in a JVM instance and be deployed on the corresponding server. The applications deployed on different servers can communicate with each other through network interfaces such as RestAPI or message queues. The application detection request can be understood as the detection request issued for the target application. The application detection request is the request issued by the operation and maintenance personnel during the operation and maintenance process. It can be a request only for the target application; it can also be the detection request corresponding to the target application when all applications are detected during regular maintenance. The first processing server can be understood as the server that receives the application detection request sent by the client.
[0049] In practical applications, the operation and maintenance personnel can log in to the application management platform through the browser on the client. The application management platform can be understood as the operation and maintenance platform used by the operation and maintenance personnel. Through the application management platform, the relevant running status or performance parameters of each application can be monitored. The application management platform involved in the embodiments of this specification can be a pre-built platform for online diagnosis of the application services deployed on each server. The application management platform can also be used to monitor the running status of each application service usually to facilitate timely discovery of the failure problems of the application services. When the operation and maintenance personnel find that there are problems with the application services or conduct regular maintenance, they can detect the application services deployed on different servers based on the application management platform. At this time, the client will receive the application detection request for the target application. The application detection request is used to perform diagnostic detection at the relevant code level on the target application. After the client receives the application detection request for the target application, it will send the application detection request to the server.
[0050] Under the distributed architecture, large application programs can be split into multiple small and independent microservices. Each microservice is used to complete a specific function. Therefore, different microservices can run in different JVM instances or even different physical or virtual machines. For this reason, when performing application detection on the target application, it is necessary to send the application detection request to the server where the target application is located so that the server can perform diagnostic detection on the target application deployed on itself. The first processing server is the server that receives the application detection request. However, the target application may not be deployed on the first processing server, that is, there is no corresponding registration relationship between the first processing server and the target application. Therefore, the first processing server needs to perform further request forwarding operations subsequently. Since during the process of sending the request, considering the actual running status of each server and the service providing stability, it is necessary to send it in the way of load balancing, so it is possible that the application detection request for the target application is sent to other servers.
[0051] In specific implementation, the application detection method provided in this specification can be applied in the Kubernetes (usually abbreviated as K8s) architecture. K8s is used to manage containerized applications on multiple hosts in a cloud platform. The goal of Kubernetes is to make it simple and efficient to deploy containerized applications. In this architecture, both the client and the server can be understood as scheduling units (pods) on the worker nodes in the K8s cluster. A corresponding application detection service can be deployed in the client to detect the container applications deployed on the server.
[0052] In a specific embodiment of this specification, currently, operation and maintenance personnel manage and maintain an online e-commerce platform. Through monitoring data, it is found that the response time significantly increases during peak periods, and even service timeouts may occur. To find out the problem and optimize the system performance, application detection can be performed on each microservice application deployed in the system. Now, it is necessary to detect Application A. The operation and maintenance personnel send an application detection request through the client. After the client receives the application detection request for the target application, it will send the application detection request to the first processing server, and the first processing server is a server selected from multiple servers in the system according to the load balancing strategy.
[0053] Furthermore, in order to be able to detect the deployed application services on any server, it is necessary to ensure that the corresponding diagnostic tools are installed in advance on each server. Specifically, before the client receives the application detection request for the target application, it further includes: determining the running environment of the target application in response to the program installation instruction for the target application through the client; sending the program installation package of the detection program to the target server corresponding to the target application, and installing the detection program in the running environment based on the program installation package through the target server.
[0054] Among them, the program installation instruction is used to install the detection program on the server. The detection program can be understood as a tool for monitoring and diagnosing application services. The detection program can be btrace (btrace is a dynamic tracing and diagnostic tool designed specifically for the Java platform, which allows developers to perform real-time monitoring and debugging of running Java applications without restarting the application) or arthas. Through the detection program, service problems can be diagnosed without modifying the application code, and online diagnosis can also be performed without shutting down the system. In the embodiments of this specification, the detection program is taken as arthas as an example for illustration. When installing the detection program, it is necessary to understand the running environment of the application service because the detection program needs to interact with the JVM of the target application, and different running environments may affect the installation method, configuration, and diagnostic effect of the detection program. The running environment can include various information such as the operating system, Java running environment, deployment method, network configuration, etc. Determine the running environment of the target application to facilitate the subsequent installation of the detection program based on the running environment. The program installation package of the detection program can be understood as the file compression package corresponding to the detection program. Through the program installation package, the detection program can be installed into the corresponding server.
[0055] In practical applications, the corresponding compressed package of the detection program can be obtained through the open-source application web page, generally a jar (Java Archive) file package. In the software field, the jar file package is a software package file format, usually used to aggregate a large number of Java class files, related metadata, and resource (text, pictures, etc.) files into one file for developing Java platform application software or libraries. The jar file package is an archive file constructed in the ZIP format with the file extension.jar. Users can use the jar command provided by the JDK to create or extract jar files. The detection program can be installed when detecting the application or can be installed on the server in advance. Therefore, determining the running environment of the target application can also be determining the running environment provided by the server, and then installing the detection program based on the running environment. It should be noted that when installing the detection program, there is no need to manually enter each server for individual installation. Only through the client can distributed automatic installation be achieved. Specifically, during implementation, users can select the containers or servers to be installed, and the installation package of the detection program is sent to the corresponding installation location through the operation and maintenance channel, thereby realizing the installation of the detection program, providing a convenient and fast program installation method for operation and maintenance users, and improving the detection efficiency of subsequent application services.
[0056] In a specific embodiment of this specification, in a Kubernetes cluster, the automatic installation and startup of Arthas can be achieved through the Kubernetes APIServer. To ensure the efficient management and use of Arthas for Java application diagnosis on each Pod container in the Kubernetes (K8s) cluster, commands can be issued through the K8s API Server to check and manage the status of Arthas. First, commands can be issued through the apiserver to check the status information of the virtual machine environment, confirm whether there are matching processes, whether Arthas is started, and whether Arthas is installed. In the case of no matching processes, not started, and not installed, commands are issued through the apiserver to install the Arthas component. It should be noted that in the K8s architecture, in addition to using the apiserver as an operation and maintenance channel for file and message distribution, other operation and maintenance channels can also be used for message transmission, such as ssh (Secure Shell, a protocol for secure remote login and other secure network services on an insecure network), star agent (star agent is a lightweight and high-performance operation and maintenance agent tool designed to provide unified monitoring, diagnosis, and management capabilities for large-scale distributed systems), etc. The specific operation and maintenance channel can be selected according to the actual situation.
[0057] Based on this, the operation and maintenance personnel remotely issue and install the detection program through the client, avoiding the original redundant and cumbersome installation steps, enabling the operation and maintenance personnel to more conveniently and quickly detect and troubleshoot the application programs deployed on each server, and improving the detection efficiency of subsequent application services.
[0058] Furthermore, to avoid resource waste caused by repeated installation, program identification can be performed before installation. Specifically, before sending the program installation package of the detection program to the target server corresponding to the target application, it further includes: performing program installation detection on the running environment through the client. In the case where the detection program exists in the running environment, starting the detection program; in the case where the detection program does not exist in the running environment, continuing to execute sending the program installation package of the detection program to the target server corresponding to the target application.
[0059] Among them, performing program installation detection on the running environment can be understood as detecting whether the detection program has been installed in the server or container location. In the case of installation, the detection program can be directly started and connected to the application process to be detected; when not installed, the installation step can be executed, that is, sending the program installation package to the target server for installation.
[0060] In practical applications, after diagnosing and detecting the application services on the target server, it is possible to choose not to close the detection program but to let the detection program enter the sleep mode. For example, after detecting Application A on the target server this time, the quit or exit command can be used to make the detection program exit the connection. When detecting Application A or other applications on the target server next time, the detection program can be directly awakened. Therefore, when performing the steps of installing the application program before detecting the application service, the program installation detection of the running environment can be carried out first to avoid wasting resources caused by repeated installation.
[0061] In specific implementation, to improve efficiency and reduce resource waste, after diagnosing and detecting the application services on the target server, it is possible to choose to let the detection program enter the sleep mode instead of directly closing it. This method allows the detection program to be quickly awakened during the next detection without having to restart. To enable the detection program to enter the sleep mode and be awakened when needed, the following strategies can be adopted:
[0062] Maintain session connection: Use WebSocket or other persistent connection technologies to maintain the session between the client and the detection program. When the operation and maintenance personnel complete the current detection, they can choose not to close the connection but to put the detection program in the "sleep" state.
[0063] Command-line control: Provide dedicated commands to manage the status of the detection program. For example, sleep or pause can be used to put the detection program in the sleep mode, retaining the background process but pausing all active operations.
[0064] Scheduled task or event-driven wake-up: Set up a scheduled task or event-driven mechanism to automatically wake up the detection program when specific conditions are met (such as regular inspection, exception alarm, etc.).
[0065] Specifically, the program installation detection of the running environment can be carried out by writing a simple script on each target server or using existing tools (such as find, which, etc.) to check whether the required detection program and its version have been installed. Subsequently, a registry or a file in a specific location can be maintained to record which servers have installed the detection program. Update the registry or file before and after each installation for subsequent query. If there are compatibility issues between different versions of the detection program, the current version can be checked before installation and upgraded or downgraded as needed.
[0066] In a specific embodiment of this specification, the client determines the target server and obtains the running environment of the target application in the target server, such as information about instances and containers corresponding to the target application, and detects the running environment to confirm whether the detection program is installed on the current target server. If it is installed, the Arthas detection program is directly started. If it is not installed, the jar file package of Arthas is sent to the target server. This solution not only improves work efficiency, reduces resource waste, but also enhances the reliability and stability of the system.
[0067] Based on this, by detecting the program installation in the running environment, the waste of resources and time caused by repeated installation is avoided. At the same time, through the detection of the running environment, when it is determined that the detection program has been installed in the current running environment, the detection program can be directly started and connected to the corresponding application instance to detect the application program, improving the detection efficiency of the application program.
[0068] Furthermore, in order to avoid the situation that the server has too much load pressure due to excessive messages processed by the server, resulting in the server crashing or delaying responses, the request needs to be sent in a load balancing manner. Specifically, sending the application detection request to the first processing server includes: sending the application detection request to the load balancing server through the client; based on a preset balancing policy, the load balancing server determines the first processing server among the at least two servers and forwards the application detection request to the first processing server.
[0069] Among them, the load balancing server is used to evenly distribute service requests to the actually executed services, thus ensuring the response speed of the entire system. Specifically, the load balancing server plays a crucial role in distributed systems and microservice architectures. It is responsible for reasonably distributing the service requests of the client to each node in the backend server cluster to ensure the efficient operation, high availability and response speed of the system. In specific implementation, the client communicates with the load balancing server. When the client needs to send an application detection request to the server where the target application is located, it will send the application detection request to the load balancing server. After the load balancing server receives the application detection request sent by the client, the load balancing server will collect and analyze the real-time load data of each server in the server cluster, including indicators such as CPU usage, memory occupancy, and network bandwidth. Then, based on a preset balancing policy (such as round-robin, least connections, weighted round-robin, source IP hashing, etc.), combined with the current load situation of the server, the load balancing server decides which server is most suitable to process this request, thereby realizing the analysis of the load situation of each server in the server cluster by the load balancing server and selecting the first processing server to which the request is sent.
[0070] In practical applications, there is also a load balancer server between the client and the server. The load balancer server will select the target for the current application detection request from multiple servers according to a preset balancing strategy. The selected server is used as the first processing server, and the application detection request is sent to the first processing server. If necessary, additional information such as the client IP address or session information can also be attached. The preset balancing strategy can be understood as a pre-set load balancing rule or algorithm, which is used to guide how the load balancer server distributes client requests to each node in the backend server cluster. These strategies can be selected and configured according to different requirements and scenarios to optimize the system performance, availability, and response speed. Common preset balancing strategies include round-robin, weighted round-robin, least connections, source IP hashing, and actual load-based.
[0071] Among them, the round-robin strategy distributes requests to each server in sequence. The round-robin strategy is simple to implement, easy to understand and manage, and is suitable for situations where the hardware configurations of each server are similar and the processing capabilities are uniform. However, it cannot dynamically adjust according to the actual load of the server, which may cause some servers to be overloaded while other servers are idle.
[0072] The weighted round-robin strategy introduces the concept of weights on the basis of round-robin, allowing different weight values to be set for different servers and distributing requests proportionally. The weighted round-robin strategy can better adapt to heterogeneous environments and make full use of the resources of high-performance servers. However, weight configuration requires manual intervention, increasing the management and maintenance costs.
[0073] The least connections strategy distributes new requests to the server with the fewest current active connections. The least connections strategy can effectively avoid single-point overload and improve the overall resource utilization of the system. It works well for short-life requests, but may not be accurate enough for long-connection services.
[0074] The source IP hashing strategy calculates the hash value based on the client IP address and selects the server accordingly. The source IP hashing strategy ensures that requests from the same client are always assigned to the same server, which helps to maintain the session state. However, if a server fails, all clients relying on that server will be affected.
[0075] The actual load-based strategy monitors real-time metrics such as the CPU usage rate, memory occupancy, and network bandwidth of the server, and dynamically distributes requests according to the actual load. The actual load-based strategy provides the most flexible and efficient request distribution method, ensuring that the system is always in a good working state. However, the implementation complexity is high, and strict requirements are imposed on the real-time performance and accuracy of the monitoring system.
[0076] In summary, the preset load balancing strategy is a crucial component in the load balancing system. It determines how to effectively distribute client requests, thus affecting the performance and stability of the entire system. According to specific application requirements and technical backgrounds, selecting an appropriate preset load balancing strategy can build an efficient and reliable service architecture, and the specific preset load balancing strategy can be determined according to the actual situation.
[0077] During specific implementation, due to the existence of the load balancing server, it may occur that the client wants to send an application detection request to Server A to detect the application service deployed on Server A, but the load balancing server sends the application detection request to Server B according to the preset load balancing strategy. Therefore, Server B needs to further process the application detection request.
[0078] In a specific embodiment of this specification, referring to the above example, it is now necessary to detect the application service A deployed on Server A. The operation and maintenance personnel send an application detection request through the client. After receiving the application detection request, the load balancing server executes the load balancing strategy and determines Server B as the sending target according to the preset load balancing strategy, and forwards the application detection request to Server B for processing.
[0079] Based on this, although the load balancing server can improve the performance and reliability of the distributed system, it may occur that other servers receive the application detection request. To solve this problem, the application detection method provided in this specification is solved through request identification and request forwarding of the server.
[0080] Step 204: Determine a target server from at least two servers based on the application detection request by the first processing server.
[0081] Among them, the target server can be understood as the server that actually processes the application detection request. Since the client side considers the load balancing situation when sending the application detection request, the first processing server that receives the application detection request may not be the server that actually processes the application detection request. Therefore, after receiving the application detection request, the first processing server can determine the target server that actually processes the application detection request from at least two servers based on the application detection request.
[0082] In practical applications, after receiving the application detection request, the first processing server can determine whether to process the request based on the application detection request. If so, it responds to the application detection request and performs corresponding operations; if not, it forwards the application detection request to the corresponding target server.
[0083] In a specific embodiment of this specification, referring to the above example, when the first processing server is server B, server B determines the target server in the server cluster based on the application detection request. When the target server is determined to be server A, the application detection request can be forwarded to server A; when the target server is determined to be server B, the server directly responds to the application detection request.
[0084] Further, determining the target server from at least two servers by the first processing server based on the application detection request includes: obtaining, by the first processing server, the application identifier information carried in the application detection request; and determining the target server from the at least two servers based on the application identifier information.
[0085] Among them, the application identifier information can be understood as the unique identifier information corresponding to the application service to be detected. The application identifier information (Application Identifier Information) is the key information used to uniquely identify a specific application service. It is particularly important in distributed systems, microservice architectures, and containerized environments because there are usually a large number of application instances and service nodes in these environments. Through the application identifier information, each application instance can be effectively managed and tracked, and requests can be ensured to be correctly routed to the target server. Common application identifier information includes, but is not limited to, application name, instance ID, version number, environment representation, etc. By providing a unique and descriptive identifier, the application identifier information enables the first processing server to accurately determine the target server in the server cluster according to the application identifier information, thus ensuring efficient processing of requests.
[0086] In practical applications, each application service deployed on each server corresponds to its own application identifier information. After determining the application identifier information of the application to be detected this time through the application detection request, the target server where the target application to be detected is located can be determined.
[0087] In a specific embodiment of this specification, the first processing server parses the application detection request to obtain the request header field of the application detection request, determines that the application identifier information is "appID = A12345" according to the request header field, and can determine the target server deploying the target application from multiple servers according to the application identifier information.
[0088] Further, in order to determine the target server among multiple servers based on the application identification information, it is necessary to bind the registration relationship between the application and the server in advance. Specifically, determining the target server among the at least two servers based on the application identification information includes: the first processing server searches in the application registration database based on the application identification information, and determines the application registration relationship corresponding to the target application according to the search result; determining the target server among the at least two servers based on the application registration relationship.
[0089] Among them, the application registration database can be understood as a database storing the registration relationship between the application service and the corresponding server. The Application Registration Database is a system for storing and managing the registration relationship between the application service and the deployment server. It plays a crucial role in distributed systems, microservice architectures, and containerized environments. By recording the metadata and deployment information of each application instance, the application registration relationship corresponding to the target application is found based on the application identification information. In specific implementation, a relational database (a relational database management system (RDBMS) is a data management and storage system based on the relational model. It uses tables to organize data and describes the data structure through a well-defined schema.) or a NoSQL database (a NoSQL (Not Only SQL) database is a new type of database system developed to address the challenges encountered by traditional relational databases in processing large-scale data and high-concurrency access.) can be used to store and manage the registration information. The application registration relationship can be understood as the connection relationship between the target application and the deployed server. The application registration relationship describes the connection relationship between a certain application instance and the server on which it is deployed, and usually includes information such as the application identifier, application instance identifier, IP address, port number, host name, etc. Through the application registration relationship, the server where the target application is located can be determined, so as to determine the target server among at least two servers.
[0090] In practical applications, after deploying the application service on the server, the application service can be registered and associated with the server, generating the corresponding application registration relationship and storing it in the application registration database, which is convenient for subsequently finding the corresponding application registration relationship based on the application identification information. Correspondingly, the application services deployed on the server can also be viewed in the application registration database based on the server identifier. In specific implementation, the application identification information may include information such as the process ID, port number, and service name of the application service on the server.
[0091] In a specific embodiment of this specification, determining the application identification information includes the process ID, port number, service name, and unique identifier of the application service. The process ID is used to distinguish different instances on the same machine, the port number is used to distinguish different service instances on the same machine, the service name is used to facilitate understanding the function of the service, and the unique identifier is used to track in the log or monitoring system. Through the application identification information, the application registration relationship corresponding to the target application can be found in the application registration relationship, so as to determine the server on which the target application is deployed, so that the first processing server can select the target server from the server cluster.
[0092] Based on this, through the application registration relationship stored and managed in the application registration database, the corresponding application registration relationship can be queried through the application identification information, and the location where the target application is deployed can be determined by using the application registration relationship, so as to select the target server from multiple servers, avoiding the situation of screening each server one by one, and further improving the application detection efficiency.
[0093] Step 2062: When the first processing server is the target server, the first processing server calls a detection program to detect the target application in response to the application detection request, where the detection program has the same running environment as the target application.
[0094] Among them, since the detection program is loaded into the JVM as a diagnostic tool to monitor and analyze the behavior of java applications, in order to be able to detect the target application based on the detection program, it is necessary to ensure that the detection program and the target application are in the same running environment, so that the detection program can directly connect to the application process in this JVM. Ensuring that the detection program and the target application are in the same running environment can not only improve the detection efficiency and accuracy, but also reduce unnecessary complexity and performance loss.
[0095] In practical applications, the running environment refers to the place where the application program actually executes, that is, the physical or virtual server where the Java Virtual Machine (JVM) is located, including the operating system, the JVM itself, related libraries, and dependencies, etc. The detection program Arthas attaches directly to the target JVM through the Java Attach API (the Java Attach API is a mechanism for dynamically attaching to a Java application (JVM) at runtime. It allows developers or tools to load an agent from an external process into the target JVM, execute diagnostic commands, or perform other types of interactions. The Attach API is part of the Java platform and provides the ability to monitor, debug, and manage running Java applications). This means that it needs to be able to access the JVM locally. If Arthas and the target JVM are not on the same machine, then this direct connection may be affected by network latency or security policies, thereby reducing the diagnostic efficiency or even making it impossible to achieve.
[0096] In specific implementation, after the first processing server determines the target server, it can determine whether it needs to respond to the application detection request to detect the target application. When the first processing server is the target server, it is necessary to detect the target application.
[0097] In a specific embodiment of this specification, the first processing server is server A, and the first processing server determines that the target server is also server A. Therefore, the first processing server is the target server, and it is necessary for the first processing server to respond to the application detection program. At this time, the first processing server will call the detection program based on the application detection request to detect the target application, thereby completing the remote diagnosis of the target application by the operation and maintenance personnel through the client.
[0098] Furthermore, calling the detection program to detect the target application in response to the application detection request includes: determining the detection command according to the application detection request by the first processing server; calling the detection program to detect the target application according to the detection command, obtaining the detection information corresponding to the detection command, and returning the detection information to the client.
[0099] Among them, the detection command can be understood as a command provided by the detection program for operation and maintenance personnel to monitor and detect applications. Through the detection command, the following can be achieved, including but not limited to: viewing thread information and thread stacks, locating problems such as thread suspension or deadlocks; monitoring method call frequencies and execution times to quickly find performance bottlenecks; dynamically changing the behavior of classes (such as method parameters and return values) without repackaging and redeploying; checking class loading situations and analyzing memory leaks; and real-time viewing of various JVM metrics, such as memory usage and GC (garbage collection) situations. The detection command is a powerful tool provided by the detection program for operation and maintenance personnel to monitor and diagnose the behavior of Java applications. These commands, through close integration with the JVM, provide in-depth insights into the runtime state of the application, helping operation and maintenance personnel quickly locate problems, optimize performance, and ensure the stability and reliability of the system.
[0100] In practical applications, the application detection request can carry corresponding detection commands, such as viewing thread status, method call stacks, etc. The first processing server calls the detection program to detect the target application according to the detection command. After detection, the detection information corresponding to the detection command can be obtained. The detection information is the detection result corresponding to the detection command. For example, if the detection command is to view thread status, the corresponding detection information is the specific thread status; if the check command is to monitor method call frequencies and execution times, the corresponding detection information is the call count and average execution time of a specific method.
[0101] Specifically, when calling the detection program to detect the target application, the detection program arthas will attach to the running java process. arthas provides an interactive command-line interface through which users can input various diagnostic commands to obtain information or perform operations. Therefore, the server can also receive the detection commands sent by the client in real time through the detection program and detect the target application according to the detection command based on the detection program. If the server and the client are not on the same machine, the remote connection function provided by WebSocket can be used to achieve remote control. For example, when starting arthas on the server side, specify the listening port, and the client can connect to this WebSocket address through a browser or other WebSocket-supported clients for remote operations.
[0102] In a specific embodiment of this specification, when the operation and maintenance personnel believe that the java process is blocked, they perform a detection. The first processing server uses the detection command thread in the application detection request to detect the java process of the target application. The detection command thread is used to view the status of the current thread. Based on the information such as the thread status, CPU time, and blocking time returned by the detection command thread, it is determined whether there are problems such as thread deadlocks or long-term resource occupation.
[0103] Based on this, by implementing remote diagnosis of each server in a distributed architecture through arthas detection program, it can greatly help operation and maintenance personnel reduce the time consumed in troubleshooting problems and ensure the reliability of the system. By integrating arthas into the existing monitoring and management platform, the operation and maintenance team can remotely control multiple JVM instances, obtain the application status in real time, quickly locate and solve problems, help operation and maintenance personnel reduce the time consumed in troubleshooting problems, and at the same time be able to quickly respond and repair based on the problems in the follow-up to ensure the reliability of the system.
[0104] Further, after returning the detection information to the client, it further includes: determining, by the client based on the detection information, application fault information corresponding to the target application; obtaining a repair instruction corresponding to the application fault information, and sending the repair instruction to the target server; and repairing, by the target server based on the repair instruction, the target application.
[0105] Among them, the application fault information can be understood as specific fault problems in the application thread determined based on the detection information. For example, a certain thread is in a deadlock state, or the database query statement takes a long time, etc. Due to these problems, the target application has a problem of slow response. Therefore, operation and maintenance personnel need to perform corresponding repairs on the specific fault problems identified.
[0106] In practical applications, since operation and maintenance personnel remotely troubleshoot faults through the client, some temporary measures can be taken based on the diagnosis results to alleviate the problems, that is, sending a repair instruction to the target server for the application fault information through the client. The repair instruction can also carry the corresponding application identifier or server identifier, so that the repair instruction can be correctly sent to the corresponding target server, and the target server repairs the specified problem of the target application based on the repair instruction. In specific cases, the Java bytecode instrumentation technology can also be used to perform temporary repairs on the application service without changing the original code.
[0107] In a specific embodiment of this specification, it is confirmed through the detection information that the application thread corresponding to the target application is in a deadlock state, and a database query statement takes a particularly long time. Based on the detection information, the repair instruction is determined to restart the service instance. After sending the repair instruction to the target server, the target server will repair the target application based on the repair instruction.
[0108] Based on this, operation and maintenance personnel can not only remotely detect the application services deployed on each server in the distributed cluster through the client, but also remotely repair the detected fault problems, helping operation and maintenance personnel quickly locate and solve problems. Correspondingly, in the follow-up, operation and maintenance personnel can also directly enter the target server to completely repair the problem by modifying the underlying code.
[0109] Step 2064: When the first processing server is not the target server, forward the application detection request to the target server through the first processing server, where the target server is used to call the detection program to detect the target application.
[0110] In practical applications, after sending the application detection request to other servers except the target server according to the load balancing policy, other servers will perform request forwarding operations. Specifically, when the first processing server determines that the target server is not itself based on the application identification information, it will forward the application request to the corresponding target server, so that the target server continues to detect the target application in response to the application detection request.
[0111] In a specific embodiment of this specification, referring to the above example, Server B is the first processing server. After the server determines that the target server is Server A through the application identification information in the application detection request, it will forward the application detection request to Server A, and Server A will call the detection program to detect the target application.
[0112] Based on this, through the message forwarding ability between servers, the client can diagnose the application programs deployed on any server in the distributed cluster, improving the detection efficiency.
[0113] Further, forwarding the application detection request to the target server includes: determining the communication information of the target server by the first processing server, and establishing a communication channel based on the communication information, where the communication channel is used for communication between the first processing server and the target server; sending the application detection request to the target server based on the communication channel.
[0114] Among them, the communication information can be understood as communication information such as the address information and port information of the target server. A communication channel is established with the target server through the communication information, and then the application detection request is sent to the target server based on the communication channel.
[0115] In practical applications, the first processing server can determine the IP address of the target server by domain name resolution or directly specifying a static IP, then determine the specific port number on the target server that listens for WebSocket requests, establish a WebSocket connection with the target server through the determined IP address and port number, and a communication channel can be established after the connection. The communication channel negotiates the communication ports of both parties, and the first processing server and the target server can perform message interaction according to the established WebSocket protocol format.
[0116] Based on this, message interaction is carried out between servers through the WebSocket protocol, eliminating the need to repeatedly establish connections, reducing the handshake time for each communication, lowering the message transmission delay, and thus improving the detection efficiency of the application program.
[0117] In summary, this specification provides an application detection method. It realizes receiving an application detection request for a target application through a client. An operation and maintenance personnel can perform application detection on applications deployed on multiple servers through a uniformly managed client. During the application detection process, the client will send the application detection request to one of the multiple servers as the first processing server. The first processing server will determine whether it is the target server based on the application detection request. If the first processing server is the target server, it will directly respond to the application detection request and call the detection program to detect the target application. If the first processing server is not the target server, it will forward the application detection request to the target server, and the target server will respond to the application detection request. Thus, it can not only uniformly manage and maintain multiple servers with a distributed structure, but also, on the premise that the system does not shut down, deeply detect the target application through a detection program with the same operating environment as the target application, improving the application detection efficiency and detection real-time rate.
[0118] See Figure 3 , Figure 3 which shows a system flow chart of an application detection system provided according to an embodiment of this specification. The system includes a client 302 and at least two servers. Among them,
[0119] the client 302 is used to receive an application detection request for a target application and send the application detection request to the first processing server, where the client is used to detect applications deployed on at least two servers;
[0120] the first processing server 304 is used to determine the target server among the at least two servers based on the application detection request;
[0121] when the first processing server is the target server, in response to the application detection request, it calls the detection program to detect the target application, where the detection program has the same operating environment as the target application;
[0122] when the first processing server is not the target server, it forwards the application detection request to the target server, where the target server is used to call the detection program to detect the target application.
[0123] In a specific embodiment of this specification, the application detection system may be an operation and maintenance system used by the service provider. Through the application detection system, the operation and maintenance personnel of the service provider can manage the application services deployed on each server in a centralized and unified manner. For example, if the service provider deploys a shopping platform in a distributed architecture and encounters performance bottleneck problems during peak periods, the operation and maintenance personnel need to diagnose the microservices applications on multiple servers under the distributed architecture. By logging in to the centralized management platform through the client, corresponding monitoring programs can be installed on each server in advance, enabling the operation and maintenance personnel to view the running status information of the application processes on each server. In the case where a specific application needs to be diagnosed and detected, remote diagnosis can be directly performed through the client, that is, an application detection request is sent to the first processing server through the client. The first processing server determines whether it is the target server, and subsequently, the target server responds to the application detection request to detect the target application, thereby helping the operation and maintenance personnel troubleshoot problems, improving the troubleshooting efficiency, enabling the service provider to ensure the reliability and stability of the service system, and avoiding bringing a bad service experience to users.
[0124] An application detection system provided in this specification, the system includes a client and at least two servers. Among them, the client is used to receive an application detection request for a target application and send the application detection request to the first processing server. Among them, the client is used to detect the applications deployed on at least two servers; the first processing server is used to determine the target server among the at least two servers based on the application detection request; in the case where the first processing server is the target server, in response to the application detection request, call the detection program to detect the target application, where the detection program is the same as the running environment of the target application; in the case where the first processing server is not the target server, forward the application detection request to the target server, where the target server is used to call the detection program to detect the target application.
[0125] By receiving an application detection request for a target application through a client, an operation and maintenance personnel can perform application detection on applications deployed on multiple servers through a uniformly managed client. During the application detection process, the client will send the application detection request to one of the multiple servers as the first processing server. The first processing server will determine whether it is the target server according to the application detection request. If the first processing server is the target server, it will directly respond to the application detection request and call the detection program to detect the target application. If the first processing server is not the target server, it will forward the application detection request to the target server, and the target server will respond to the application detection request. In this way, not only can the multiple servers with a distributed structure be uniformly managed and maintained, but also the target application can be deeply detected through a detection program with the same operating environment as the target application without system downtime, improving the application detection efficiency and detection real-time rate.
[0126] The following combines the attached Figure 4 , taking the application of the application detection method provided in this specification for diagnosis in a distributed scenario as an example, to further illustrate the application detection method. Among them, Figure 4 is the processing procedure flowchart of an application detection method provided by an embodiment of this specification, which specifically includes the following steps.
[0127] Step 402: Determine the operating environment of the target application by the client in response to a program installation instruction for the target application.
[0128] In a specific embodiment of this specification, the service provider deploys a shopping application through a distributed architecture, and microservice applications of the shopping application are deployed on multiple servers, such as query user information service, recommendation service, etc. During the online operation of the shopping service, the operation and maintenance personnel find that the query service has a problem of response delay, so they diagnose the service application. Log in to the management platform through the client to determine the server where the target application is located and its operating environment.
[0129] Step 404: Send the program installation package of the detection program to the target server corresponding to the target application, and install the detection program based on the program installation package in the operating environment through the target server.
[0130] In a specific embodiment of this specification, confirm whether the arthas detection program has been installed on the server. If not, send the program installation package to the server for program installation. After installation, start arthas and attach it to the specified application process.
[0131] Step 406: Receive an application detection request for the target application through the client, and send the application detection request to the load balancing server through the client.
[0132] In a specific embodiment of this specification, the operation and maintenance personnel generate an application detection request through the client and send the application detection request to the load balancing server.
[0133] Step 408: Based on a preset balancing policy, the load balancing server determines a first processing server among at least two servers and forwards the application detection request to the first processing server.
[0134] In a specific embodiment of this specification, the load balancing server determines a first processing server from multiple servers in the distributed cluster according to the load balancing policy and sends the application detection request to the first processing server.
[0135] Step 410: The first processing server obtains the application identification information carried in the application detection request and determines a target server among at least two servers based on the application identification information.
[0136] In a specific embodiment of this specification, the first processing server is server A. The first processing server determines that the target application for the query service is the application identification according to the application identification information in the application detection request, and searches for the corresponding registration relationship in the database according to the application identification, so as to determine that the target server corresponding to the query service is server B.
[0137] Step 412: The first processing server determines the communication information of the target server and establishes a communication channel based on the communication information, where the communication channel is used for communication between the first processing server and the target server.
[0138] In a specific embodiment of this specification, server A obtains the communication information of server B, including the IP address, port number, etc., and establishes a WebSocket protocol connection with server B based on the communication information, and performs information interaction according to the established communication channel.
[0139] Step 414: Send the application detection request to the target server based on the communication channel.
[0140] In a specific embodiment of this specification, server A sends the application detection request to server B through the communication channel.
[0141] Step 416: The target server determines a detection command according to the application detection request, calls a detection program to detect the target application according to the detection command, obtains detection information corresponding to the detection command, and returns the detection information to the client.
[0142] In a specific embodiment of this specification, the target server detects the target application according to the detection command thread in the application detection request, determines the thread state of the target application, and returns the detected thread state as detection information to the client.
[0143] Step 418: The client determines the application fault information corresponding to the target application based on the detection information, obtains the repair instruction corresponding to the application fault information, and sends the repair instruction to the target server.
[0144] In a specific embodiment of this specification, the operation and maintenance personnel discover that the target application is in a locked state based on the thread state, generate a corresponding repair instruction for this fault information, such as using the redefine command to dynamically modify the class to temporarily repair the problem without stopping the machine until the next redeployment of the application, and send the repair instruction to the target server.
[0145] Step 420: The target server repairs the target application based on the repair instruction.
[0146] Based on this, by the client receiving the application detection request for the target application, the operation and maintenance personnel can perform application detection on the applications deployed on multiple servers through the uniformly managed client. During the application detection process, the client will send the application detection request to one of the multiple servers and use it as the first processing server. The first processing server will determine whether it is the target server according to the application detection request. If the first processing server is the target server, it will directly respond to the application detection request and call the detection program to detect the target application. If the first processing server is not the target server, it will forward the application detection request to the target server, and the target server will respond to the application detection request. Thus, not only can the multiple servers with a distributed structure be uniformly managed and maintained, but also the target application can be deeply detected through the detection program with the same operating environment as the target application without stopping the system, improving the application detection efficiency and detection real-time rate.
[0147] Corresponding to the above method embodiment, this specification also provides an embodiment of an application detection device. Figure 5 It is a schematic structural diagram of an application detection device provided by an embodiment of this specification. As Figure 5 shown, the device includes:
[0148] A sending module 502, configured to receive an application detection request for a target application through the client and send the application detection request to the first processing server, where the client is used to detect the applications deployed on at least two servers;
[0149] Determination module 504, configured to determine a target server among the at least two servers by the first processing server based on the application detection request;
[0150] Detection module 5062, configured to, when the first processing server is the target server, call a detection program by the first processing server to detect the target application in response to the application detection request, wherein the detection program has the same operating environment as the target application;
[0151] Forwarding module 5064, configured to, when the first processing server is not the target server, forward the application detection request to the target server by the first processing server, wherein the target server is used to call the detection program to detect the target application.
[0152] Optionally, the device further includes an installation module, configured to determine the operating environment of the target application by the client in response to a program installation instruction for the target application; send the program installation package of the detection program to the target server corresponding to the target application, and install the detection program based on the program installation package in the operating environment by the target server.
[0153] Optionally, the installation module is further configured to perform program installation detection on the operating environment by the client, start the detection program when the detection program exists in the operating environment; and continue to execute sending the program installation package of the detection program to the target server corresponding to the target application when the detection program does not exist in the operating environment.
[0154] Optionally, the sending module 502 is further configured to send the application detection request to a load balancing server by the client; determine a first processing server among the at least two servers by the load balancing server based on a preset balancing policy, and forward the application detection request to the first processing server.
[0155] Optionally, the determination module 504 is further configured to obtain application identification information carried in the application detection request by the first processing server; determine a target server among the at least two servers based on the application identification information.
[0156] Optionally, the determination module 504 is further configured to perform a lookup in an application registration database by the first processing server based on the application identification information, determine an application registration relationship corresponding to the target application according to the lookup result; and determine a target server among the at least two servers based on the application registration relationship.
[0157] Optionally, the forwarding module 5064 is further configured to determine communication information of the target server through the first processing server, and establish a communication channel based on the communication information, where the communication channel is used for communication between the first processing server and the target server; and send the application detection request to the target server based on the communication channel.
[0158] Optionally, the detection module 5062 is further configured to determine a detection command according to the application detection request through the first processing server; call the detection program to detect the target application according to the detection command, obtain detection information corresponding to the detection command, and return the detection information to the client.
[0159] Optionally, the device further includes a repair module, configured to determine application fault information corresponding to the target application based on the detection information through the client; obtain a repair instruction corresponding to the application fault information, and send the repair instruction to the target server; and repair the target application by the target server based on the repair instruction.
[0160] This specification provides an application detection device, including a sending module configured to receive an application detection request for a target application through a client and send the application detection request to a first processing server, where the client is used to detect applications deployed on at least two servers; a determination module configured to determine a target server among the at least two servers based on the application detection request through the first processing server; a detection module configured to, when the first processing server is the target server, call a detection program to detect the target application in response to the application detection request through the first processing server, where the detection program has the same operating environment as the target application; and a forwarding module configured to, when the first processing server is not the target server, forward the application detection request to the target server through the first processing server, where the target server is used to call the detection program to detect the target application. It realizes receiving an application detection request for a target application through a client. An operation and maintenance personnel can perform application detection on applications deployed on multiple servers through a uniformly managed client. During the application detection process, the client will send the application detection request to one of the multiple servers as the first processing server. The first processing server will determine whether it is the target server according to the application detection request. When the first processing server is the target server, it directly responds to the application detection request and calls the detection program to detect the target application. When the first processing server is not the target server, it forwards the application detection request to the target server, and the target server responds to the application detection request. Thus, it can not only perform unified management and maintenance on multiple servers with a distributed structure, but also deeply detect the target application through a detection program with the same operating environment as the target application without system downtime, improving the application detection efficiency and detection real-time rate.
[0161] The above is a schematic solution of an application detection device in this embodiment. It should be noted that the technical solution of this application detection device and the technical solution of the above application detection method belong to the same concept. For the details not described in detail in the technical solution of the application detection device, reference can be made to the description of the technical solution of the above application detection method.
[0162] Figure 6 It is a structural block diagram of a computing device 600 provided by an embodiment of this specification. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 through a bus 630, and a database 650 is used to store data.
[0163] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of such networks include the Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.
[0164] In one embodiment of the present specification, the above components of the computing device 600 and Figure 6 other components not shown therein may also be connected to each other, for example, via a bus. It should be understood that Figure 6 the block diagram of the computing device shown is for illustrative purposes only and is not a limitation on the scope of the present specification. Those skilled in the art may add or replace other components as needed.
[0165] The computing device 600 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.) or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 600 can also be a mobile or stationary server.
[0166] Wherein, the processor 620 is used to execute the following computer-executable instructions, and when the computer-executable instructions are executed by the processor, the steps of the above application detection method are implemented.
[0167] The above is a schematic solution of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above application detection method belong to the same concept. For the details not described in detail in the technical solution of the computing device, reference can be made to the description of the technical solution of the above application detection method.
[0168] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above application detection method.
[0169] The above is a schematic solution of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above application detection method belong to the same concept. For the details not described in detail in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above application detection method.
[0170] An embodiment of this specification also provides a computer program product including a computer program or instructions, which, when executed by a processor, implement the steps of the above application detection method.
[0171] The above is a schematic solution of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above application detection method belong to the same concept. For the details not described in detail in the technical solution of the computer program product, reference can be made to the description of the technical solution of the above application detection method.
[0172] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain implementations, multitasking and parallel processing are also possible or may be advantageous.
[0173] The computer instructions include computer program code, which may be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memories, read-only memories (ROMs), random access memories (RAMs), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0174] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the embodiments of this specification are not limited by the described action sequence, because according to the embodiments of this specification, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of this specification.
[0175] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0176] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The alternative embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can understand and utilize this specification well.
Claims
1. An application detection method, comprising: Receiving an application detection request for a target application through a client, and sending the application detection request to a first processing server, wherein the client is used to detect applications deployed on at least two servers; Determining, by the first processing server, a target server among the at least two servers based on the application detection request; In the case where the first processing server is the target server, the first processing server calls a detection program in response to the application detection request to detect the target application, wherein the detection program has the same operating environment as the target application; In the case that the first processing server is not the target server, the application detection request is forwarded to the target server through the first processing server, wherein the target server is used to call the detection program to detect the target application.
2. The method according to claim 1, before receiving, through the client, an application detection request for the target application, further comprising: Determining, by a client, an operating environment of the target application in response to a program installation instruction for the target application; The program installation package of the detection program is sent to a target server corresponding to the target application, and the detection program is installed in the operating environment based on the program installation package by the target server.
3. The method according to claim 2, before sending the program installation package of the detection program to the target server corresponding to the target application, further comprises: Performing a program installation detection on the operating environment through the client, and starting the detection program if the detection program exists in the operating environment; In the case that the detection program does not exist in the operating environment, the program installation package of the detection program is continued to be sent to the target server corresponding to the target application.
4. The method according to claim 1, sending the application detection request to the first processing server, comprising: Sending the application detection request to the load balancing server through the client; The load balancing server determines a first processing server among the at least two servers based on a preset balancing strategy, and forwards the application detection request to the first processing server.
5. The method according to claim 1, determining, by the first processing server, a target server among at least two servers based on the application detection request, comprises: Acquire, through the first processing server, the application identification information carried in the application detection request; A target server is determined among the at least two servers based on the application identification information.
6. The method according to claim 5, determining a target server among the at least two servers based on the application identification information, comprising: Searching, by the first processing server, in an application registration database based on the application identification information, and determining, according to the search result, an application registration relationship corresponding to the target application; A target server is determined among the at least two servers based on the application registration relationship.
7. The method according to claim 1, forwarding the application detection request to the target server, comprising: Determining communication information of the target server through the first processing server, and establishing a communication channel based on the communication information, wherein the communication channel is used for communication between the first processing server and the target server; The application detection request is sent to the target server based on the communication channel.
8. The method according to claim 1, calling a detection program to detect the target application in response to the application detection request, comprises: Determining, by the first processing server, a detection command according to the application detection request; The detection program is called to detect the target application according to the detection command, to obtain detection information corresponding to the detection command, and to return the detection information to the client.
9. The method according to claim 8, after returning the detection information to the client, further comprises: Determining, by the client based on the detection information, application fault information corresponding to the target application; Obtaining a repair instruction corresponding to the application fault information, and sending the repair instruction to the target server; The target application is repaired by the target server based on the repair instruction.
10. An application detection system, comprising a client and at least two servers, wherein: The client is used to receive an application detection request for a target application and send the application detection request to a first processing server, wherein the client is used to detect the applications deployed on the at least two servers; The first processing server is configured to determine a target server among the at least two servers based on the application detection request; In the case where the first processing server is the target server, in response to the application detection request, calling a detection program to detect the target application, wherein the detection program and the target application have the same operating environment; In the case that the first processing server is not the target server, the application detection request is forwarded to the target server, wherein the target server is used to call the detection program to detect the target application.
11. An application detection device, comprising: a sending module, configured to receive an application detection request for a target application through a client, and send the application detection request to a first processing server, wherein the client is used to detect applications deployed on at least two servers; a determination module, configured to determine a target server among the at least two servers based on the application detection request through the first processing server; a detection module configured to, when the first processing server is the target server, call a detection program to detect the target application in response to the application detection request through the first processing server, wherein the detection program has the same operating environment as the target application; The forwarding module is configured to forward the application detection request to the target server through the first processing server when the first processing server is not the target server, wherein the target server is used to call the detection program to detect the target application.
12. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the application detection method described in any one of claims 1 to 9 are implemented.
13. A computer-readable storage medium, characterized in that: It stores computer executable instructions, which, when executed by a processor, can implement the steps of the application detection method described in any one of claims 1 to 9.
14. A computer program product, characterized in that The invention comprises a computer program or an instruction, which, when executed by a processor, implements the steps of the application detection method according to any one of claims 1 to 9.