CN114697291A - 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
CN114697291A
CN114697291A CN202210327122.6A CN202210327122A CN114697291A CN 114697291 A CN114697291 A CN 114697291A CN 202210327122 A CN202210327122 A CN 202210327122A CN 114697291 A CN114697291 A CN 114697291A
Authority
CN
China
Prior art keywords
address
target
address field
original
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.)
Granted
Application number
CN202210327122.6A
Other languages
Chinese (zh)
Other versions
CN114697291B (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

The application provides a method, a device, a server and a storage medium for obtaining an available IP address field, after obtaining at least one original IP address field, a target mask bit number and a used IP address field, obtaining an original target IP address field according to the original IP address field and the target mask bit number, screening out target IP address fields which are not crossed with the used IP address field and are less than or equal to a preset number threshold value from the original target IP address field, obtaining a routing device mapping table corresponding to a target device, inquiring the target IP address field in the routing device mapping table, determining the target IP address field which is not inquired as the available IP address field, displaying the available IP address field, removing the used IP address from the original IP address field under the limitation of the target mask bit number and verifying the used IP address in the routing information of the target device by the server respectively, the accuracy of obtaining the available IP address is guaranteed.

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 segment.
Background
As the demand for 5G mobile network IP addresses increases, the complexity of IP address management grows. In the IP address total segment, there are a large number of unused IP addresses and used IP addresses, and the complexity of picking out a free available IP address segment with a specified number of mask bits from the IP address total segment also increases.
At present, the idle available IP address segments of the specified mask in the IP total segment can be inquired only by manually calculating all IP address segments under the specified mask bit number, and after used IP addresses are screened out from the IP address segments, the scattered available IP addresses are clustered to obtain the available IP address segments. In addition, the available IP address field needs to be verified as free by manually logging into the relevant network device. Therefore, how to improve the acquisition efficiency and accuracy of the available IP address field becomes an urgent 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 acquiring an available IP address segment, 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 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 value and do not intersect with used IP address segments from the original target IP address segments;
and acquiring a routing equipment mapping table corresponding to the target equipment, inquiring a target IP address field in the routing equipment mapping table, determining the target IP address field which is not inquired as an available IP address field, and displaying the available IP address field.
In the technical scheme, the server determines an original target IP address segment by using the obtained original IP address segment and the target mask digit, reduces the search range, then screens out the IP address segment containing the used IP address from the original target by comparing the address coverage range of the original target IP address segment and the used IP address segment, determines the available IP address segments smaller than or equal to the preset number threshold, and verifies the availability of the available IP address segments by comparing the used IP address segments recorded in the routing mapping table of the available IP address segments and the target equipment, thereby ensuring the accuracy of calculating the available IP address segments, and improving the acquisition efficiency compared with a method for manually calculating the available IP address segments and verifying the availability of the IP address segments by manually logging in equipment one by one.
Optionally, the obtaining at least one original IP address segment and used IP address segment specifically includes:
acquiring preset parameters and an original distribution IP address field, wherein the preset parameters comprise a preset network type, a preset Internet communication protocol version and a preset network distribution type;
according to preset parameters, screening out unoccupied original IP address segments from the original allocated IP address segments;
and according to the preset network type, screening out occupied used IP address fields from the originally allocated IP address fields.
Optionally, according to preset parameters, screening out an unoccupied original IP address segment from the originally allocated IP address segments, specifically including:
acquiring an address use identifier of an originally allocated IP address field; the address use identification comprises a used identification and an unused identification;
and determining the network type as a preset network type, the Internet communication protocol version as a preset Internet communication protocol version, the network allocation type as a preset network allocation type and the address use identifier as a first IP address field of an unused identifier from the original allocated IP address field, and determining the first IP address field as the original IP address field.
Optionally, before determining, from the originally allocated IP address field, that the network type is a preset network type, the internet communication protocol version is a preset internet communication protocol version, the network allocation type is a preset network allocation type, and the address usage identifier is a first IP address field of an unused identifier, the method further includes:
if the first IP address segment exists in the original distribution IP address segment, screening out the first IP address segment from the original distribution IP address segment;
and if the first IP address field does not exist in the originally distributed IP address field, determining that no available IP address field exists in the originally distributed IP address field, generating reminding information, and controlling the reminding information to display.
Optionally, according to a preset network type, screening out an occupied used IP address segment from the originally allocated IP address segment, specifically including:
acquiring an address use identifier of an originally allocated IP address field;
and determining the network type as a preset network type and the address use identifier as a second IP address segment of the used identifier from the originally allocated IP address segment, 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 originally allocated IP address segment, the method further includes:
if the second IP address segment exists in the original distribution IP address segment, screening out the second IP address segment from the original distribution IP address segment;
and if the second IP address segment does not exist in the original distributed IP address segment, screening a third IP address segment which is less than or equal to a 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 be displayed.
Optionally, before obtaining the routing device mapping table corresponding to the target device, the method further includes:
acquiring at least one target device identifier, IP address information of each target device 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, obtaining a routing device mapping table corresponding to the target device, querying the target IP address segment in the routing device mapping table, and determining the target IP address segment that is not queried as the available IP address segment, specifically including:
inquiring the target equipment identifier in a routing equipment mapping table to obtain routing information, wherein the routing equipment mapping table represents the mapping relation 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 field corresponding to at least one access equipment connected with the target equipment;
and comparing the target IP address field with the IP address fields of the access devices in sequence to obtain available IP address fields which are not crossed with the IP address fields of the access devices.
Optionally, after querying the destination device identifier in the routing device mapping table and obtaining the routing information, the method further includes:
displaying the routing information;
and acquiring the tail end data of the displayed information, and if the tail end data is a partial display identifier, displaying the rest routing information under the displayed information until the tail end data of the displayed information is a complete display identifier.
In the technical scheme, the server respectively determines an original IP address field and a used IP address field through preset parameters and address use identification, a search range of an available IP address is obtained by limiting the original IP address field through combining target mask digits, the address field containing the used IP address is removed from the search range to obtain a target IP address field, a routing device mapping table is obtained through automatic remote login of target devices, the availability of the target IP address field is verified through the IP address field used by the access device obtained from routing information in the mapping table, so that the available IP address field is finally determined, the accuracy of the query result of the available IP address field is guaranteed, and the processing efficiency is improved through reducing manual participation processes in the query process.
In a second aspect, the present application provides an available IP address segment obtaining apparatus, including:
the acquisition module is used for acquiring at least one original IP address field, a target mask bit number and a used IP address field;
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 out target IP address segments which are less than or equal to a preset number threshold value and do not intersect with 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 the target IP address field in the routing device mapping table, determine the target IP address field that is not queried as an available IP address field, and display the available IP address field.
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 the computer-executable instructions stored in the memory to implement the method for acquiring the available IP address segment according to the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, in which computer instructions are stored, and the computer instructions are executed by a processor to implement the method for acquiring an available IP address segment according to the first aspect.
The application provides a method, a device, a server and a storage medium for acquiring an available IP address field, wherein the server acquires at least one original IP address field, a target mask bit number and a used IP address field, acquires an original target IP address field according to the original IP address field and the target mask bit number, screens out target IP address fields which are less than or equal to a preset number threshold value and do not intersect with the used IP address field from the original target IP address field, acquires a routing device mapping table corresponding to a target device, inquires the target IP address field from the routing device mapping table, determines the target IP address field which is not inquired as the available IP address field, and displays the available IP address field, and the server respectively removes the used IP address from the original IP address field limited by the target mask bit number and verifies the used IP address in the routing information of the target device, the accuracy of obtaining the available IP address is guaranteed, and the query efficiency is improved by reducing the participation of the user in the query process.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is an application scenario diagram of a method for acquiring an available IP address field according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for acquiring an available IP address field according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a method for acquiring an available IP address field according to another embodiment of the present application;
FIG. 4 is a schematic interface diagram 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 apparatus for acquiring a usable IP address field 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.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
As the demand for 5G mobile network IP addresses increases, the complexity of IP address management grows. In the IP address total segment, there are a large number of unused IP addresses and used IP addresses, and the complexity of picking out a free available IP address segment with a specified number of mask bits from the IP address total segment also increases.
At present, the idle available IP address segments of the specified mask in the IP total segment can be inquired only by manually calculating all IP address segments under the specified mask bit number, and after used IP addresses are screened out from the IP address segments, the scattered available IP addresses are clustered to obtain available IP address segments. In addition, the available IP address field needs to be verified as free by manually logging into the relevant network device. Therefore, how to improve the acquisition efficiency and accuracy of the available IP address field becomes an urgent problem to be solved.
In view of the foregoing technical problems, embodiments of the present application provide a method, an apparatus, a server, and a storage medium for acquiring an available IP address segment, which aim to solve the problem of improving the acquisition efficiency and accuracy of an available IP address segment. The technical idea of the application is as follows: and determining a used IP address field and an unused IP address field which meet preset parameters according to the address use identification corresponding to the IP address field stored in the database, screening the IP address field containing the used IP address from the unused IP address field, and determining the usable IP address field after checking the used IP address in the routing information stored in the routing equipment.
Fig. 1 is an application scenario diagram of the available IP address segment obtaining method provided in this application, and as shown in fig. 1, the application scenario diagram includes a server 10, a data server 11, a routing device 12, and a network access device 13, where the number of the network access device 13 is at least one, and in the embodiment corresponding to fig. 1, the number of the network access device 13 is 3, and the network access device includes a first network access device 131, a second network access device 132, and a third network access device 133. The server 10 is connected with a data server 11 for storing the database, the server 10 is further connected with a routing device 12, and the routing device 12 is connected with a network access device 13 for providing services for the network access device 13. In the process of using all the devices in a networking mode, each device uses the corresponding and allocated IP address.
The data server 11 stores all IP address segments that can be allocated and utilized by the server 10 and related parameters of each address segment, wherein the related parameters include an address use identifier, and when an IP address segment is occupied, the address use identifier of the IP address segment is set as a used identifier; when the IP address field is not occupied, the address use identification of the IP address field is set as the unused identification. When the server 10 needs to search an unused IP address, the input unit of the server 10 obtains preset parameters of the IP address to be searched, searches the preset parameters in the relevant parameters of all the assignable IP address segments through the data server 11, and selects an original target IP address segment whose data corresponding to the relevant parameters is equal to the preset parameters, where an address use identifier in the preset parameters of the IP address to be searched is an unused identifier, the original target IP address segment includes an original mask bit number, and the original mask bit number, in combination with an internet communication protocol version, can define an address range of the target IP address segment. When the number of used mask bits of the server 10 is higher than the number of original mask bits, a part of IP address fields in the original target IP address field will be used, and the address use identifiers of the used IP address fields are set as used identifiers, but the address use identifiers of the original IP target address fields still remain unused identifiers, so when determining an unused IP address, the used part of IP address fields need to be removed from the original target IP address field to obtain unoccupied IP address fields, and the unoccupied IP address fields need to be determined as usable IP address fields.
In order to confirm that the available IP address segment is not occupied again, the server 10 may obtain a routing device mapping table of the routing device 12 by logging in the routing device 12 remotely to obtain an IP address segment being used by the access device 13 connected to the routing device 12, and the server 10 may confirm 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, and in the case of not being occupied, determine the available IP address segment as an available IP address segment and display the available IP address segment, so that a user using the server 10 can know about the available IP address segment satisfying preset parameters. It should be noted that when the server 10 obtains the IP address field used in the routing device table by logging in the routing device 12, there is at least one routing device 12 that the server 10 can log in, the number of the routing devices 12 in the embodiment corresponding to fig. 1 is 1, and when there are a plurality of routing devices 12, the server 10 can sequentially log in the plurality of routing devices 12 to confirm the usage of the available IP address field.
Fig. 2 is a flowchart illustrating a method for acquiring an available IP address field according to an exemplary embodiment of the present application. As shown in fig. 2, the method for acquiring an available IP address field provided by the present application includes:
s201, the server acquires at least one original IP address field, a target mask bit number and a used IP address field.
The original IP address field represents a usable IP address field that the server looks up in the database, indicating that the address field is unoccupied.
The target mask bit number is the bit number of the network address in the available IP address to be acquired by the server, the bit number is smaller than the total bit number of the original IP address segment, and the residual address bit number after the target mask bit number is removed from the original IP address segment is the host address bit number. In the original IP address segment, the address corresponding to the target mask number from left to right is a network address, and the address corresponding to the rest position of the original IP address segment after the network address is removed is a host address. For example: if the bit number of the original IP address segment is 32 bits, the target mask bit number is less than or equal to 32, if the target mask bit number is 28 bits, the address corresponding to the first 28 bits of the original IP address segment 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 which is searched in a database by the server and marks that the address field is occupied.
S202, the server obtains an original target IP address field according to the original IP address field and the target mask bit number.
Wherein, the original IP address segment and the target mask bit number are both obtained from step S201.
The original target IP address field represents all IP address ranges available to the original IP address field under the restriction 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 on 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 the AND operation, the first 28-bit address of the obtained result is the same as the first 28-bit address of the original IP address field, the last 4-bit address is 0, 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 value and do not intersect with used IP address segments from the original target IP address segments.
Wherein the original destination IP address field is obtained from step S202.
The target IP address field is an IP address field which is obtained by the server in the original IP address field except the IP address field used and is less than or equal to the preset number threshold. The target IP address field does not have a cross phenomenon with all the used IP address fields, namely, the target IP address field does not contain the IP address marked as used. 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 a 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 obtained number of target IP address segments is less than the preset number threshold, otherwise, the obtained number of 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, inquires a target IP address field in the routing equipment mapping table, determines the target IP address field which is not inquired as an available IP address field, and displays the available IP address field.
The target device is a device that is related in the embodiment corresponding to fig. 1 and that determines whether an IP address in a routing device mapping table corresponding to the device to be detected is intersected with the target IP address.
The routing device mapping table indicates a mapping relationship between the target device and the routing information corresponding to the device. The routing information includes an IP address used by a network access device connected to the target device.
The destination IP address field obtained in step S203 is queried in the routing device mapping table, and the destination IP address field that is not queried is determined as an available IP address field, that is, the remaining IP addresses that are not used by the network access device connected to the destination device in the destination IP address field are screened out are determined as available IP addresses, and the addresses are addresses that can be allocated and used by the server.
In the technical scheme, the server determines an original target IP address segment by using the obtained original IP address segment and the target mask digit, reduces the search range, then screens out the IP address segment containing the used IP address from the original target by comparing the address coverage range of the original target IP address segment and the used IP address segment, determines the available IP address segments smaller than or equal to the preset number threshold, and verifies the availability of the available IP address segments by comparing the used IP address segments recorded in the routing mapping table of the available IP address segments and the target equipment, thereby ensuring the accuracy of calculating the available IP address segments, and improving the acquisition efficiency compared with a method for manually calculating the available IP address segments and verifying the availability of the IP address segments by manually logging in equipment one by one.
Fig. 3 is a flowchart illustrating a method for acquiring an available IP address field according to an embodiment of the present application, where an execution subject of the method is a server. As shown in fig. 3, the method for acquiring an available IP address field provided by the present application includes:
s301, acquiring preset parameters and an original distributed IP address field.
The preset parameters comprise a preset network type, a preset internet communication protocol version and a preset network distribution type.
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 chain backup network. The Internet communication Protocol versions comprise a fourth version of network communication Protocol (Internet Protocol version 4, IPv4 for short) and a sixth version of network communication Protocol (Internet Protocol version 6, IPv6 for short), and the Protocol versions correspond to IP addresses with different bit numbers. The network allocation types include public networks and private networks. The above-mentioned network type, internet communication protocol version and network allocation type are all prior art and will not be explained in detail here.
S302, according to preset parameters, an unoccupied original IP address field is screened out from the original allocated IP address field.
Wherein the originally assigned IP address field and the preset parameters are obtained from step S301.
The originally allocated IP address field indicates all IP address fields that can be allocated and used by the user corresponding to the server, and the relevant information of the IP address field needs to be stored in the database before the IP address field is allocated and used by the user. The related information of the IP address field is the IP address field and the related attribute information thereof. In one embodiment, the attribute information includes the preset parameter and the address use identifier in step S301.
The unoccupied original IP address has been explained in detail in step S201, and will not be described in detail here.
The original IP address field represents an IP address field of which the address identifier found by the server in all usable IP address fields stored in the database according to the preset parameters is an unused identifier.
More specifically, the process of obtaining an unoccupied original IP address segment specifically includes steps S3021 to S3024:
s3021, obtaining the address use identifier of the original allocated IP address field.
The originally 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 address use identifier is acquired according to the setting of the user when the IP address is allocated or used. More specifically, when an IP address field is available but not yet used by the server, the address use identification of the IP address field is an unused identification; when the IP address field is allocated to a certain device by the server for use, the address use identifier of the IP address field is the used identifier.
The server queries the first IP address segment satisfying the above condition from the originally assigned IP address segment according to the preset parameters obtained in step S301 and the address use identifier obtained in this step. The first IP address field is an IP address field which is originally distributed, and relevant parameters are equal to preset parameters and are not occupied.
When the server can inquire the first IP address field in the original distribution IP address field, step S3022 is proceeded with, otherwise, step S3023 is proceeded with.
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 field is:
and determining a first IP address field with the network type as a preset network type, the Internet communication protocol version as a preset Internet communication protocol version, the network allocation type as a preset network allocation type and the address use identifier as an unused identifier from the originally allocated IP address field, and determining the first IP address field as the original IP address field. Wherein the originally allocated IP address field is obtained from step S302, a plurality of preset parameters that the first IP address field needs to satisfy are obtained from step S301, and the address usage identification is obtained from step S3021.
After this step is completed, the process proceeds to step S303.
And S3023, if the first IP address segment does not exist in the originally allocated IP address segment, determining that no available IP address segment exists in the originally allocated IP address segment, 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 originally allocated IP address field, the IP address field which can be utilized by the current server does not exist, and the server generates the reminding information according to the state that the IP address field does not exist and displays the reminding information.
After this step is completed, the current flow is ended.
S303, according to the preset network type, the occupied used IP address field is screened out from the original IP address field.
Wherein the preset network type is obtained from the preset parameters in step S301, and the originally assigned IP address field is also obtained from step S301.
The used IP address field that is already occupied refers to an IP address field that has already been assigned by the server to be used by other devices in the database that can be invoked.
More specifically, the process of obtaining the occupied used IP address segment specifically includes steps S3031 to S3034:
s3031, obtaining the address use identification of the original distribution IP address field.
The address use identifier includes a used identifier and an unused identifier. This step is the same as step S3021, and is not described here again.
After obtaining the address use identifier, the server searches a second unused IP address field meeting the requirement of the preset network type in the originally allocated IP address field according to the address use identifier and the preset network type in step S303.
And when the second IP address field exists in the original allocated IP address field, the step S3032 is carried out, otherwise, the step S3033 is carried out.
S3032, if the second IP address segment exists in the original distribution IP address segment, screening the second IP address segment from the original distribution IP address segment.
More specifically, a second IP address segment in which the network type is the preset network type and the address use identifier is the used identifier is determined from the originally allocated IP address segment, and the second IP address segment is determined as the used IP address segment.
After this step is completed, the process proceeds to step S304.
S3033, if the second IP address segment does not exist in the original distributed IP address segments, screening a third IP address segment which is less than or equal to a preset number threshold value from the original IP address segments, 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 segment does not exist, the IP address segment with the network type being the preset network type in the originally distributed IP address segment is not used, and the IP address segment which is limited in the original IP address segment according to the corresponding preset parameters is not used on the basis that the network type is the preset network type. Therefore, in the case where the second IP address segment does not exist, all the original IP address segments can be assigned to the device to acquire an IP address by the server and used.
After all the original IP address segments are determined to be available, if the number of the original IP address segments is smaller than a preset number threshold, determining all the original IP address segments as third IP address segments; and if the number of the original IP address segments is larger 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. Wherein, 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, and is not described herein again.
After this step is completed, the process proceeds to step S306.
S304, obtaining an 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, the target mask bit number is the bit number of the network address in the subnet mask that defines the distribution range of the server search IP address field, and the target mask bit number has been explained in detail in step S201, and is not described herein again.
The process of obtaining the original target IP address field defined by the subnet mask corresponding to the target mask bit number from the original IP address field is explained in detail in step S202, and is not described herein again.
S305, screening out target IP address segments which are less than or equal to a preset number threshold value and do not intersect with used IP address segments from the original target IP address segments.
Wherein the original destination 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 is not overlapped with the address distribution ranges of all the used IP address segments obtained in step S3032, that is, the target IP address segment does not contain any used IP address.
After determining IP address segments which are not crossed with used IP address segments in the original target IP address segments, obtaining target IP address segments which are less than or equal to a preset number threshold value according to the number of the IP address segments, namely obtaining the target IP address segments which are equal to the preset number threshold value 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 value; 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, acquiring at least one target device identification, IP address information and account information of each target device.
The target device identifier is an identifier indicating a target device that determines whether the target IP address segment obtained in step S305 or step S3033 is occupied again.
The target device is a device for providing service for the network access device connected with the target device, the IP address information of the target device is an allocated IP address of the target device, and the IP address is used for the server to determine the network position of the target device.
The account information of the target device represents account information required for the device to verify identity information when remotely logging in to the target device. In one embodiment, the account information includes an account name and an account password.
In addition, the server also obtains input port information of the target device.
S307, according to the IP address information and the 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 the account information of the target device are obtained from step S306.
The process that the server obtains the control authority of each target device through the remote login protocol is as follows: and the server transmits the IP address information and the account information of the target equipment to a port corresponding to the target equipment according to the input port information of the target equipment, performs identity authentication through a remote login protocol, and acquires control authority of each target equipment after the authentication is passed. In an embodiment, the telnet protocol is an SSH telnet protocol, which is a prior art and is not described herein again.
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 a mapping relation between the target device identification and the routing information associated with the target device identification.
The server obtains the routing information corresponding to the routing service provided by the target device according to the target device identifier obtained in 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.
S309, displaying the routing information.
Wherein the routing information is obtained from step S308.
S310, obtaining the terminal data of the displayed information, if the terminal data is a part of display mark, displaying the rest route information under the displayed information until the terminal data of the displayed information is a complete display mark.
Wherein the displayed information is information that the routing 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 routing information can be fully displayed in the display process in step S309, the identifier displayed at the last bit of the information is a full display identifier, otherwise, the identifier displayed at the last bit of the information is a partial display identifier. In an embodiment, if the routing information is completely displayed on a display screen of the server through a line of information, the last bit of the routing information is identified as a carriage return symbol, and the carriage return symbol is a complete display identifier, otherwise, when the last bit of the routing information is identified as '>', the symbol is a partial display identifier, the server inserts the carriage return symbol at the position of the routing information, another line displays the remaining route information which is not displayed, and obtains the last bit display identifier again until the last bit of the newly displayed routing information is identified as the carriage return symbol, that is, the routing information is completely displayed in multiple lines, so as to improve readability of the routing information for a user using the server.
S311, performing regular matching on the routing information to obtain an access device IP address field corresponding to at least one access device connected with the target device.
Wherein the routing information is obtained from step S308.
The regular matching refers to extracting an IP address section from the routing information according to an IP address display format, wherein the IP address section is an access equipment IP address section of access equipment connected with target equipment. The format of the IP address field is "IP address/mask bit number". The process of extracting the IP address segment by regular matching is prior art and is not described herein again.
And S312, comparing the target IP address field with the IP address fields of the access devices in sequence to obtain available IP address fields which are not crossed with the IP address fields of the access devices, and displaying the available IP address fields.
Wherein, the target IP address field is obtained from step S305 or step S3033.
The access device IP address field, which is an already occupied IP address field, is obtained from step S311.
If the target IP address field does not contain any IP address in the IP address field of any access equipment, determining that the target IP address field is not occupied, and distributing the target IP address field to available IP address fields used by other equipment for the server. The target IP address field does not contain any IP address in any access equipment IP address field, which means that the target IP address field and any access equipment IP address field do not intersect.
In the technical scheme, a server respectively determines an original IP address segment and a used IP address segment through preset parameters and address use identification, a searching range of an available IP address is obtained by limiting the original IP address segment according to a target mask bit number, the address segment containing the used IP address is removed from the searching range to obtain a target IP address segment, a routing equipment mapping table is obtained by automatically logging in a target device remotely, the availability of the target IP address segment is verified through the IP address segment used by an access device and obtained from routing information in the mapping table, so that the available IP address segment is finally determined, the accuracy of the query result of the available IP address segment is guaranteed, and the processing efficiency is improved by reducing manual participation processes in the query process.
Fig. 4 is a schematic interface diagram of an available IP address field acquisition application according to another embodiment of the present application. The available IP address field acquisition application program is a program that is installed in the server, receives preset parameters and an address use identifier, and determines and displays an available IP address field according to the available IP address field acquisition method in the embodiment corresponding to fig. 2 or fig. 3. As shown in fig. 4, the interface of the available IP address field acquisition application is an interface displayed by the display device when the server runs the available IP address field acquisition application. The available IP address field acquisition 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 preset parameters and address use identifiers required in the above embodiment, and after the server obtains the required data for querying the available IP address field according to the parameter selection area 401 and the parameter input area 402, the server obtains the available IP address field by combining the database stored in the data server with the available IP address field obtaining method in the embodiment corresponding to fig. 2 or fig. 3, and displays the 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 segment obtaining apparatus 500, which includes an obtaining module 501 and a processing module 502, where the obtaining module 501 is connected to the processing module 502.
An obtaining module 501, 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 that are not intersected with used IP address segments and are less than or equal to a preset number threshold from the original target IP address segments.
The processing module 502 is further configured to obtain a routing device mapping table corresponding to the target device, query the target IP address field in the routing device mapping table, determine the target IP address field that is not queried as an available IP address field, and display the available IP address field.
As shown in fig. 6, an embodiment of the present application provides a server 600, where the server 600 includes a memory 601 and a processor 602.
The memory 601 is used for storing computer instructions executable by the processor 602.
The processor 602, when executing the computer instructions, implements the steps in the method for acquiring an available IP address field with the server 600 as the execution subject in the above embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 601 may be separate or integrated with the processor 602. When the memory 601 is separately provided, the server 600 further includes a bus for connecting the memory 601 and the processor 602.
An embodiment of the present application further provides a computer-readable storage medium, where a computer instruction is stored in the computer-readable storage medium, and when the processor executes the computer instruction, the steps in the method for acquiring an available IP address segment in the foregoing embodiments are implemented.
An embodiment of the present application further provides a computer program product, which includes computer instructions, and when executed by a processor, the computer instructions implement the steps in the method for acquiring an available IP address field in the foregoing embodiment.
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 invention 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 invention 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 will be understood that the present application is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (12)

1. An available IP address field obtaining method, which is applied to a server and comprises the following steps:
acquiring at least one original IP address field, a target mask bit number and a used IP address field;
obtaining an original target IP address segment according to the original IP address segment and the target mask bit number;
screening out target IP address segments which are less than or equal to a preset number threshold value and do not intersect with the used IP address segments from the original target IP address segments;
and acquiring a routing equipment mapping table corresponding to target equipment, inquiring the target IP address field in the routing equipment mapping table, determining the target IP address field which is not inquired as an available IP address field, and displaying the available IP address field.
2. The method of claim 1, wherein obtaining at least one of the original IP address field and the used IP address field specifically comprises:
acquiring preset parameters and an original distribution IP address field, wherein the preset parameters comprise a preset network type, a preset Internet communication protocol version and a preset network distribution type;
according to the preset parameters, screening out unoccupied original IP address segments from the original allocated IP address segments;
and screening out occupied used IP address segments from the original allocated IP address segments according to the preset network type.
3. The method according to claim 2, wherein the step of screening out unoccupied original IP address segments from the original allocated IP address segments according to the preset parameters specifically comprises:
acquiring an address use identifier of the originally allocated IP address field; the address use identification comprises a used identification and an unused identification;
and determining a first IP address segment with a network type of the preset network type, an Internet communication protocol version of the preset Internet communication protocol version, a network distribution type of the preset network distribution type and an address use identifier of an unused identifier from the original distribution IP address segment, and determining the first IP address segment as the original IP address segment.
4. The method of claim 3, wherein prior to determining from the originally assigned IP address segment that the network type is the predetermined network type, the Internet protocol version is a predetermined Internet protocol version, the network assignment type is a predetermined network assignment type, and the address usage identifier is a first IP address segment that is not identified as being used, the method further comprises:
if the first IP address field exists in the original distribution IP address field, screening the first IP address field from the original distribution IP address field;
if the first IP address field does not exist in the original distribution IP address field, determining that no available IP address field exists in the original distribution IP address field, generating reminding information, and controlling the reminding information to display.
5. The method according to claim 2, wherein the step of screening out used IP address segments that have been occupied from the originally allocated IP address segments according to the preset network type includes:
acquiring an address use identifier of the originally allocated IP address field;
and determining the network type as the preset network type and the address use identifier as the second IP address segment of the used identifier from the originally distributed IP address segment, and determining the second IP address segment as the used IP address segment.
6. The method of claim 5, wherein prior to determining that the network type is the predetermined network type and the address usage identification is the second IP address segment of the used identification in the originally assigned IP address segment, the method further comprises:
if the second IP address segment exists in the original distribution IP address segment, screening the second IP address segment from the original distribution IP address segment;
if the second IP address segment does not exist in the original distributed IP address segment, screening a third IP address segment which is smaller than or equal to a preset number threshold 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 be displayed.
7. The method of claim 1, wherein before obtaining the mapping table of the routing device corresponding to the target device, the method further comprises:
acquiring at least one target device identifier, IP address information of each target device 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.
8. The method according to claim 7, 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:
querying the target device identifier in the routing device mapping table to obtain routing information, where the routing device mapping table indicates a mapping relationship between the target device identifier and routing information associated with the target device identifier;
performing regular matching on the routing information to obtain an access device IP address field corresponding to at least one access device connected with the target device;
and comparing the target IP address field with the IP address fields of the access devices in sequence to obtain available IP address fields which are not crossed with the IP address fields of the access devices.
9. The method of claim 8, wherein after querying the routing device mapping table for the target device identifier and obtaining the routing information, the method further comprises:
displaying the routing information;
and acquiring the terminal data of the displayed information, and if the terminal data is a partial display identifier, displaying the rest routing information at the lower side of the displayed information until the terminal data of the displayed information is a complete display identifier.
10. An available IP address field acquisition apparatus, comprising:
the acquisition module is used for acquiring at least one original IP address field, a target mask bit number and a used IP address field;
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 out target IP address segments which are less than or equal to a preset number threshold value and do not intersect with 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 the target IP address field in the routing device mapping table, determine the target IP address field that is not queried as an available IP address field, and display the available IP address field.
11. 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 acquisition method of any of claims 1 to 9.
12. A computer-readable storage medium having stored thereon computer instructions for implementing the method of retrieving usable IP address segments as claimed in any one of claims 1 to 9 when executed by a processor.
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 true CN114697291A (en) 2022-07-01
CN114697291B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115190110A (en) * 2022-07-18 2022-10-14 北京字节跳动科技有限公司 Geographic position determining method and device

Citations (5)

* 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
CN105472048A (en) * 2014-07-14 2016-04-06 华为技术有限公司 Address allocating method, information aggregation method and related equipment
EP3591912A1 (en) * 2017-03-14 2020-01-08 Huawei Technologies Co., Ltd. Evpn packet processing method, device and system
CN112532501A (en) * 2019-09-18 2021-03-19 中国电信股份有限公司 Host physical address processing method and device and computer readable storage medium
CN113794773A (en) * 2021-09-15 2021-12-14 中国电信股份有限公司 Edge node scheduling method and device, storage medium and electronic equipment

Patent Citations (5)

* 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
CN105472048A (en) * 2014-07-14 2016-04-06 华为技术有限公司 Address allocating method, information aggregation method and related equipment
EP3591912A1 (en) * 2017-03-14 2020-01-08 Huawei Technologies Co., Ltd. Evpn packet processing method, device and system
CN112532501A (en) * 2019-09-18 2021-03-19 中国电信股份有限公司 Host physical address processing method and device and computer readable storage medium
CN113794773A (en) * 2021-09-15 2021-12-14 中国电信股份有限公司 Edge node scheduling method and device, storage medium and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WACHIRAWIT PONGHIRAN; SEONGBO SHIM; YOUNGSOO SHIN: ""Cut mask optimization for multi-patterning directed self-assembly lithography"", 《DESIGN, AUTOMATION & TEST IN EUROPE CONFERENCE & EXHIBITION (DATE), 2017》 *
陈星星: ""基于IPv6的高性能安全网关研究与实现"", 《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》 *

Cited By (2)

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

Also Published As

Publication number Publication date
CN114697291B (en) 2023-06-06

Similar Documents

Publication Publication Date Title
CN109474481B (en) Equipment deployment method and system, network management server, mobile terminal and storage medium
CN102710811B (en) Realize method and the switch of dhcp address safety distribution
CN108880840A (en) The method and apparatus for obtaining access path
US8775629B1 (en) System and method for managing internet protocol (IP) address space for enterprise network
CN111683371B (en) Intelligent household appliance network distribution method, intelligent household appliance, mobile terminal and medium
CN108337739B (en) Method and device for establishing wireless debugging connection and data processing method
CN112261175B (en) Asset information updating method, device, equipment and medium
CN109194525A (en) A kind of network node configuration method and management node
CN106210155A (en) The method and apparatus connecting application server
CN114697291B (en) Method, device, server and storage medium for acquiring available IP address field
CN1921496B (en) Method for DHCP client terminal to identifying DHCP server
CN112788576B (en) Equipment offline processing method and system, storage medium and electronic device
CN109413227A (en) IPv4 user based on more IPv6 networks accesses IPv6 network interworking device and equipment
CN111131049B (en) Method and device for processing routing table entry
CN106789695B (en) Message processing method and device
CN104506405A (en) Method and device for cross-domain access
CN106354706A (en) Information collecting method and system
CN109981813A (en) Message processing method and device
US20090240836A1 (en) Support apparatus, design support method, and design support program
CN112565482B (en) Electronic equipment, domain name query method and related product
CN104168290B (en) A kind of terminal registration method and registrar
US20020151270A1 (en) Method of programming wireless broadband equipment
CN102118766A (en) Method and device for identifying base station, and network system
JP4586722B2 (en) Microwave radio communication system, IP address automatic allocation method, and system configuration information download method
CN110708208B (en) Monitoring data acquisition method and device, storage medium and terminal

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