CN115022289A - Method, device, equipment and storage medium for detecting continuously available IP addresses - Google Patents

Method, device, equipment and storage medium for detecting continuously available IP addresses Download PDF

Info

Publication number
CN115022289A
CN115022289A CN202210611017.5A CN202210611017A CN115022289A CN 115022289 A CN115022289 A CN 115022289A CN 202210611017 A CN202210611017 A CN 202210611017A CN 115022289 A CN115022289 A CN 115022289A
Authority
CN
China
Prior art keywords
addresses
continuous
maximum
address
numbers
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.)
Granted
Application number
CN202210611017.5A
Other languages
Chinese (zh)
Other versions
CN115022289B (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210611017.5A priority Critical patent/CN115022289B/en
Publication of CN115022289A publication Critical patent/CN115022289A/en
Application granted granted Critical
Publication of CN115022289B publication Critical patent/CN115022289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The application discloses a method, a device and equipment for detecting continuously available IP addresses and a readable storage medium, wherein the method comprises the following steps: acquiring continuous IP addresses distributed to a target data center machine room, and continuously numbering the continuous IP addresses; acquiring IP addresses in continuous IP addresses occupied by physical nodes in a target data center machine room, and recording numbers corresponding to the occupied IP addresses in the continuous IP addresses in a used array; adding a minimum record number and a maximum record number in a used array according to the minimum number and the maximum number corresponding to the continuous IP addresses; the minimum record number is 1 less than the minimum number, and the maximum record number is 1 greater than the maximum number; and determining the maximum continuous available IP address information corresponding to the target central computer room according to the used array. According to the technical scheme, the automatic detection of the maximum continuous IP addresses is realized, the labor consumption of the maximum continuous IP address detection is reduced, and the detection efficiency and the detection accuracy are improved.

Description

Method, device, equipment and storage medium for detecting continuously available IP addresses
Technical Field
The present application relates to the field of IP address detection technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for detecting a continuously available IP address.
Background
At present, the digital transformation and upgrading of the society cannot be realized by intelligent transformation. With the integration of cloud computing and big data into various industries, the people enter an intelligent computing era, the total amount of data in the whole society is increased explosively, and the demand on computing power is greatly improved. Computational power is becoming the core driving force for the development of digital economies. Data center machine rooms in the industries such as government affairs, national enterprises, internet and the like are hundreds of thousands, even thousands of physical nodes are common. Among them, these data centers usually do not use a DHCP (Dynamic Host Configuration Protocol) to automatically allocate IP (Internet Protocol) addresses, and have strict IP planning.
Whether the data center machine room is a small machine room with thousands of nodes or dozens of servers, new idle IP addresses are planned to be used every day, and the idle IP addresses are released to be idle networks when the used IP addresses are used up. For convenience of use, many scenarios require multiple consecutive available IP addresses, and therefore, the maximum number of consecutive available IP addresses needs to be detected.
Currently, when detecting the maximum number of continuous available IP addresses, an IP address used by each physical node in a data center machine room is obtained through manual query, all IP addresses corresponding to the data center machine room are obtained, and then, the maximum number of available continuous IP addresses is determined through manual sequencing, calculation and the like based on the queried used IP addresses and all IP addresses. However, since the number of physical nodes and the number of IP addresses in the data center room are large, and idle IP addresses may be used at any time, the manual detection of the maximum available continuous IP addresses consumes a lot of manpower, the efficiency is low, and errors in query and record may occur, which may result in an error detection of the maximum available continuous IP addresses.
In summary, how to reduce the labor consumption for detecting the maximum number of continuously available IP addresses and improve the detection efficiency is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, an object of the present application is to provide a method, an apparatus, a device and a readable storage medium for detecting continuously available IP addresses, which are used to reduce the manpower consumption for detecting the continuously available IP addresses at most and improve the detection efficiency.
In order to achieve the above purpose, the present application provides the following technical solutions:
a method of continuously available IP address detection, comprising:
acquiring continuous IP addresses distributed to a target data center machine room, and continuously numbering the continuous IP addresses;
acquiring IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room, and recording the numbers corresponding to the occupied IP addresses in the continuous IP addresses in a used array;
adding a minimum record number and a maximum record number in the used array according to the minimum number and the maximum number corresponding to the continuous IP addresses; wherein the minimum record number is 1 less than the minimum number, and the maximum record number is 1 greater than the maximum number;
and determining the maximum continuous available IP address information corresponding to the target central machine room according to the used array.
Preferably, determining the maximum continuously available IP address information corresponding to the target central office according to the used array includes:
sequencing the numbers contained in the used arrays according to the size sequence to obtain the sequenced used arrays;
acquiring the number of serial numbers contained between two adjacent serial numbers in the sorted used array, and determining the maximum number of serial numbers as the maximum number of continuous available IP addresses corresponding to the target central machine room;
and determining the IP address corresponding to the maximum number of the continuous available IP addresses according to the two adjacent numbers corresponding to the maximum number in the sorted used array and the numbers corresponding to the continuous IP addresses.
Preferably, the obtaining the number of the serial numbers included between two adjacent serial numbers in the sorted used array includes:
and subtracting two adjacent numbers in the sorted used array, taking the absolute value of the difference obtained by subtracting, and subtracting 1 from the absolute value to obtain the number of the numbers contained in the two adjacent numbers.
Preferably, after obtaining the number of numbers included between two adjacent numbers in the sorted used array, the method further includes:
and determining the number of the serial numbers contained between two adjacent serial numbers in the sorted used array as the number of the continuous available IP addresses corresponding to the target central computer room.
Preferably, after determining the IP address corresponding to the maximum number of consecutive available IP addresses, the method further includes:
and outputting the maximum continuous available IP address number and the corresponding IP address corresponding to the target data center machine room.
Preferably, the acquiring an IP address of the consecutive IP addresses occupied by the physical node in the target data center machine room includes:
and acquiring the IP address in the continuous IP addresses occupied by the physical node in the target data center machine room in real time.
Preferably, the method further comprises the following steps:
and if the occupied IP address is detected to be released, deleting the number corresponding to the released IP address from the used array.
A continuously available IP address detection apparatus comprising:
the system comprises an acquisition module, a storage module and a control module, wherein the acquisition module is used for acquiring continuous IP addresses distributed to a target data center machine room and continuously numbering the continuous IP addresses;
the recording module is used for acquiring the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room and recording the numbers corresponding to the occupied IP addresses in the continuous IP addresses in the used array;
the adding module is used for adding a minimum record number and a maximum record number in the used array according to the minimum number and the maximum number corresponding to the continuous IP addresses; wherein the minimum record number is 1 less than the minimum number, and the maximum record number is 1 more than the maximum number;
and the determining module is used for determining the maximum continuous available IP address information corresponding to the target central computer room according to the used array.
A continuously available IP address detecting apparatus comprising:
a memory for storing a computer program;
a processor for implementing the steps of the continuously available IP address detection method according to any of the above when executing the computer program.
A readable storage medium, having stored therein a computer program which, when being executed by a processor, carries out the steps of the continuously available IP address detection method according to any one of the preceding claims.
The application provides a method, a device, equipment and a readable storage medium for detecting a continuously available IP address, wherein the method comprises the following steps: acquiring continuous IP addresses distributed to a target data center machine room, and continuously numbering the continuous IP addresses; acquiring IP addresses in continuous IP addresses occupied by physical nodes in a target data center machine room, and recording numbers corresponding to the occupied IP addresses in the continuous IP addresses in a used array; adding a minimum record number and a maximum record number in a used array according to the minimum number and the maximum number corresponding to the continuous IP addresses; wherein, the minimum record number is 1 less than the minimum number, and the maximum record number is 1 more than the maximum number; and determining the maximum continuous available IP address information corresponding to the target central computer room according to the used array.
According to the technical scheme disclosed by the application, the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room are obtained by continuously numbering the continuous IP addresses allocated to the target data center machine room, the numbers corresponding to the occupied IP addresses in the continuous IP addresses are recorded in the used array, the minimum record number which is smaller than the minimum number corresponding to the continuous IP addresses by 1 and the maximum record number which is larger than the maximum number corresponding to the continuous IP addresses by 1 are added in the used array, and the maximum continuously available IP address information corresponding to the target center machine room is determined according to the used array so as to realize the automatic detection of the maximum continuous IP addresses without manual participation, so that the labor consumption in the detection process of the maximum continuous IP addresses is reduced, the detection efficiency and the detection accuracy of the maximum continuous IP addresses are improved, and the quick deployment and the online of the application are convenient to realize, the stability of the data center is guaranteed, the management cost investment of the data center is reduced, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for detecting a continuously available IP address according to an embodiment of the present application;
fig. 2 is a schematic view of consecutive numbers corresponding to consecutive IP addresses allocated to a target data center machine room according to the embodiment of the present application;
fig. 3 is a schematic structural diagram of a continuously available IP address detection apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a continuously available IP address detection device according to an embodiment of the present application.
Detailed Description
The core of the application is to provide a method, a device, equipment and a readable storage medium for detecting continuously available IP addresses, which are used for reducing the manpower consumption of detecting the continuously available IP addresses at most and improving the detection efficiency.
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, which shows a flowchart of a method for detecting a continuously available IP address according to an embodiment of the present application, the method for detecting a continuously available IP address according to an embodiment of the present application may include:
s11: and acquiring continuous IP addresses distributed to the target data center machine room, and numbering the continuous IP addresses continuously.
When detecting the continuously available IP addresses, first, a target data center room to be detected the continuously available IP addresses needs to be determined. The determining method may specifically be that a user sends a query command of the continuously available IP addresses of the target data center computer room (the query command may include information such as an identifier or a name of the target data center computer room), and then, the target data center computer room is determined according to the received query command of the continuously available IP addresses of the target data center computer room sent by the user, or of course, the target data center computer room may also be obtained through automatic query.
After the target data center room is determined, the continuous IP addresses allocated to the target data center room may be automatically obtained, where the continuous IP addresses mentioned herein may be specifically allocated to the target data center room by the system, or may be allocated by a user of the target data center room actively.
After the continuous IP addresses allocated to the target data center room are automatically obtained, the continuous IP addresses allocated to the target data center room may be automatically numbered: first, first +1, … …, last, and specifically refer to fig. 2, which shows a schematic diagram of consecutive numbers corresponding to consecutive IP addresses allocated to a target data center computer room according to an embodiment of the present application, that is, a first IP address in the consecutive IP addresses is numbered as first, and a second IP address in the consecutive IP addresses is numbered as first +1 … …, so as to detect continuously available IP addresses according to the consecutive numbers of the consecutive IP addresses, and improve convenience and accuracy of detecting the continuously available IP addresses by continuously numbering the consecutive IP addresses.
In order to improve the convenience of detection, first +1, … …, last are integers, and the value of first may be 1 or not 1, that is, when consecutive IP addresses are assigned, consecutive IP addresses may be numbered from 1 according to 1, 2, … … (i.e., the first IP address in the consecutive IP addresses is numbered as 1, and the second IP address in the consecutive IP addresses is numbered as 2 … …), or from an integer (e.g., 2) not equal to 1 according to 2, 3, … … (i.e., the first IP address in the consecutive IP addresses is numbered as 2, and the second IP address in the consecutive IP addresses is numbered as 3 … …).
Through the above-mentioned serial numbering of the continuous IP addresses, the corresponding relation between each IP address in the continuous IP addresses and the serial number can be obtained, so that the detection of the continuously available IP addresses can be conveniently carried out based on the corresponding relation.
S12: and acquiring IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room, and recording the numbers corresponding to the occupied IP addresses in the continuous IP addresses in the used array.
After the continuous IP addresses allocated to the target data center machine room are numbered continuously, the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room can be automatically obtained, that is, the IP addresses occupied in the continuous IP addresses allocated to the target data center machine room are obtained. Then, the occupied IP address corresponding number in the continuous IP addresses can be determined according to the corresponding relation between the IP addresses and the numbers in the continuous IP addresses, and the number corresponding to the occupied IP address in the continuous IP addresses is recorded in the used array. Where used [ i ] indicates that the IP address is already occupied and the used array may be unordered.
After the used array is obtained, the number of the numbers existing between any two adjacent numbers in the numbers contained in the used array is the number of the continuously available IP addresses, so that the determination of the maximum continuously available IP address information can be performed subsequently through the used array.
S13: adding a minimum record number and a maximum record number in the used array according to the minimum number and the maximum number corresponding to the continuous IP addresses; the minimum record number is 1 smaller than the minimum number, and the maximum record number is 1 larger than the maximum number.
Considering that only the number corresponding to the occupied IP address in the consecutive IP addresses is recorded in the used array used and the maximum consecutive available IP address is determined, the first IP address and the last IP address in the consecutive IP addresses are ignored, that is, the IP addresses numbered first and last are ignored, so in order to improve the accuracy of detecting the maximum consecutive available IP address information, the minimum record number and the maximum record number may be added in the used array used according to the minimum number and the maximum number corresponding to the consecutive IP addresses, specifically, the minimum record number added in the used array used is less than 1 than the minimum number corresponding to the consecutive IP addresses, that is, the minimum record number added in the used array used is less than 1 than first, that is, the minimum record number added in the used array used is first-1; the maximum record number added in the used array is 1 greater than the maximum number corresponding to the consecutive IP addresses, that is, the maximum record number added in the used array is 1 greater than last, that is, the maximum record number added in the used array is last + 1. For example: assuming that the used array used obtained in step S12 is used ═ b, a, d, c … … ], the used array used obtained after step S13 is used ═ first-1, b, a, d, c … …, last + 1.
S14: and determining the maximum continuous available IP address information corresponding to the target central computer room according to the used array.
After the minimum record number and the maximum record number are added to the used array used, the maximum continuously available IP address information corresponding to the target central computer room may be determined according to the used array used, and specifically, the maximum continuously available IP address information corresponding to the target central computer room may be determined according to two adjacent numbers in the numbers included in the used array used, so as to automatically determine the maximum continuously available IP address information corresponding to the target central computer room.
According to the process, the continuous IP addresses are automatically numbered continuously, the numbers corresponding to the occupied IP addresses in the continuous IP addresses are automatically recorded in the used array, the minimum record number and the maximum record number are automatically added in the used array, and the last continuous available IP address information corresponding to the target center machine room is automatically, quickly and accurately detected without manual participation.
According to the technical scheme disclosed by the application, the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room are obtained by continuously numbering the continuous IP addresses allocated to the target data center machine room, the numbers corresponding to the occupied IP addresses in the continuous IP addresses are recorded in the used array, the minimum record number which is smaller than the minimum number corresponding to the continuous IP addresses by 1 and the maximum record number which is larger than the maximum number corresponding to the continuous IP addresses by 1 are added in the used array, and the maximum continuously available IP address information corresponding to the target center machine room is determined according to the used array so as to realize the automatic detection of the maximum continuous IP addresses without manual participation, so that the labor consumption in the detection process of the maximum continuous IP addresses is reduced, the detection efficiency and the detection accuracy of the maximum continuous IP addresses are improved, and the quick deployment and the online of the application are convenient to realize, the stability of the data center is guaranteed, the management cost investment of the data center is reduced, and the user experience is improved.
The method for detecting continuously available IP addresses provided in the embodiment of the present application, determining the maximum continuously available IP address information corresponding to a target central computer room according to a used array, may include:
sequencing numbers contained in the used arrays according to the size sequence to obtain sequenced used arrays;
acquiring the number of serial numbers contained between two adjacent serial numbers in the sorted used array, and determining the maximum number as the maximum number of continuous available IP addresses corresponding to the target central machine room;
and determining the IP address corresponding to the maximum number of the continuous available IP addresses according to the two adjacent numbers corresponding to the maximum number in the sorted used array and the numbers corresponding to the continuous IP addresses.
In the present application, when determining the maximum consecutive available IP address information corresponding to the target central equipment room according to the used array, in order to improve convenience and efficiency of determining the maximum consecutive available IP address information corresponding to the target central equipment room, the numbers included in the used array may be sorted according to a size order (specifically, according to a sequence from small to large, or according to a sequence from large to small) to obtain the sorted used array. Then, the number of numbers included between two adjacent numbers in the sorted used array may be obtained, for example: assuming that there are two numbers 2 and 6 adjacent to each other in the sorted used array, it can be determined that the number of numbers included between the two adjacent numbers is 3. And after the number of the numbers contained between every two adjacent numbers in the sorted used array is determined, determining the maximum number of the numbers as the maximum number of the continuous available IP addresses corresponding to the target central computer room. Meanwhile, the IP addresses corresponding to the maximum number of the continuously available IP addresses can be determined according to the two adjacent numbers corresponding to the maximum number in the sorted used array and the numbers corresponding to the continuous IP addresses (namely, the numbers corresponding to the IP addresses in the continuous IP addresses respectively, namely, the corresponding relation between the IP addresses and the numbers in the continuous IP addresses), and specifically, the IP address corresponding to the number existing between the two adjacent numbers corresponding to the maximum number in the sorted used array is determined as each IP address corresponding to the maximum number of the continuously available IP addresses, so that the related personnel can know the maximum number of the continuously available IP addresses corresponding to the target data center machine room, and can also determine each IP address corresponding to the maximum number of the continuously available IP addresses, and the related personnel can conveniently perform subsequent operation based on the information, The preparation is used.
For example: for simplicity, assuming that a certain target data center room is allocated with 8 consecutive IP addresses, and the 8 numbers 2-9 are obtained by consecutively numbering the 8 consecutive IP addresses, wherein the IP addresses with numbers 4 and 6 are occupied, the sorted used array is [1,4,6,10] obtained by recording, adding the minimum record number and the maximum record number, and sorting, and the two numbers 2 and 3 included between the adjacent two numbers 1 and 4 in the sorted used array are obtained, the number 5 included between the adjacent two numbers 4 and 6 in the sorted used array is obtained, the three numbers 7, 8, and 9 included between the adjacent two numbers 6 and 10 in the sorted used array are obtained, and thus, the maximum number 3 can be obtained, at this time, it may be determined that the maximum number of consecutive available IP addresses corresponding to the target central equipment room is 3, and the IP address corresponding to the maximum number of consecutive available IP addresses may be determined according to two adjacent numbers, 6 and 10, corresponding to the maximum number of 3 in the sorted used array, and the number corresponding to the consecutive IP address, specifically, the IP address corresponding to the three numbers, 7, 8, and 9, existing between the two adjacent numbers, 6 and 10, is determined as the IP address corresponding to the maximum number of consecutive available IP addresses.
The method for detecting a continuously available IP address, provided by the embodiment of the present application, for obtaining the number of numbers included between two adjacent numbers in a sorted used array, may include:
and subtracting two adjacent numbers in the sequenced used array, taking the absolute value of the difference obtained by subtracting, and subtracting 1 from the absolute value to obtain the number of the numbers contained in the two adjacent numbers.
In this application, when obtaining the number of numbers included between two adjacent numbers in the sorted used array, specifically, the two adjacent numbers in the sorted used array may be subtracted, then an absolute value is obtained for the difference obtained by the subtraction, and then 1 is subtracted from the absolute value to obtain the number of numbers included in two adjacent numbers, for example: and if two adjacent numbers in the sorted used array are x and y respectively, the number of the numbers contained between the two adjacent numbers of x and y can be obtained by adopting | y-x | -1. Of course, the number of the numbers contained in the two adjacent numbers can also be obtained by directly subtracting the smaller number from the larger number and then subtracting 1 from the smaller number in the two adjacent numbers in the used array.
The number of the numbers contained between two adjacent numbers in the sorted used array can be quickly calculated by the method.
Taking the example that the used arrays after the sorting are obtained by sorting the numbers included in the used arrays from small to large in the present application, the core code for obtaining the maximum number of numbers included between two adjacent numbers in the used arrays after the sorting is specifically as follows:
Figure BDA0003673151960000091
Figure BDA0003673151960000101
the method for detecting a continuously available IP address provided in the embodiment of the present application, after obtaining the number of numbers included between two adjacent numbers in the sorted used array, may further include:
and determining the number of the serial numbers contained between two adjacent serial numbers in the sorted used array as the number of the continuous available IP addresses corresponding to the target central computer room.
In the application, after the number of the serial numbers contained between two adjacent serial numbers in the sorted used array is obtained, the number of the serial numbers contained between two adjacent serial numbers in the sorted used array can be determined as the number of the continuous available IP addresses corresponding to the target center machine room, and the number of the continuous available IP addresses corresponding to the target center machine room can be output, so that related personnel can obtain the maximum number of the continuous available IP addresses corresponding to the target center machine room, and can obtain the rest of the continuous available IP addresses corresponding to the target center machine room at the same time, and the related personnel can select and use according to requirements subsequently.
In addition, when the number of the numbers contained between two adjacent numbers in the sorted used array is determined as the number of the continuous available IP addresses corresponding to the target central computer room, the corresponding IP addresses corresponding to the number of the other continuous available IP addresses except the maximum number of the continuous available IP addresses can be respectively determined according to the number of the other continuous available IP addresses corresponding to the two adjacent numbers and the continuous IP addresses in the sorted used array, so that the relevant personnel can obtain the IP addresses corresponding to the other continuous available IP addresses, and the relevant personnel can select and use the IP addresses according to requirements, and the user experience degree is improved.
After determining the IP address corresponding to the maximum number of consecutive available IP addresses, the method for detecting a consecutive available IP address provided in the embodiment of the present application may further include:
and outputting the maximum continuous available IP address number and the corresponding IP address corresponding to the target data center machine room.
In the application, after the IP address corresponding to the maximum number of the continuous available IP addresses is determined, the maximum number of the continuous available IP addresses corresponding to the target data center machine room and the corresponding IP address can be output, and specifically, the maximum number of the continuous available IP addresses corresponding to the target data center machine room and the corresponding IP address can be output in at least one mode of short messages, mails, WeChat small programs and Paibao small programs, so that related personnel can timely and quickly obtain the maximum number of the continuous available IP addresses corresponding to the target data center machine room and the corresponding IP address.
The method for detecting the continuously available IP addresses, provided by the embodiment of the present application, for acquiring the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room, may include:
and acquiring the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room in real time.
In the application, when the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room are obtained, the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room can be obtained in real time, so that the occupied IP addresses in the continuous IP addresses can be found in time, the occupied IP addresses are recorded in the used array in time, and the accuracy of information detection of the maximum continuous available IP addresses is improved.
Of course, the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room may also be obtained at regular time, where the regular time interval may be set according to actual conditions, so as to reduce resources consumed by the query and implement automatic detection of the maximum continuous available IP address information.
The method for detecting a continuously available IP address provided in the embodiment of the present application may further include:
and if the occupied IP address is detected to be released, deleting the number corresponding to the released IP address from the used array.
In the application, in the process of acquiring the IP addresses in the continuous IP addresses occupied by the physical node in the target data center machine room, if it is detected that the occupied IP addresses are released (at this time, the released IP addresses become idle and available IP addresses), the numbers corresponding to the released IP addresses can be acquired, and the numbers corresponding to the released IP addresses are deleted from the used array, so as to improve the accuracy of information detection of the maximum continuously available IP addresses.
An embodiment of the present application further provides a device for detecting a continuously available IP address, refer to fig. 3, which shows a schematic structural diagram of the device for detecting a continuously available IP address according to the embodiment of the present application, and the device may include:
the acquiring module 31 is configured to acquire continuous IP addresses allocated to a target data center machine room, and continuously number the continuous IP addresses;
the recording module 32 is configured to obtain IP addresses in continuous IP addresses occupied by physical nodes in a target data center machine room, and record numbers corresponding to the occupied IP addresses in the continuous IP addresses in a used array;
an adding module 33, configured to add a minimum record number and a maximum record number in the used array according to the minimum number and the maximum number corresponding to the consecutive IP addresses; wherein, the minimum record number is 1 less than the minimum number, and the maximum record number is 1 more than the maximum number;
and the determining module 34 is configured to determine, according to the used array, the maximum continuously available IP address information corresponding to the target central office.
According to the technical scheme disclosed by the application, the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room are obtained by continuously numbering the continuous IP addresses allocated to the target data center machine room, the numbers corresponding to the occupied IP addresses in the continuous IP addresses are recorded in the used array, the minimum record number which is smaller than the minimum number corresponding to the continuous IP addresses by 1 and the maximum record number which is larger than the maximum number corresponding to the continuous IP addresses by 1 are added in the used array, and the maximum continuously available IP address information corresponding to the target center machine room is determined according to the used array so as to realize the automatic detection of the maximum continuous IP addresses without manual participation, so that the labor consumption in the detection process of the maximum continuous IP addresses is reduced, the detection efficiency and the detection accuracy of the maximum continuous IP addresses are improved, and the quick deployment and the online of the application are convenient to realize, the stability of the data center is guaranteed, the management cost investment of the data center is reduced, and the user experience is improved.
In the apparatus for detecting a continuously available IP address provided in the embodiment of the present application, the determining module 34 may include:
the sequencing unit is used for sequencing the numbers contained in the used arrays according to the size sequence to obtain the sequenced used arrays;
the first determining unit is used for acquiring the number of serial numbers contained between two adjacent serial numbers in the sorted used array, and determining the maximum number of serial numbers as the maximum number of continuous available IP addresses corresponding to the target central computer room;
and the second determining unit is used for determining the IP address corresponding to the maximum number of the continuous available IP addresses according to the two adjacent numbers corresponding to the maximum number in the sorted used array and the numbers corresponding to the continuous IP addresses.
In an apparatus for detecting a continuously available IP address provided in an embodiment of the present application, a first determining unit may include:
and the subtracting subunit is used for subtracting two adjacent numbers in the sorted used array, taking an absolute value of the difference obtained by subtracting, and subtracting 1 from the absolute value to obtain the number of the numbers contained in the two adjacent numbers.
In the apparatus for detecting a continuously available IP address provided in the embodiment of the present application, the determining module 34 may further include:
and the third determining subunit is used for determining the number of the serial numbers included between the two adjacent serial numbers in the sorted used array as the number of the continuous available IP addresses corresponding to the target central computer room after acquiring the number of the serial numbers included between the two adjacent serial numbers in the sorted used array.
In the apparatus for detecting a continuously available IP address provided in the embodiment of the present application, the determining module 34 may further include:
and the output subunit is used for outputting the maximum number of the continuous available IP addresses and the corresponding IP addresses corresponding to the target data center machine room after the IP addresses corresponding to the maximum number of the continuous available IP addresses are determined.
In the apparatus for detecting a continuously available IP address provided in the embodiment of the present application, the obtaining module 31 may include:
and the acquisition unit is used for acquiring the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room in real time.
The apparatus for detecting a continuously available IP address provided in the embodiment of the present application may further include:
and the deleting module is used for deleting the number corresponding to the released IP address from the used array if the occupied IP address is detected to be released.
An embodiment of the present application further provides a device for detecting a continuously available IP address, refer to fig. 4, which shows a schematic structural diagram of the device for detecting a continuously available IP address provided in the embodiment of the present application, and the device may include:
a memory 41 for storing a computer program;
the processor 42, when executing the computer program stored in the memory 41, may implement the following steps:
acquiring continuous IP addresses distributed to a target data center machine room, and continuously numbering the continuous IP addresses; acquiring IP addresses in continuous IP addresses occupied by physical nodes in a target data center machine room, and recording numbers corresponding to the occupied IP addresses in the continuous IP addresses in a used array; adding a minimum record number and a maximum record number in a used array according to the minimum number and the maximum number corresponding to the continuous IP addresses; wherein, the minimum record number is 1 less than the minimum number, and the maximum record number is 1 more than the maximum number; and determining the maximum continuous available IP address information corresponding to the target central computer room according to the used array.
An embodiment of the present application further provides a readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the following steps may be implemented:
acquiring continuous IP addresses distributed to a target data center machine room, and continuously numbering the continuous IP addresses; acquiring IP addresses in continuous IP addresses occupied by physical nodes in a target data center machine room, and recording numbers corresponding to the occupied IP addresses in the continuous IP addresses in a used array; adding a minimum record number and a maximum record number in a used array according to the minimum number and the maximum number corresponding to the continuous IP addresses; wherein, the minimum record number is 1 less than the minimum number, and the maximum record number is 1 more than the maximum number; and determining the maximum continuous available IP address information corresponding to the target central computer room according to the used array.
The readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
For a description of a relevant part in the apparatus, the device, and the readable storage medium for detecting a continuously available IP address provided in the present application, reference may be made to a detailed description of a corresponding part in a method for detecting a continuously available IP address provided in the present application, and details are not described herein again.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include elements inherent in the list. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element. In addition, parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of corresponding technical solutions in the prior art, are not described in detail so as to avoid redundant description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for detecting a continuously available IP address, comprising:
acquiring continuous IP addresses distributed to a target data center machine room, and continuously numbering the continuous IP addresses;
acquiring IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room, and recording the numbers corresponding to the occupied IP addresses in the continuous IP addresses in a used array;
adding a minimum record number and a maximum record number in the used array according to the minimum number and the maximum number corresponding to the continuous IP addresses; wherein the minimum record number is 1 less than the minimum number, and the maximum record number is 1 greater than the maximum number;
and determining the maximum continuous available IP address information corresponding to the target central machine room according to the used array.
2. The method of claim 1, wherein determining the maximum consecutive available IP address information corresponding to the target central office according to the used array comprises:
sequencing the numbers contained in the used arrays according to the size sequence to obtain the sequenced used arrays;
acquiring the number of serial numbers contained between two adjacent serial numbers in the sorted used array, and determining the maximum number of serial numbers as the maximum number of continuous available IP addresses corresponding to the target central machine room;
and determining the IP address corresponding to the maximum number of the continuous available IP addresses according to the two adjacent numbers corresponding to the maximum number in the sorted used array and the numbers corresponding to the continuous IP addresses.
3. The method of claim 2, wherein obtaining the number of numbers included between two adjacent numbers in the sorted used array comprises:
and subtracting two adjacent numbers in the sorted used array, taking the absolute value of the difference obtained by subtracting, and subtracting 1 from the absolute value to obtain the number of the numbers contained in the two adjacent numbers.
4. The method according to claim 2, further comprising, after obtaining the number of numbers included between two adjacent numbers in the sorted used array, the following steps:
and determining the number of the serial numbers contained between two adjacent serial numbers in the sequenced used array as the number of the continuous available IP addresses corresponding to the target central computer room.
5. The method according to claim 2, further comprising, after determining the IP address corresponding to the maximum number of consecutive available IP addresses:
and outputting the maximum continuous available IP address number and the corresponding IP address corresponding to the target data center machine room.
6. The method of claim 1, wherein obtaining the IP address of the consecutive IP addresses occupied by the physical node in the target data center room comprises:
and acquiring the IP address in the continuous IP addresses occupied by the physical node in the target data center machine room in real time.
7. The method of claim 1, further comprising:
and if the occupied IP address is detected to be released, deleting the number corresponding to the released IP address from the used array.
8. A continuously available IP address detecting apparatus, comprising:
the system comprises an acquisition module, a storage module and a control module, wherein the acquisition module is used for acquiring continuous IP addresses distributed to a target data center machine room and continuously numbering the continuous IP addresses;
the recording module is used for acquiring the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center machine room and recording the numbers corresponding to the occupied IP addresses in the continuous IP addresses in the used array;
the adding module is used for adding a minimum record number and a maximum record number in the used array according to the minimum number and the maximum number corresponding to the continuous IP addresses; wherein the minimum record number is 1 less than the minimum number, and the maximum record number is 1 more than the maximum number;
and the determining module is used for determining the maximum continuous available IP address information corresponding to the target central machine room according to the used array.
9. A continuously available IP address detecting apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the continuously available IP address detection method according to any of claims 1 to 7 when executing said computer program.
10. A readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method for continuously available IP address detection according to any one of claims 1 to 7.
CN202210611017.5A 2022-05-31 2022-05-31 Method, device, equipment and storage medium for detecting continuously available IP addresses Active CN115022289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210611017.5A CN115022289B (en) 2022-05-31 2022-05-31 Method, device, equipment and storage medium for detecting continuously available IP addresses

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210611017.5A CN115022289B (en) 2022-05-31 2022-05-31 Method, device, equipment and storage medium for detecting continuously available IP addresses

