CN113055252B - Method, device, equipment and storage medium for detecting newly added service host - Google Patents

Method, device, equipment and storage medium for detecting newly added service host Download PDF

Info

Publication number
CN113055252B
CN113055252B CN202110607635.8A CN202110607635A CN113055252B CN 113055252 B CN113055252 B CN 113055252B CN 202110607635 A CN202110607635 A CN 202110607635A CN 113055252 B CN113055252 B CN 113055252B
Authority
CN
China
Prior art keywords
host
information
service
network segment
target service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110607635.8A
Other languages
Chinese (zh)
Other versions
CN113055252A (en
Inventor
刘梦阳
游仁均
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Clerware Technology Co ltd
Original Assignee
Shenzhen Clerware Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Clerware Technology Co ltd filed Critical Shenzhen Clerware Technology Co ltd
Priority to CN202110607635.8A priority Critical patent/CN113055252B/en
Publication of CN113055252A publication Critical patent/CN113055252A/en
Application granted granted Critical
Publication of CN113055252B publication Critical patent/CN113055252B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/0836Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability to enhance reliability, e.g. reduce downtime
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The invention belongs to the technical field of computers, and discloses a method, a device, equipment and a storage medium for detecting a newly added service host. When a host detection instruction is received, a target service system is determined according to the host detection instruction, and a target service host is selected from the target service system; sending a host scanning instruction to a target service host to enable the target service host to perform host scanning according to the host scanning instruction and feeding back network segment host information when the host scanning is finished; searching corresponding backup host information in a backup host information table according to the received network segment host information; and when the backup host information corresponding to the network segment host information is not found, judging the service host corresponding to the network segment host information as a newly added service host. Because the service hosts in the same network segment can directly carry out two-layer network communication, host scanning is carried out through the target service host, and whether a new service host exists in the network segment where the target service host is located can be determined according to the scanning result.

Description

Method, device, equipment and storage medium for detecting newly added service host
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for detecting a newly added service host.
Background
Nowadays, a service system is generally a system composed of a plurality of service host clusters, each service host cluster completes a part of functions in the service system, and because of high service access volume, there may be a plurality of service hosts in each service host cluster, for example: the service system of the data center can comprise a data processing cluster, a data storage cluster and other service host clusters. Therefore, an administrator of the service system manages a large number of service hosts, the workload is very high, and with the development of the service, a new service host may be needed, such new service host may not immediately perform disaster recovery backup because the administrator is busy, and then forgets to perform disaster recovery backup due to various factors, and if a human error or a system failure occurs at this time, the phenomena of data loss, system crash and the like may occur, resulting in a very large loss.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a storage medium for detecting a newly added service host, and aims to solve the technical problem that whether the newly added service host which is not backed up exists in a service system cannot be determined in the prior art.
In order to achieve the above object, the present invention provides a method for detecting a newly added service host, which comprises the following steps:
when a host detection instruction is received, determining a target service system according to the host detection instruction, and selecting a target service host from the target service system;
sending a host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction and feed back network segment host information when the host scanning is finished;
searching corresponding backup host information in a backup host information table according to the received network segment host information;
and when the backup host information corresponding to the network segment host information is not found, judging that the service host corresponding to the network segment host information is a newly added service host.
Optionally, the step of sending a host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, and feeding back network segment host information when the host scanning is completed includes:
acquiring a service network segment corresponding to the target service host;
generating a host scanning instruction according to the service network segment;
and sending the host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, acquiring network segment host identifiers corresponding to all network segment IP addresses in the service network segment, and generating network segment host information and feeding back the network segment host information according to the network segment host identifiers and the service network segment when the host scanning is finished.
Optionally, the step of generating a host scanning instruction according to the service network segment includes:
acquiring information of a backup host corresponding to the service network segment;
generating a host scanning instruction according to the service network segment and the information of the backup host;
correspondingly, the step of sending the host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, obtain segment host identifiers corresponding to all segment IP addresses in the service segment, and generate segment host information and feed back the segment host information according to the segment host identifiers and the service segment when the host scanning is completed includes:
sending the host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, acquiring network segment host identifiers corresponding to all network segment IP addresses in the service network segment, generating network segment host information according to the network segment host identifiers and the service network segment when the host scanning is completed, performing data filtering on the network segment host information according to the backup host information, and feeding back the network segment host information when the data filtering is completed.
Optionally, the step of searching for the corresponding provisioning host information in the provisioning host information table according to the received network segment host information includes:
determining a network segment IP address and a network segment host identity corresponding to the network segment IP address according to the network segment host information;
and searching backup host information corresponding to the network segment host information in a backup host information table according to the network segment IP address and the network segment host identifier.
Optionally, after the step of determining a target service system according to the received host detection instruction and selecting a target service host in the target service system, the method further includes:
sending a network detection instruction to the target service host to enable the target service host to carry out network connection detection according to the network detection instruction, and feeding back information of the connection host when the network detection is finished;
searching corresponding information of the preparation host in the information table of the preparation host according to the received information of the connection host;
and when the backup host information corresponding to the connection host information is not found, judging that the service host corresponding to the connection host information is a newly added service host.
Optionally, before the step of determining that the service host corresponding to the connection host information is the newly added service host when the provisioning host information corresponding to the connection host information is not found, the method further includes:
acquiring a preset service system network segment corresponding to the target service system;
correspondingly, when the backup host information corresponding to the connection host information is not found, the step of determining that the service host corresponding to the connection host information is a newly added service host includes:
when the backup host information corresponding to the connection host information is not found, determining the IP address of the connection host according to the connection host information;
and when the IP address of the connecting host belongs to the preset service system network segment, judging that the service host corresponding to the connecting host information is a new service host.
Optionally, after the step of determining that the service host corresponding to the segment host information is a newly added service host when the provisioning host information corresponding to the segment host information is not found, the method further includes:
generating a new host report according to the network segment host information;
and storing the new host report to a preset storage space, and displaying the new host report to a user.
In addition, in order to achieve the above object, the present invention further provides a device for detecting a newly added service host, where the device for detecting a newly added service host includes the following modules:
the system comprises an instruction receiving module, a target service system and a target service host, wherein the instruction receiving module is used for determining the target service system according to a host detection instruction and selecting the target service host from the target service system when receiving the host detection instruction;
the instruction sending module is used for sending a host scanning instruction to the target service host so that the target service host performs host scanning according to the host scanning instruction and feeds back network segment host information when the host scanning is finished;
the information searching module is used for searching corresponding backup host information in the backup host information table according to the received network segment host information;
and the result judging module is used for judging the service host corresponding to the network segment host information as the newly-added service host when the backup host corresponding to the network segment host information is not found.
In addition, in order to achieve the above object, the present invention further provides a device for detecting a newly added service host, where the device for detecting a newly added service host includes: the system comprises a processor, a memory and a newly added service host detection program which is stored on the memory and can run on the processor, wherein the newly added service host detection program realizes the steps of the newly added service host detection method when being executed by the processor.
In addition, in order to achieve the above object, the present invention further provides a computer-readable storage medium, where a new service host detection program is stored, and when the new service host detection program is executed, the steps of the new service host detection method described above are implemented.
When a host detection instruction is received, a target service system is determined according to the host detection instruction, and a target service host is selected from the target service system; sending a host scanning instruction to a target service host to enable the target service host to perform host scanning according to the host scanning instruction and feeding back network segment host information when the host scanning is finished; searching corresponding backup host information in a backup host information table according to the received network segment host information; and when the backup host information corresponding to the network segment host information is not found, judging the service host corresponding to the network segment host information as a newly added service host. Because the service hosts in the same network segment can directly carry out two-layer network communication, host scanning is carried out through the target service host, and whether a new service host exists in the network segment where the target service host is located can be quickly determined according to the host scanning result.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device in a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for detecting a newly added service host according to a first embodiment of the present invention;
fig. 3 is a schematic diagram of service host distribution according to a first embodiment of the method for detecting a newly added service host of the present invention;
fig. 4 is a flowchart illustrating a method for detecting a newly added service host according to a second embodiment of the present invention;
fig. 5 is a schematic diagram of service host distribution according to a second embodiment of the method for detecting a newly added service host of the present invention;
fig. 6 is a block diagram of a first embodiment of a device for detecting a new service host according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a device for detecting a newly added service host in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the electronic device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include an operating system, a network communication module, a user interface module, and a new service host detection program.
In the electronic apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device of the present invention may be disposed in a detection device of the newly added service host, and the electronic device calls a detection program of the newly added service host stored in the memory 1005 through the processor 1001 and executes the detection method of the newly added service host provided in the embodiment of the present invention.
An embodiment of the present invention provides a method for detecting a newly added service host, and referring to fig. 2, fig. 2 is a schematic flow diagram of a first embodiment of a method for detecting a newly added service host according to the present invention.
In this embodiment, the method for detecting the newly added service host includes the following steps:
step S10: when a host detection instruction is received, a target service system is determined according to the host detection instruction, and a target service host is selected from the target service system.
It should be noted that, the execution main body in this embodiment may be the detection device of the newly added service host, and the detection device of the newly added service host may be an electronic device such as a personal computer, a server, and the like, or may also be other devices that can achieve the same or similar functions.
It should be noted that the newly added service host detection device may be a disaster recovery backup server, or may be an independent server that is connected to the disaster recovery backup server and the target service system through a network. The host detection instruction may be an instruction sent by the other device to the host detection device of the newly added service. The host detection instruction may include a service system identifier, and determining the target system according to the host detection instruction may be to search corresponding service system information in a system information table according to the service system identifier included in the host detection instruction to determine the target service system. The service system information may include information including the number of service host clusters, the number of service hosts in each cluster, network segments used by each service host cluster, and the like in the service system.
In actual use, the selecting of the target service host in the target service system may be to search backup host information of each service host of the target service system according to the service system information, determine a network Identifier (ID) corresponding to each service host in the target service system according to the backup host information, determine all used network segments of the target service system according to the network ID, and then randomly select one service host in each network segment as the target service host. The network ID is used to indicate which network the service host belongs to, and computers with the same network ID can directly perform two-layer network communication without being connected through a router, that is, data link layers in an Open System Interconnection Reference Model (OSI) seven-layer network protocol stack, and the computers with different network IDs must be connected through a router; computers with the same network ID form a network called a local network (network segment).
As shown in fig. 3, fig. 3 is a schematic diagram of service host distribution of a target service system, where the target service system includes 5 reported service hosts, such as A, B, C, D, E, etc., the IP addresses used by the reported service hosts are 172.16.2.4, 172.16.2.5, 192.168.4.5, 192.168.4.6, 222.166.7.9, the target service system includes three sub-routers, the IP addresses are 172.16.2.1, 192.168.4.1, 222.166.7.1, the three sub-routers are connected to a main router, the target service system has an unpredicted new server, i.e., a new service host, and the IP address of the new service host is 192.168.4.9, and then the network ID of each reported service host can be obtained, and then the obtained network ID is deduplicated to determine that there are three network segments 172.16.2.0/24, 192.168.4.0/24, and 222.166.7.0/24 used in the target service system, at this time, one service host can be randomly extracted in each network segment as the target service host, for example: target service hosts are 3 service hosts such as A, C, E.
Step S20: and sending a host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction and feed back network segment host information when the host scanning is finished.
It should be noted that the network segment host information may include an IP address and a service host identifier corresponding to the IP address. The target service host can obtain the network segment where the target service host locates when receiving the host scanning instruction, obtain all the IP addresses (Internet Protocol addresses) in the network segment where the target service host locates, determine whether each IP Address has a corresponding network segment host identity, and finally generate and feed back network segment host information according to the IP addresses of all the inquired network segment host identities and the corresponding network segment host identities. The network segment host identifier may be a mac Address (Media Access Control Address) of the service host, and determining whether each IP Address has a corresponding network segment host identifier may be scanning through an arp (Address Resolution protocol) protocol to determine whether each IP Address has a corresponding mac Address.
It can be understood that, in the use process of each network segment, some special IP addresses in the network segment are not set with service hosts, and such special IP addresses can be filtered out without host scanning, for example: for segment 192.168.4.0/24, the range of IP addresses is typically 192.168.4.0-192.168.4.255, wherein 192.168.4.0 is typically unused IP and can be filtered, 192.168.4.255 typically broadcasts the used IP address and typically does not set a service host, and therefore, can also be filtered.
In practical use, the newly added service host detection device may periodically send a host scanning instruction to the target service host at a preset time interval, where the preset time interval may be preset by a user, for example: and setting the preset time interval to be 5 minutes, and sending a host scanning instruction to the target service host every 5 minutes by the newly added service host detection equipment.
In practical use, the scanning of one IP address may be used as a complete host scanning process, network segment host information is generated and fed back after a single IP address is scanned, or the scanning of all IP addresses may be used as a complete host scanning process, and network segment host information is generated and fed back uniformly after the scanning is finished, which is not limited in this embodiment.
Further, if the target service host needs to acquire its own network segment when receiving the host scanning instruction, which may slow down the host scanning process, in order to overcome the above-mentioned defect and increase the host scanning speed, step S20 in this embodiment may include:
acquiring a service network segment corresponding to the target service host; generating a host scanning instruction according to the service network segment; and sending the host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, acquiring network segment host identifiers corresponding to all network segment IP addresses in the service network segment, and generating network segment host information and feeding back the network segment host information according to the network segment host identifiers and the service network segment when the host scanning is finished.
It should be noted that the service network segment may be a network segment where a service host is located. The newly added service host detects that information such as IP addresses of all the service hosts are obtained when the target service host is selected, and counts network IDs of all the service hosts, so that the service network segment of each target service host can be directly determined.
Further, since the target service host may have a provisioned host in the same network segment when performing host scanning, the generated network segment host information also includes information such as an IP address and a mac address of the provisioned service host, so that the provisioned host information of the provisioned service host can be found when searching for the corresponding provisioned host information in the provisioned host information table according to the network segment host information, which wastes computing resources, and in order to overcome the above-mentioned defects, the step of generating a host scanning instruction according to the service network segment may include:
acquiring information of a backup host corresponding to the service network segment; and generating a host scanning instruction according to the service network segment and the information of the backup host.
Correspondingly, the step of sending the host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, obtain segment host identifiers corresponding to each segment IP address in the service segment, and generate segment host information and feed back the segment host information according to the segment host identifiers and the service segment when the host scanning is completed may include:
sending the host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, acquiring network segment host identifiers corresponding to all network segment IP addresses in the service network segment, generating network segment host information according to the network segment host identifiers and the service network segment when the host scanning is completed, performing data filtering on the network segment host information according to the backup host information, and feeding back the network segment host information when the data filtering is completed.
It should be noted that the information of the provisioning host may include information such as a name of the service host, an IP address of the service host, and a network segment host identifier of the service host.
It can be understood that all the preparation host information in the service network segment corresponding to the target service host is added to the host scanning instruction, and then the target service host can analyze the host scanning instruction when receiving the host scanning instruction, so as to obtain the service network segment and the preparation host information corresponding to the service network segment, and when the host scanning is completed, the generated network segment host information can be subjected to data filtering according to the preparation host information corresponding to the service network segment, and the information corresponding to all the prepared service hosts included in the network segment host information is removed, so that the network segment host information does not include the information of the prepared service hosts, thereby saving computing resources.
Step S30: and searching corresponding backup host information in the backup host information table according to the received network segment host information.
It should be noted that the segment host information may simultaneously include a plurality of IP addresses and service host identifiers corresponding to the IP addresses, and at this time, the received segment host information may be split into a plurality of segment host information, so that each segment host information only includes one IP address and a service host identifier corresponding to the IP address. And then, respectively searching corresponding backup host information in a backup host information table according to the split multiple network segment host information.
It should be noted that, when the segment host information is received, it may be determined whether the segment host information includes information such as an IP address and a corresponding mac address, and step S30 is executed only when the segment host information includes the information, so that it may be avoided that a null value is used for searching, and a situation that a query error is reported or a large amount of data is queried occurs.
Further, since the service hosts may be down in practical use, the service hosts of the same IP address may be the service hosts to be replaced after the previous service host is down, the service host identity of the service host is different from the previous service host, but the IP address is the same, but the service host is not reported, or due to the service regulation, the service host stealing occurs, for example, the service host originally used in the A service host cluster is stolen for use in the B service host cluster, the service host IP address changes, but the service host identity does not change, the service host should be provisioned again, therefore, in order to overcome the above-mentioned defect, step S30 in this embodiment may include:
determining a network segment IP address and a network segment host identity corresponding to the network segment IP address according to the network segment host information; and searching backup host information corresponding to the network segment host information in a backup host information table according to the network segment IP address and the network segment host identifier.
It should be noted that the network segment IP address may be an IP address corresponding to a service host corresponding to the network segment host information in the service network segment.
It can be understood that the backup host information corresponding to the segment host information is searched in the backup host information table by simultaneously using the segment IP address and the segment host identifier, so that the missing detection phenomenon caused by the conditions of different segment host identifiers with the same IP address or different IP addresses and segment host identifiers and the like can be avoided.
Step S40: and when the backup host information corresponding to the network segment host information is not found, judging that the service host corresponding to the network segment host information is a newly added service host.
It can be understood that, if the backup host information corresponding to the segment host information is not found, it is stated that the service host corresponding to the segment host information is not backed up, and therefore, it can be determined that the service host corresponding to the segment host information is the new service host, that is, the new service host exists in the target service system.
Further, in order to facilitate the user to determine which service host is the new service host, after step S40, the method may further include:
generating a new host report according to the network segment host information; and storing the new host report to a preset storage space, and displaying the new host report to a user.
It can be understood that the network segment host information may include information such as the network segment IP address and the network segment host identifier of the service host, and a new host report is generated according to the network segment host information and displayed to the user, so that the user can quickly specify the network segment IP address and the network segment host identifier of the newly added service host, and the user can quickly locate the newly added service host, so as to perform data disaster recovery backup on the newly added service host. The new host report is stored in the preset storage space, so that the user can conveniently remind or search by himself when the user timely knows the new host report.
In the embodiment, when a host detection instruction is received, a target service system is determined according to the host detection instruction, and a target service host is selected from the target service system; sending a host scanning instruction to a target service host to enable the target service host to perform host scanning according to the host scanning instruction and feeding back network segment host information when the host scanning is finished; searching corresponding backup host information in a backup host information table according to the received network segment host information; and when the backup host information corresponding to the network segment host information is not found, judging the service host corresponding to the network segment host information as a newly added service host. Because the service hosts in the same network segment can directly carry out two-layer network communication, host scanning is carried out through the target service host, and whether a new service host exists in the network segment where the target service host is located can be quickly determined according to the host scanning result.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method for detecting a newly added service host according to a second embodiment of the present invention.
Based on the first embodiment, after step S10, the method for detecting a new service host in this embodiment further includes:
step S20': and sending a network detection instruction to the target service host to enable the target service host to carry out network connection detection according to the network detection instruction, and feeding back information of the connection host when the network detection is finished.
It should be noted that, since the service hosts with different network IDs cannot directly perform two-layer network communication, scanning by the arp protocol is also impossible. If a new service host is added in a newly used network segment, namely, the new service host is added in the case of an independent network, the arp protocol cannot be used for scanning to determine whether a new service host exists. The newly added service hosts generally have more or less contact with the existing servers, and do not exist in isolation, so that the newly added server can be found by scanning network connection, and at this time, the selection of the target service host in the target service system in step S10 may be to use each already reported service host in the target service system as the target service host.
For example: as shown in fig. 5, fig. 5 is a service host distribution diagram of a target service system when a new service host is added to an independent network, where A, B, C, D four reported hosts exist in the target service system, IP addresses are 172.16.2.4, 172.16.2.5, 192.168.4.5, and 192.168.4.6, the target service system includes three sub-routers, the IP addresses are 172.16.2.1, 192.168.4.1, and 222.166.7.1, the three sub-routers are connected to a main router, and an IP address of a newly added service host is 222.166.7.9, where the newly added service host is added to a network segment 222.166.7.0/24 that is newly put into use, and no service host that has been reported exists in the network segment.
It should be noted that, when receiving the network detection instruction, the target service host queries the service host that has undergone network connection with the target service host, extracts the IP address of the service host to generate connection host information, and feeds the connection host information back to the newly added service host detection device. The target service host checks whether the service host connected to the target service host via the network is queried through a command such as netstat, or through a record called by a system function, which is not limited in this embodiment.
In actual use, the newly added service host detection device may periodically send a network detection instruction to each target service host at a preset time interval, where the preset time interval may be preset by a user, for example: and setting the preset time interval to be 5 minutes, and sending a network detection instruction to each target service host every 5 minutes by the newly added service host detection equipment.
Step S30': and searching corresponding information of the preparation host in the information table of the preparation host according to the received information of the connection host.
It should be noted that, the searching for the corresponding provisioning host information in the provisioning host information table according to the received connection host information may be that, when the received connection host information is received, the IP address of the service host performing network connection with the target service host is determined according to the connection host information, and then the corresponding provisioning host information is searched in the provisioning host information table according to the IP address.
Step S40': and when the backup host information corresponding to the connection host information is not found, judging that the service host corresponding to the connection host information is a newly added service host.
It should be noted that, if the provisioning host information corresponding to the connection host information is not found, it is determined that the service host corresponding to the connection host information is not provisioned, and therefore, it can be determined that the service host corresponding to the connection host information is the new service host.
It is to be understood that, in order to facilitate the user to determine which service host is the new service host, the new host report may also be generated according to the information of the connected hosts after step S40', and the new host report may be stored and presented to the user.
Further, since part of the service system is used externally, not only internally, and therefore, the user host may be an external user host rather than a system host, where the user host is connected to the target service host through a network, and at this time, if it is determined whether the service host corresponding to the connection host information is a new service host only according to whether the provisioning host information corresponding to the connection host information can be found, a large number of false alarms may exist, and in order to overcome the above defect, before step S40 of this embodiment, the method may further include:
and acquiring a preset service system network segment corresponding to the target service system.
Accordingly, step S40 of this embodiment may include:
when the backup host information corresponding to the connection host information is not found, determining the IP address of the connection host according to the connection host information; and when the IP address of the connecting host belongs to the preset service system network segment, judging that the service host corresponding to the connecting host information is a new service host.
It should be noted that the IP address of the connection host may be an IP address of a host that is network-connected to the target service host and corresponds to the connection host information. The preset service system network segment can be preset by a user, the preset service system network segment can be a plurality of network segments used by the service system, if the IP address of a certain host belongs to any one of the preset service system network segments, the IP address can be judged to belong to the preset service system network segment, that is, the host is the service host in the service system.
It can be understood that if the provisioning host information corresponding to the connection host information is not found, it may be said that the host has not been provisioned, if the connection host IP address belongs to the preset service system network segment, it may be said that the host corresponding to the connection host information is a service host, if one host has not been provisioned and it may be determined that the host is a service host, it may be determined that the host is a new service host, and therefore, it may be determined that the service host corresponding to the connection host information is a new service host.
In this embodiment, a network detection instruction is sent to the target service host, so that the target service host performs network connection detection according to the network detection instruction, and feeds back connection host information when network detection is completed; searching corresponding information of the preparation host in the information table of the preparation host according to the received information of the connection host; and when the backup host information corresponding to the connection host information is not found, judging that the service host corresponding to the connection host information is a newly added service host. Because the newly added service host in the independent network generally has more or less contact with the existing service host and does not exist in isolation, the network connection detection is carried out through the target service host, and the newly added service host in the independent network can be quickly found according to the network connection detection result.
In addition, an embodiment of the present invention further provides a storage medium, where the storage medium stores a new service host detection program, and the new service host detection program, when executed by a processor, implements the steps of the new service host detection method described above.
Referring to fig. 6, fig. 6 is a block diagram illustrating a structure of a new service host detection apparatus according to a first embodiment of the present invention.
As shown in fig. 6, the apparatus for detecting a newly added service host according to an embodiment of the present invention includes:
the instruction receiving module 601 is configured to, when a host detection instruction is received, determine a target service system according to the host detection instruction, and select a target service host from the target service system;
an instruction sending module 602, configured to send a host scanning instruction to the target service host, so that the target service host performs host scanning according to the host scanning instruction, and feeds back network segment host information when the host scanning is completed;
an information searching module 603, configured to search, according to the received segment host information, corresponding provisioning host information in a provisioning host information table;
and a result determining module 604, configured to determine, when the provisioning host information corresponding to the segment host information is not found, that the service host corresponding to the segment host information is an additional service host.
In the embodiment, when a host detection instruction is received, a target service system is determined according to the host detection instruction, and a target service host is selected from the target service system; sending a host scanning instruction to a target service host to enable the target service host to perform host scanning according to the host scanning instruction and feeding back network segment host information when the host scanning is finished; searching corresponding backup host information in a backup host information table according to the received network segment host information; and when the backup host information corresponding to the network segment host information is not found, judging the service host corresponding to the network segment host information as a newly added service host. Because the service hosts in the same network segment can directly carry out two-layer network communication, host scanning is carried out through the target service host, and whether a new service host exists in the network segment where the target service host is located can be quickly determined according to the host scanning result.
Further, the instruction sending module 602 is further configured to obtain a service network segment corresponding to the target service host; generating a host scanning instruction according to the service network segment; and sending the host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, acquiring network segment host identifiers corresponding to all network segment IP addresses in the service network segment, and generating network segment host information and feeding back the network segment host information according to the network segment host identifiers and the service network segment when the host scanning is finished.
Further, the instruction sending module 602 is further configured to obtain provisioning host information corresponding to the service network segment; generating a host scanning instruction according to the service network segment and the information of the backup host;
the instruction sending module 602 is further configured to send the host scanning instruction to the target service host, so that the target service host performs host scanning according to the host scanning instruction, obtains a segment host identifier corresponding to each segment IP address in the service segment, generates segment host information according to the segment host identifier and the service segment when host scanning is completed, performs data filtering on the segment host information according to the reported host information, and feeds back the segment host information when data filtering is completed.
Further, the information search module 603 is further configured to determine a network segment IP address and a network segment host identifier corresponding to the network segment IP address according to the network segment host information; and searching backup host information corresponding to the network segment host information in a backup host information table according to the network segment IP address and the network segment host identifier.
Further, the instruction sending module 602 is further configured to send a network detection instruction to the target service host, so that the target service host performs network connection detection according to the network detection instruction, and feeds back connection host information when network detection is completed;
the information searching module 603 is further configured to search, according to the received connection host information, corresponding provisioning host information in the provisioning host information table;
the result determining module 604 is further configured to determine that the service host corresponding to the connection host information is a new service host when the provisioning host information corresponding to the connection host information is not found.
Further, the information search module 603 is further configured to obtain a preset service system network segment corresponding to the target service system;
the result determining module 604 is further configured to determine an IP address of the connected host according to the connected host information when the provisioning host information corresponding to the connected host information is not found; and when the IP address of the connecting host belongs to the preset service system network segment, judging that the service host corresponding to the connecting host information is a new service host.
Further, the result determining module 604 is further configured to generate a new host report according to the network segment host information; and storing the new host report to a preset storage space, and displaying the new host report to a user.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited thereto.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the method for detecting a newly added service host provided in any embodiment of the present invention, and are not described herein again.
Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for detecting a newly added service host is characterized by comprising the following steps:
when a host detection instruction is received, determining a target service system according to the host detection instruction, and selecting a target service host from the target service system;
sending a host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction and feed back network segment host information when the host scanning is finished;
searching corresponding backup host information in a backup host information table according to the received network segment host information;
when the backup host information corresponding to the network segment host information is not found, determining that the service host corresponding to the network segment host information is a newly added service host;
wherein, the step of selecting the target service host in the target service system comprises:
acquiring information of a preparation host corresponding to the target service system;
determining a plurality of using network segments corresponding to the target service system according to the information of the preparation host;
and respectively randomly selecting one service host from each using network segment as a target service host.
2. The method as claimed in claim 1, wherein the step of sending a host scanning command to the target service host, so that the target service host performs host scanning according to the host scanning command, and feeding back network segment host information when the host scanning is completed, comprises:
acquiring a service network segment corresponding to the target service host;
generating a host scanning instruction according to the service network segment;
and sending the host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, acquiring network segment host identifiers corresponding to all network segment IP addresses in the service network segment, and generating network segment host information and feeding back the network segment host information according to the network segment host identifiers and the service network segment when the host scanning is finished.
3. The method for detecting a newly added service host according to claim 2, wherein the step of generating a host scanning command according to the service network segment includes:
acquiring information of a backup host corresponding to the service network segment;
generating a host scanning instruction according to the service network segment and the information of the backup host;
correspondingly, the step of sending the host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, obtain segment host identifiers corresponding to all segment IP addresses in the service segment, and generate segment host information and feed back the segment host information according to the segment host identifiers and the service segment when the host scanning is completed includes:
sending the host scanning instruction to the target service host to enable the target service host to perform host scanning according to the host scanning instruction, acquiring network segment host identifiers corresponding to all network segment IP addresses in the service network segment, generating network segment host information according to the network segment host identifiers and the service network segment when the host scanning is completed, performing data filtering on the network segment host information according to the backup host information, and feeding back the network segment host information when the data filtering is completed.
4. The method as claimed in claim 1, wherein the step of looking up the corresponding provisioning host information in the provisioning host information table according to the received segment host information comprises:
determining a network segment IP address and a network segment host identity corresponding to the network segment IP address according to the network segment host information;
and searching backup host information corresponding to the network segment host information in a backup host information table according to the network segment IP address and the network segment host identifier.
5. A method as claimed in claim 1, wherein after the step of determining a target service system according to the received host detection command and selecting a target service host from the target service system, the method further comprises:
sending a network detection instruction to the target service host to enable the target service host to carry out network connection detection according to the network detection instruction, and feeding back information of the connection host when the network detection is finished;
searching corresponding information of the preparation host in the information table of the preparation host according to the received information of the connection host;
and when the backup host information corresponding to the connection host information is not found, judging that the service host corresponding to the connection host information is a newly added service host.
6. The method for detecting a newly added service host according to claim 5, wherein before the step of determining the service host corresponding to the connection host information as the newly added service host when the provisioning host information corresponding to the connection host information is not found, the method further comprises:
acquiring a preset service system network segment corresponding to the target service system;
correspondingly, when the backup host information corresponding to the connection host information is not found, the step of determining that the service host corresponding to the connection host information is a newly added service host includes:
when the backup host information corresponding to the connection host information is not found, determining the IP address of the connection host according to the connection host information;
and when the IP address of the connecting host belongs to the preset service system network segment, judging that the service host corresponding to the connecting host information is a new service host.
7. A method as claimed in any one of claims 1 to 6, wherein after the step of determining that the service host corresponding to the segment host information is the newly added service host when the provisioning host information corresponding to the segment host information is not found, the method further comprises:
generating a new host report according to the network segment host information;
and storing the new host report to a preset storage space, and displaying the new host report to a user.
8. A newly added service host detection device is characterized by comprising the following modules:
the system comprises an instruction receiving module, a target service system and a target service host, wherein the instruction receiving module is used for determining the target service system according to a host detection instruction and selecting the target service host from the target service system when receiving the host detection instruction;
the instruction sending module is used for sending a host scanning instruction to the target service host so that the target service host performs host scanning according to the host scanning instruction and feeds back network segment host information when the host scanning is finished;
the information searching module is used for searching corresponding backup host information in the backup host information table according to the received network segment host information;
the result judging module is used for judging the service host corresponding to the network segment host information as a newly-added service host when the backup host corresponding to the network segment host information is not found;
the instruction receiving module is also used for acquiring the information of the backup host corresponding to the target service system; determining a plurality of using network segments corresponding to the target service system according to the information of the preparation host; and respectively randomly selecting one service host from each using network segment as a target service host.
9. A newly added service host detection device, comprising: a processor, a memory and a new service host detection program stored on the memory and operable on the processor, the new service host detection program, when executed by the processor, implementing the steps of the new service host detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein the computer-readable storage medium stores a new service host detection program, and when the new service host detection program is executed, the steps of the new service host detection method according to any one of claims 1 to 7 are implemented.
CN202110607635.8A 2021-06-01 2021-06-01 Method, device, equipment and storage medium for detecting newly added service host Active CN113055252B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110607635.8A CN113055252B (en) 2021-06-01 2021-06-01 Method, device, equipment and storage medium for detecting newly added service host

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110607635.8A CN113055252B (en) 2021-06-01 2021-06-01 Method, device, equipment and storage medium for detecting newly added service host

Publications (2)

Publication Number Publication Date
CN113055252A CN113055252A (en) 2021-06-29
CN113055252B true CN113055252B (en) 2021-09-07

Family

ID=76518662

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110607635.8A Active CN113055252B (en) 2021-06-01 2021-06-01 Method, device, equipment and storage medium for detecting newly added service host

Country Status (1)

Country Link
CN (1) CN113055252B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114124899A (en) * 2021-10-28 2022-03-01 北京三快在线科技有限公司 Bill printing equipment management method and device and electronic equipment
CN114584470A (en) * 2022-03-10 2022-06-03 北京自如信息科技有限公司 Network equipment topological graph generation method and device and electronic equipment
CN116974857B (en) * 2023-09-21 2024-01-23 中国西安卫星测控中心 Automatic deployment and update method and system for monitoring agent

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109245940A (en) * 2018-10-15 2019-01-18 厦门卓网信息科技股份有限公司 A kind of method network equipment discovery and detected
US10270675B1 (en) * 2010-12-31 2019-04-23 Open Invention Network Llc Method and apparatus of discovering and monitoring network devices

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1885858A (en) * 2005-06-24 2006-12-27 中国长城计算机深圳股份有限公司 Method for carrying out cluster management on network equipment based on SNMP protocol
CN103516531A (en) * 2012-06-21 2014-01-15 中兴通讯股份有限公司 Method for automatically discovering network element and corresponding network element and network management devices
CN103812672A (en) * 2012-11-06 2014-05-21 浙江大华技术股份有限公司 Method for discovering newly-added network element device, correlative device, and system
CN106899444A (en) * 2015-12-21 2017-06-27 北京奇虎科技有限公司 A kind of end-probing method and device for many LANs
CN106375491A (en) * 2016-08-31 2017-02-01 浙江远望信息股份有限公司 Method, device and system for discovering network equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10270675B1 (en) * 2010-12-31 2019-04-23 Open Invention Network Llc Method and apparatus of discovering and monitoring network devices
CN109245940A (en) * 2018-10-15 2019-01-18 厦门卓网信息科技股份有限公司 A kind of method network equipment discovery and detected

Also Published As

Publication number Publication date
CN113055252A (en) 2021-06-29

Similar Documents

Publication Publication Date Title
CN113055252B (en) Method, device, equipment and storage medium for detecting newly added service host
WO2021051878A1 (en) Cloud resource acquisition method and apparatus based on user permission, and computer device
CN110311831B (en) Container cloud-based system resource monitoring method and related equipment
CN107800565B (en) Inspection method, inspection device, inspection system, computer equipment and storage medium
CN107666493B (en) Database configuration method and equipment thereof
CN112364110A (en) Metadata management method, device and equipment and computer storage medium
CN110297867B (en) Database cluster operation method and system based on domestic CPU and distributed container cluster
CN114884838A (en) Monitoring method of Kubernetes component and server
CN110278101B (en) Resource management method and equipment
CN114281253A (en) Storage volume management method
CN114138483B (en) Virtualized resource management method, device, server, system and medium
CN115988057A (en) Database cluster quick connection method, storage medium and device
CN114050990B (en) Method and device for testing network isolation equipment, storage medium and electronic equipment
CN115001974A (en) Cluster system consistency detection method, device, system, equipment and storage medium
CN108228272B (en) WEB container generation processing method, equipment and server
CN115643163A (en) Fault equipment positioning method, device, equipment and storage medium
CN112468314B (en) Method for realizing automatic deployment of log service based on service grid
CN111858079B (en) Distributed lock migration method and device, electronic equipment and storage medium
CN111221847B (en) Monitoring data storage method, device and computer readable storage medium
CN113076112A (en) Database deployment method and device and electronic equipment
CN114513419A (en) Security policy configuration method and system
CN106850245B (en) Diagnostic test message processing method and device
CN106844058B (en) Management method and device for virtualized resources
CN115118955B (en) Service testing method and device and storable medium
CN114884987B (en) Method, device and storage medium for acquiring equipment state information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant