CN115022289B - 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
CN115022289B
CN115022289B CN202210611017.5A CN202210611017A CN115022289B CN 115022289 B CN115022289 B CN 115022289B CN 202210611017 A CN202210611017 A CN 202210611017A CN 115022289 B CN115022289 B CN 115022289B
Authority
CN
China
Prior art keywords
addresses
continuous
maximum
available
address
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
CN202210611017.5A
Other languages
Chinese (zh)
Other versions
CN115022289A (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

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The application discloses a method, a device, equipment and a readable storage medium for detecting continuously available IP addresses, wherein the method comprises the following steps: acquiring continuous IP addresses distributed by 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 into the used array according to the minimum number and the maximum number corresponding to the continuous IP address; the minimum record number is smaller than the minimum number by 1, and the maximum record number is larger than the maximum number by 1; and determining the maximum continuous available IP address information corresponding to the target central machine room according to the used array. According to the technical scheme disclosed by the application, automatic detection of the maximum continuous IP addresses is realized, the manpower consumption for detecting the maximum continuous IP addresses 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 technology, and more particularly, to a method, apparatus, device, and readable storage medium for continuously available IP address detection.
Background
Currently, the digital transformation upgrading of society is not separated from intelligent transformation. Along with the integration of cloud computing and big data into various industries, we are entering an intelligent computing age, the total amount of the whole social data is exploded, and the demand on computing power is greatly improved. Computational effort is becoming the core driving force for the development of digital economies. Data center machine rooms of government, national enterprises, the Internet and other industries are hundreds of thousands, even tens of thousands of physical nodes are common. These data centers, among other things, typically do not automatically assign IP (Internet Protocol ) addresses using DHCP (Dynamic Host Configuration Protocol ), all have strict IP planning.
Whether a data center machine room with thousands of nodes or a small machine room with only tens of servers, a new free IP address may need to be planned for use every day, and meanwhile, the new free IP address may be released as a free network when the use of the IP address is finished. For convenience, many scenarios require multiple IP addresses to be continuously available, and therefore, it is necessary to detect the maximum number of IP addresses continuously available.
At present, when the number of the most available continuous IP addresses is detected, the number of the most available continuous IP addresses is manually determined by manually inquiring and acquiring the IP addresses used by each physical node in the data center machine room and acquiring all the IP addresses corresponding to the data center machine room, and then manually sorting, calculating and the like based on the inquired used IP addresses and all the IP addresses. However, because the number of physical nodes and the number of IP addresses in the data center room are numerous, and the idle IP addresses may be used at any time, detecting the most available continuous IP addresses by using a manual method consumes relatively large manpower, has relatively low efficiency, and may cause errors in querying and recording, thereby causing the situation of detecting the most available continuous IP addresses.
In summary, how to reduce the manpower consumption of the detection of the most 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, it is an object of the present application to provide a method, apparatus, device and readable storage medium for continuously available IP address detection, which are used for reducing the manpower consumption for continuously available IP address detection at most and improving the detection efficiency.
In order to achieve the above object, the present application provides the following technical solutions:
a method for continuously available IP address detection, comprising:
acquiring continuous IP addresses distributed by 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 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 into the used array according to the minimum number and the maximum number corresponding to the continuous IP address; 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, according to the used array, the most continuously available IP address information corresponding to the target central office includes:
sequencing the numbers contained in the used arrays according to the order of the sizes to obtain sequenced used arrays;
acquiring number numbers contained between two adjacent numbers in the ordered used array, and determining the maximum number as the maximum continuous available IP address number 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 adjacent two numbers corresponding to the maximum number in the ordered used array and the number corresponding to the continuous IP addresses.
Preferably, the obtaining the number of numbers included between two adjacent numbers in the ordered used array includes:
subtracting two adjacent numbers in the ordered used array, taking an absolute value of the difference value obtained by subtraction, 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 ordered used array, the method further includes:
and determining the number of the numbers contained between two adjacent numbers in the sequenced used array as the number of the continuous available IP addresses corresponding to the target central machine room.
Preferably, after determining the IP address corresponding to the maximum number of continuously available IP addresses, the method further includes:
and outputting the maximum number of the continuous available IP addresses corresponding to the target data center machine room and the corresponding IP addresses.
Preferably, the obtaining the IP address in the continuous IP addresses occupied by the physical node in the target data center room includes:
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.
Preferably, the method further comprises:
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 acquisition module is used for acquiring the continuous IP addresses distributed by the target data center machine room and numbering the continuous IP addresses continuously;
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 a used array;
the adding module is used for adding the minimum record number and the maximum record number into the used array according to the minimum number and the maximum number corresponding to the continuous IP address; 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 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.
A continuously available IP address detection apparatus comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for continuously detecting available IP addresses as claimed in any one of the preceding claims when executing the computer program.
A readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of the continuously available IP address detection method as claimed in any of the preceding claims.
The application provides a method, a device, equipment and a readable storage medium for detecting continuously available IP addresses, wherein the method comprises the following steps: acquiring continuous IP addresses distributed by 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 into the used array according to the minimum number and the maximum number corresponding to the continuous IP address; wherein, the minimum record number is smaller than the minimum number by 1, and the maximum record number is larger than the maximum number by 1; and determining the maximum continuous available IP address information corresponding to the target central machine room according to the used array.
According to the technical scheme disclosed by the application, the continuous IP addresses distributed 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 are obtained, 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 1 smaller than the minimum number corresponding to the continuous IP addresses and the maximum record number which is 1 larger than the maximum number corresponding to the continuous IP addresses are added in the used array, and the maximum continuous available IP address information corresponding to the target center machine room is determined according to the used array, so that the automatic detection of the maximum continuous IP addresses is realized without manual participation, the manpower 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, the quick deployment of the application is facilitated, the stability of the data center is ensured, 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 that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for detecting continuously available IP addresses according to an embodiment of the present application;
fig. 2 is a schematic diagram of serial numbers corresponding to continuous IP addresses allocated to a target data center room according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a continuously available IP address detecting apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a continuously available IP address detecting apparatus 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 following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, a flowchart of a method for detecting a continuously available IP address according to an embodiment of the present application is shown, where the method for detecting a continuously available IP address according to the embodiment of the present application may include:
s11: and acquiring continuous IP addresses distributed by the target data center machine room, and continuously numbering the continuous IP addresses.
In performing the continuously available IP address detection, first, it is necessary to determine a target data center room to be subjected to the continuously available IP address detection. The determining mode may specifically be that the user sends a continuous available IP address query command of the target data center room (the query command may include information such as an identifier or a name of the target center room), and then determines the target data center room according to the received continuous available IP address query command of the target data center room sent by the user, where, of course, the target data center room may also be obtained through automatic query.
After determining the target data center room, the continuous IP addresses allocated to the target data center room may be automatically acquired, where the continuous IP addresses mentioned herein may specifically be allocated to the target data center room by the system actively, or may be allocated by a user of the target data center room actively.
After automatically acquiring the continuous IP addresses allocated to the target data center room, the continuous IP addresses allocated to the target data center room may be automatically numbered: referring to fig. 2, a schematic diagram of a continuous number corresponding to a continuous IP address allocated to a target data center room in the embodiment of the present application may be shown, that is, a first IP address in the continuous IP addresses is numbered as first, and a second IP address in the continuous IP addresses is numbered as first+1 … …, so as to facilitate detection of continuously available IP addresses according to the continuous number of the continuous IP addresses, and improve convenience and accuracy of detection of continuously available IP addresses by continuously numbering the continuous IP addresses.
For the convenience of detection, the first, first+1, … …, last are integers, and the first may or may not be 1, that is, when the assigned consecutive IP addresses are consecutively numbered, the consecutive IP addresses may be consecutively numbered 1, 2, … … from 1 (i.e., the first IP address in the consecutive IP addresses is numbered 1, and the second IP address in the consecutive IP addresses is numbered 2 … …), or the consecutive IP addresses may be consecutively numbered 2, 3, … … from an integer (e.g., 2) other than 1 (i.e., the first IP address in the consecutive IP addresses is numbered 2, and the second IP address in the consecutive IP addresses is numbered 3 … …).
Through the continuous numbering of the continuous IP addresses, the corresponding relation between each IP address and the number in the continuous IP addresses can be obtained, so that the detection of the continuous available IP addresses is conveniently carried out based on the corresponding relation.
S12: and 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.
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 acquired automatically, namely the occupied IP addresses in the continuous IP addresses allocated to the target data center machine room are acquired. Then, the number corresponding to the occupied IP address in the continuous IP address may be determined according to the correspondence between the IP address and the number in the continuous IP address, and the number corresponding to the occupied IP address in the continuous IP address may be recorded in the used array. Where used i indicates that the IP address is already occupied and the used array used may be unordered.
After the used array used is obtained, the number of the numbers existing between any two adjacent numbers in the numbers contained in the used array used is the number of the continuous available IP addresses, so that the determination of the maximum continuous available IP address information can be carried out through the used array used later.
S13: adding a minimum record number and a maximum record number into the used array according to the minimum number and the maximum number corresponding to the continuous IP address; wherein the minimum record number is smaller than the minimum number by 1, and the maximum record number is larger than the maximum number by 1.
Considering that the first and last IP addresses of the consecutive IP addresses, i.e., the IP addresses numbered first and last, are ignored when the number corresponding to the occupied IP address of the consecutive IP addresses is recorded in the used array used only for the determination of the most consecutive available IP addresses, in order to improve the accuracy of the detection of the most 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 smaller than the minimum number corresponding to the consecutive IP addresses by 1, i.e., the minimum record number added in the used array used is smaller than first by 1, i.e., the minimum record number added in the used array used is first-1; the maximum record number added in the used array used is 1 greater than the maximum number corresponding to the continuous IP address, i.e., the maximum record number added in the used array used is 1 greater than last, i.e., the maximum record number added in the used array used is last+1. For example: assuming that the used array used obtained through 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 machine room according to the used array.
After the minimum record number and the maximum record number have been added to the used array used, the maximum continuous available IP address information corresponding to the target central machine room may be determined according to the used array used, specifically, the determination of the maximum continuous available IP address information corresponding to the target central machine room may be performed according to two adjacent numbers in the numbers included in the used array used, so as to automatically determine the maximum continuous available IP address information corresponding to the target central machine room.
According to the method and the device, continuous numbering is carried out on the continuous IP addresses automatically, numbers corresponding to occupied IP addresses in the continuous IP addresses are recorded in the used array automatically, the minimum recorded number and the maximum recorded number are added in the used array automatically, and finally continuous available IP address information corresponding to a target central machine room is detected automatically, rapidly and accurately without manual participation, so that manpower consumption in the process of detecting the maximum continuous available IP address information can be reduced, labor cost is reduced, accuracy and efficiency of detecting the maximum continuous available IP address information are improved, and research, development and testing efficiency can be greatly improved.
According to the technical scheme disclosed by the application, the continuous IP addresses distributed 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 are obtained, 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 1 smaller than the minimum number corresponding to the continuous IP addresses and the maximum record number which is 1 larger than the maximum number corresponding to the continuous IP addresses are added in the used array, and the maximum continuous available IP address information corresponding to the target center machine room is determined according to the used array, so that the automatic detection of the maximum continuous IP addresses is realized without manual participation, the manpower 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, the quick deployment of the application is facilitated, the stability of the data center is ensured, the management cost investment of the data center is reduced, and the user experience is improved.
The method for detecting the continuous available IP address provided by the embodiment of the application can determine the maximum continuous available IP address information corresponding to the target central machine room according to the used array, and can comprise the following steps:
sequencing the numbers contained in the used arrays according to the order of the sizes to obtain sequenced used arrays;
acquiring number numbers contained between two adjacent numbers in the ordered 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 adjacent two numbers corresponding to the maximum number in the ordered used array and the number corresponding to the continuous IP addresses.
In the present application, when determining the maximum available IP address information corresponding to the target central office according to the used array, in order to improve the convenience and efficiency of determining the maximum available IP address information corresponding to the target central office, the numbers included in the used array may be first sorted according to the order of sizes (specifically, the order may be from small to large, or the order may also be from large to small), so as to obtain the sorted used array. Then, the number of numbers included between two adjacent numbers in the ordered used array may be obtained, for example: assuming that there are two adjacent numbers 2 and 6 in the ordered used array, the number of numbers included between the two adjacent numbers can be determined to be 3. After the number of the numbers contained between every two adjacent numbers in the ordered used array is determined, the maximum number is determined as the maximum number of the continuous available IP addresses corresponding to the target central machine room. Meanwhile, each IP address corresponding to the maximum number of available IP addresses can be determined according to two adjacent numbers corresponding to the maximum number in the ordered used array and the number corresponding to the continuous IP addresses (namely, the numbers corresponding to each IP address in the continuous IP addresses, namely, the corresponding relation between each IP address in the continuous IP addresses and the number), specifically, each IP address corresponding to the number existing between the adjacent two numbers corresponding to the maximum number in the ordered used array is determined as each IP address corresponding to the maximum number of available IP addresses, so that a related person can not only obtain the maximum number of available IP addresses corresponding to the target data center machine room, but also determine each IP address corresponding to the maximum number of available IP addresses, and further, the related person can conveniently perform subsequent operation and use based on the obtained information.
For example: for simplicity, assuming that a target data center room is assigned 8 consecutive IP addresses, the 8 numbers of 2-9 are obtained by consecutively numbering the 8 consecutive IP addresses, wherein the IP addresses numbered 4 and 6 are already occupied, the ordered used array is [1,4,6,10] by recording, adding the minimum recording number and the maximum recording number, and ordering, and the number of the two numbers 2 and 3 contained between the two adjacent numbers 1 and 4 in the ordered used array is obtained, the number of the one number 5 contained between the two adjacent numbers 4 and 6 in the ordered used array is obtained, the numbers of the numbers 7, 8 and 9 contained between the adjacent two numbers 6 and 10 in the ordered used array are obtained, so that the maximum number of numbers is 3, at this time, the maximum number of continuous available IP addresses corresponding to the target central machine room can be determined to be 3, and the IP address corresponding to the maximum number of continuous available IP addresses can be determined according to the numbers of the adjacent two numbers 6 and 10 and the numbers of continuous IP addresses corresponding to the maximum number of numbers 3 in the ordered used array, specifically, the IP addresses corresponding to the three numbers 7, 8 and 9 respectively existing between the adjacent two numbers 6 and 10 are determined to be the IP addresses corresponding to the maximum number of continuous available IP addresses.
The method for detecting the continuously available IP address provided by the embodiments of the present application, for obtaining the number of numbers included between two adjacent numbers in the sequenced used array, may include:
subtracting two adjacent numbers in the ordered used array, taking an absolute value of the difference value obtained by subtraction, and subtracting 1 from the absolute value to obtain the number of the numbers contained in the two adjacent numbers.
In the present application, when obtaining numbers included between two adjacent numbers in the ordered used array, specifically, the two adjacent numbers in the ordered used array may be subtracted, then, an absolute value is taken for a difference obtained by the subtraction, and then, the absolute value is subtracted by 1 to obtain numbers included in the two adjacent numbers, for example: and if two adjacent numbers in the ordered 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 numbers included in two adjacent numbers in the used array can be obtained by directly subtracting 1 from the smaller number from the larger number in the two adjacent numbers.
By the method, the number of the numbers contained between two adjacent numbers in the ordered used array can be rapidly calculated.
Taking the application as an example of sorting the numbers contained in the used array according to the order from small to large to obtain the sorted used array, the core codes for obtaining the number of the largest number contained between two adjacent numbers in the sorted used array are specifically as follows:
the method for detecting the continuously available IP address provided by the embodiment of the present application may further include, after obtaining the number of numbers included between two adjacent numbers in the ordered used array:
and determining the number of the numbers contained between two adjacent numbers in the sequenced used array as the number of the continuous available IP addresses corresponding to the target central machine room.
In the application, after the number of the numbers contained between the adjacent two numbers in the ordered used array is obtained, the number of the numbers contained between the adjacent two numbers in the ordered used array can be also determined as the continuous available IP address number corresponding to the target central machine room, and the continuous available IP address number corresponding to the target central machine room can be output, so that a related person can not only know the maximum continuous available IP address number corresponding to the target central machine room, but also simultaneously obtain the rest continuous available IP address numbers corresponding to the target central machine room, thereby being convenient for the related person to select the use according to the requirement.
In addition, while the number of numbers included between two adjacent numbers in the ordered used array is determined as the number of continuous available IP addresses corresponding to the target central machine room, corresponding IP addresses corresponding to the number of continuous available IP addresses except the number of continuous available IP addresses in the ordered used array can be determined according to the number of adjacent two corresponding numbers and the number of continuous IP addresses corresponding to the number of continuous available IP addresses in the ordered used array, so that related personnel can acquire each IP address corresponding to the number of continuous available IP addresses, and the related personnel can select and use the IP addresses according to requirements conveniently.
The method for detecting the continuously available IP addresses provided by the embodiment of the present application may further include, after determining the IP address corresponding to the maximum number of continuously available IP addresses:
and outputting the maximum number of the continuously available IP addresses and the corresponding IP addresses corresponding to the target data center machine room.
In the application, after the IP address corresponding to the maximum continuous available IP address number is determined, the maximum continuous available IP address number and the corresponding IP address corresponding to the target data center machine room can be output, and the maximum continuous available IP address number and the corresponding IP address corresponding to the target data center machine room can be output by at least one mode of short messages, mails, weChat applets and payment treasures, thereby being convenient for related personnel to acquire the maximum continuous available IP address number and the corresponding IP address corresponding to the target data center machine room in time and quickly.
The method for detecting the continuously available IP address provided by the embodiment of the present application, to obtain the IP address in the continuous IP address occupied by the physical node in the target data center 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 address in the continuous IP address occupied by the physical node in the target data center machine room is acquired, the IP address in the continuous IP address occupied by the physical node in the target data center machine room can be acquired in real time, so that the occupied IP address in the continuous IP address can be found out in time, thereby recording the occupied IP address in the used array in time, and improving the accuracy of detecting the maximum continuous available IP address information.
Of course, the IP addresses in the continuous IP addresses occupied by the physical nodes in the target data center room can also be obtained at regular time, wherein the regular time interval can be set according to actual conditions, so that resources consumed by inquiry can be reduced, and the detection of the maximum continuous available IP address information can be automatically realized.
The method for detecting the continuously available IP address provided by the embodiment of the application can further comprise the following steps:
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 nodes in the target data center machine room, if the occupied IP addresses are detected to be released (at the moment, 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 that the accuracy of detecting the maximum continuous available IP address information is improved.
The embodiment of the application also provides a device for detecting the continuously available IP address, referring to fig. 3, which shows a schematic structural diagram of the device for detecting the continuously available IP address, which may include:
the acquiring module 31 is configured to acquire a continuous IP address allocated to the target data center room, and continuously number the continuous IP address;
the recording module 32 is configured to obtain an IP address in the continuous IP addresses occupied by the physical nodes in the target data center room, and record a number corresponding to the occupied IP address in the continuous IP address in the 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 continuous IP address; wherein, the minimum record number is smaller than the minimum number by 1, and the maximum record number is larger than the maximum number by 1;
and the determining module 34 is configured to determine, according to the used array, the most continuously available IP address information corresponding to the target central office.
According to the technical scheme disclosed by the application, the continuous IP addresses distributed 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 are obtained, 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 1 smaller than the minimum number corresponding to the continuous IP addresses and the maximum record number which is 1 larger than the maximum number corresponding to the continuous IP addresses are added in the used array, and the maximum continuous available IP address information corresponding to the target center machine room is determined according to the used array, so that the automatic detection of the maximum continuous IP addresses is realized without manual participation, the manpower 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, the quick deployment of the application is facilitated, the stability of the data center is ensured, the management cost investment of the data center is reduced, and the user experience is improved.
The determining module 34 may include:
the ordering unit is used for ordering the numbers contained in the used arrays according to the order of the sizes to obtain ordered used arrays;
the first determining unit is used for obtaining the number of the serial numbers contained between two adjacent serial numbers in the ordered used array, and determining the maximum number as the maximum number of the continuous available IP addresses corresponding to the target central machine 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 adjacent two numbers corresponding to the maximum number in the ordered used array and the numbers corresponding to the continuous IP addresses.
The embodiment of the application provides a continuously available IP address detecting apparatus, and the first determining unit may include:
and the subtracting subunit is used for subtracting two adjacent numbers in the ordered used array, taking an absolute value of the difference value obtained by subtracting, and subtracting 1 from the absolute value to obtain the number of the numbers contained in the two adjacent numbers.
The determining module 34 may further include:
and the third determining subunit is configured to determine, after acquiring the number of numbers included between two adjacent numbers in the ordered used array, the number of numbers included between two adjacent numbers in the ordered used array as the number of continuous available IP addresses corresponding to the target central machine room.
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 determining the IP addresses corresponding to the maximum number of the continuous available IP addresses.
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 device for detecting the continuously available IP addresses provided by the embodiment of the application can further comprise:
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.
The embodiment of the application also provides a continuously available IP address detection device, referring to fig. 4, which shows a schematic structural diagram of the continuously available IP address detection device provided by the embodiment of the application, and 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 by 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 into the used array according to the minimum number and the maximum number corresponding to the continuous IP address; wherein, the minimum record number is smaller than the minimum number by 1, and the maximum record number is larger than the maximum number by 1; and determining the maximum continuous available IP address information corresponding to the target central machine room according to the used array.
The embodiment of the application also provides a readable storage medium, wherein the readable storage medium stores a computer program, and the computer program can realize the following steps when being executed by a processor:
acquiring continuous IP addresses distributed by 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 into the used array according to the minimum number and the maximum number corresponding to the continuous IP address; wherein, the minimum record number is smaller than the minimum number by 1, and the maximum record number is larger than the maximum number by 1; and determining the maximum continuous available IP address information corresponding to the target central machine room according to the used array.
The readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The description of the relevant parts in the continuously available IP address detection apparatus, the device and the readable storage medium provided by the present application may refer to the detailed description of the corresponding parts in the continuously available IP address detection method provided by the embodiment of the present application, which is not repeated herein.
It is noted that relational terms such as first and second, and the like are 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. Moreover, 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 is inherent to. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element. In addition, the parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of the corresponding technical solutions in the prior art, are not described in detail, so that redundant descriptions are avoided.
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 (9)

1. A method for detecting continuously available IP addresses, comprising:
acquiring continuous IP addresses distributed by 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 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 into the used array according to the minimum number and the maximum number corresponding to the continuous IP address; wherein the minimum record number is 1 less than the minimum number, and the maximum record number is 1 greater than the maximum number;
determining the maximum continuous available IP address information corresponding to the target data center machine room according to the used array;
and determining the maximum continuous available IP address information corresponding to the target data center machine room according to the used array, wherein the method comprises the following steps of:
sequencing the numbers contained in the used arrays according to the order of the sizes to obtain sequenced used arrays;
acquiring number numbers contained between two adjacent numbers in the ordered used array, and determining the maximum number as the maximum number of continuous available IP addresses corresponding to the target data center machine room;
and determining the IP address corresponding to the maximum number of the continuous available IP addresses according to the adjacent two numbers corresponding to the maximum number in the ordered used array and the number corresponding to the continuous IP addresses.
2. The method for detecting continuously available IP addresses of claim 1, wherein obtaining the number of numbers included between two adjacent numbers in the ordered used array comprises:
subtracting two adjacent numbers in the ordered used array, taking an absolute value of the difference value obtained by subtraction, and subtracting 1 from the absolute value to obtain the number of the numbers contained in the two adjacent numbers.
3. The method for detecting continuously available IP addresses of claim 1, further comprising, after obtaining the number of numbers included between two adjacent numbers in the ordered used array:
and determining the number of the numbers contained between two adjacent numbers in the sequenced used array as the number of the continuous available IP addresses corresponding to the target data center machine room.
4. The method for detecting continuously available IP addresses according to claim 1, further comprising, after determining the IP address corresponding to the maximum number of continuously available IP addresses:
and outputting the maximum number of the continuous available IP addresses corresponding to the target data center machine room and the corresponding IP addresses.
5. The method for detecting continuously available IP addresses of claim 1, wherein obtaining the IP address of the continuous IP addresses occupied by the physical nodes in the target data center room comprises:
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.
6. The method for continuously detecting available IP addresses 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.
7. A continuously available IP address detection apparatus, comprising:
the acquisition module is used for acquiring the continuous IP addresses distributed by the target data center machine room and numbering the continuous IP addresses continuously;
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 a used array;
the adding module is used for adding the minimum record number and the maximum record number into the used array according to the minimum number and the maximum number corresponding to the continuous IP address; wherein the minimum record number is 1 less than the minimum number, and the maximum record number is 1 greater than the maximum number;
the determining module is used for determining the maximum continuous available IP address information corresponding to the target data center machine room according to the used array;
the determining module includes:
the sorting unit is used for sorting the numbers contained in the used arrays according to the order of the sizes to obtain sorted used arrays;
the first determining unit is used for obtaining the number of the serial numbers contained between two adjacent serial numbers in the ordered used array, and determining the maximum number of the serial numbers as the maximum number of the continuous available IP addresses corresponding to the target data center machine 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 ordered used array and the number corresponding to the continuous IP addresses.
8. A continuously available IP address detection 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 6 when executing the computer program.
9. A readable storage medium, characterized in that the readable storage medium has stored therein a computer program which, when executed by a processor, implements the steps of the continuously available IP address detection method according to any of claims 1 to 6.
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 CN115022289A (en) 2022-09-06
CN115022289B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116896543B (en) * 2023-09-11 2024-05-24 中移(苏州)软件技术有限公司 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

Also Published As

Publication number Publication date
CN115022289A (en) 2022-09-06

Similar Documents

Publication Publication Date Title
CN109033471B (en) Information asset identification method and device
CN111459985A (en) Identification information processing method and device
CN115022289B (en) Method, device, equipment and storage medium for detecting continuously available IP addresses
CN109241084B (en) Data query method, terminal equipment and medium
CN106952085B (en) Method and device for data storage and service processing
CN111338888B (en) Data statistics method and device, electronic equipment and storage medium
CN113378044A (en) Question matching method and platform
CN110851817A (en) Terminal type identification method and device
CN114781688A (en) Method, device, equipment and storage medium for identifying abnormal data of business expansion project
CN112100452B (en) Method, apparatus, device and computer readable storage medium for data processing
CN111475305B (en) Big data processing method and system based on cloud platform multithreading
CN111274004B (en) Process instance management method and device and computer storage medium
CN115309907B (en) Alarm log association method and device
CN115935231A (en) Data classification method, device, equipment and storage medium
CN110895745B (en) Method and device for polling to obtain task, computer equipment and storage medium
CN103440174A (en) Error information processing method, device and electronic equipment applying device
CN113031835A (en) Menu data processing method and device
CN112532414B (en) Method, device, equipment and computer storage medium for determining ISP attribution
CN110517009B (en) Real-time public layer construction method and device and server
CN112861021B (en) Multi-point-based house source searching method and system
CN115562869B (en) Method and system for managing structure opcua clients based on key values
CN115994172B (en) Method, device, equipment and medium for determining service access relation
CN112307047B (en) Production problem processing method, device, equipment and storage medium
CN111966993B (en) Equipment identification code identification and generation algorithm test method, device, equipment and medium
CN112835991B (en) System, method, device and storage medium for monitoring data

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