A method and apparatus for detecting a server link
By acquiring application server link information and identifying transmission direction, and combining it with management database and verification interface, the problem of untimely link detection in existing technologies is solved, realizing automatic detection and alarm of application server links, and improving the stability and reliability of applications.
Patent Information
- Application Number
- CN202411743233.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Existing technologies lack effective methods to detect the connection status of links between application servers, resulting in the inability to detect link interruptions in a timely manner when network conditions change, which affects the stability and reliability of application services.
By obtaining the link information of the application server, the link information and transmission direction are determined using the netstat and netstat -an commands. The application type is identified by combining the management database, and the connection status of the target link is verified according to the application type. Alarm information is generated to indicate abnormal links.
It enables automatic detection of application server links, timely discovery of abnormal links and generation of alarm information, improves application stability and reliability, reduces manual intervention, and is suitable for complex and flexible link scenarios.
Smart Images

Figure CN119520341B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a server link detection method and device. BACKGROUND
[0002] With the rapid development of Internet technology and cloud computing technology, more and more application servers provide services for users. Usually, links are built between application servers, and access and calling between application servers are realized through the links, so as to realize various functions of the application. During the running of the application server, the link between the application servers may be interrupted due to the influence of the network state, resulting in that the application cannot normally provide services for users.
[0003] At present, there is no detection method for the connection state of the link between the application servers. SUMMARY
[0004] Therefore, the embodiments of the present application provide a server link detection method and device, which can detect the connection state of the link between the application servers and prompt the abnormal link.
[0005] The technical scheme provided by the embodiments of the present application is as follows:
[0006] In a first aspect, the present application provides a server link detection method, which comprises:
[0007] Obtaining link information of a first application server, wherein the link information comprises first information of the first application server and second information of a second application server, and the first application server is connected with the second application server through a target link;
[0008] Obtaining established link information and waiting connection link information, and determining an initiating server in the first application server and the second application server according to the established link information and the waiting connection link information;
[0009] Determining an application type of the second application server according to the second information;
[0010] Verifying the connection state of the target link according to the application type of the initiating server, and obtaining a verification result;
[0011] If the target link is determined to be an abnormal link according to the verification result, generating an alarm information.
[0012] In a possible implementation manner, the obtaining of the link information of the first application server comprises:
[0013] Obtaining first network statistics by executing a netstat command, the first network statistics including network addresses and interfaces of the first application server, network addresses and interfaces of the second application server, and a connection protocol;
[0014] Extracting link information of the first application server from the first network statistics.
[0015] In a possible implementation, the obtaining of the established link information and the waiting connection link information, and determining the initiating server from the first application server and the second application server according to the established link information and the waiting connection link information, comprises:
[0016] Executing a netstat-an command to obtain second network statistics, the second network statistics including established link information and waiting connection link information, the established link information including information of the target link;
[0017] If the information of the target link is found in the waiting connection 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 connection link information, determining that the first application server is the initiating server.
[0019] In a possible implementation, the determining of the application type of the second application server according to the second information, comprises:
[0020] Querying the second information in a management database to obtain a server type to which the second information belongs;
[0021] Determining the application type of the second application server according to the server type.
[0022] In a possible implementation, the determining of the application type of the second application server according to the server type, comprises:
[0023] If the server type is a cloud off application server, querying an application type corresponding to the second information from the management database;
[0024] If the server type is a cloud cluster node, querying the application type corresponding to the second information on the second application server.
[0025] In a possible implementation, the verifying of the connection state of the target link according to the application type of the initiating server, comprises:
[0026] If the application type of the initiating server is a cloud application, the cloud cluster to which the initiating server belongs is determined through the network address of the initiating server, and a network verification interface of the cloud cluster is called to verify the connection state of the target link.
[0027] If the application type of the initiating server is a cloud application, the cloud cluster to which the initiating server belongs is determined through the network address of the initiating server, and a network verification interface of the cloud cluster is called to verify the connection state of the target link.
[0028] In a possible implementation, the method further includes:
[0029] If the first information and the second information are not recorded, it is determined that the target link is a new link, and first abnormal behavior prompt information is generated;
[0030] Alternatively,
[0031] If the target link has not been accessed for a time period exceeding a time period threshold, it is determined that the target link is a long-term no-flow link, and second abnormal behavior prompt information is generated.
[0032] In a second aspect, the present application provides a server link detection device, which includes:
[0033] A first acquisition unit is configured to acquire link information of a first application server, the link information including first information of the first application server and second information of a second application server, and the first application server being connected to the second application server through a target link.
[0034] A first determination unit is configured to acquire established link information and waiting connection link information, and determine an initiating server in the first application server and the second application server according to the established link information and the waiting connection link information.
[0035] A second determination unit is configured to determine an application type of the second application server according to the second information.
[0036] A verification unit is configured to verify a connection state of the target link according to the application type of the initiating server, and obtain a verification result.
[0037] An alarm unit is configured to generate alarm information 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 configured to acquire first network statistics by executing a netstat command, the first network statistics including a network address and an interface of the first application server, a network address and an interface of the second application server, and a connection protocol; and the link information of the first application server is extracted from the first network statistics.
[0039] In a possible implementation, the first determining unit is specifically configured to execute a netstat-an command to obtain second network statistics, the second network statistics including established link information and waiting connection link information, the established link information including information of the target link; if the information of the target link is found in the waiting connection 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 connection link information, determining that the first application server is the initiating server.
[0040] In a possible implementation, the second determining unit 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.
[0041] In a possible implementation, 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 determining unit is configured to, if the server type is an off-cloud application server, query an application type corresponding to the second information from the management database; and 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 verifying unit is specifically configured to, if the application type of the initiating server is an on-cloud application, determine a cloud cluster to which the initiating server belongs through a network address of the initiating server, and call a network verification interface of the cloud cluster to verify the connection state of the target link; and if the application type of the initiating server is an off-cloud application, call an agent to verify the connection state of the target link.
[0044] In a possible implementation, the apparatus further includes:
[0045] The third determining unit is configured to determine that the first information and the second information are not recorded, determine that the target link is a new link, and generate first abnormal behavior prompt information.
[0046] Or,
[0047] Determine that the target link has not been accessed for a time length exceeding a time length threshold, determine that the target link is a long-term no-flow link, and generate second abnormal behavior prompt information.
[0048] In a third aspect, the present application provides an apparatus, including: a processor, a memory, a system bus;
[0049] The processor and the memory are connected through the system bus;
[0050] The memory is configured to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform the method of any of the embodiments of the first aspect.
[0051] In a fourth aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium storing instructions, when the instructions run on a terminal device, causing the terminal device to perform the method of any of the embodiments of the first aspect.
[0052] Therefore, the embodiments of the present application have the following beneficial effects:
[0053] The embodiments of the present application provide a server link detection method and device. In the method, 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. Established link information and waiting connection link information are obtained. An initiating server is determined according to the established link information and the waiting connection link information. An application type of the second application server is determined according to the second information. A connection state of the target link is verified according to the application type of the initiating server, and a verification result is obtained. If the target link is determined to be an abnormal link according to the verification result, an alarm information is generated. In this way, the information of the connected application server can be automatically obtained, and the connection state of the link between the application servers can be automatically detected according to the information of the application server. The link is detected, so that when the link of the application server is disconnected, the abnormal link can be detected in time and the alarm information 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 DRAWINGS
[0054] Figure 1 A flowchart of a server link detection method provided by the embodiments of the present application is shown;
[0055] Figure 2 A schematic diagram of second network statistical data provided by the embodiments of the present application is shown;
[0056] Figure 3 A flowchart of determining an application type provided by the embodiments of the present application is shown;
[0057] Figure 4 A verification flowchart provided by the embodiments of the present application is shown;
[0058] Figure 5A flowchart for identifying abnormal behavior provided by an embodiment of the present application;
[0059] Figure 6 A structural diagram of a server link detection device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to facilitate understanding and explanation of the technical solutions provided by the embodiments of the present application, the background art of the present application will be described first.
[0061] In a distributed application environment, there are a large number of application servers. The application servers are distributed in a cloud environment or a cloud environment. Links are established between the application servers in order to access and call between the application servers, to realize data exchange, so as to provide various services for users through the application, and to realize various functions of the application. The links between the application servers are affected by the network state and the running state of the application servers. For example, network problems or other faults caused by scenarios such as network changes and cloud partition migration may cause the links between the application servers to fail and the connection to be interrupted. The application servers are difficult to interact normally.
[0062] Currently, heartbeat detection technology or network monitoring tools can be used to detect the links between the application servers.
[0063] Heartbeat detection technology is to periodically send heartbeat signals between the application servers to detect the connection state between the application servers. If an application server does not receive a heartbeat signal from another application server within a certain 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 detecting the link between two specific and known application servers. For a more complex connection scenario between the application servers, and for a newly established link scenario, it is difficult to achieve effective detection.
[0064] Network monitoring tools are special tools for detecting the connectivity between application servers. In the case of detecting abnormal links between application servers, the network monitoring tool triggers an alarm according to the pre-defined rules. Network monitoring tools are usually for monitoring the entire network infrastructure, and may not be flexible enough for the detection of links between specific application servers.
[0065] Therefore, the current link detection method is difficult to meet the link detection in the scenario of more complex links and more flexible link establishment.
[0066] Based on this, the embodiment of the application provides a server link detection method and device. In the method, link information of a first application server is acquired. The link information comprises first information of the first application server and second information of a second application server connected with the first application server through a target link. Established link information and waiting connection link information are acquired, and an initiating server is determined according to the established link information and the waiting connection link information. 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 state of the target link is verified, and a verification result is obtained. If the target link is determined to be an abnormal link according to the verification result, alarm information is generated. In this way, the information of the connected application server can be automatically acquired, and the connection state of the link between the application servers can be automatically detected according to the information of the application server. By detecting the link, the abnormal link can be detected in time and the alarm information can be generated when the link of the application server is disconnected, so that the maintenance personnel can timely process the abnormal link, solve the problem of link disconnection, and improve the stability and reliability of the application.
[0067] The server link detection method provided by the embodiment of the application is applied to an operation center of an operation and maintenance platform. The operation and maintenance platform operation center 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 solutions provided by the embodiments of the application, a server link detection method provided by the embodiments of the application will be described below with reference to the drawings.
[0069] Referring to Figure 1 As shown in the figure, the figure is a flowchart of a server link detection method provided by the embodiment of the application. As Figure 1 As shown in the figure, the server link detection method provided by the embodiment of the application comprises S101-S105.
[0070] S101: Acquire link information of a first application server, the link information comprising first information of the first application server and second information of a second server, the first application server being connected with the second application server through a target link.
[0071] The first primary work to realize the link verification between the application servers is to acquire 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] Acquire the link information of the first application server.
[0073] In a possible implementation, the first network statistics are obtained by executing a netstat command. The netstat command is a command for displaying network connections in a computer network. By executing the netstat command, current active network connections, listening ports, routing table information, and network interface statistics can be obtained. The first network statistics include network addresses and interfaces of the first application server, network addresses and interfaces of the second application server connected to the first application server, and a connection protocol between the first application server and the second application server connected to the first application server. In addition, the first network statistics further include a collection time of data, and a number of applications of the first application server. The first network statistics can be registered in a local data table of an operation center of the operation and maintenance platform.
[0074] The link information of the first application server is extracted from the first network statistics.
[0075] The link information of the first application server includes first information of the first application server and 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, a network address and an 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, a network address and an interface of the second application server.
[0076] S102: Obtain established link information and waiting connection link information, and determine an initiating server in the first application server and the second application server according to the established link information and the waiting connection link information.
[0077] The link information obtained by the netstat command does not include information related to the transmission direction of the link. The link information is further analyzed to identify the transmission direction of the target link.
[0078] In a possible implementation, a netstat-an command is executed to obtain second network statistics. The second network statistics include established link information and waiting connection 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 according to the established link information and the waiting connection link information.
[0079] Referring to Figure 2As shown, the second network statistics obtained from executing the `netstat -an` command includes four parts: protocol, local address, external address, and status. Box ② shows a status of ESTABLISHED, indicating an established link. The local address is a combination of the local IP address and port. Link direction is analyzed using the IP+Port combination. Box ① shows a status of LISTENING, indicating connection requests from other computers, representing links waiting to be connected.
[0080] If the target link information is found in the pending connection link information, the second application server is determined to be the initiating server. If the target link information is not found in the pending connection link information, the first application server is determined to be the initiating server.
[0081] Specifically, with Figure 2 For example, the P port of the target link in box ② is searched for in the ports in box ①. If the P port of the target link is found in the information of the links waiting to be connected, the first application server is determined to be the receiving server and the second application server to be the initiating server. If the P port of the target link is not found in the information of the links waiting to be connected, the first application server is determined to be the initiating server and the second application server to be the receiving server.
[0082] S103: Determine the application type of the second application server based on the second information.
[0083] The above steps can obtain the target link and link direction between application servers. It is also necessary to determine the application corresponding to the second application server so as to locate the application that is affected by the target link failure.
[0084] The application type of the second application server can be either a cloud application or an on-premises application. A cloud application refers to an application that is hosted in the cloud. An on-premises application refers to an application that is not hosted in the cloud.
[0085] As an example, querying the second piece of information in the management database retrieves the server type to which that information belongs. The management database is a centralized database that stores information about various configuration items in an information technology environment. These configuration items can include hardware, software, network devices, 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 mapping between server types and IP addresses.
[0086] Specifically, by the IP address of the second application server included in the second information, the management database queries the technology stack to which the IP address belongs, that is, the source of the IP address, so as to determine the server type of the second application server. The source of the IP address mainly includes: operating system IP, cloud cluster node IP, load balancing virtual server IP and load balancing self 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, the load balancing virtual server IP and the load balancing self 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 correspondence 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] Referring to Figure 3 The figure is a flowchart for determining the application type provided by the embodiment of the application.
[0091] For the cloud application server, the application module information corresponding to the cloud partition can be queried in real time through the management database, and the application type of the second application server is identified.
[0092] For the cloud cluster node, the application type of the second application server can be determined by locating the path of "connected Port-> process ID-> application on the cloud" on the corresponding node.
[0093] In addition, for the cloud cluster node, the load balancing virtual server address corresponding to the route can also be identified based on the routing information in the distributed application interconnection link, the cloud cluster list where the consumer is located is obtained through the management database, the cloud cluster interface is called, and the link verification between the cluster and the load balancing virtual server is realized. According to the cloud partition address of the second application server and the cloud cluster node address, the application type is identified, which is convenient for positioning the problem of the specific target link.
[0094] S104: According to the application type of the initiating server, the connection state of the target link is verified, and a verification result is obtained.
[0095] The initiating server is a server that initiates interaction. The initiating server is determined based on the transmission direction of the target link. According to the application type of the initiating server, a corresponding initiating verification mode is adopted to verify the connection state of the target link.
[0096] In the case where the initiating server is the second application server, the verification policy is determined according to the application type determined in S103. In the case where the initiating server is the first application server, the application type of the first application server is acquired, and the verification policy is determined according to the application type of the first application server.
[0097] The verification policies adopted for the application running in the cloud environment and the application running in the cloud environment are different.
[0098] Referring to Figure 4 As shown in the figure, the figure is a verification flow diagram provided by an embodiment of the application.
[0099] As an example, if the application type of the initiating server belongs to the 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 state of the target link.
[0100] If the initiating server belongs to the cloud environment, the proxy is called to verify the connection state of the target link.
[0101] Specifically, the Telnet verification tool can be used to perform verification of the connection state of the target link. The Telnet verification tool is a tool for testing network connection, which is used to check whether the server port is open.
[0102] In a possible implementation, in the case where the target link needs to be verified more, classification can be performed. The target link is divided into two types, a real-time data bus and other links except the real-time data bus. The real-time data bus is a real-time data transmission channel between applications, and is used to realize real-time data transmission between applications, between databases, and between databases and applications.
[0103] The verification result at least includes the connection state of the target link.
[0104] S105: If it is determined according to the verification result that the target link is an abnormal link, alarm information is generated.
[0105] The alarm information can be sent to the pre-set operation and maintenance personnel, so that the operation and maintenance personnel can discover the fault of the link in time, and locate and solve the problem in time.
[0106] Based on the above, by collecting the active network connections on the server on the application server through the netstat command, recording in the local data table, by analyzing and comparing the collected network link data, automatically generating the network verification policy of the application, and periodically initiating verification, the abnormal link is automatically identified. In this way, the problem of network disconnection between application servers due to omissions in some links in the scenarios of network changes, partition migration, etc. can be detected. Finally, the operation and maintenance personnel are notified through the alarm information, so that the operation and maintenance personnel can timely locate and solve the problem to ensure the normal network connection.
[0107] The server link detection method of the embodiment of the application can realize automatic monitoring and disposal, reduce manual intervention, and improve operation and maintenance efficiency. Moreover, it can be applied to application systems of different scales and has strong scalability and can adapt to various scenarios. By directly calling the existing network verification function of the operation and maintenance platform operation center, compatibility is enhanced, and verification of the link is realized in a relatively agile manner.
[0108] Further, in a possible implementation manner, the abnormal behavior of the target link can also be detected.
[0109] Specifically, as shown in Figure 5 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 unknown application server access. The first information at least includes the IP address of the first application server, i.e., the local IP address. The second information at least includes the IP address of the second application server, i.e., the opposite IP address.
[0110] If it is determined that the access duration of the target link exceeds the duration threshold, it is determined that the target link is a long-term no-flow link, and a second abnormal behavior prompt information is generated. The long-term no-flow link has a serious risk of long-term disconnection of the target link. The duration threshold is, for example, 7 days.
[0111] The first abnormal behavior prompt information and the second abnormal behavior prompt information are used to issue an alarm to the application to which the target link with the abnormal behavior belongs. In this way, the change of the link between the application servers can be classified in more detail, and on the basis of verifying the link connection and disconnection, the link with the abnormal behavior is further detected, and the application is reminded in a timely manner.
[0112] Based on the server link detection method provided in the above method embodiment, the embodiment of the application further provides a server link detection device, which will be described below in combination with the accompanying drawings.
[0113] Referring to Figure 6As shown, the figure is a structural schematic diagram of a server link detection device provided by an embodiment of the present application. As shown in Figure 6 The server link detection device includes:
[0114] A first obtaining unit 601 is configured to obtain link information of a first application server, the link information including first information of the first application server and second information of a second application server, the first application server being connected to the second application server through a target link;
[0115] A first determining unit 602 is configured to obtain established link information and a link information to be connected, and determine an initiating server in the first application server and the second application server according to the established link information and the link information to be connected.
[0116] A second determining unit 603 is configured to determine an application type of the second application server according to the second information.
[0117] A verifying unit 604 is configured to verify a connection state of the target link according to the application type of the initiating server, and obtain a verification result.
[0118] An alarming unit 605 is configured to generate alarm information if the target link is determined to be an abnormal link according to the verification result.
[0119] In a possible implementation, the first obtaining unit 601 is specifically configured to obtain first network statistics by executing a netstat command, the first network statistics including a network address and an interface of the first application server, a network address and an interface of the second application server, and a connection protocol; and extract the link information of the first application server from the first network statistics.
[0120] In a possible implementation, the first determining unit 602 is specifically configured to execute a netstat-an command to obtain second network statistics, the second network statistics including the established link information and the link information to be connected, the established link information including information of the target link; determine the second application server to be the initiating server if the information of the target link is queried in the link information to be connected; and determine the first application server to be the initiating server if the information of the target link is not queried in the link information to be connected.
[0121] In a possible implementation, the second determining 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 the 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, according to the server type, an application type of the second application server, including:
[0123] The second determining unit 603 is configured to query, if the server type is an off-cloud application server, an application type corresponding to the second information from the management database, and query, if the server type is a cloud cluster node, an application type corresponding to the second information on the second application server.
[0124] In a possible implementation, the verifying unit 604 is specifically configured to determine, if the application type of the initiating server is an on-cloud application, a cloud cluster to which the initiating server belongs through a network address of the initiating server, and call a network verification interface of the cloud cluster to verify the connection state of the target link, and call an agent to verify the connection state of the target link, if the application type of the initiating server is an off-cloud application.
[0125] In a possible implementation, the apparatus further includes:
[0126] The third determining unit is 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] Alternatively,
[0128] The third determining unit is configured to determine that the target link has not been accessed for a time period exceeding a time period threshold, determine that the target link is a long-term no-flow link, and generate second abnormal behavior prompt information.
[0129] Based on the method embodiment described above, 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 through the system bus.
[0131] The memory is configured to store one or more programs, and the one or more programs include instructions that, when executed by the processor, cause the processor to perform the server link detection method described in any of the embodiments.
[0132] Based on the method embodiment described above, the present application provides a computer readable storage medium, and the computer readable storage medium stores instructions, and when the instructions run on a terminal device, the terminal device performs the server link detection method described in any of the embodiments.
[0133] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.
[0134] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0135] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0136] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0137] The foregoing description of the disclosed embodiments enables a person skilled in the art to make or use the application. Modifications of these embodiments will occur to persons of skill in the art, and that the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Therefore, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting a server link, characterized by, The method comprises: obtaining link information of a first application server, the link information comprising first information of the first application server and second information of a second application server, the first application server being connected to the second application server through a target link; obtaining established link information and waiting connection link information, and determining an initiating server in the first application server and the second application server according to the established link information and the waiting connection link information; determining an application type of the second application server according to the second information; verifying a connection state of the target link according to the application type of the initiating server, and obtaining a verification result; generating an alarm information if the target link is determined to be an abnormal link according to the verification result.
2. The method of claim 1, wherein, The obtaining of the link information of the first application server comprises: obtaining first network statistics by executing a netstat command, the first network statistics comprising network addresses and interfaces of the first application server, network addresses and interfaces of the second application server, and a connection protocol; extracting the link information of the first application server from the first network statistics.
3. The method of claim 1, wherein, The obtaining of the established link information and the waiting connection link information, and the determination of the initiating server in the first application server and the second application server according to the established link information and the waiting connection link information, comprise: executing a netstat-an command to obtain second network statistics, the second network statistics comprising the established link information and the waiting connection link information, the established link information comprising information of the target link; determining the second application server to be the initiating server if the information of the target link is queried in the waiting connection link information; determining the first application server to be the initiating server if the information of the target link is not queried in the waiting connection link information.
4. The method of claim 1, wherein, The determination of the application type of the second application server according to the second information comprises: querying the second information in a management database to obtain a server type to which the second information belongs; determining the application type of the second application server according to the server type.
5. The method of claim 4, wherein, The determination of the application type of the second application server according to the server type comprises: if the server type is a cloud-off application server, querying an application type corresponding to the second information from the management database; if the server type is a cloud cluster node, querying the application type corresponding to the second information on the second application server.
6. The method of claim 1, wherein, The verification of the connection state of the target link according to the application type of the initiating server comprises: if the application type of the initiating server is a cloud-on application, determining a cloud cluster to which the initiating server belongs through a network address of the initiating server, and calling a network verification interface of the cloud cluster to verify the connection state of the target link; if the application type of the initiating server is a cloud-off application, calling an agent to verify the connection state 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, determining that the target link has not been accessed for a time period exceeding a time period threshold, determining that the target link is a long-term no-flow link, and generating second abnormal behavior prompt information.
8. A server link detection apparatus, characterized by comprising: The apparatus comprises: a first obtaining unit configured to obtain link information of a first application server, the link information comprising first information of the first application server and second information of a second application server, the first application server being connected to the second application server through a target link; a first determining unit configured to obtain established link information and to-be-connected link information, and to determine an initiating server in the first application server and the second application server according to the established link information and the to-be-connected link information; a second determining unit configured to determine an application type of the second application server according to the second information; a verifying unit configured to verify a connection state of the target link according to the application type of the initiating server, and to obtain a verification result; an alarming unit configured to generate alarm information if the target link is determined to be an abnormal link according to the verification result.
9. A server link detection device, characterized by, comprise: a processor, a memory, and a system bus; the processor and the memory are connected through the system bus; the memory is configured to store one or more programs, the one or more programs comprising instructions that, when executed by the processor, cause the processor to perform the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores instructions, when the instructions run on the terminal device, cause the terminal device to perform the method of any one of claims 1-7.
Citation Information
Patent Citations
Middleware state checking method and device, electronic equipment and readable storage medium
CN115242618A
Topological graph generation method and device
CN116962197A