Method for monitoring service in IP (Internet Protocol) network and related device
By periodically obtaining and detecting the IP addresses and service port numbers in the IP network, building a service information database, and registering the newly added and reduced service information to the monitoring node, it solves the problem that operation and maintenance personnel find and register services in a timely manner, and realizes automatic monitoring and real-time continuous monitoring of IP network services.
Patent Information
- Application Number
- CN202510023078.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-03-28
AI Technical Summary
In IP networks, due to the numerous services, it is difficult for operation and maintenance personnel to discover and register services in a timely manner, resulting in the inability to monitor services in the network in a timely manner.
By periodically obtaining the IP address of the target network, detecting the status of the IP address and the corresponding service port number, building a service information database, and registering the newly added and reduced service information to the monitoring node.
It realizes automatic discovery, comparison and registration of IP network services, and timely discovers and monitors network services, avoiding monitoring delays and false alarms caused by unregistered services.
Smart Images

Figure CN119728760A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of network service monitoring, and in particular to a method and related apparatus for implementing monitoring of services in an IP network. Background Art
[0002] With the continuous development of computer networks, the number of devices (terminals and servers) connected to IP networks is increasing, ranging from hundreds to tens of thousands or even millions. Each device in an IP network has an IP address, each IP address usually corresponds to multiple service ports, and each service port corresponds to a service. It can be seen that there are a large number of services in the IP network.
[0003] Considering that services in IP networks may be abnormal, in order to discover abnormal services in IP networks, it is usually necessary to monitor services in IP networks. In order to monitor services in IP networks, it is usually necessary to perform service discovery (discover services in the network) and service registration (register services in the network to monitoring nodes so that monitoring nodes can monitor services).
[0004] Currently, when monitoring services in an IP network, service discovery and service registration in the IP network are completed by operation and maintenance personnel. However, there are many services in the IP network, and operation and maintenance personnel often find it difficult to discover services in a timely manner, and thus fail to register services to monitoring nodes in a timely manner. Failure to register services to monitoring nodes in a timely manner will result in failure to monitor services in the network in a timely manner. Summary of the invention
[0005] In view of this, the present application provides a method for monitoring services in an IP network, which is used to solve the problem that some services in the IP network cannot be discovered and registered manually in a timely manner, thereby causing the inability to monitor some services in the IP network in a timely manner. The technical solution is as follows:
[0006] The first aspect of the present application provides a method for monitoring a service in an IP network, comprising:
[0007] In the current cycle, obtain each IP address of the target network segment of the target network;
[0008] Detecting the status of each IP address of the target network segment, where the status of an IP address is one of alive and non-alive;
[0009] Detect the service port numbers corresponding to each surviving IP address of the target network segment;
[0010] A service information database is constructed according to each surviving IP address of the target network segment and the service port number corresponding to each surviving IP address of the target network segment, to obtain a current service information database, wherein the service information database includes a plurality of service information, each service information includes at least a service port number and an IP address corresponding to the service port number;
[0011] Determine the service information newly added in the current period compared with the previous period by comparing the current service information database with the historical service information database, wherein the historical service information database is the service information database constructed in the previous period;
[0012] The service information newly added in the current cycle compared with the previous cycle is registered to the monitoring node, so that the monitoring node can monitor the service of the target network segment.
[0013] In a possible implementation, the method for monitoring services in an IP network further includes:
[0014] Determining the service information reduced in the current period compared with the previous period by comparing the current service information database with the historical service information database;
[0015] The service information that is reduced in the current cycle compared to the previous cycle is removed from the monitoring node.
[0016] In a possible implementation, the obtaining of each IP address of a target network segment of the target network includes:
[0017] Obtaining the network segment information of the target network segment pre-entered for the target network, wherein the network segment information of any network segment at least includes the IP address segment and subnet mask of the network segment;
[0018] According to the network segment information of the target network segment, each IP address of the target network segment is determined.
[0019] In a possible implementation, the detecting the status of each IP address of the target network segment includes:
[0020] For each IP address in the target network segment:
[0021] Send an ICMP-based request to the IP address;
[0022] If a response corresponding to the request is received within a preset time period, the state of the IP address is determined to be alive;
[0023] If no response corresponding to the request is received within a preset time period, the state of the IP address is determined to be non-alive.
[0024] In a possible implementation, comparing the current service information database with the historical service information database to determine the service information newly added in the current period compared with the previous period includes:
[0025] For each service information in the current service information database:
[0026] Determine whether there is service information matching the service information in the historical service information database, wherein the matching of two service information means that the IP addresses and service port numbers in the two service information are consistent;
[0027] If there is no service information matching the piece of service information in the historical service information database, it is determined that the piece of service information is service information newly added in the current period compared with the previous period.
[0028] In a possible implementation, comparing the current service information database with the historical service information database to determine the service information reduced in the current period compared with the previous period includes:
[0029] For each service information in the historical service information database:
[0030] Determine whether there is service information matching the piece of service information in the current service information database, wherein the matching of two pieces of service information means that the IP addresses and service port numbers in the two pieces of service information are consistent;
[0031] If there is no service information matching the piece of service information in the current service information database, it is determined that the piece of service information is service information that is reduced in the current period compared to the previous period.
[0032] In a possible implementation, there are multiple monitoring nodes;
[0033] The registering of the service information newly added in the current cycle compared with the previous cycle to the monitoring node, and the offline of the service information reduced in the current cycle compared with the previous cycle from the monitoring node, comprises:
[0034] Using the monitoring scheduler, the service information newly added in the current cycle compared with the previous cycle is integrated into a registered service information list, and the service information reduced in the current cycle compared with the previous cycle is integrated into an offline service information list;
[0035] The registration service information list and the offline service information list are distributed to each monitoring node by using a monitoring scheduler, so that each monitoring node performs service registration according to the registration service information list and performs service offline according to the offline service information list.
[0036] In a possible implementation, the method for monitoring services in an IP network further includes:
[0037] Receiving service exception information reported by the monitoring node;
[0038] Determine abnormal service according to received service abnormality information;
[0039] Obtaining the person-in-charge information corresponding to the IP address in the service information corresponding to the abnormal service, wherein the person-in-charge information includes the person-in-charge and contact information;
[0040] Generating abnormal service alarm information for the abnormal service;
[0041] According to the contact information in the acquired person-in-charge information, the abnormal service alarm information is notified to the corresponding person-in-charge so that the corresponding person-in-charge can handle the abnormal service alarm information.
[0042] In a possible implementation, there are multiple monitoring nodes;
[0043] The determining of abnormal service according to the received service abnormality information includes:
[0044] For any service, if service abnormality information reported by two or more monitoring nodes for the service is received, the service is determined to be an abnormal service.
[0045] A second aspect of the present application provides a device for monitoring services in an IP network, comprising: an IP address acquisition module, an IP address detection module, a service detection module, a service information database construction module, a service information determination module, and a service information processing module;
[0046] The IP address acquisition module is used to acquire each IP address of the target network segment of the target network in the current cycle;
[0047] The IP address detection module is used to detect the status of each IP address of the target network segment, wherein the status of an IP address is one of alive and non-alive;
[0048] The service detection module is used to detect the service port numbers corresponding to each surviving IP address of the target network segment;
[0049] The service information database construction module is used to construct a service information database according to each surviving IP address of the target network segment and the service port number corresponding to each surviving IP address of the target network segment, so as to obtain a current service information database, wherein the service information database includes a plurality of service information, each service information includes at least a service port number and an IP address corresponding to the service port number;
[0050] The service information determination module is used to determine the service information newly added in the current period compared with the previous period by comparing the current service information database with the historical service information database, wherein the historical service information database is a service information database constructed in the previous period;
[0051] The service information processing module is used to register the service information newly added in the current cycle compared with the previous cycle to the monitoring node, so that the monitoring node can monitor the service of the target network segment.
[0052] A third aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0053] The memory is used to store computer programs;
[0054] The processor is used to execute the computer program so that the electronic device can implement the steps of any one of the above-mentioned methods for monitoring services in an IP network.
[0055] The fourth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the steps of any one of the above-mentioned methods for monitoring services in an IP network.
[0056] The fifth aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the steps of any one of the above-mentioned methods for monitoring services in an IP network.
[0057] By means of the above technical scheme, the present application provides a method for monitoring services in an IP network. In the current cycle, first, each IP address of the target network segment of the target network is obtained, and then the status of each IP address of the target network segment is detected for the target network to obtain each surviving IP address of the target network segment, and then the service port number corresponding to each surviving IP address of the target network segment is detected for the target network, and then a service information database is constructed according to each surviving IP address of the target network segment and the service port number corresponding to each surviving IP address of the target network segment to obtain the current service information database, and then the current service information database is compared with the historical service information database to determine the service information newly added in the current cycle compared with the previous cycle, and finally the service information newly added in the current cycle compared with the previous cycle is registered to the monitoring node, so that the monitoring node can monitor the service of the target network segment. The method for monitoring services in an IP network provided by the present application can periodically perform automatic service discovery, automatic service comparison, and automatic service registration for a target network segment of a target network. Since service discovery, service comparison, and service registration are performed automatically and periodically, services in the network can be discovered in a timely manner, and then the services discovered in a timely manner can be registered in a timely manner to a monitoring node, thereby enabling timely monitoring of services in the target network segment. At the same time, the present application can achieve real-time and continuous monitoring of services. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0059] Figure 1 A schematic diagram of a hardware structure of a server provided in an embodiment of the present application;
[0060] Figure 2 A flowchart of a method for monitoring services in an IP network provided in an embodiment of the present application;
[0061] Figure 3 An example of abnormal service alarm information provided in an embodiment of the present application;
[0062] Figure 4 A schematic diagram of a service monitoring console provided in an embodiment of the present application;
[0063] Figure 5 A schematic diagram of graphically displaying historical detection data of a service provided by a monitoring node in an embodiment of the present application;
[0064] Figure 6 A schematic diagram of the structure of an apparatus for monitoring services in an IP network provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0066] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0067] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0068] The method for monitoring services in an IP network provided in the present application can be applied to a server, and the server may include one or more servers.
[0069] Next, the product form of the above server is described.
[0070] Figure 1 A structural diagram of the above server is provided, such as Figure 1 As shown, the server may include a bus 101, a processor 102, a communication interface 103, and a memory 104. The processor 102, the memory 104, and the communication interface 103 communicate with each other via the bus 101.
[0071] The bus 101 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0072] The processor 102 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0073] The memory 104 may include a volatile memory, such as a random access memory (RAM). The memory 104 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0074] The memory 104 may be used to store software codes related to the method for implementing monitoring services in an IP network. The processor 102 may call the software codes stored in the memory 104 or schedule other units to implement corresponding functions.
[0075] The processor 102 in the above-mentioned server can be a hardware circuit (such as an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0076] Next, the method for monitoring services in an IP network provided by the present application is introduced through the following embodiments.
[0077] See also Figure 2 , shows a flow chart of a method for monitoring services in an IP network provided by an embodiment of the present application, the method may include:
[0078] Step S201: In the current cycle, each IP address of the target network segment of the target network is obtained.
[0079] Specifically, the network segment information of the target network segment pre-entered for the target network may be obtained, and then, each IP address of the target network segment may be determined according to the network segment information of the target network segment.
[0080] The target network segment is the network segment in the target network that needs to be monitored. The target network segment may be the entire network segment of the target network or a partial network segment of the target network.
[0081] The network segment information of the target network segment includes at least the IP address segment and subnet mask of the target network segment. In addition, the network segment information of the target network segment may also include the network type, computer room, etc. The following table shows an example of the network segment information of a network segment:
[0082] Table 1 Example of network segment information for a network segment
[0083]
[0084] When determining each IP address of the target network segment, each IP address of the target network segment may be determined according to the IP address segment and the subnet mask of the target network segment.
[0085] Step S202: Detect the status of each IP address of the target network segment.
[0086] The state of an IP address of the target network segment is one of alive and dead.
[0087] There are many ways to detect the status of each IP address of the target network segment. In one possible implementation method, for each IP address of the target network segment, a request based on the control message protocol ICMP can be sent to the IP address. If a response corresponding to the request is received within a preset time period, the status of the IP address is determined to be alive. If no response corresponding to the request is received within the preset time period, the status of the IP address is determined to be non-alive.
[0088] It should be noted that this embodiment is not limited to the above-mentioned method for detecting the status of each IP address of the target network segment, and any other method that can detect the status of each IP address of the target network segment is applicable to this application.
[0089] This embodiment can call a multi-task, distributed automatic scanning program to scan each IP address of the target network segment of the target network to collect the status of each IP address of the target network segment of the target network.
[0090] After the status of each IP address of the target network segment is obtained, an IP address information database may be constructed according to each IP address of the target network segment and the status of each IP address of the target network segment to obtain a current IP address information database.
[0091] The IP address information database includes multiple IP address information, each of which includes at least: an IP address, the status of the IP address, and other information, such as ID, IP address attributes, the time when the IP address was detected, etc. An example of an IP address information in the IP address information database is as follows:
[0092] "id": 108331206;
[0093] "log_time": "2024-10-11 04:32:09";
[0094] "ip_address": "10.0.0.11";
[0095] "status": "Active";
[0096] "attribute": "PrivateAddress".
[0097] Step S203: Detect the service port numbers corresponding to each surviving IP address of the target network segment.
[0098] The IP addresses in the live state, ie, the live IP addresses of the target network segment, can be retrieved from the current IP address information database, and then the service port numbers corresponding to the live IP addresses of the target network segment are detected for the target network.
[0099] It should be noted that one IP address may correspond to one service port number or multiple service port numbers.
[0100] This embodiment can call a multi-task, distributed automatic scanning program to scan the service ports corresponding to each IP address of the target network segment to obtain the service port numbers corresponding to each IP address of the target network segment.
[0101] Step S204: construct a service information database according to each surviving IP address of the target network segment and the service port number corresponding to each surviving IP address of the target network segment, and obtain a current service information database.
[0102] The service information database includes several pieces of service information, each piece of service information includes at least a service port number and an IP address corresponding to the service port number. In addition to the service port number and the IP address corresponding to the service port number, each piece of service information may also include part or all of the following information: the id of the IP address corresponding to the service port number, the status of the IP address corresponding to the service port number, the attributes of the IP address corresponding to the service port number, the time of detecting the IP address corresponding to the service port number, etc. An example of a piece of service information in the current service information database is as follows:
[0103] "id": 108331206;
[0104] "log_time": "2024-10-11 04:32:09";
[0105] "ip_address": "10.0.0.11";
[0106] "status": "Active";
[0107] "attribute": "PrivateAddress";
[0108] "port": "80".
[0109] Step S205: Determine the service information newly added in the current period compared with the previous period by comparing the current service information database with the historical service information database.
[0110] The historical service information database is a service information database constructed in the previous cycle, that is, the historical service information database is constructed according to each surviving IP address of the target network segment in the previous cycle and the service port number corresponding to each surviving IP address of the target network segment in the previous cycle.
[0111] It should be noted that if the current cycle is the first cycle, the historical service information database is considered to be empty, and thus, the service information newly added in the current cycle compared to the previous cycle is all the service information in the current service information database.
[0112] Step S206: registering the service information newly added in the current cycle compared with the previous cycle to the monitoring node, so that the monitoring node can monitor the service of the target network segment.
[0113] After obtaining the service information newly added in the current cycle compared with the previous cycle, the service information newly added in the current cycle compared with the previous cycle can be registered to the monitoring node.
[0114] The embodiment of the present application provides a method for monitoring services in an IP network. In the current cycle, first, each IP address of a target network segment of a target network is obtained, and then the status of each IP address of the target network segment is detected for the target network to obtain each surviving IP address of the target network segment, and then the service port number corresponding to each surviving IP address of the target network segment is detected for the target network, and then a service information database is constructed according to each surviving IP address of the target network segment and the service port number corresponding to each surviving IP address of the target network segment to obtain a current service information database, and then the current service information database is compared with the historical service information database to determine the service information newly added in the current cycle compared with the previous cycle, and finally the service information newly added in the current cycle compared with the previous cycle is registered to the monitoring node, so that the monitoring node can monitor the service of the target network segment. The method for monitoring services in an IP network provided in the embodiment of the present application can periodically perform automatic service discovery, automatic service comparison and automatic service registration. Since service discovery, service comparison and service registration are performed automatically and periodically, services in the IP network can be discovered in a timely manner, and then the services discovered in a timely manner can be registered in a timely manner to the monitoring node, so that the services can be monitored in a timely manner. At the same time, the method for monitoring services in an IP network provided in the embodiment of the present application can realize real-time and continuous monitoring of services.
[0115] Considering that in the process of network operation, in addition to the possibility of adding new services, some services may also be reduced. For the services reduced in the network, if they are not taken offline from the monitoring node, false alarms will be generated (the monitoring node will continue to detect the reduced services in the network. Since the service does not exist, the monitoring node will detect the service abnormality, and then generate an abnormal service alarm). In view of this, in another embodiment of the present application, the method for monitoring services in the IP network may also include:
[0116] By comparing the current service information database with the historical service information database, the service information reduced in the current cycle compared with the previous cycle is determined; the service information reduced in the current cycle compared with the previous cycle is removed from the monitoring node. It should be noted that if the current cycle is the first cycle, the historical service information database is considered empty, that is, there is no service information reduced in the current cycle compared with the previous cycle.
[0117] By comparing the current service information database with the historical service information database to determine the service information that has been reduced in the current period compared to the previous period, it is possible to promptly discover the services that have been reduced in the target network segment of the target network, and then promptly take them offline from the monitoring node, thereby ensuring that the monitoring node only monitors the services that currently exist in the target network segment of the target network, avoiding false alarms caused by the fact that the reduced services in the network have not been taken offline in a timely manner.
[0118] Next, the specific implementation process of "determining the service information newly added in the current period compared with the previous period by comparing the current service information database with the historical service information database" and "determining the service information reduced in the current period compared with the previous period by comparing the current service information database with the historical service information database" in the above embodiments is introduced.
[0119] In a possible implementation, the specific implementation process of determining the service information newly added in the current period compared with the previous period by comparing the current service information database with the historical service information database may include:
[0120] Step a1: for each piece of service information in the current service information database, determine whether there is service information matching the piece of service information in the historical service information database.
[0121] The matching of two pieces of service information means that the IP addresses and service port numbers in the two pieces of service information are consistent.
[0122] For a service information f in the current service information database i , determine whether there is service information f in the historical service information database i The process of matching service information may include: traversing the service information in the historical service information database, and matching the service information to the service information. i Compare with the currently traversed service information. If the service information f i If the IP address and service port number in the currently traversed service information are consistent, the service information f is determined. i Matches the currently traversed service information. If the service information f i The IP address is inconsistent with the currently traversed service information, or the service information f i The service port number is inconsistent with the service information currently traversed, or the service information f i If the IP address and service port number in the currently traversed service information are inconsistent, the service information f i does not match the currently traversed service information. It should be noted that if the service information f i If it matches the currently traversed service information, the service information f can be determined i It is not the service information newly added in the current cycle compared with the previous cycle. At this time, the traversal can be ended. If the service information f i If it does not match the currently traversed service information, continue to traverse the next service information in the historical service information database.
[0123] Step a2: If the historical service information database does not contain service information matching the piece of service information, it is determined that the piece of service information is new service information added in the current period compared with the previous period.
[0124] By comparing the service information with the service information in the historical service information database, if it is found that there is no service information matching the service information in the historical service information database, it can be determined that the service information is new service information in the current period compared with the previous period.
[0125] Through the above steps a1 and a2, the service information newly added in the current cycle compared with the previous cycle can be determined.
[0126] In a possible implementation, the specific implementation process of determining the service information reduced in the current period compared with the previous period by comparing the current service information database with the historical service information database may include:
[0127] Step b1: for each piece of service information in the historical service information database, determine whether there is service information matching the piece of service information in the current service information database.
[0128] For a service information f in the historical service information database j , determine whether there is service information f in the current service information database j The process of matching service information may include: traversing the service information in the current service information database, and matching the service information to the service information f j Compare with the currently traversed service information. If the service information f j If the IP address and service port number in the currently traversed service information are consistent, the service information f is determined. j Matches the currently traversed service information. If the service information f j The IP address is inconsistent with the currently traversed service information, or the service information f j The service port number is inconsistent with the service information currently traversed, or the service information f j If the IP address and service port number in the currently traversed service information are inconsistent, the service information f j does not match the currently traversed service information. It should be noted that if the service information f j If it matches the currently traversed service information, the service information f can be determined j It is not the service information that is reduced in the current cycle compared with the previous cycle. At this time, the traversal can be ended. If the service information f j If it does not match the currently traversed service information, continue to traverse the next service information in the current service information database.
[0129] Step b2: If the current service information database does not contain service information matching the piece of service information, determine that the piece of service information is service information that is reduced in the current period compared to the previous period.
[0130] By comparing the service information with the service information in the current service information database, if it is found that the current service information database does not have service information matching the service information, it can be determined that the service information is reduced in the current period compared to the previous period.
[0131] Through the above steps b1 and b2, the service information reduced in the current cycle compared with the previous cycle can be determined.
[0132] In another embodiment of the present application, the specific implementation process of "registering the service information newly added in the current cycle compared with the previous cycle to the monitoring node, and taking the service information reduced in the current cycle compared with the previous cycle offline from the monitoring node" in the above embodiment is introduced.
[0133] In a possible implementation, the process of registering service information newly added in the current cycle compared with the previous cycle to the monitoring node, and removing service information reduced in the current cycle compared with the previous cycle from the monitoring node may include:
[0134] Step c1: using the monitoring scheduler, integrating the service information newly added in the current cycle compared with the previous cycle into a registered service information list, and integrating the service information reduced in the current cycle compared with the previous cycle into an offline service information list.
[0135] After obtaining the service information that has been added and reduced in the current cycle compared to the previous cycle, the service information that has been added and reduced in the current cycle compared to the previous cycle can be provided to the monitoring scheduler. The monitoring scheduler integrates the service information that has been added in the current cycle compared to the previous cycle into a registered service information list, and integrates the service information that has been reduced in the current cycle compared to the previous cycle into an offline service information list.
[0136] Among them, the registration service information list includes several service information that need to be registered. Each service information in the registration service information list may include a service port number, the IP address corresponding to the service port number, and may also include computer room information. The offline service information list includes several service information that need to be taken offline. Similarly, each service information in the offline service information list may include a service port number, the IP address corresponding to the service port number, and may also include computer room information.
[0137] Step c2: using the monitoring scheduler to provide the registration service information list and the offline service information list to the monitoring node, so that the monitoring node performs service registration according to the registration service information list and performs service offline according to the offline service information list.
[0138] After the monitoring scheduler integrates the service information newly added in the current cycle compared to the previous cycle into a registered service information list and integrates the service information reduced in the current cycle compared to the previous cycle into an offline service information list, it provides the registered service information list and the offline service information list to the monitoring node. The monitoring node registers services according to the registered service information list and takes services offline according to the offline service information list.
[0139] In one possible implementation, there may be one monitoring node for monitoring services in the network. Considering the problem of cross-computer room monitoring, when the computer room dedicated line jitters or is interrupted, a large number of alarms will be generated. In order to avoid this problem, in another possible implementation, there may be multiple monitoring nodes for monitoring services in the network (that is, multiple monitoring nodes monitor the same service at the same time). If there are multiple monitoring nodes, the monitoring scheduler distributes the registration service information list and the offline service information list to each monitoring node. Each monitoring node registers the service according to the registration service information list, and takes the service offline according to the offline service information list.
[0140] When the monitoring node monitors the registered services, it will continuously detect the registered services. When a service anomaly is detected, the service anomaly information will be reported.
[0141] In another embodiment of the present application, the method for monitoring services in an IP network may further include:
[0142] Receive service exception information reported by the monitoring node; determine the abnormal service based on the received service exception information; obtain the person in charge information corresponding to the IP address in the service information corresponding to the abnormal service, where the person in charge information includes the person in charge and contact information; generate abnormal service alarm information for the abnormal service; notify the corresponding person in charge of the abnormal service alarm information based on the contact information in the obtained person in charge information, so that the corresponding person in charge can handle the abnormal service alarm information.
[0143] The above content mentioned that there can be multiple monitoring nodes. If there are multiple monitoring nodes, in a possible implementation, the process of determining an abnormal service based on the received service abnormality information may include: for any service, if service abnormality information reported by two or more monitoring nodes for the service is received, then the service is determined to be an abnormal service. If multiple monitoring nodes report service abnormality information for the same service, it means that the service is more likely to be an abnormal service. The above abnormal service determination method can reduce false alarms.
[0144] Of course, this embodiment is not limited to the above-mentioned method for determining abnormal services, and other methods may also be used to determine abnormal services. For example, if abnormal service information sent by a monitoring node for a service is received multiple times in a row (the number of times can be set according to actual conditions), it can be determined that the service is abnormal (for a service, the monitoring node will detect the service once every period of time. If the monitoring node detects that the service is abnormal multiple times in a row, it can be determined that the service is abnormal). In addition, when determining abnormal services, the number of monitoring nodes that receive abnormal service information and the number of times a single monitoring node sends abnormal service information continuously can also be combined to determine the abnormal service.
[0145] After determining the abnormal service, the person-in-charge information corresponding to the IP address in the service information corresponding to the abnormal service can be obtained. The CMDB system can be used to directly correspond the IP address in the service information corresponding to the abnormal service to the specific person-in-charge, and obtain the contact information of the person-in-charge, such as phone, email, corporate communication software, etc. After obtaining the contact information of the person-in-charge, abnormal service alarm information can be generated for the abnormal service, and then the abnormal service alarm information can be notified to the corresponding person-in-charge according to the contact information of the person-in-charge. Figure 3 An example of abnormal service alarm information is shown.
[0146] When the person in charge receives the abnormal service alarm information, he can handle the alarm. Specifically, if the abnormal service is normal business operation maintenance or offline, he can Figure 4 (as shown) to control the deactivation time of the abnormal service or delete the monitoring of the abnormal service. If the abnormal service fails, perform fault handling. During the fault handling of the abnormal service, the abnormal service can be continuously monitored. In order to avoid frequent alarms, the alarm repetition times can be set. If the number exceeds the set number, the service will enter a silent state (the silent time can be set). After the silent time exceeds the silent time, the alarm will be restored. After the abnormal service fault is handled, the historical detection data of the monitoring node for the abnormal service can be graphed to facilitate the backtracking of the historical detection data and the re-analysis of the fault. Of course, the historical detection data of the monitoring node for non-abnormal services can also be graphed to facilitate the operation and maintenance personnel to view. Figure 5 A schematic diagram is shown for graphically displaying the historical detection data of a monitoring node for a service.
[0147] The method for monitoring services in an IP network provided in an embodiment of the present application can periodically perform automatic service discovery, automatic service comparison, automatic service registration, and automatic service offline for a target network. Since service discovery, service comparison, service registration, and service offline are performed automatically and periodically, services in the IP network can be discovered in a timely manner, and then the services discovered in a timely manner can be registered to the monitoring node in a timely manner, so that the services can be monitored in a timely manner. Furthermore, services that are reduced in the IP network can be discovered in a timely manner, and then the services that are reduced in the IP network can be offline from the monitoring node in a timely manner, thereby reducing false alarms. The method for monitoring services in an IP network provided in the embodiment of the present application can realize real-time and continuous monitoring of services in the network. In addition, when the monitoring node monitors a service abnormality, the method for monitoring services in an IP network provided in the embodiment of the present application can determine the abnormal service based on the service abnormality information reported by the monitoring node, and can also generate an abnormal service alarm for the abnormal service, and promptly notify the corresponding person in charge of the abnormal service alarm. In this way, the abnormal service alarm can be handled in a timely manner. In addition, the method for monitoring services in an IP network provided in the embodiment of the present application can also graph the historical detection data of the monitoring node for the service, and the graphical historical detection data facilitates operation and maintenance personnel to conduct fault re-analysis.
[0148] The above introduces the method for monitoring services in an IP network provided in an embodiment of the present application. The following will introduce the device corresponding to the above method for monitoring services in an IP network.
[0149] See also Figure 6 , Figure 6 A structural diagram of a device for monitoring services in an IP network provided in an embodiment of the present application, the device may include: an IP address acquisition module 601, an IP address detection module 602, a service detection module 603, a service information database construction module 604, a service information determination module 605 and a service information processing module 606.
[0150] The IP address acquisition module 601 is used to acquire each IP address of the target network segment of the target network in the current cycle.
[0151] The IP address detection module 602 is used to detect the status of each IP address of the target network segment.
[0152] The status of an IP address is either alive or dead.
[0153] The service detection module 603 is used to detect the service port numbers corresponding to each surviving IP address of the target network segment.
[0154] The service information database construction module 604 is used to construct a service information database according to each surviving IP address of the target network segment and the service port number corresponding to each surviving IP address of the target network segment, so as to obtain a current service information database.
[0155] The service information database includes a number of service information, and each service information includes at least a service port number and an IP address corresponding to the service port number.
[0156] The service information determination module 605 is used to determine the service information newly added in the current period compared with the previous period by comparing the current service information database with the historical service information database.
[0157] The historical service information database is a service information database constructed in the previous cycle.
[0158] The service information processing module 606 is used to register the service information newly added in the current cycle compared with the previous cycle to the monitoring node, so that the monitoring node can monitor the service of the target network segment.
[0159] In a possible implementation, the service information determination module 605 is further configured to determine the service information reduced in the current period compared with the previous period by comparing the current service information database with the historical service information database.
[0160] The service information processing module 606 is further used to remove service information whose current period is reduced compared with the previous period from the monitoring node.
[0161] In a possible implementation, when acquiring each IP address of the target network segment of the target network, the IP address acquisition module 601 is specifically used to:
[0162] Obtaining the network segment information of the target network segment pre-entered for the target network, wherein the network segment information of any network segment at least includes the IP address segment and subnet mask of the network segment;
[0163] Determine each IP address of the target network segment according to the network segment information of the target network segment.
[0164] In a possible implementation, when detecting the status of each IP address of the target network segment, the IP address detection module 602 is specifically used to:
[0165] For each IP address in the target network segment:
[0166] Send an ICMP-based request to the IP address;
[0167] If a response corresponding to the request is received within a preset time period, the state of the IP address is determined to be alive;
[0168] If no response corresponding to the request is received within a preset time period, the state of the IP address is determined to be non-alive.
[0169] In a possible implementation, when the service information determination module 605 determines the service information newly added in the current period compared with the previous period by comparing the current service information database with the historical service information database, it is specifically used to:
[0170] For each service information in the current service information database:
[0171] Determine whether there is service information matching the service information in the historical service information database, wherein the matching of two service information means that the IP addresses and service port numbers in the two service information are consistent;
[0172] If there is no service information matching the piece of service information in the historical service information database, it is determined that the piece of service information is service information newly added in the current period compared with the previous period.
[0173] In a possible implementation, when the service information determination module 605 determines the service information reduced in the current period compared with the previous period by comparing the current service information database with the historical service information database, it is specifically configured to:
[0174] For each service information in the historical service information database:
[0175] Determine whether there is service information matching the service information in the current service information database, wherein the matching of two service information means that the IP addresses and service port numbers in the two service information are consistent;
[0176] If there is no service information matching the piece of service information in the current service information database, it is determined that the piece of service information is service information that is reduced in the current period compared to the previous period.
[0177] In a possible implementation, there are multiple monitoring nodes.
[0178] When the service information processing module 606 registers the service information added in the current cycle compared with the previous cycle to the monitoring node and removes the service information reduced in the current cycle compared with the previous cycle from the monitoring node, it is specifically used to:
[0179] Using the monitoring scheduler, the service information newly added in the current cycle compared with the previous cycle is integrated into a registered service information list, and the service information reduced in the current cycle compared with the previous cycle is integrated into an offline service information list;
[0180] The monitoring scheduler is used to distribute the registration service information list and the offline service information list to each monitoring node, so that each monitoring node performs service registration according to the registration service information list and performs service offline according to the offline service information list.
[0181] In a possible implementation, the device for monitoring services in an IP network may also include: a service abnormality information receiving module, an abnormal service determination module, a responsible person information acquisition module, an abnormal service alarm information generation module and an abnormal service alarm information notification module.
[0182] The service exception information receiving module is used to receive the service exception information reported by the monitoring node.
[0183] The abnormal service determination module is used to determine the abnormal service according to the received service abnormality information.
[0184] The responsible person information acquisition module is used to obtain the responsible person information corresponding to the IP address in the service information corresponding to the abnormal service, wherein the responsible person information includes the responsible person and contact information.
[0185] An abnormal service warning information generating module, used for generating abnormal service warning information for the abnormal service;
[0186] The abnormal service alarm information notification module is used to notify the abnormal service alarm information to the corresponding person in charge according to the contact information in the acquired person in charge information, so that the corresponding person in charge can handle the abnormal service alarm information.
[0187] In a possible implementation, there are multiple monitoring nodes. When the abnormal service determination module determines the abnormal service according to the received service abnormality information, it is specifically used to:
[0188] For any service, if service abnormality information reported by two or more monitoring nodes for the service is received, the service is determined to be an abnormal service.
[0189] The device for monitoring services in an IP network provided by the embodiment of the present application can periodically perform automatic service discovery, automatic service comparison, automatic service registration, and automatic service offline for the target network of the target network. Since service discovery, service comparison, service registration, and service offline are periodically and automatically performed, it is possible to timely discover services in the IP network, and then timely register the services discovered in time to the monitoring node, so that the services can be monitored in time, and it is possible to timely discover services reduced in the IP network, and then timely offline the services reduced in the IP network from the monitoring node, so that false alarms can be reduced. The device for monitoring services in an IP network provided by the embodiment of the present application can realize real-time and continuous monitoring of services in the network. In addition, when the monitoring node monitors a service abnormality, the device for monitoring services in an IP network provided by the embodiment of the present application can determine the abnormal service according to the service abnormality information reported by the monitoring node, and can also generate an abnormal service alarm for the abnormal service, and notify the abnormal service alarm to the corresponding person in charge in time, so that the abnormal service alarm can be processed in time.
[0190] An embodiment of the present application also provides an electronic device, which may include: at least one processor, at least one communication interface, at least one memory and at least one communication bus.
[0191] In the embodiment of the present application, the number of the processor, the communication interface, the memory, and the communication bus is at least one, and the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0192] The processor may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application;
[0193] The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;
[0194] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to implement the steps of the method for monitoring services in an IP network provided in the above embodiment.
[0195] An embodiment of the present application also provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the steps of the method for monitoring services in an IP network provided in the above embodiment.
[0196] An embodiment of the present application also provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the steps of the method for monitoring services in an IP network provided in the above embodiment.
[0197] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0198] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0199] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0200] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A method for monitoring services in an IP network, characterized in that: include: In the current cycle, obtain each IP address of the target network segment of the target network; Detecting the status of each IP address of the target network segment, where the status of an IP address is one of alive and non-alive; Detect the service port numbers corresponding to each surviving IP address of the target network segment; A service information database is constructed according to each surviving IP address of the target network segment and the service port number corresponding to each surviving IP address of the target network segment, to obtain a current service information database, wherein the service information database includes a plurality of service information, each service information includes at least a service port number and an IP address corresponding to the service port number; Determine the service information newly added in the current period compared with the previous period by comparing the current service information database with the historical service information database, wherein the historical service information database is the service information database constructed in the previous period; The service information newly added in the current cycle compared with the previous cycle is registered to the monitoring node, so that the monitoring node can monitor the service of the target network segment.
2. The method for monitoring services in an IP network according to claim 1, characterized in that: Also includes: Determining the service information reduced in the current period compared with the previous period by comparing the current service information database with the historical service information database; The service information that is reduced in the current cycle compared to the previous cycle is removed from the monitoring node.
3. The method for monitoring services in an IP network according to claim 1, characterized in that: The step of obtaining each IP address of a target network segment of a target network includes: Obtaining the network segment information of the target network segment pre-entered for the target network, wherein the network segment information of any network segment at least includes the IP address segment and subnet mask of the network segment; According to the network segment information of the target network segment, each IP address of the target network segment is determined.
4. The method for monitoring services in an IP network according to claim 1, characterized in that: The detecting the status of each IP address of the target network segment includes: For each IP address in the target network segment: Send an ICMP-based request to the IP address; If a response corresponding to the request is received within a preset time period, the state of the IP address is determined to be alive; If no response corresponding to the request is received within a preset time period, the state of the IP address is determined to be non-alive.
5. The method for monitoring services in an IP network according to claim 1, characterized in that: The comparing the current service information database with the historical service information database to determine the service information newly added in the current period compared with the previous period includes: For each service information in the current service information database: Determine whether there is service information matching the service information in the historical service information database, wherein the matching of two service information means that the IP addresses and service port numbers in the two service information are consistent; If there is no service information matching the piece of service information in the historical service information database, it is determined that the piece of service information is service information newly added in the current period compared with the previous period.
6. The method for monitoring services in an IP network according to claim 2, characterized in that: The comparing the current service information database with the historical service information database to determine the service information reduced in the current period compared with the previous period includes: For each service information in the historical service information database: Determine whether there is service information matching the piece of service information in the current service information database, wherein the matching of two pieces of service information means that the IP addresses and service port numbers in the two pieces of service information are consistent; If there is no service information matching the piece of service information in the current service information database, it is determined that the piece of service information is service information that is reduced in the current period compared to the previous period.
7. The method for monitoring services in an IP network according to claim 2, characterized in that: There are multiple monitoring nodes; The registering of the service information newly added in the current cycle compared with the previous cycle to the monitoring node, and the offline of the service information reduced in the current cycle compared with the previous cycle from the monitoring node, comprises: Using the monitoring scheduler, the service information newly added in the current cycle compared with the previous cycle is integrated into a registered service information list, and the service information reduced in the current cycle compared with the previous cycle is integrated into an offline service information list; The registration service information list and the offline service information list are distributed to each monitoring node by using a monitoring scheduler, so that each monitoring node performs service registration according to the registration service information list and performs service offline according to the offline service information list.
8. The method for monitoring services in an IP network according to claim 1, characterized in that: Also includes: Receiving service exception information reported by the monitoring node; Determine abnormal service according to received service abnormality information; Obtaining the person-in-charge information corresponding to the IP address in the service information corresponding to the abnormal service, wherein the person-in-charge information includes the person-in-charge and contact information; Generating abnormal service alarm information for the abnormal service; According to the contact information in the acquired person-in-charge information, the abnormal service alarm information is notified to the corresponding person-in-charge so that the corresponding person-in-charge can handle the abnormal service alarm information.
9. The method for monitoring services in an IP network according to claim 8, characterized in that: There are multiple monitoring nodes; The determining of abnormal service according to the received service abnormality information includes: For any service, if service abnormality information reported by two or more monitoring nodes for the service is received, the service is determined to be an abnormal service.
10. A device for monitoring services in an IP network, characterized in that: include: IP address acquisition module, IP address detection module, service detection module, service information database construction module, service information determination module and service information processing module; The IP address acquisition module is used to acquire each IP address of the target network segment of the target network in the current cycle; The IP address detection module is used to detect the status of each IP address of the target network segment, wherein the status of an IP address is one of alive and non-alive; The service detection module is used to detect the service port numbers corresponding to each surviving IP address of the target network segment; The service information database construction module is used to construct a service information database according to each surviving IP address of the target network segment and the service port number corresponding to each surviving IP address of the target network segment, so as to obtain a current service information database, wherein the service information database includes a plurality of service information, each service information includes at least a service port number and an IP address corresponding to the service port number; The service information determination module is used to determine the service information newly added in the current period compared with the previous period by comparing the current service information database with the historical service information database, wherein the historical service information database is a service information database constructed in the previous period; The service information processing module is used to register the service information newly added in the current cycle compared with the previous cycle to the monitoring node, so that the monitoring node can monitor the service of the target network segment.
11. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the steps of the method for monitoring services in an IP network as described in any one of claims 1 to 9.
12. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the steps of the method for monitoring services in an IP network as described in any one of claims 1 to 9.
13. A computer program product, characterized in that It includes computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the steps of the method for monitoring services in an IP network as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Multi-hierarchy load balancing cloud resource monitoring method
CN104184819A
Authorization information configuration method and device based on API gateway, equipment and storage medium
CN114518909A
Method for monitoring frequent change of network asset information
CN116647407A
Automatic monitoring method, system, equipment and medium
CN118250163A
Host IP port scanning automatic adding monitoring system, method, equipment and medium
CN118300962A