Server link detection method and device
By detecting the link connection status between application servers and generating alarm information, the problem of not being able to be timely discovered and handled when links are interrupted in the prior art is solved, automatic detection of application server links and timely identification of abnormal links are realized, and the stability and reliability of the application are improved.
Patent Information
- Application Number
- CN202411743233.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The prior art lacks effective methods to detect link connection status between application servers, resulting in the inability to detect and process in time when links are interrupted.
It provides a method and device for detecting a server link, and realizes automatic detection of links between application servers and timely identification of abnormal links by obtaining link information of application servers, determining the initiating server, verifying the link connection status and generating alarm information.
It realizes automatic detection of links between application servers and timely identification of abnormal links, ensuring that operation and maintenance personnel can deal with link disconnection problems in a timely manner, and improves the stability and reliability of applications.
Smart Images

Figure CN119520341A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for detecting a server link. Background Art
[0002] With the rapid development of Internet technology and cloud computing technology, more and more application servers are providing services to users. Usually, links are built between application servers, and access and calling between application servers are achieved through links, thereby realizing various functions of applications. During the operation of application servers, the links between application servers may be interrupted due to the influence of network status, resulting in the inability of applications to provide services to users normally.
[0003] Currently, there is a lack of a method for detecting the connection status of links between application servers. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a method and device for detecting a server link, which can detect the connection status of links between application servers and prompt abnormal links.
[0005] The technical solutions provided by the embodiments of this application are as follows:
[0006] In a first aspect, the present application provides a method for detecting a server link, the method comprising:
[0007] Acquire link information of a first application server, where the link information includes first information of the first application server and second information of a second application server, where the first application server is connected to the second application server through a target link;
[0008] Acquire established link information and link information waiting for connection, and determine an initiating server among the first application server and the second application server according to the established link information and the link information waiting for connection;
[0009] determining, according to the second information, an application type of the second application server;
[0010] Verifying the connection status of the target link according to the application type of the initiating server to obtain a verification result;
[0011] If the target link is determined to be an abnormal link according to the verification result, an alarm message is generated.
[0012] In a possible implementation manner, obtaining the link information of the first application server includes:
[0013] Obtaining first network statistical data by executing the netstat command, where the first network statistical data includes a network address and an interface of the first application server, and a network address and an interface and a connection protocol of the second application server;
[0014] The link information of the first application server is extracted from the first network statistical data.
[0015] In a possible implementation, the acquiring the established link information and the waiting-to-connect link information, and determining the initiating server of the first application server and the second application server according to the established link information and the waiting-to-connect link information, includes:
[0016] Execute the netstat -an command to obtain second network statistical data, where the second network statistical data includes information about established links and information about links waiting to be connected, where the established link information includes information about the target link;
[0017] If the information of the target link is found in the waiting-to-connect link information, determining that the second application server is the initiating server;
[0018] If the information of the target link is not found in the waiting-to-connect link information, it is determined that the first application server is the initiating server.
[0019] In a possible implementation manner, determining the application type of the second application server according to the second information includes:
[0020] querying the second information in a management database to obtain the server type to which the second information belongs;
[0021] An application type of the second application server is determined according to the server type.
[0022] In a possible implementation manner, determining the application type of the second application server according to the server type includes:
[0023] If the server type is an off-cloud application server, query the management database for an application type corresponding to the second information;
[0024] If the server type is a cloud cluster node, the application type corresponding to the second information is queried on the second application server.
[0025] In a possible implementation, verifying the connection status of the target link according to the application type of the initiating server includes:
[0026] If the application type of the initiating server is a cloud application, determine the cloud cluster to which the initiating server belongs through the network address of the initiating server, and call the network verification interface of the cloud cluster to verify the connection status of the target link;
[0027] If the application type of the initiating server is a cloud application, the calling agent verifies the connection status of the target link.
[0028] In a possible implementation, the method further includes:
[0029] Determining that the first information and the second information are not recorded, determining that the target link is a newly added link, and generating first abnormal behavior prompt information;
[0030] or,
[0031] It is determined that the target link has not been accessed for a period of time exceeding a period threshold, that the target link is a long-term no-traffic link, and that second abnormal behavior prompt information is generated.
[0032] In a second aspect, the present application provides a server link detection device, the device comprising:
[0033] A first acquisition unit is used to acquire link information of a first application server, where the link information includes first information of the first application server and second information of a second application server, and the first application server is connected to the second application server through a target link;
[0034] A first determining unit, configured to obtain established link information and link information waiting for connection, and determine an initiating server among the first application server and the second application server according to the established link information and the link information waiting for connection;
[0035] A second determining unit, configured to determine an application type of the second application server according to the second information;
[0036] A verification unit, configured to verify the connection status of the target link according to the application type of the initiating server, and obtain a verification result;
[0037] An alarm unit is used to generate an alarm message if the target link is determined to be an abnormal link according to the verification result.
[0038] In a possible implementation, the first acquisition unit is specifically used to acquire first network statistical data by executing a netstat command, where the first network statistical data includes a network address and an interface of a first application server, and a network address and an interface and a connection protocol of the second application server; and extract link information of the first application server from the first network statistical data.
[0039] In a possible implementation, the first determination unit is specifically used to execute the netstat -an command to obtain second network statistical data, wherein the second network statistical data includes established link information and waiting-to-connect link information, and the established link information includes information of the target link; if the information of the target link is queried in the waiting-to-connect link information, it is determined that the second application server is the initiating server; if the information of the target link is not queried in the waiting-to-connect link information, it is determined that the first application server is the initiating server.
[0040] In a possible implementation, the second determination unit is specifically configured to query a management database for the second information to obtain a server type to which the second information belongs; and determine an application type of the second application server according to the server type.
[0041] In a possible implementation manner, the second determining unit is configured to determine the application type of the second application server according to the server type, including:
[0042] The second determination unit is used to query the application type corresponding to the second information from the management database if the server type is a cloud application server; if the server type is a cloud cluster node, query the application type corresponding to the second information on the second application server.
[0043] In a possible implementation, the verification unit is specifically used to determine the cloud cluster to which the initiating server belongs through the network address of the initiating server if the application type of the initiating server is an on-cloud application, and call the network verification interface of the cloud cluster to verify the connection status of the target link; if the application type of the initiating server is an off-cloud application, call the agent to verify the connection status of the target link.
[0044] In a possible implementation manner, the device further includes:
[0045] a third determining unit, configured to determine that the first information and the second information are not recorded, determine that the target link is a newly added link, and generate first abnormal behavior prompt information;
[0046] or,
[0047] It is determined that the target link has not been accessed for a period of time exceeding a period threshold, that the target link is a long-term no-traffic link, and that second abnormal behavior prompt information is generated.
[0048] In a third aspect, the present application provides a device, including: a processor, a memory, and a system bus;
[0049] The processor and the memory are connected via the system bus;
[0050] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes the method described in any embodiment of the first aspect.
[0051] In a fourth aspect, the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a terminal device, the terminal device executes the method described in any implementation of the first aspect above.
[0052] It can be seen that the embodiments of the present application have the following beneficial effects:
[0053] The embodiment of the present application provides a method and device for detecting a server link, in which the link information of a first application server is obtained. The link information includes first information of the first application server and second information of a second application server connected to the first application server through a target link. The established link information and the link information waiting for connection are obtained, and the initiating server is determined according to the established link information and the link information waiting for connection. According to the second information, the application type of the second application server is determined. According to the application type of the initiating server, the connection status of the target link is verified to obtain a verification result. If it is determined that the target link is an abnormal link according to the verification result, an alarm message is generated. In this way, the information of the connected application server can be automatically obtained, and the connection status of the link between the application servers can be automatically detected according to the information of the application server. By detecting the link, when the link of the application server is disconnected, the abnormal link can be detected in time and an alarm message can be generated, so that the operation and maintenance personnel can handle the abnormal link in time, solve the problem of link disconnection, and improve the stability and reliability of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of a flow chart of a server link detection method provided in an embodiment of the present application;
[0055] Figure 2 A schematic diagram of second network statistical data provided in an embodiment of the present application;
[0056] Figure 3 A schematic diagram of a process for determining an application type provided in an embodiment of the present application;
[0057] Figure 4 A schematic diagram of a verification process provided in an embodiment of the present application;
[0058] Figure 5A schematic diagram of a process for identifying abnormal behavior provided in an embodiment of the present application;
[0059] Figure 6 A schematic diagram of the structure of a server link detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to facilitate the understanding and explanation of the technical solutions provided by the embodiments of the present application, the background technology of the present application will be described below.
[0061] In a distributed application environment, there are a large number of application servers. Application servers are distributed in the cloud environment or on-cloud environment. Links are established between application servers to facilitate access and call between application servers to achieve data exchange, thereby providing users with a variety of services through applications and realizing various functions of applications. The links between application servers are affected by the network status and the running status of the application servers. For example, network problems or other failures may be caused by network changes, cloud partition migration, etc., resulting in failures in the links between application servers and disconnection. It is difficult for application servers to interact normally.
[0062] Currently, heartbeat detection technology or network monitoring tools can be used to detect the links between application servers.
[0063] Heartbeat detection technology periodically sends heartbeat signals between application servers to detect the connection status between application servers. If an application server does not receive a heartbeat signal from another application server within a certain period of time, it is determined that the link between the application servers is disconnected and an alarm is generated. Heartbeat detection technology is more suitable for link detection between two specific and known application servers. For more complex scenarios of connections between application servers and scenarios for newly established links, it is difficult to achieve effective detection.
[0064] Network monitoring tools are specialized tools for detecting connectivity between application servers. When a network monitoring tool detects an abnormal link between application servers, it triggers an alarm based on predefined rules. Network monitoring tools usually monitor the entire network infrastructure and may not be flexible enough to detect links between specific application servers.
[0065] Therefore, the current link detection method is difficult to meet the requirements of link detection in scenarios where more complex links and more flexible link establishment are required.
[0066] Based on this, an embodiment of the present application provides a method and device for detecting a server link, in which the link information of a first application server is obtained. The link information includes first information of the first application server and second information of a second application server connected to the first application server through a target link. The established link information and the link information waiting for connection are obtained, and the initiating server is determined according to the established link information and the link information waiting for connection. According to the second information, the application type of the second application server is determined. According to the application type of the initiating server, the connection status of the target link is verified to obtain a verification result. If the target link is determined to be an abnormal link according to the verification result, an alarm message is generated. In this way, the information of the connected application server can be automatically obtained, and the connection status of the link between the application servers can be automatically detected according to the information of the application server. By detecting the link, when the link of the application server is disconnected, the abnormal link can be detected in time and an alarm message can be generated, so that the maintenance personnel can handle the abnormal link in time, solve the problem of link disconnection, and improve the stability and reliability of the application.
[0067] The server link detection method provided in the embodiment of the present application is applied to the operation center of the operation and maintenance platform. The operation center of the operation and maintenance platform provides automatic operation and maintenance service capabilities, mainly including a monitoring center, an operation center, a delivery center, and a log center, a total of four center modules.
[0068] In order to facilitate understanding of the technical solution provided by the embodiment of the present application, a server link detection method provided by the embodiment of the present application is described below with reference to the accompanying drawings.
[0069] See also Figure 1 As shown in FIG. 1 , this figure is a flow chart of a method for detecting a server link provided in an embodiment of the present application. Figure 1 As shown, a server link detection method provided in an embodiment of the present application includes S101-S105.
[0070] S101: Acquire link information of a first application server, where the link information includes first information of the first application server and second information of a second server. The first application server is connected to the second application server via a target link.
[0071] The first task of implementing link verification between application servers is to obtain the network link between the application servers. The first application server is any one of the application servers that need to detect the link.
[0072] Obtain link information of the first application server.
[0073] In a possible implementation, the first network statistical data is obtained by executing the netstat command. The netstat command is a command for displaying network connections in a computer network. By executing the netstat command, the currently active network connection, listening port, routing table information, and statistical data of the network interface can be obtained. The first network statistical data includes the network address and interface of the first application server, the network address and interface of the second application server connected to the first application server, and the connection protocol between the second application server connected to the first application server. In addition, the first network statistical data also includes the data collection time and the application number of the first application server. The first network statistical data can be registered in a local data table of the operation center of the operation and maintenance platform.
[0074] Link information of the first application server is extracted from the first network statistical data.
[0075] The link information of the first application server includes the first information of the first application server and the second information of the second server. The second application server is an application server connected to the first application server. The first application server and the second application server are connected through a target link. The first information of the first application server includes, for example, the network address and the interface (Port) of the first application server. The network address is, for example, an Internet Protocol (IP) address. The second information of the second application server includes, for example, the network address and the interface of the second application server.
[0076] S102: Acquire established link information and waiting-to-connect link information, and determine an initiating server among the first application server and the second application server according to the established link information and the waiting-to-connect link information.
[0077] The link information obtained by the netstat command does not include information about the link transmission direction. Further analyze the link information to identify the transmission direction of the target link.
[0078] In a possible implementation, the netstat -an command is executed to obtain second network statistical data. The second network statistical data includes established link information and waiting-to-connect link information. The target link is an established link. The established link information includes information of the target link. The transmission direction of the target link is determined based on the established link information and the waiting-to-connect link information.
[0079] See also Figure 2As shown in the figure, the second network statistics obtained by executing the netstat -an command include four parts, namely protocol, local address, external address and status. The link is established in box ② with the status of ESTABLISHED. The local address is the combination of the local IP and Port. The link direction is analyzed by the combination of IP+Port. The link is waiting for connection.
[0080] If the target link information is found in the waiting connection link information, the second application server is determined to be the initiating server. If the target link information is not found in the waiting connection link information, the first application server is determined to be the initiating server.
[0081] Specifically, Figure 2 For example, the P port of the target link in box ② is searched in the port in box ①. If the P port of the target link is found in the information of the link waiting to be connected, the first application server is determined to be the receiving server and the second application server is the initiating server. If the P port of the target link is not found in the information of the link waiting to be connected, the first application server is determined to be the initiating server and the second application server is the receiving server.
[0082] S103: Determine the application type of the second application server according to the second information.
[0083] Through the above steps, the target link and link direction between the application servers can be obtained. It is also necessary to determine the application corresponding to the second application server so as to subsequently locate the application that has problems due to the target link failure.
[0084] The application type of the second application server is, for example, an on-cloud application or an off-cloud application. An on-cloud application refers to an application program that belongs to the cloud. An off-cloud application refers to an application program that does not belong to the cloud.
[0085] As an example, the second information is queried in the management database to obtain the server type to which the second information belongs. The management database is a centralized database that stores various configuration items in the information technology environment. The configuration items included in the management database may be hardware, software, network equipment, services, documents, etc., and the relationships and attributes between them are recorded in the management database. Specifically, the management database is used to maintain the correspondence between the server type and the IP address.
[0086] Specifically, through the IP address of the second application server included in the second information, the technology stack to which the IP address belongs, that is, the source of the IP address, is queried in the management database to determine the server type of the second application server. The sources of the IP address mainly include: operating system IP, cloud cluster node IP, load balancing virtual server IP, and load balancing itself IP. Among them, the cloud cluster node IP corresponds to the server type of the cloud cluster node on the cloud. The operating system IP, load balancing virtual server IP, and load balancing itself IP correspond to the server type of the cloud application server under the cloud.
[0087] According to the server type, the application type of the second application server is determined.
[0088] Specifically, if the server type is a cloud application server, the application type corresponding to the second information is queried from the management database. The management database is also used to maintain the corresponding relationship between the application server and the application type.
[0089] If the server type is a cloud cluster node, the application type corresponding to the second information is queried on the second application server.
[0090] See also Figure 3 As shown, the figure is a schematic diagram of a process for determining an application type provided in an embodiment of the present application.
[0091] For the application server under the cloud, the application module information corresponding to the partition under the cloud can be queried in real time through the management database to identify the application type of the second application server.
[0092] For a cloud cluster node, the application type of the second application server can be determined by locating the corresponding node according to the path of "connected Port->process ID->application on the cloud".
[0093] In addition, for cloud cluster nodes, it is also possible to identify the load balancing virtual server address corresponding to the route based on the routing information in the distributed application interconnection link, obtain the cloud cluster list where the consumer is located through the management database, call the cloud cluster interface, and implement the link verification between the cluster and the load balancing virtual server. The application type is identified based on the cloud partition address of the second application server and the cloud cluster node address, which facilitates the location of specific target link problems.
[0094] S104: Verify the connection status of the target link according to the application type of the initiating server to obtain a verification result.
[0095] The initiating server is the server that initiates the interaction. The initiating server is determined based on the transmission direction of the target link. According to the application type of the initiating server, the corresponding initiation verification method is adopted to verify the connection status of the target link.
[0096] When the initiating server is the second application server, the verification policy is determined according to the application type determined in S103. When the initiating server is the first application server, the application type of the first application server is obtained, and the verification policy is determined according to the application type of the first application server.
[0097] Different verification strategies are adopted for applications running in the cloud environment and applications running in the off-cloud environment.
[0098] See also Figure 4 As shown, this figure is a schematic diagram of a verification process provided in an embodiment of the present application.
[0099] As an example, if the application type of the initiating server is a cloud application, the cluster name of the cloud cluster to which the initiating server belongs is determined through the network address of the initiating server, and the network verification interface of the cloud cluster is called to verify the connection status of the target link.
[0100] If the initiating server belongs to the cloud environment, the proxy is called to verify the connection status of the target link.
[0101] Specifically, the connection status of the target link can be verified by using a Telnet verification tool, which is a tool for testing network connections and is used to check whether a server port is open.
[0102] In a possible implementation, when there are many target links to be verified, they can be classified into two types: real-time data bus and other links except real-time data bus. Real-time data bus is a real-time data transmission channel between applications, which realizes real-time data transmission between applications, between databases, and between databases and applications.
[0103] The verification result includes at least the connection status of the target link.
[0104] S105: If the target link is determined to be an abnormal link according to the verification result, an alarm message is generated.
[0105] Alarm information can be sent to pre-set operation and maintenance personnel so that they can promptly discover link failures, locate and solve problems in a timely manner.
[0106] Based on the above content, we can know that the netstat command is used to collect active network connections on the application server and record them in the local data table. By analyzing and comparing the collected network link data, the network verification strategy of the application is automatically generated, and verification is initiated regularly to realize automatic identification of abnormal links. In this way, it is possible to detect network disconnection between application servers due to omissions in certain links in scenarios such as network changes and partition migration. Finally, the operation and maintenance personnel are notified through alarm information so that they can locate and solve the problem in time to ensure normal network connection.
[0107] The server link detection method of the embodiment of the present application can realize automatic monitoring and disposal, reduce manual intervention, and improve operation and maintenance efficiency. In addition, it can be applied to application systems of different scales, has strong scalability, and can adapt to various scenarios. By directly calling the existing network verification function of the operation center of the operation and maintenance platform, compatibility is enhanced, and link verification is realized in a more agile way.
[0108] Furthermore, in a possible implementation, abnormal behavior of the target link can also be detected.
[0109] For details, see Figure 5 As shown, if it is determined that the first information and the second information are not recorded, it is determined that the target link is a newly added link, and a first abnormal behavior prompt information is generated. The newly added link may have a risk of being accessed by an unknown application server. The first information includes at least the IP address of the first application server, that is, the local IP address. The second information includes at least the IP address of the second application server, that is, the peer IP address.
[0110] If it is determined that the target link has not been accessed for a period of time exceeding the time threshold, the target link is determined to be a long-term no-traffic link, and a second abnormal behavior prompt message is generated. A long-term no-traffic link has a serious risk of the target link being disconnected for a long time. The time threshold is, for example, 7 days.
[0111] The first abnormal behavior prompt information and the second abnormal behavior prompt information are used to send an alarm to the application to which the target link with abnormal behavior belongs. In this way, the abnormal behavior changes between the application servers can be classified into more detailed abnormal behaviors. On the basis of verifying the link connection and disconnection, the links with abnormal behavior can be further detected, and reminders can be sent to the application in a timely manner.
[0112] Based on the server link detection method provided in the above method embodiment, the embodiment of the present application also provides a server link detection device, and the server link detection device will be described below in conjunction with the accompanying drawings.
[0113] See also Figure 6As shown in FIG. 1 , this figure is a schematic diagram of the structure of a server link detection device provided in an embodiment of the present application. Figure 6 As shown, the detection device of the server link includes:
[0114] A first acquiring unit 601 is configured to acquire link information of a first application server, where the link information includes first information of the first application server and second information of a second application server, where the first application server is connected to the second application server via a target link;
[0115] A first determining unit 602 is configured to obtain established link information and waiting-to-connect link information, and determine an initiating server among the first application server and the second application server according to the established link information and the waiting-to-connect link information;
[0116] A second determining unit 603 is used to determine the application type of the second application server according to the second information;
[0117] A verification unit 604, configured to verify the connection state of the target link according to the application type of the initiating server, and obtain a verification result;
[0118] The alarm unit 605 is configured to generate an alarm message if it is determined that the target link is an abnormal link according to the verification result.
[0119] In a possible implementation, the first acquisition unit 601 is specifically used to acquire first network statistical data by executing a netstat command, where the first network statistical data includes a network address and an interface of a first application server, and a network address and an interface and a connection protocol of the second application server; and extract link information of the first application server from the first network statistical data.
[0120] In a possible implementation, the first determination unit 602 is specifically used to execute the netstat -an command to obtain second network statistical data, where the second network statistical data includes established link information and waiting-to-connect link information, and the established link information includes information of the target link; if the information of the target link is queried in the waiting-to-connect link information, it is determined that the second application server is the initiating server; if the information of the target link is not queried in the waiting-to-connect link information, it is determined that the first application server is the initiating server.
[0121] In a possible implementation, the second determination unit 603 is specifically configured to query the second information in a management database to obtain a server type to which the second information belongs; and determine an application type of the second application server according to the server type.
[0122] In a possible implementation, the second determining unit 603 is configured to determine the application type of the second application server according to the server type, including:
[0123] The second determination unit 603 is used to query the application type corresponding to the second information from the management database if the server type is a cloud application server; if the server type is a cloud cluster node, query the application type corresponding to the second information on the second application server.
[0124] In one possible implementation, the verification unit 604 is specifically used to determine the cloud cluster to which the initiating server belongs through the network address of the initiating server if the application type of the initiating server is an on-cloud application, and call the network verification interface of the cloud cluster to verify the connection status of the target link; if the application type of the initiating server is an off-cloud application, call the agent to verify the connection status of the target link.
[0125] In a possible implementation manner, the device further includes:
[0126] a third determining unit, configured to determine that the first information and the second information are not recorded, determine that the target link is a newly added link, and generate first abnormal behavior prompt information;
[0127] or,
[0128] It is determined that the target link has not been accessed for a period of time exceeding a period threshold, that the target link is a long-term no-traffic link, and that second abnormal behavior prompt information is generated.
[0129] Based on a server link detection method provided by the above method embodiment, the present application provides a server link detection device, including: a processor, a memory, and a system bus;
[0130] The processor and the memory are connected via the system bus;
[0131] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes the server link detection method described in any of the above embodiments.
[0132] Based on a server link detection method provided in the above method embodiment, the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the server link detection method described in any of the above embodiments.
[0133] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0134] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0135] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0136] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0137] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting a server link, characterized in that: The method comprises: Acquire link information of a first application server, where the link information includes first information of the first application server and second information of a second application server, where the first application server is connected to the second application server through a target link; Acquire established link information and link information waiting for connection, and determine an initiating server among the first application server and the second application server according to the established link information and the link information waiting for connection; determining, according to the second information, an application type of the second application server; Verifying the connection status of the target link according to the application type of the initiating server to obtain a verification result; If the target link is determined to be an abnormal link according to the verification result, an alarm message is generated.
2. The method according to claim 1, characterized in that The obtaining the link information of the first application server includes: Obtaining first network statistical data by executing the netstat command, where the first network statistical data includes a network address and an interface of the first application server, and a network address and an interface and a connection protocol of the second application server; The link information of the first application server is extracted from the first network statistical data.
3. The method according to claim 1, characterized in that The acquiring the established link information and the waiting-to-connect link information, and determining the initiating server of the first application server and the second application server according to the established link information and the waiting-to-connect link information, comprises: Execute the netstat -an command to obtain second network statistical data, where the second network statistical data includes information about established links and information about links waiting to be connected, where the established link information includes information about the target link; If the information of the target link is found in the waiting-to-connect link information, determining that the second application server is the initiating server; If the information of the target link is not found in the waiting-to-connect link information, it is determined that the first application server is the initiating server.
4. The method according to claim 1, characterized in that: The determining, according to the second information, the application type of the second application server includes: querying the second information in a management database to obtain the server type to which the second information belongs; An application type of the second application server is determined according to the server type.
5. The method according to claim 4, characterized in that The determining, according to the server type, the application type of the second application server includes: If the server type is an off-cloud application server, query the management database for an application type corresponding to the second information; If the server type is a cloud cluster node, the application type corresponding to the second information is queried on the second application server.
6. The method according to claim 1, characterized in that The verifying the connection status of the target link according to the application type of the initiating server includes: If the application type of the initiating server is a cloud application, determine the cloud cluster to which the initiating server belongs through the network address of the initiating server, and call the network verification interface of the cloud cluster to verify the connection status of the target link; If the application type of the initiating server is a cloud application, the calling agent verifies the connection status of the target link.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determining that the first information and the second information are not recorded, determining that the target link is a newly added link, and generating first abnormal behavior prompt information; or, It is determined that the target link has not been accessed for a period of time exceeding a period threshold, that the target link is a long-term no-traffic link, and that second abnormal behavior prompt information is generated.
8. A server link detection device, characterized in that: The device comprises: A first acquisition unit is used to acquire link information of a first application server, where the link information includes first information of the first application server and second information of a second application server, and the first application server is connected to the second application server through a target link; A first determining unit, configured to obtain established link information and link information waiting for connection, and determine an initiating server among the first application server and the second application server according to the established link information and the link information waiting for connection; A second determining unit, configured to determine an application type of the second application server according to the second information; A verification unit, configured to verify the connection status of the target link according to the application type of the initiating server, and obtain a verification result; An alarm unit is used to generate an alarm message if the target link is determined to be an abnormal link according to the verification result.
9. A device, characterized in that: include: Processor, memory, system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, wherein the one or more programs include instructions, and when the instructions are executed by the processor, the processor executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Query routing in distributed database system
CN101465876A
Middleware state checking method and device, electronic equipment and readable storage medium
CN115242618A
Topological graph generation method and device
CN116962197A
Exception based quality assessment
US20140237453A1