Publications (2)

Publication Number Publication Date
CN115022289A true CN115022289A (en) 2022-09-06
CN115022289B CN115022289B (en) 2023-08-15

Family

ID=83071874

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210611017.5A Active CN115022289B (en) 2022-05-31 2022-05-31 Method, device, equipment and storage medium for detecting continuously available IP addresses

Country Status (1)

Country Link
CN (1) CN115022289B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116896543A (en) * 2023-09-11 2023-10-17 中移(苏州)软件技术有限公司 IP address allocation method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103002067A (en) * 2012-12-24 2013-03-27 曙光云计算技术有限公司 Acquiring method of internet protocol (IP) addresses of virtual machine
CN108712519A (en) * 2018-05-31 2018-10-26 康键信息技术(深圳)有限公司 Localization method, device and the storage medium of IP address
WO2022017380A1 (en) * 2020-07-21 2022-01-27 中国移动通信有限公司研究院 User ip address allocation management method and apparatus, and session management function entity
CN114124690A (en) * 2021-08-30 2022-03-01 济南浪潮数据技术有限公司 Alarm configuration method, system and related device for data center

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103002067A (en) * 2012-12-24 2013-03-27 曙光云计算技术有限公司 Acquiring method of internet protocol (IP) addresses of virtual machine
CN108712519A (en) * 2018-05-31 2018-10-26 康键信息技术(深圳)有限公司 Localization method, device and the storage medium of IP address
WO2022017380A1 (en) * 2020-07-21 2022-01-27 中国移动通信有限公司研究院 User ip address allocation management method and apparatus, and session management function entity
CN114124690A (en) * 2021-08-30 2022-03-01 济南浪潮数据技术有限公司 Alarm configuration method, system and related device for data center

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116896543A (en) * 2023-09-11 2023-10-17 中移(苏州)软件技术有限公司 IP address allocation method and device, electronic equipment and storage medium
CN116896543B (en) * 2023-09-11 2024-05-24 中移(苏州)软件技术有限公司 IP address allocation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115022289B (en) 2023-08-15

