CN114697291B - Method, device, server and storage medium for acquiring available IP address field - Google Patents

Method, device, server and storage medium for acquiring available IP address field Download PDF

Info

Publication number
CN114697291B
CN114697291B CN202210327122.6A CN202210327122A CN114697291B CN 114697291 B CN114697291 B CN 114697291B CN 202210327122 A CN202210327122 A CN 202210327122A CN 114697291 B CN114697291 B CN 114697291B
Authority
CN
China
Prior art keywords
address
original
target
segment
address segment
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
CN202210327122.6A
Other languages
Chinese (zh)
Other versions
CN114697291A (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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202210327122.6A priority Critical patent/CN114697291B/en
Publication of CN114697291A publication Critical patent/CN114697291A/en
Application granted granted Critical
Publication of CN114697291B publication Critical patent/CN114697291B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/30Managing network names, e.g. use of aliases or nicknames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/26Network addressing or numbering for mobility support

Abstract

After at least one original IP address segment, a target mask bit number and a used IP address segment are acquired, the original target IP address segment is acquired according to the original IP address segment and the target mask bit number, a target IP address segment which is smaller than or equal to a preset number threshold and is not intersected with the used IP address segment is screened out from the original IP address segment, a routing equipment mapping table corresponding to target equipment is acquired, the target IP address segment is inquired in the routing equipment mapping table, the target IP address segment which is not inquired is determined to be the available IP address segment, the available IP address segment is displayed, and the server removes the used IP address from the original IP address segment limited by the target mask bit number and verifies the removal process of the used IP address in the routing information of the target equipment, so that the accuracy of acquiring the available IP address is ensured.

Description

Method, device, server and storage medium for acquiring available IP address field
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method, an apparatus, a server, and a storage medium for acquiring an available IP address field.
Background
As the demand for IP addresses for 5G mobile networks increases, the complexity of IP address management increases. The complexity of picking out free available IP address segments in a given mask number of bits from the IP address block is also increased by including a large number of and intermixed unused IP addresses and used IP addresses in the IP address block.
The available IP address segments free of the specified mask in the current query IP total segment can only be obtained by manually calculating all IP address segments under the specified mask bit number, screening out the used IP addresses from the IP address segments, and clustering the scattered available IP addresses to obtain the available IP address segments. Furthermore, the available IP address field needs to be verified by manually logging into the relevant network device to see if it is idle. Therefore, how to improve the efficiency and accuracy of obtaining the available IP address segments is a problem to be solved.
Disclosure of Invention
The application provides a method, a device, a server and a storage medium for acquiring an available IP address field, which are used for solving the technical problem of improving the acquisition efficiency and accuracy of the available IP address field.
In a first aspect, the present application provides a method for obtaining an available IP address field, where the method is applied to a server, and the method includes:
Acquiring at least one original IP address segment, a target mask bit number and a used IP address segment;
obtaining an original target IP address field according to the original IP address field and the target mask bit number;
screening target IP address segments which are less than or equal to a preset number threshold and do not cross the used IP address segments from the original target IP address segments;
obtaining a routing equipment mapping table corresponding to the target equipment, inquiring a target IP address segment in the routing equipment mapping table, determining the unrequired target IP address segment as an available IP address segment, and displaying the available IP address segment.
In the technical scheme, the server determines the original target IP address segment by utilizing the obtained original IP address segment and the target mask bit number, shortens the searching range, screens the IP address segment containing the used IP address from the original target by comparing the original target IP address segment with the address coverage of the used IP address segment, determines the available IP address segment which is smaller than or equal to a preset number threshold value, verifies the availability of the available IP address segment by comparing the available IP address segment with the used IP address segment recorded in the routing mapping table of the target equipment, ensures the accuracy of calculating the available IP address segment, and improves the acquisition efficiency compared with a method for manually calculating the available IP address segment and verifying the availability of the IP address segment by one manual login equipment.
Optionally, acquiring at least one original IP address field and a used IP address field specifically includes:
acquiring preset parameters and an original allocation IP address segment, wherein the preset parameters comprise a preset network type, a preset Internet communication protocol version and a preset network allocation type;
screening unoccupied original IP address segments from the original allocated IP address segments according to preset parameters;
and screening the occupied used IP address field from the original allocated IP address field according to the preset network type.
Optionally, screening the unoccupied original IP address field from the original allocated IP address field according to a preset parameter, which specifically includes:
acquiring an address use identifier of an original allocated IP address segment; the address use identifier comprises a used identifier and an unused identifier;
and determining a first IP address segment with the network type being a preset network type, the Internet communication protocol version being a preset Internet communication protocol version, the network allocation type being a preset network allocation type and the address use identification being an unused identification from the original allocation IP address segment, and determining the first IP address segment as the original IP address segment.
Optionally, before determining, from the original allocated IP address segment, that the network type is the preset network type, the internet communication protocol version is the preset internet communication protocol version, the network allocation type is the preset network allocation type, and the address use identifier is the first IP address segment of the unused identifier, the method further includes:
If the first IP address segment exists in the original allocated IP address segment, screening the first IP address segment from the original allocated IP address segment;
if the first IP address segment does not exist in the original allocated IP address segment, determining that no available IP address segment exists in the original allocated IP address segment, generating reminding information, and controlling the reminding information to be displayed.
Optionally, the screening the occupied used IP address field from the originally allocated IP address field according to the preset network type specifically includes:
acquiring an address use identifier of an original allocated IP address segment;
and determining a second IP address segment of which the network type is the preset network type and the address use identifier is the used identifier from the originally allocated IP address segments, and determining the second IP address segment as the used IP address segment.
Optionally, before determining that the network type is the preset network type and the address usage identifier is the second IP address segment of the used identifier in the original allocated IP address segment, the method further includes:
if the second IP address segment exists in the original allocated IP address segment, screening the second IP address segment from the original allocated IP address segment;
if the second IP address segment does not exist in the original allocated IP address segment, screening a third IP address segment smaller than or equal to the preset number threshold value from the original IP address segment, determining the third IP address segment as a target IP address segment, and controlling the target IP address segment to display.
Optionally, before obtaining the routing device mapping table corresponding to the target device, the method further includes:
acquiring at least one target equipment identifier, IP address information of each target equipment and account information of each target address;
and obtaining the control authority of each target device through a remote login protocol according to the IP address information of each target device and the account information of each target address.
Optionally, a routing device mapping table corresponding to the target device is obtained, a target IP address segment is queried in the routing device mapping table, and the unsequired target IP address segment is determined as an available IP address segment, which specifically includes:
inquiring a target device identifier in a routing device mapping table to obtain routing information, wherein the routing device mapping table represents a mapping relation between the target device identifier and the routing information associated with the target device identifier;
regular matching is carried out on the route information, and an access equipment IP address segment corresponding to at least one access equipment connected with the target equipment is obtained;
and comparing the target IP address segment with the IP address segments of the access devices in turn to obtain available IP address segments which are not intersected with the IP address segments of the access devices.
Optionally, the method further includes, after querying the target device identifier in the routing device mapping table and obtaining the routing information:
Displaying the route information;
and acquiring the terminal data of the displayed information, and if the terminal data is a partial display mark, displaying the rest route information on the lower side of the displayed information until the terminal data of the displayed information is a complete display mark.
In the technical scheme, the server respectively determines the original IP address field and the used IP address field through preset parameters and address use identifiers, limits the searching range of the available IP address by combining the original IP address field with the target mask digits, removes the address field containing the used IP address from the searching range to obtain the target IP address field, obtains the routing equipment mapping table through automatic remote login of the target equipment, verifies the availability of the target IP address field through the IP address field used by the access equipment obtained from the routing information in the mapping table, and finally determines the available IP address field, ensures the accuracy of the query result of the available IP address field, and improves the processing efficiency by reducing the manual participation process in the query process.
In a second aspect, the present application provides an available IP address field obtaining apparatus, including:
the acquisition module is used for acquiring at least one original IP address segment, the target mask bit number and the used IP address segment;
The processing module is used for obtaining an original target IP address segment according to the original IP address segment and the target mask bit number;
the processing module is also used for screening target IP address segments which are less than or equal to a preset number threshold and do not cross the used IP address segments from the original target IP address segments;
the processing module is further configured to obtain a routing device mapping table corresponding to the target device, query a target IP address segment in the routing device mapping table, determine an unrequired target IP address segment as an available IP address segment, and display the available IP address segment.
In a third aspect, the present application provides a server comprising: a processor and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to implement the available IP address fragment retrieval method of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium having stored therein computer instructions which, when executed by a processor, are configured to implement the method for obtaining the available IP address field according to the first aspect.
The application provides a method, a device, a server and a storage medium for acquiring an available IP address segment, wherein the server acquires at least one original IP address segment, a target mask bit number and a used IP address segment, acquires the original target IP address segment according to the original IP address segment and the target mask bit number, screens out target IP address segments which are smaller than or equal to a preset number threshold and do not cross the used IP address segment from the original target IP address segment, acquires a routing equipment mapping table corresponding to target equipment, queries the target IP address segment in the routing equipment mapping table, determines the target IP address segment which is not queried as the available IP address segment, displays the available IP address segment, and ensures the accuracy of acquiring the available IP address by removing the used IP address in two stages of checking the used IP address in the routing information of the target equipment respectively through limiting the original IP address segment from the target mask bit number.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is an application scenario diagram of an available IP address field obtaining method according to an embodiment of the present application;
fig. 2 is a flow chart of a method for obtaining an available IP address field according to an embodiment of the present application;
fig. 3 is a flowchart of a method for obtaining an available IP address field according to another embodiment of the present application;
FIG. 4 is a schematic diagram of an interface of an available IP address field acquisition application according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of an available IP address field acquiring apparatus according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of a server according to an embodiment of the present application.
Specific embodiments thereof have been shown by way of example in the drawings and will herein be described in more detail. These drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
As the demand for IP addresses for 5G mobile networks increases, the complexity of IP address management increases. The complexity of picking out free available IP address segments in a given mask number of bits from the IP address block is also increased by including a large number of and intermixed unused IP addresses and used IP addresses in the IP address block.
The available IP address segments free of the specified mask in the current query IP total segment can only be obtained by manually calculating all IP address segments under the specified mask bit number, screening out the used IP addresses from the IP address segments, and clustering the scattered available IP addresses to obtain the available IP address segments. Furthermore, the available IP address field needs to be verified by manually logging into the relevant network device to see if it is idle. Therefore, how to improve the efficiency and accuracy of obtaining the available IP address segments is a problem to be solved.
Aiming at the technical problems, the embodiment of the application provides a method, a device, a server and a storage medium for acquiring an available IP address field, which aim to solve the problem of improving the acquisition efficiency and accuracy of the available IP address field. The technical conception of the application is as follows: and determining a used IP address section and an unused IP address section which meet preset parameters according to the address use identification corresponding to the IP address section stored in the database, screening the IP address section containing the used IP address from the unused IP address section, and determining the usable IP address section after checking the used IP address in the routing information stored in the routing equipment.
Fig. 1 is an application scenario diagram of an available IP address segment obtaining method provided in the present application, as shown in fig. 1, including a server 10, a data server 11, a routing device 12, and a network access device 13, where the number of network access devices 13 is at least one, and in an embodiment corresponding to fig. 1, the number of network access devices 13 is 3, including a first network access device 131, a second network access device 132, and a third network access device 133. The server 10 is connected to a data server 11 for database storage, the server 10 is also connected to a routing device 12, and the routing device 12 is connected to a network access device 13 for providing services to the network access device 13. In the process of networking use of all the devices, each device uses its corresponding allocated IP address.
The data server 11 stores all the IP address segments and the related parameters of each address segment that can be allocated and utilized by the server 10, wherein the related parameters include an address usage identifier, and when the IP address segment is occupied, the address usage identifier of the IP address segment is set as a used identifier; when the IP address segment is unoccupied, the address use identifier of the IP address segment is set to be an unused identifier. When the server 10 needs to search for an unused IP address, the input unit of the server 10 obtains a preset parameter of the IP address to be searched, searches for the preset parameter from the relevant parameters of all the allocable IP address segments through the data server 11, and picks out an original target IP address segment with data corresponding to the relevant parameter equal to the preset parameter, where an address use identifier in the preset parameter of the IP address to be searched is an unused identifier, and the original target IP address segment includes an original mask bit number, and the original mask bit number in combination with the internet communication protocol version can define an address range of the target IP address segment. When the number of usage mask bits of the server 10 is higher than the number of original mask bits, a part of the IP address segments of the original target IP address segments will be used, the address usage identification of the used IP address segments is set to the used identification, but the address usage identification of the original IP target address segments remains unused, so that when determining the unused IP address, it is necessary to reject the used part of the IP address segments from the above-mentioned original target IP address segments to obtain the unoccupied IP address segments, and determine the unoccupied IP address segments as usable IP address segments.
To again confirm that the available IP address segment is unoccupied, the server 10 may obtain, through the telnet routing device 12, a routing device mapping table of the routing device 12 to obtain an IP address segment being used by the access device 13 connected to the routing device 12, and the server 10 confirms whether the available IP address segment is occupied by comparing the available IP address segment with the IP address segment in the routing device mapping table, determines the available IP address segment as an available IP address segment if it is unoccupied, and displays the available IP address segment so that a user using the server 10 can learn about the situation of the available IP address segment satisfying the preset parameters. Notably, when the server 10 obtains the IP address field used in the routing device table by logging on the routing device 12, the server 10 may log on at least one routing device 12, and in the embodiment corresponding to fig. 1, the number of routing devices 12 is 1, and when the number of routing devices 12 is multiple, the server 10 may confirm the use condition of the available IP address field by logging on the routing devices 12 sequentially.
Fig. 2 is a flowchart of a method for obtaining an available IP address field according to an exemplary embodiment of the present application. As shown in fig. 2, the available IP address segment acquiring method provided in the present application includes:
S201, the server acquires at least one original IP address segment, a target mask bit number and a used IP address segment.
The original IP address segment represents a usable IP address segment which is searched in a database by a server and marks that the address segment is unoccupied.
The number of bits of the target mask is the number of bits of the network address in the available IP address to be acquired by the server, the number of bits is smaller than the total number of bits of the original IP address field, and the number of address bits remaining after the number of bits of the target mask is removed in the original IP address field is the number of bits of the host address. In the original IP address segment, the address corresponding to the number of the target mask bits from left to right is a network address, and the address corresponding to the rest position after the network address is removed from the original IP address segment is a host address. For example: the number of bits of the original IP address field is 32 bits, the number of bits of the target mask is less than or equal to 32, if the number of bits of the target mask is 28 bits, the address corresponding to the first 28 bits of the original IP address field is a network address, and the address corresponding to the last 4 bits is a host address.
The used IP address field is a usable IP address field that the server looks up in the database, indicating that the address field is occupied.
S202, the server obtains an original target IP address segment according to the original IP address segment and the target mask bit number.
Wherein both the original IP address field and the target mask number of bits are obtained from step S201.
The original target IP address field represents all the IP address ranges that the original IP address field can obtain under the constraint of the target mask bit number. More specifically, the original target IP address field is an IP address field obtained after performing an and operation for the subnet mask determined by the original IP address field and the target mask bit number. For example: the original IP address field is a 32-bit IP address field, the target mask bit number is 28 bits, the subnet mask corresponding to the target mask bit number is a 32-bit subnet mask with the first 28 bits being 1 and the last 4 bits being 0, after the subnet mask and the 32-bit original IP address field are subjected to AND operation, the obtained first 28-bit address of the result is the same as the first 28-bit address of the original IP address field, and the last 4-bit address is 0, and in the original target IP address field corresponding to the result, the first 28-bit address is the first 28-bit address of the original IP address field, and the change range of the last 4-bit address is ' 0000 ' -1111 '.
S203, the server screens out target IP address segments which are less than or equal to a preset number threshold and do not cross the used IP address segments from the original target IP address segments.
Wherein the original target IP address field is obtained from step S202.
The target IP address segment is an IP address segment which is smaller than or equal to a preset number threshold value and is obtained from the rest IP address segments after the server removes the used IP address segment from the original IP address segment. The target IP address segment does not cross all the used IP address segments, namely the target IP address segment does not contain the used IP address. Wherein the preset number threshold represents a maximum number of IP address segments obtained in the original target IP address segment.
More specifically, when the number of original target IP address segments is less than the preset number threshold or the number of original target IP address segments is greater than the preset number threshold but the number of all target IP address segments determined from the original target IP address segments is less than the preset number threshold, the number of obtained target IP address segments is less than the preset number threshold, otherwise, the number of obtained target IP address segments is equal to the preset number threshold.
S204, the server acquires a routing equipment mapping table corresponding to the target equipment, queries a target IP address segment in the routing equipment mapping table, determines the unrequired target IP address segment as an available IP address segment, and displays the available IP address segment.
The target device is a device, in at least one routing device related to the embodiment corresponding to fig. 1, to be detected whether an IP address in a routing device mapping table corresponding to the device crosses the target IP address.
The routing device mapping table represents the mapping relationship between the target device and the routing information corresponding to the device. The routing information includes an IP address in use by the network access device connected to the target device.
And querying the target IP address segment obtained in the step S203 in a routing equipment mapping table, and determining the target IP address segment which is not queried as an available IP address segment, namely determining the remaining IP addresses which are obtained after screening out the IP addresses which are not used by the network access equipment connected with the target equipment in the target IP address segment as available IP addresses, wherein the addresses are the addresses which can be allocated and used by the server.
In the technical scheme, the server determines the original target IP address segment by utilizing the obtained original IP address segment and the target mask bit number, shortens the searching range, screens the IP address segment containing the used IP address from the original target by comparing the original target IP address segment with the address coverage of the used IP address segment, determines the available IP address segment which is smaller than or equal to a preset number threshold value, verifies the availability of the available IP address segment by comparing the available IP address segment with the used IP address segment recorded in the routing mapping table of the target equipment, ensures the accuracy of calculating the available IP address segment, and improves the acquisition efficiency compared with a method for manually calculating the available IP address segment and verifying the availability of the IP address segment by one manual login equipment.
Fig. 3 is a flow chart of a method for obtaining an available IP address field according to an embodiment of the present application, where an execution body of the method is a server. As shown in fig. 3, the available IP address field obtaining method provided in the present application includes:
s301, acquiring preset parameters and an original allocated IP address field.
The preset parameters include a preset network type, a preset internet communication protocol version and a preset network allocation type.
Wherein the network type is a network type usable by the device to be allocated with the IP address, and in an embodiment, the network type includes a 4G signaling network, a 4G wireless network, an internet interface network, a 3G data interface network, a packet signaling service network, a voice signaling network, and a voice chained backup network. The internet communication protocol versions include a fourth version of the network communication protocol (Internet Protocol version, abbreviated as IPv 4) and a sixth version of the network communication protocol (Internet Protocol version, abbreviated as IPv 6), which correspond to IP addresses of different digits. The network allocation types include public networks and private networks. The above network types, internet communication protocol versions and network allocation types are all prior art and will not be explained in detail here.
S302, screening unoccupied original IP address segments from the original allocated IP address segments according to preset parameters.
Wherein the original allocated IP address field and the preset parameters are obtained from step S301.
The original allocated IP address field represents all the IP address fields that can be allocated and used by the user corresponding to the server, and the IP address field needs to store the relevant information of the IP address field into the database before being allocated and used by the user. The relevant information of the IP address field is the IP address field and the associated attribute information thereof. In one embodiment, the attribute information includes the preset parameters and address usage identification in step S301.
The unoccupied original IP address has been explained in detail in step S201, and will not be described again.
The original IP address segment represents the IP address segment with unused identification which is identified by the address found by the server in all available IP address segments stored in the database according to the preset parameters.
More specifically, the process of obtaining the unoccupied original IP address field specifically includes steps S3021 to S3024:
s3021, obtaining an address use identifier of the original allocated IP address field.
The original assigned IP address field of this step is obtained from step S301. The address use identifier includes a used identifier and an unused identifier, and the acquisition of the address use identifier is set according to the user when assigning or using the IP address. More specifically, when an IP address segment is available but not yet used by the server, the address usage identification of the IP address segment is an unused identification; when an IP address segment is assigned by a server to a device for use, the address use identifier of the IP address segment is a used identifier.
The server queries the first IP address field satisfying the above condition in the original allocated IP address field according to the preset parameters obtained in step S301 and the address usage identifier obtained in this step. The first IP address segment is an unoccupied IP address segment with related parameters equal to preset parameters in the original allocated IP address segment.
When the server can query the first IP address field in the originally allocated IP address field, step S3022 is entered, otherwise step S3023 is entered.
S3022, if the first IP address field exists in the original allocated IP address field, screening the first IP address field from the original allocated IP address field.
More specifically, the process of screening out the first IP address segment is:
and determining a first IP address segment with the network type being a preset network type, the Internet communication protocol version being a preset Internet communication protocol version, the network allocation type being a preset network allocation type and the address use identification being an unused identification from the original allocation IP address segment, and determining the first IP address segment as the original IP address segment. Wherein the original allocated IP address field is obtained from step S302, the plurality of preset parameters that the first IP address field needs to satisfy are obtained from step S301, and the address usage identifier is obtained from step S3021.
After this step is completed, the flow advances to step S303.
S3023, if the first IP address field does not exist in the original allocated IP address field, determining that no IP address field is available in the original allocated IP address field, generating reminding information, and controlling the reminding information to be displayed.
When the preset parameters are required to be met and the unoccupied IP address field does not exist, the server cannot obtain the first IP address field from the original allocated IP address field, the IP address field which can be utilized by the current server does not exist, and the server generates reminding information according to the nonexistent state of the IP address field and displays the reminding information.
After the step is completed, the current flow is ended.
S303, screening out occupied used IP address segments from the original allocated IP address segments according to the preset network type.
Wherein, the preset network type is obtained from the preset parameters in step S301, and the original allocated IP address field is also obtained from step S301.
The occupied used IP address field refers to an IP address field that has been allocated by the server to be used by other devices in the callable database.
More specifically, the process of obtaining the occupied used IP address field specifically includes steps S3031 to S3034:
S3031, the address use identification of the original allocated IP address field is obtained.
The address usage identification includes a used identification and an unused identification. This step is the same as step S3021 and will not be described here again.
After obtaining the address usage identifier, the server searches for a second IP address segment which meets the requirement of the preset network type and is not used yet in the original allocated IP address segment according to the address usage identifier and the preset network type in step S303.
When there is a second IP address segment in the originally allocated IP address segment, step S3032 is entered, otherwise, step S3033 is entered.
S3032, if the second IP address segment exists in the original allocated IP address segment, the second IP address segment is screened from the original allocated IP address segment.
More specifically, a second IP address segment whose network type is a preset network type and whose address usage identification is a used identification is determined from the originally assigned IP address segments, and the second IP address segment is determined as a used IP address segment.
After the completion of this step, the flow advances to step S304.
S3033, if the second IP address segment does not exist in the original allocated IP address segment, screening a third IP address segment smaller than or equal to the preset number threshold value from the original IP address segment, determining the third IP address segment as a target IP address segment, and controlling the target IP address segment to display.
Wherein the originally assigned IP address field is obtained from step S301. The original IP address field is obtained from step S302.
If the second IP address field does not exist, the IP address field with the network type being the preset network type in the original allocated IP address field is not used, and on the basis that the network type is the preset network type, the IP address field limited in the original IP address field according to the corresponding preset parameters is not used. Thus, in the absence of the second IP address segment, all of the original IP address segments may be assigned by the server to the device to be obtained and used.
After all the original IP address fields are determined to be available, if the number of the original IP address fields is smaller than a preset number threshold value, determining all the original IP address fields as a third IP address field; if the number of the original IP address segments is greater than or equal to the preset number threshold, selecting the IP address segments equal to the preset number threshold from the original IP address segments, and determining the IP address segments as a third IP address segment. The selection mode of the IP address field is not limited.
After the third IP address segment is selected, the server determines the third IP address segment as a target IP address segment, where the explanation of the target IP address segment is explained in detail in step S203, which is not described herein.
After this step is completed, the flow proceeds to step S306.
S304, obtaining the original target IP address segment according to the original IP address segment and the target mask bit number.
Wherein the original IP address field is obtained from step S3032, and the target mask bit number is a bit number representing the network address in the subnet mask defining the distribution range of the server lookup IP address field, and the target mask bit number is explained in detail in step S201 and is not described herein.
The process of acquiring the original target IP address segment defined by the subnet mask corresponding to the target mask bit number from the original IP address segment is explained in detail in step S202, and will not be described again here.
S305, screening out target IP address segments which are less than or equal to a preset number threshold and do not cross the used IP address segments from the original target IP address segments.
Wherein the original target IP address field is obtained from step S304.
The target IP address segment screened from the original target IP address segment means that the address distribution range of the target IP address segment does not overlap with the address distribution ranges of all the used IP address segments obtained in step S3032, i.e., the target IP address segment does not include any used IP address.
After determining the IP address segments which are not intersected with the used IP address segments in the original target IP address segments, obtaining target IP address segments which are smaller than or equal to a preset number threshold according to the number of the IP address segments, namely obtaining target IP address segments which are equal to the preset number threshold from the original target IP address segments when the number of the determined IP address segments is equal to or greater than the preset number threshold; and when the number of the determined IP address segments is smaller than a preset number threshold, determining all the determined IP address segments as target IP address segments.
S306, at least one target device identifier, IP address information and account information of each target device are obtained.
The target device identifier is an identifier indicating a target device that determines again whether or not the target IP address segment obtained in step S305 or step S3033 is occupied.
The target device is a device that provides services for a network access device connected thereto, and the IP address information of the target device is an IP address to which the target device is assigned, the IP address being used by the server to determine the network location of the target device.
The account information of the target device represents account information required by the device to verify identity information when remotely logging into the target device. In one embodiment, the account information includes an account name and an account password.
In addition, the server obtains input port information of the target device.
S307, according to the IP address information and account information of each target device, the control authority of each target device is obtained through a remote login protocol.
Wherein the IP address information and account information of the target device are obtained from step S306.
The process of the server obtaining the control authority of each target device through the remote login protocol is as follows: the server transmits the IP address information and account information of the target equipment to a port corresponding to the target equipment according to the input port information of the target equipment, identity verification is carried out through a remote login protocol, and control authority of each target equipment is obtained after verification is passed. In an embodiment, the telnet protocol is an SSH telnet protocol, which is a prior art and will not be described herein.
S308, inquiring the target equipment identification in the routing equipment mapping table to obtain the routing information.
The routing device mapping table is stored in the target device, and represents the mapping table of the mapping relationship between the target device identifier and the routing information associated with the target device identifier.
And the server obtains the route information corresponding to the route service provided by the target equipment according to the target equipment identifier obtained in the step S306. The routing information includes information of the access device receiving the routing service of the target device, and the information includes an IP address field used by the access device.
And S309, displaying the route information.
Wherein the routing information is obtained from step S308.
And S310, acquiring terminal data of the displayed information, and if the terminal data is a partial display mark, displaying the rest route information on the lower side of the displayed information until the terminal data of the displayed information is a complete display mark.
Wherein the displayed information is information that the route information in step S309 has been displayed on the output unit in the server. In one embodiment, the displayed information is a line of routing information that the server displays on its display screen.
If the route information can be displayed in the display process in step S309, the last display identifier of the information is a full display identifier, otherwise, the last display identifier of the information is a partial display identifier. In an embodiment, if the route information is completely displayed on the display screen of the server through one line of information, the last bit of the route information is a carriage return sign, and the carriage return sign is a complete display sign, otherwise, when the last bit of the route information is a '>' sign, the sign is a partial display sign, the server inserts the carriage return sign at the position of the route information, and another line displays the route information which is not displayed, and obtains the last bit display sign again until the last bit of the route information which is displayed last is the carriage return sign, that is, the route information is completely displayed in a plurality of lines, so as to improve the readability of the route information by a user using the server.
S311, regular matching is carried out on the routing information, and an access device IP address segment corresponding to at least one access device connected with the target device is obtained.
Wherein the routing information is obtained from step S308.
Regular matching refers to extracting an IP address segment from routing information according to an IP address display format, where the IP address segment is an access device IP address segment of an access device connected to a target device. The IP address field is formatted as an "IP address/mask bit number". The process of extracting the IP address segment through regular matching is in the prior art, and is not described herein.
S312, comparing the target IP address segment with each access equipment IP address segment in turn, obtaining available IP address segments which do not cross each access equipment IP address segment, and displaying the available IP address segments.
Wherein the target IP address field is obtained from step S305 or step S3033.
The access device IP address field is obtained from step S311, and is the occupied IP address field.
If the target IP address segment does not contain any IP address in any access equipment IP address segment, determining that the target IP address segment is unoccupied, and allocating the target IP address segment to the available IP address segment used by other equipment for the server. Wherein, the fact that the target IP address segment does not contain any IP address in any access device IP address segment means that the target IP address segment and any access device IP address segment do not have a cross.
In the technical scheme, the server respectively determines the original IP address field and the used IP address field through preset parameters and address use identifiers, limits the searching range of the available IP address by combining the original IP address field with the target mask digits, removes the address field containing the used IP address from the searching range to obtain the target IP address field, obtains the routing equipment mapping table through automatic remote login of the target equipment, verifies the availability of the target IP address field through the IP address field used by the access equipment obtained from the routing information in the mapping table, and finally determines the available IP address field, ensures the accuracy of the query result of the available IP address field, and improves the processing efficiency by reducing the manual participation process in the query process.
Fig. 4 is an interface schematic diagram of an available IP address field acquiring application according to another embodiment of the present application. The available IP address field acquiring application program is a program installed in a server, which receives preset parameters and address use identifiers, and determines and displays an available IP address field according to the available IP address field acquiring method in the embodiment corresponding to fig. 2 or fig. 3. As shown in fig. 4, the available IP address field acquiring application program interface is an interface displayed by the display device when the server runs the available IP address field acquiring application program. The available IP address field acquiring application program interface 40 includes a parameter selection area 401, a parameter input area 402, and a result output area 403, where the parameter selection area 401 is an area for selecting at least one selectable data range displayed corresponding to a parameter, and the parameter input area 402 is an area for inputting data according to an input format. The parameter selection area 401 and the parameter input area 402 are both areas for displaying and inputting preset parameters and address usage identifiers required in the above embodiments, and after the server obtains required data for querying the available IP address field according to the above parameter selection area 401 and parameter input area 402, the server obtains the available IP address field by combining the available IP address field obtaining method related in the embodiment corresponding to fig. 2 or fig. 3 with the database stored in the data server, and displays relevant information of the available IP address field in the result output area 403 of the available IP address field obtaining application program interface 403.
As shown in fig. 5, an embodiment of the present application provides an available IP address field acquiring apparatus 500, which includes an acquiring module 501 and a processing module 502, where the acquiring module 501 is connected to the processing module 502.
The obtaining module 501 is configured to obtain at least one original IP address segment, a target mask bit number, and a used IP address segment.
The processing module 502 is configured to obtain an original target IP address segment according to the original IP address segment and the target mask bit number.
The processing module 502 is further configured to screen out target IP address segments from the original target IP address segments that are less than or equal to a preset number of thresholds and do not intersect the used IP address segments.
The processing module 502 is further configured to obtain a routing device mapping table corresponding to the target device, query a target IP address segment in the routing device mapping table, determine an unrequired target IP address segment as an available IP address segment, and display the available IP address segment.
As shown in fig. 6, an embodiment of the present application provides a server 600, the server 600 including a memory 601 and a processor 602.
Wherein the memory 601 is used to store computer instructions executable by the processor 602.
The processor 602, when executing the computer instructions, implements the steps of the available IP address segment acquisition method of the embodiment described above, which is mainly implemented by the server 600. Reference may be made in particular to the relevant description of the embodiments of the method described above.
Alternatively, the memory 601 may be separate or integrated with the processor 602. When the memory 601 is provided separately, the server 600 further includes a bus for connecting the memory 601 and the processor 602.
The embodiment of the application further provides a computer readable storage medium, wherein computer instructions are stored in the computer readable storage medium, and when a processor executes the computer instructions, the steps in the method for acquiring the available IP address field in the embodiment are realized.
Embodiments of the present application also provide a computer program product comprising computer instructions which, when executed by a processor, implement the steps in the method for obtaining a segment of an available IP address in the above embodiments.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A method for obtaining an available IP address field, wherein the method is applied to a server, the method comprising:
acquiring at least one original IP address segment, a target mask bit number and a used IP address segment;
obtaining an original target IP address segment according to the original IP address segment and the target mask bit number;
screening target IP address segments which are less than or equal to a preset number threshold and do not cross the used IP address segments from the original target IP address segments;
obtaining a routing equipment mapping table corresponding to target equipment, inquiring the target IP address segment in the routing equipment mapping table, determining the target IP address segment which is not inquired as an available IP address segment, and displaying the available IP address segment;
the method for acquiring the at least one original IP address field and the used IP address field specifically comprises the following steps:
acquiring preset parameters and an original allocation IP address field, wherein the preset parameters comprise a preset network type, a preset Internet communication protocol version and a preset network allocation type;
Screening unoccupied original IP address fields from the original allocated IP address fields according to the preset parameters;
screening out occupied used IP address segments from the original allocated IP address segments according to the preset network type;
screening unoccupied original IP address segments from the original allocated IP address segments according to the preset parameters, wherein the method specifically comprises the following steps:
acquiring an address use identifier of the original allocated IP address segment; the address use identifier comprises a used identifier and an unused identifier;
and determining a first IP address section of which the network type is the preset network type, the Internet communication protocol version is the preset Internet communication protocol version, the network allocation type is the preset network allocation type and the address use identifier is an unused identifier from the original allocation IP address section, and determining the first IP address section as the original IP address section.
2. The method of claim 1, wherein prior to determining from the original assigned IP address field that the network type is the preset network type, the internet communication protocol version is the preset internet communication protocol version, the network assignment type is the preset network assignment type, and the address usage identifier is the unused identifier of the first IP address field, the method further comprises:
If the first IP address field exists in the original allocated IP address field, the first IP address field is screened from the original allocated IP address field;
if the first IP address segment does not exist in the original allocated IP address segment, determining that no IP address segment exists in the original allocated IP address segment, generating reminding information, and controlling the reminding information to be displayed.
3. The method according to claim 1, wherein the screening the occupied used IP address field from the originally allocated IP address field according to the preset network type, specifically comprises:
acquiring an address use identifier of the original allocated IP address segment;
and determining a second IP address section of which the network type is the preset network type and the address use identifier is the used identifier from the original allocated IP address section, and determining the second IP address section as the used IP address section.
4. A method according to claim 3, wherein before determining that the network type is the preset network type and that the address usage is identified as the second IP address segment of the usage identification in the original assigned IP address segment, the method further comprises:
if the second IP address field exists in the original allocated IP address field, screening the second IP address field from the original allocated IP address field;
And if the second IP address segment does not exist in the original allocated IP address segment, screening a third IP address segment smaller than or equal to a preset number threshold value from the original IP address segment, determining the third IP address segment as the target IP address segment, and controlling the target IP address segment to display.
5. The method of claim 1, wherein before obtaining the routing device mapping table corresponding to the target device, the method further comprises:
acquiring at least one target equipment identifier, IP address information of each target equipment and account information of each target address;
and obtaining the control authority of each target device through a remote login protocol according to the IP address information of each target device and the account information of each target address.
6. The method according to claim 5, wherein obtaining a routing device mapping table corresponding to a target device, querying the target IP address field in the routing device mapping table, and determining the target IP address field that is not queried as an available IP address field, specifically includes:
inquiring the target equipment identifier in the routing equipment mapping table to obtain routing information, wherein the routing equipment mapping table represents the mapping relationship between the target equipment identifier and the routing information associated with the target equipment identifier;
Performing regular matching on the routing information to obtain an access equipment IP address segment corresponding to at least one access equipment connected with the target equipment;
and comparing the target IP address segment with each access equipment IP address segment in turn to obtain an available IP address segment which does not cross each access equipment IP address segment.
7. The method of claim 6, wherein after querying the routing device mapping table for the destination device identification to obtain routing information, the method further comprises:
displaying the route information;
and acquiring terminal data of the displayed information, and if the terminal data is a partial display mark, displaying the rest route information on the lower side of the displayed information until the terminal data of the displayed information is a complete display mark.
8. An available IP address field obtaining apparatus, comprising:
the acquisition module is used for acquiring at least one original IP address segment, the target mask bit number and the used IP address segment;
the processing module is used for obtaining an original target IP address segment according to the original IP address segment and the target mask bit number;
the processing module is also used for screening target IP address segments which are less than or equal to a preset number threshold and do not cross the used IP address segments from the original target IP address segments;
The processing module is also used for acquiring a routing equipment mapping table corresponding to the target equipment, inquiring a target IP address segment in the routing equipment mapping table, determining the unrequired target IP address segment as an available IP address segment, and displaying the available IP address segment;
the acquiring module is specifically configured to, when acquiring at least one original IP address field and a used IP address field: acquiring preset parameters and an original allocation IP address field, wherein the preset parameters comprise a preset network type, a preset Internet communication protocol version and a preset network allocation type; screening unoccupied original IP address fields from the original allocated IP address fields according to the preset parameters; screening out occupied used IP address segments from the original allocated IP address segments according to the preset network type;
the step of screening the unoccupied original IP address field from the original allocated IP address field according to the preset parameters comprises the following steps:
acquiring an address use identifier of the original allocated IP address segment; the address use identifier comprises a used identifier and an unused identifier;
and determining a first IP address section of which the network type is the preset network type, the Internet communication protocol version is the preset Internet communication protocol version, the network allocation type is the preset network allocation type and the address use identifier is an unused identifier from the original allocation IP address section, and determining the first IP address section as the original IP address section.
9. A server, comprising: a processor and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor, when executing the computer-executable instructions, is configured to implement the available IP address segment retrieval method of any one of claims 1 to 7.
10. A computer readable storage medium having stored therein computer instructions which when executed by a processor are adapted to carry out the method of obtaining available IP address segments according to any of claims 1 to 7.
CN202210327122.6A 2022-03-30 2022-03-30 Method, device, server and storage medium for acquiring available IP address field Active CN114697291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210327122.6A CN114697291B (en) 2022-03-30 2022-03-30 Method, device, server and storage medium for acquiring available IP address field

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210327122.6A CN114697291B (en) 2022-03-30 2022-03-30 Method, device, server and storage medium for acquiring available IP address field

Publications (2)

Publication Number Publication Date
CN114697291A CN114697291A (en) 2022-07-01
CN114697291B true CN114697291B (en) 2023-06-06

Family

ID=82140293

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210327122.6A Active CN114697291B (en) 2022-03-30 2022-03-30 Method, device, server and storage medium for acquiring available IP address field

Country Status (1)

Country Link
CN (1) CN114697291B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115190110B (en) * 2022-07-18 2024-01-09 北京抖音信息服务有限公司 Geographic position determining method and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102231764A (en) * 2011-06-22 2011-11-02 华为技术有限公司 Method and device for distributing network addresses

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105472048B (en) * 2014-07-14 2019-05-10 华为技术有限公司 A kind of address distribution method, information aggregation method and relevant device
CN111510379B (en) * 2017-03-14 2024-04-16 华为技术有限公司 EVPN message processing method, device and system
CN112532501B (en) * 2019-09-18 2023-04-18 中国电信股份有限公司 Host physical address processing method and device and computer readable storage medium
CN113794773B (en) * 2021-09-15 2023-04-07 中国电信股份有限公司 Edge node scheduling method and device, storage medium and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102231764A (en) * 2011-06-22 2011-11-02 华为技术有限公司 Method and device for distributing network addresses

Also Published As

Publication number Publication date
CN114697291A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
US8775629B1 (en) System and method for managing internet protocol (IP) address space for enterprise network
CN108810192A (en) A kind of static IP configuration method, device, equipment and readable storage medium storing program for executing
CN114697291B (en) Method, device, server and storage medium for acquiring available IP address field
CN112953737A (en) Configuration abnormality detection method, server, and storage medium
CN111107173B (en) IP address planning method and system of IP bearing network
CN109447820B (en) Data processing method, device, computer equipment and storage medium
CN108460271B (en) Terminal identification method and device
CN109194525A (en) A kind of network node configuration method and management node
CN106302384A (en) DNS message processing method and device
CN105516395A (en) Network address assignment method and device
CN111083055B (en) Client device management method and device, router and storage medium
CN103888435B (en) For the methods, devices and systems of business admission control
CN104424316A (en) Data storage method, data searching method, related device and system
CN108446283A (en) Date storage method and device
CN111131049B (en) Method and device for processing routing table entry
CN106789695B (en) Message processing method and device
CN110798547B (en) Address configuration method of outdoor unit, address configuration method of indoor unit and air conditioner
CN112788576A (en) Equipment offline processing method and system, storage medium and electronic device
CN109842482B (en) Information synchronization method, system and terminal equipment
CN106407470A (en) Fingerprint sharing method, terminal and server
CN110691012A (en) Message processing method and tester
KR20090012489A (en) Method and apparatus for updating digital map
CN114553819B (en) IPv6 address identification method and device
CN108366136A (en) A kind of analysis method and device of domain name
CN112822123A (en) Data acquisition method and device

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