Similar Documents

Publication Publication Date Title
CN109241084B (en) Data query method, terminal equipment and medium
WO2022083436A1 (en) Data processing method and apparatus, and device and readable storage medium
CN115022289B (en) Method, device, equipment and storage medium for detecting continuously available IP addresses
CN111198662A (en) Data storage method and device and computer readable storage medium
CN109960678A (en) A kind of name processing method and computer processor unit
US7437505B2 (en) Logical to physical device topological location mappings
CN115599300A (en) Task allocation method, device, equipment and medium
CN116610496A (en) Data recovery system
CN111274004B (en) Process instance management method and device and computer storage medium
CN113378044A (en) Question matching method and platform
CN113094224B (en) Server asset management method and device, computer equipment and storage medium
CN115309907B (en) Alarm log association method and device
CN103440174A (en) Error information processing method, device and electronic equipment applying device
CN115391318A (en) Expired data clearing method and device, storage medium and computer equipment
CN111858079B (en) Distributed lock migration method and device, electronic equipment and storage medium
CA3150581A1 (en) Method, apparatus, and system for incremental update of graphs
CN109039770B (en) Server CMC refreshing method and device and related equipment
CN113031835A (en) Menu data processing method and device
US6493822B1 (en) Foreign drive determination and drive letter conflict resolution
CN111159006B (en) Automatic testing method and device
CN111885159A (en) Data acquisition method and device, electronic equipment and storage medium
CN112698606A (en) Processing method for collected message
CN110837454A (en) Interface monitoring processing method and server
CN111966993B (en) Equipment identification code identification and generation algorithm test method, device, equipment and medium
CN111311329B (en) Tag data acquisition method, device, equipment and readable storage medium

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