CN115065664B - Internet protocol address recycling method, electronic equipment and storage medium - Google Patents

Internet protocol address recycling method, electronic equipment and storage medium Download PDF

Info

Publication number
CN115065664B
CN115065664B CN202210691448.7A CN202210691448A CN115065664B CN 115065664 B CN115065664 B CN 115065664B CN 202210691448 A CN202210691448 A CN 202210691448A CN 115065664 B CN115065664 B CN 115065664B
Authority
CN
China
Prior art keywords
internet protocol
protocol address
condition
user terminal
response message
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
CN202210691448.7A
Other languages
Chinese (zh)
Other versions
CN115065664A (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.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software 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 Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202210691448.7A priority Critical patent/CN115065664B/en
Publication of CN115065664A publication Critical patent/CN115065664A/en
Application granted granted Critical
Publication of CN115065664B publication Critical patent/CN115065664B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The disclosure provides a method for recovering an internet protocol address, an electronic device and a storage medium, comprising the following steps: acquiring and responding to the recovery instruction, and sending a plurality of detection messages to each Internet protocol address according to the time interval; determining whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition according to each internet protocol address, wherein the response message is obtained by the user terminal responding to the detection message, and the first condition is that the ratio of the first number of the response messages to the second number of the detection messages is smaller than a preset threshold; under the condition that a response message returned by the user terminal corresponding to the Internet protocol address meets a first condition, updating a current identifier of the Internet protocol address, wherein the current identifier represents the times that the response message returned by the user terminal corresponding to the Internet protocol address continuously meets the first condition; it is determined whether to reclaim its corresponding internet protocol address based on the updated identification. The present disclosure can improve accuracy of recovery.

Description

Internet protocol address recycling method, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of network configuration, and in particular, to a method for recovering an internet protocol address, electronic equipment and a storage medium.
Background
As the network scale is continuously enlarged and the network complexity is continuously increased, the network configuration is also becoming more and more complex, so that more and more enterprises and families acquire internet protocol addresses (Internet Protocol Address, IP addresses) through dynamic host configuration protocols (Dynamic Host Configuration Protocol, DHCP), the DHCP is a mode that clients can acquire required network configuration information from a DHCP server through DHCP message interaction, and the IP addresses are allocated to user terminals temporarily accessing the network, or in the case that a group of user terminals not requiring permanent IP addresses share a group of limited IP addresses, the IP addresses are allocated to the user terminals by using a dynamic allocation mode.
The number of IP addresses of each network is fixed, and as a new user terminal requests access to the network, the number of available IP addresses of the network gradually decreases, so that the IP addresses of the network need to be recovered to enable the new user terminal to access the network. At present, the method for recovering the IP address comprises the following steps: the server sends a detection message to all IP addresses in the lease period, if the response of the user terminal corresponding to the address is not received, the address is recovered, but under the condition that the network is temporarily disconnected or the user terminal is not started or connected with the network, the response of the user terminal cannot be received, and at the moment, the error recovery of the IP address is caused, namely the detection result is lower in accuracy; in addition, after the IP address is recovered by mistake, the original user terminal corresponding to the recovered IP address cannot access the network, so that resource waste is caused.
Disclosure of Invention
In view of the above, an object of the embodiments of the present disclosure is to provide a method, an electronic device, and a storage medium for recovering an internet protocol address, which are used for solving the problem in the prior art that, when a network is temporarily disconnected or a user terminal is not started or is not connected to the network, an IP address is erroneously recovered, so that the accuracy of a detection result is low, and after the IP address is erroneously recovered, an original user terminal corresponding to the recovered IP address cannot access the network, resulting in resource waste.
In a first aspect, an embodiment of the present disclosure provides a method for recovering an internet protocol address, including:
acquiring and responding to the recovery instruction, and sending a plurality of detection messages to each Internet protocol address according to the time interval;
determining whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition according to each internet protocol address, wherein the response message is obtained by the user terminal responding to the detection message, and the first condition is that the ratio of the first number of the response messages to the second number of the detection messages is smaller than a preset threshold;
updating a current identifier of the internet protocol address under the condition that a response message returned by the user terminal corresponding to the internet protocol address meets the first condition, wherein the current identifier represents the times that the response message returned by the user terminal corresponding to the internet protocol address continuously meets the first condition;
And determining whether to recycle the corresponding internet protocol address based on the updated identification.
In one possible implementation, acquiring the reclamation instruction includes:
determining whether a preset period is reached;
and generating the recycling instruction under the condition that the preset period is reached.
In one possible implementation, the acquiring the reclamation instruction further includes:
determining whether an address allocation request is received, wherein the address allocation request is sent by a new user terminal which is not accessed to the current network;
and generating the recycling instruction under the condition that the address allocation request is received.
In a possible implementation manner, in a case that the address allocation request is received, generating the reclamation instruction includes:
under the condition that the address allocation request is received, determining whether unallocated internet protocol addresses in the current network meet a second condition, wherein the second condition is that the proportion of the unallocated internet protocol addresses to all internet protocol addresses is smaller than a preset proportion;
and generating the recycling instruction under the condition that the unassigned internet protocol address meets the second condition.
In one possible implementation, the current identification is a numerical value, and the updating the current identification of the internet protocol address includes:
and adding 1 to the current identification to update the current identification of the Internet protocol address.
In a possible implementation manner, the determining whether to reclaim the corresponding internet protocol address based on the updated identifier includes:
and recovering the preset number of internet protocol addresses according to the descending order of the times that the response messages returned by the user terminals corresponding to the internet protocol addresses continuously meet the first condition.
In a possible implementation manner, the determining whether to reclaim the corresponding internet protocol address based on the updated identifier further includes:
determining the number of received address allocation requests;
and recovering the Internet protocol addresses of the request number according to the descending order of the times that the response messages returned by the user terminals corresponding to the Internet protocol addresses continuously meet the first condition.
In one possible embodiment, the recovery method further comprises:
determining whether the current identifier of the internet protocol address is a preset identifier or not under the condition that a response message returned by the user terminal corresponding to the internet protocol address does not meet the first condition;
If not, changing the current identification of the Internet protocol address into the preset identification, wherein the preset identification represents that the Internet protocol address is allocated.
In one possible embodiment, the recovery method further comprises:
and responding to the address allocation request, and reallocating the recovered Internet protocol address.
In a second aspect, an embodiment of the present disclosure further provides an electronic device, including:
a transmitting module configured to acquire and respond to the reclamation instruction, and transmit a plurality of detection messages to each internet protocol address according to a time interval;
a first determining module, configured to determine, for each internet protocol address, whether a response message returned by a user terminal corresponding to the internet protocol address meets a first condition, where the response message is obtained by the user terminal responding to the probe message, and the first condition is that a ratio of a first number of the response messages to a second number of the probe messages is smaller than a preset threshold;
the updating module is configured to update a current identifier of the internet protocol address under the condition that a response message returned by the user terminal corresponding to the internet protocol address meets the first condition, wherein the current identifier represents the number of times that the response message returned by the user terminal corresponding to the internet protocol address continuously meets the first condition;
A reclamation module configured to determine whether to reclaim its corresponding internet protocol address based on the updated identification.
In a third aspect, the disclosed embodiments also provide a storage medium, wherein the computer readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring and responding to the recovery instruction, and sending a plurality of detection messages to each Internet protocol address according to the time interval;
determining whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition according to each internet protocol address, wherein the response message is obtained by the user terminal responding to the detection message, and the first condition is that the ratio of the first number of the response messages to the second number of the detection messages is smaller than a preset threshold;
updating a current identifier of the internet protocol address under the condition that a response message returned by the user terminal corresponding to the internet protocol address meets the first condition, wherein the current identifier represents the times that the response message returned by the user terminal corresponding to the internet protocol address continuously meets the first condition;
And determining whether to recycle the corresponding internet protocol address based on the updated identification.
In a fourth aspect, an embodiment of the present disclosure further provides an electronic device, including: a processor and a memory storing machine-readable instructions executable by the processor, the processor and the memory in communication over a bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of:
acquiring and responding to the recovery instruction, and sending a plurality of detection messages to each Internet protocol address according to the time interval;
determining whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition according to each internet protocol address, wherein the response message is obtained by the user terminal responding to the detection message, and the first condition is that the ratio of the first number of the response messages to the second number of the detection messages is smaller than a preset threshold;
updating a current identifier of the internet protocol address under the condition that a response message returned by the user terminal corresponding to the internet protocol address meets the first condition, wherein the current identifier represents the times that the response message returned by the user terminal corresponding to the internet protocol address continuously meets the first condition;
And determining whether to recycle the corresponding internet protocol address based on the updated identification.
After acquiring the recycling instruction, the embodiment of the disclosure transmits a plurality of detection messages to each internet protocol address according to a time interval in response to the recycling instruction so as to finish one-time detection of each internet protocol address, further determines whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition, and if so, updates a current identifier of the internet protocol address to obtain an updated identifier, so as to determine whether to recycle the corresponding internet protocol address based on the updated identifier, thereby avoiding the problem of incorrect recycling of the internet protocol address caused by temporary network disconnection or un-started and un-connected network of the user terminal, and improving the accuracy of detection results, namely recycling; and the original user terminal corresponding to the Internet protocol address can be ensured to normally use the network, and the resource waste is avoided.
The foregoing objects, features and advantages of the disclosure will be more readily apparent from the following detailed description of the preferred embodiments taken in conjunction with the accompanying drawings.
Drawings
In order to more clearly illustrate the technical solutions of the present disclosure or the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and other drawings may be obtained according to these drawings without inventive effort to a person of ordinary skill in the art.
FIG. 1 illustrates a flow chart of a method of reclaiming an Internet protocol address provided by the present disclosure;
fig. 2 shows a schematic structural diagram of an electronic device provided by the present disclosure;
fig. 3 shows a schematic structural diagram of another electronic device provided by the present disclosure.
Detailed Description
Various aspects and features of the disclosure are described herein with reference to the drawings.
It should be understood that various modifications may be made to the embodiments of the application herein. Therefore, the above description should not be taken as limiting, but merely as exemplification of the embodiments. Other modifications within the scope and spirit of this disclosure will occur to persons of ordinary skill in the art.
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and, together with a general description of the disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the disclosure.
These and other characteristics of the present disclosure will become apparent from the following description of a preferred form of embodiment, given as a non-limiting example, with reference to the accompanying drawings.
It should also be understood that, although the present disclosure has been described with reference to some specific examples, a person skilled in the art will certainly be able to achieve many other equivalent forms of the present disclosure, having the characteristics as set forth in the claims and hence all coming within the field of protection defined thereby.
The above and other aspects, features and advantages of the present disclosure will become more apparent in light of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present disclosure will be described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely examples of the disclosure, which may be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the disclosure in unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not intended to be limiting, but merely serve as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present disclosure in virtually any appropriately detailed structure.
The specification may use the word "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the disclosure.
In a first aspect, for ease of understanding the present disclosure, a method for recovering an internet protocol address provided by the present disclosure is first described in detail. As shown in fig. 1, in the recovery method provided in the embodiment of the present disclosure, according to the method steps shown in fig. 1, the problem that in the prior art, when a network is temporarily disconnected or a user terminal is not started or is not connected to the network, an IP address is erroneously recovered, so that the accuracy of a detection result is low, and after the IP address is erroneously recovered, an original user terminal corresponding to the recovered IP address cannot access the network, resulting in resource waste is solved. The specific steps include S101-S104.
S101, acquiring and responding to the recycling instruction, and sending a plurality of detection messages to each Internet protocol address according to the time interval.
In an implementation, the reclamation instruction is acquired in real time and/or periodically, and after the reclamation instruction is acquired, the reclamation instruction is responded to, that is, the detection of the internet protocol address is started. Optionally, after acquiring the reclamation instruction, sending a plurality of detection messages to each internet protocol address according to a time interval. That is, for each internet protocol address, a plurality of detection messages are sent, and a certain time interval exists between the sending time of two adjacent detection messages, so that the problem that when only one detection message is sent, the current network is temporarily disconnected or the current network is not started or connected, so that a response message of the user terminal cannot be received is avoided, and the problem that the internet protocol address is recovered by mistake in the follow-up is avoided.
It is worth noting that in the case where no reclamation instruction is obtained, no probing of the internet protocol address is performed.
Optionally, embodiments of the present disclosure provide for generating the reclamation instruction in two ways, the first way being: determining whether a preset period is reached, and generating a recycling instruction under the condition that the preset period is reached, namely setting a preset period for the current network, wherein the preset period is used for indicating to detect the internet protocol address in the current network. The preset period may be set to one week, three days, one month, etc., and as one example, the preset period is set based on the attribute of the current network, the number of accessed user terminals, etc., for example, in a scenario where the current network is an internal network of a company and the number of accessed user terminals is relatively fixed, the preset period may be set to be relatively long, such as one month; in the scenario that the current network is a public network and the change frequency of the accessed user terminal is high, the preset period can be set to be short, such as three days.
The second way to generate the recycling instruction provided by the embodiments of the present disclosure is: it is determined whether an address allocation request is received, wherein the address allocation request is sent by a new user terminal that is not accessing the current network, that is, there is a new user terminal requesting access to the current network. Further, in the case of receiving the address allocation request, generating a reclamation instruction, and as one example, in the case of receiving the address allocation request, further determining whether the unallocated internet protocol address in the current network meets a second condition, where the second condition is that a proportion of the unallocated internet protocol address to all internet protocol addresses is smaller than a preset proportion, where the preset proportion is a proportion of an internet protocol address which cannot be allocated to a new user terminal in the current network to all internet protocol addresses, where the preset proportion is determined based on an attribute of the current network, for example, in a case that a bandwidth of the current network is larger, the preset proportion may be set smaller; in the scene of smaller bandwidth of the current network, a larger preset proportion can be set, and the like. And then, after determining that the unassigned internet protocol address meets the second condition, namely, determining that the assignable internet protocol address in the current network is insufficient, generating a recycling instruction.
Of course, in the same network, the reclamation instruction may be generated only by the first manner or the second manner, or may be generated by the first manner and the second manner, which is not particularly limited in the embodiments of the present disclosure.
S102, determining whether a response message returned by a user terminal corresponding to each Internet protocol address meets a first condition according to each Internet protocol address, wherein the response message is obtained by the user terminal responding to the detection message, and the first condition is that the ratio of the first number of the response messages to the second number of the detection messages is smaller than a preset threshold.
And after sending a plurality of detection messages to each internet protocol address according to the time interval, receiving a response message returned by the user terminal corresponding to each internet protocol address in real time aiming at each internet protocol address.
After receiving a response message returned by a user terminal corresponding to the internet protocol address, determining whether the response message returned by the user terminal corresponding to the internet protocol address meets a first condition, wherein the response message is obtained by the user terminal responding to a detection message, the first condition is that the ratio of the first number of the response messages to the second number of the detection messages is smaller than a preset threshold, for example, the detection messages sent to the internet protocol address are set to be 5, the preset threshold is set to be 0.6, if the received response message is set to be 4, the ratio of the first number to the second number is set to be 4/5=0.8, and the ratio is larger than the preset threshold to be 0.6, so that the response message returned by the user terminal corresponding to the internet protocol address is determined to not meet the first condition; if the number of the received response messages is 2, the ratio of the first number to the second number is 2/5=0.4, which is smaller than the preset threshold value of 0.6, and further it is determined that the response message returned by the user terminal corresponding to the internet protocol address meets the first condition.
And S103, under the condition that the response message returned by the user terminal corresponding to the Internet protocol address meets the first condition, updating the current identification of the Internet protocol address, wherein the current identification represents the times that the response message returned by the user terminal corresponding to the Internet protocol address continuously meets the first condition.
And under the condition that the response message returned by the user terminal corresponding to the Internet protocol address meets the first condition, indicating that the user terminal corresponding to the Internet protocol address does not use the Internet protocol address, and updating the current identification of the Internet protocol address. The current identifier characterizes the times that the response message returned by the user terminal corresponding to the Internet protocol address continuously meets the first condition.
As one example, the current identifier is a numerical value, and when the current identifier of the internet protocol address is updated to obtain an updated identifier, 1 may be directly added to the current identifier to obtain an updated identifier, and then the updated identifier is used to update the current identifier, that is, the current identifier is modified to be the updated identifier.
And S104, determining whether to recycle the corresponding Internet protocol address based on the updated identification.
After the updated identifier is obtained, determining whether to recycle the corresponding internet protocol addresses according to the updated identifier, wherein as an example, the preset number of internet protocol addresses can be recycled according to the descending order of the times that the response messages returned by the user terminals corresponding to the internet protocol addresses continuously meet the first condition; optionally, the number of the received address allocation requests may be determined first, and then the internet protocol addresses of the number of requests may be recovered according to the descending order of the times that the response messages returned by the user terminals corresponding to the internet protocol addresses continuously meet the first condition, so as to achieve the purpose that the new user terminal accesses the current network.
In a specific implementation, when a response message returned by a user terminal corresponding to an internet protocol address does not meet a first condition, that is, a ratio of a first number of response messages to a second number of probe messages is greater than or equal to a preset threshold, that is, the user terminal corresponding to the internet protocol address uses the internet protocol address, it is determined whether a current identifier of the internet protocol address is a preset identifier. If it is determined that the current identifier of the internet protocol address is not the preset identifier, the current identifier of the internet protocol address is changed to the preset identifier, wherein the preset identifier characterizes that the internet protocol address is allocated, and for example, the preset identifier is set to 0.
After the updated identifier is obtained, an address allocation request is received in real time, and the address allocation request is responded, namely, the recovered internet protocol address is redistributed, so that the request of accessing the new user terminal into the current network is met.
After acquiring the recycling instruction, the embodiment of the disclosure transmits a plurality of detection messages to each internet protocol address according to a time interval in response to the recycling instruction so as to finish one-time detection of each internet protocol address, further determines whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition, and if so, updates a current identifier of the internet protocol address to obtain an updated identifier, so as to determine whether to recycle the corresponding internet protocol address based on the updated identifier, thereby avoiding the problem of incorrect recycling of the internet protocol address caused by temporary network disconnection or un-started and un-connected network of the user terminal, and improving the accuracy of detection results, namely recycling; and the original user terminal corresponding to the Internet protocol address can be ensured to normally use the network, and the resource waste is avoided.
Based on the same inventive concept, the second aspect of the present disclosure further provides an electronic device corresponding to the recycling method, and since the principle of solving the problem of the electronic device in the present disclosure is similar to that of the recycling method described above, the implementation of the electronic device may refer to the implementation of the method, and the repetition is omitted.
Fig. 2 shows a schematic diagram of an electronic device provided by an embodiment of the disclosure, specifically including:
a transmitting module 201 configured to acquire and respond to the reclamation instruction, and transmit a plurality of detection messages to each internet protocol address at intervals;
a first determining module 202, configured to determine, for each ip address, whether a response packet returned by a user terminal corresponding to the ip address meets a first condition, where the response packet is obtained by the user terminal responding to the probe packet, and the first condition is that a ratio of a first number of the response packets to a second number of the probe packets is smaller than a preset threshold;
an updating module 203, configured to update a current identifier of the internet protocol address when a response message returned by the user terminal corresponding to the internet protocol address meets the first condition, where the current identifier characterizes a number of times that the response message returned by the user terminal corresponding to the internet protocol address continuously meets the first condition;
a reclamation module 204 configured to determine whether to reclaim its corresponding internet protocol address based on the updated identification.
In yet another embodiment, the electronic device further comprises a second determination module 205 configured to:
determining whether a preset period is reached;
and generating the recycling instruction under the condition that the preset period is reached.
In yet another embodiment, the second determining module 205 is further configured to:
determining whether an address allocation request is received, wherein the address allocation request is sent by a new user terminal which is not accessed to the current network;
and generating the recycling instruction under the condition that the address allocation request is received.
In yet another embodiment, the second determining module 205 is further configured to:
under the condition that the address allocation request is received, determining whether unallocated internet protocol addresses in the current network meet a second condition, wherein the second condition is that the proportion of the unallocated internet protocol addresses to all internet protocol addresses is smaller than a preset proportion;
and generating the recycling instruction under the condition that the unassigned internet protocol address meets the second condition.
In yet another embodiment, the updating module 203 is specifically configured to:
adding 1 to the current identifier to update the current identifier of the internet protocol address;
And updating the current identifier by using the updated identifier.
In yet another embodiment, the reclamation module 204 is specifically configured to:
and recovering the preset number of internet protocol addresses according to the descending order of the times that the response messages returned by the user terminals corresponding to the internet protocol addresses continuously meet the first condition.
In yet another embodiment, the reclamation module 204 is further configured to:
determining the number of received address allocation requests;
and recovering the Internet protocol addresses of the request number according to the descending order of the times that the response messages returned by the user terminals corresponding to the Internet protocol addresses continuously meet the first condition.
In yet another embodiment, the electronic device further comprises a third determination module 206 configured to:
determining whether the current identifier of the internet protocol address is a preset identifier or not under the condition that a response message returned by the user terminal corresponding to the internet protocol address does not meet the first condition;
if not, changing the current identification of the Internet protocol address into the preset identification, wherein the preset identification represents that the Internet protocol address is allocated.
In yet another embodiment, the electronic device further comprises an allocation module 207 configured to:
And responding to the address allocation request, and reallocating the recovered Internet protocol address.
After acquiring the recycling instruction, the embodiment of the disclosure transmits a plurality of detection messages to each internet protocol address according to a time interval in response to the recycling instruction so as to finish one-time detection of each internet protocol address, further determines whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition, and if so, updates a current identifier of the internet protocol address to obtain an updated identifier, so as to determine whether to recycle the corresponding internet protocol address based on the updated identifier, thereby avoiding the problem of incorrect recycling of the internet protocol address caused by temporary network disconnection or un-started and un-connected network of the user terminal, and improving the accuracy of detection results, namely recycling; and the original user terminal corresponding to the Internet protocol address can be ensured to normally use the network, and the resource waste is avoided.
The embodiment of the present disclosure provides a storage medium, which is a computer readable medium storing a computer program, the computer program implementing the method provided by any embodiment of the present disclosure when executed by a processor, including steps S11 to S14 as follows:
S11, acquiring and responding to the recovery instruction, and sending a plurality of detection messages to each Internet protocol address according to the time interval;
s12, determining whether a response message returned by a user terminal corresponding to each Internet protocol address meets a first condition according to each Internet protocol address, wherein the response message is obtained by the user terminal responding to the detection message, and the first condition is that the ratio of the first quantity of the response messages to the second quantity of the detection messages is smaller than a preset threshold;
s13, under the condition that a response message returned by the user terminal corresponding to the Internet protocol address meets the first condition, updating the current identification of the Internet protocol address, wherein the current identification represents the times that the response message returned by the user terminal corresponding to the Internet protocol address continuously meets the first condition;
and S14, determining whether to recycle the corresponding Internet protocol address based on the updated identification.
When the computer program is executed by the processor to acquire the recycling instruction, the processor specifically executes the following steps: determining whether a preset period is reached; and generating the recycling instruction under the condition that the preset period is reached.
The computer program, when executed by the processor to obtain the reclamation instruction, further performs the steps of: determining whether an address allocation request is received, wherein the address allocation request is sent by a new user terminal which is not accessed to the current network; and generating the recycling instruction under the condition that the address allocation request is received.
The computer program is executed by the processor to generate the reclamation instruction upon receiving the address allocation request, and further executed by the processor to: under the condition that the address allocation request is received, determining whether unallocated internet protocol addresses in the current network meet a second condition, wherein the second condition is that the proportion of the unallocated internet protocol addresses to all internet protocol addresses is smaller than a preset proportion; and generating the recycling instruction under the condition that the unassigned internet protocol address meets the second condition.
The computer program is executed by the processor with the current identification being a numerical value, and when updating the current identification of the internet protocol address, the processor further executes the following steps: and adding 1 to the current identification to update the current identification of the Internet protocol address.
The computer program, when executed by the processor, determines whether to reclaim its corresponding internet protocol address based on the updated identification, further performs the steps of: and recovering the preset number of internet protocol addresses according to the descending order of the times that the response messages returned by the user terminals corresponding to the internet protocol addresses continuously meet the first condition.
The computer program, when executed by the processor, determines whether to reclaim its corresponding internet protocol address based on the updated identification, further performs the steps of: determining the number of received address allocation requests; and recovering the Internet protocol addresses of the request number according to the descending order of the times that the response messages returned by the user terminals corresponding to the Internet protocol addresses continuously meet the first condition.
The computer program, when executed by the processor, further performs the steps of: determining whether the current identifier of the internet protocol address is a preset identifier or not under the condition that a response message returned by the user terminal corresponding to the internet protocol address does not meet the first condition; if not, changing the current identification of the Internet protocol address into the preset identification, wherein the preset identification represents that the Internet protocol address is allocated.
The computer program, when executed by the processor, further performs the steps of: and responding to the address allocation request, and reallocating the recovered Internet protocol address.
After acquiring the recycling instruction, the embodiment of the disclosure transmits a plurality of detection messages to each internet protocol address according to a time interval in response to the recycling instruction so as to finish one-time detection of each internet protocol address, further determines whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition, and if so, updates a current identifier of the internet protocol address to obtain an updated identifier, so as to determine whether to recycle the corresponding internet protocol address based on the updated identifier, thereby avoiding the problem of incorrect recycling of the internet protocol address caused by temporary network disconnection or un-started and un-connected network of the user terminal, and improving the accuracy of detection results, namely recycling; and the original user terminal corresponding to the Internet protocol address can be ensured to normally use the network, and the resource waste is avoided.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes. Optionally, in this embodiment, the processor performs the method steps described in the above embodiment according to the program code stored in the storage medium. Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein. It will be appreciated by those skilled in the art that the modules or steps of the disclosure described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by computing devices, such that they may be stored in a memory device for execution by the computing devices and, in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be implemented as individual integrated circuit modules, or as individual integrated circuit modules. As such, the present disclosure is not limited to any specific combination of hardware and software.
The embodiment of the present disclosure further provides an electronic device, where a schematic structural diagram of the electronic device may be shown in fig. 3, and the electronic device at least includes a memory 301 and a processor 302, where the memory 301 stores a computer program, and the processor 302 implements a method provided by any embodiment of the present disclosure when executing the computer program on the memory 301. Exemplary, the electronic device computer program steps are as follows S21 to S24:
s21, acquiring and responding to the recovery instruction, and sending a plurality of detection messages to each Internet protocol address according to the time interval;
s22, determining whether a response message returned by a user terminal corresponding to each Internet protocol address meets a first condition according to each Internet protocol address, wherein the response message is obtained by the user terminal responding to the detection message, and the first condition is that the ratio of the first quantity of the response messages to the second quantity of the detection messages is smaller than a preset threshold;
s23, under the condition that the response message returned by the user terminal corresponding to the Internet protocol address meets the first condition, updating the current identification of the Internet protocol address, wherein the current identification represents the times that the response message returned by the user terminal corresponding to the Internet protocol address continuously meets the first condition;
And S24, determining whether to recycle the corresponding Internet protocol address based on the updated identification.
The processor, when executing the fetch reclamation instructions stored on the memory, also executes the computer program as follows: determining whether a preset period is reached; and generating the recycling instruction under the condition that the preset period is reached.
The processor, when executing the fetch reclamation instructions stored on the memory, also executes the computer program as follows: determining whether an address allocation request is received, wherein the address allocation request is sent by a new user terminal which is not accessed to the current network; and generating the recycling instruction under the condition that the address allocation request is received.
The processor, upon executing the fetch instruction, upon receiving the address allocation request stored on the memory, further executes a computer program to: under the condition that the address allocation request is received, determining whether unallocated internet protocol addresses in the current network meet a second condition, wherein the second condition is that the proportion of the unallocated internet protocol addresses to all internet protocol addresses is smaller than a preset proportion; and generating the recycling instruction under the condition that the unassigned internet protocol address meets the second condition.
The processor, when executing the current identification stored on the memory as a numerical value, further executes the following computer program when updating the current identification of the internet protocol address: and adding 1 to the current identification to update the current identification of the Internet protocol address.
The processor, when executing the stored computer program stored on the memory, to determine whether to reclaim its corresponding internet protocol address based on the updated identification, further executes the computer program as follows: and recovering the preset number of internet protocol addresses according to the descending order of the times that the response messages returned by the user terminals corresponding to the internet protocol addresses continuously meet the first condition.
The processor, when executing the stored computer program stored on the memory, to determine whether to reclaim its corresponding internet protocol address based on the updated identification, further executes the computer program as follows: determining the number of received address allocation requests; and recovering the Internet protocol addresses of the request number according to the descending order of the times that the response messages returned by the user terminals corresponding to the Internet protocol addresses continuously meet the first condition.
The processor, when executing the reclamation method stored on the memory, also executes the following computer program: determining whether the current identifier of the internet protocol address is a preset identifier or not under the condition that a response message returned by the user terminal corresponding to the internet protocol address does not meet the first condition; if not, changing the current identification of the Internet protocol address into the preset identification, wherein the preset identification represents that the Internet protocol address is allocated.
The processor, when executing the reclamation method stored on the memory, also executes the following computer program: and responding to the address allocation request, and reallocating the recovered Internet protocol address.
After acquiring the recycling instruction, the embodiment of the disclosure transmits a plurality of detection messages to each internet protocol address according to a time interval in response to the recycling instruction so as to finish one-time detection of each internet protocol address, further determines whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition, and if so, updates a current identifier of the internet protocol address to obtain an updated identifier, so as to determine whether to recycle the corresponding internet protocol address based on the updated identifier, thereby avoiding the problem of incorrect recycling of the internet protocol address caused by temporary network disconnection or un-started and un-connected network of the user terminal, and improving the accuracy of detection results, namely recycling; and the original user terminal corresponding to the Internet protocol address can be ensured to normally use the network, and the resource waste is avoided.
Furthermore, although exemplary embodiments have been described herein, the scope thereof includes any and all embodiments having equivalent elements, modifications, omissions, combinations (e.g., of the various embodiments across schemes), adaptations or alterations based on the present disclosure. Elements in the claims are to be construed broadly based on language employed in the claims and not limited to examples described in the present specification or during the practice of the present disclosure, which examples are to be construed as non-exclusive. It is intended, therefore, that the specification and examples be considered as exemplary only, with a true scope and spirit being indicated by the following claims and their full scope of equivalents.
The above description is intended to be illustrative and not restrictive. For example, the above-described examples (or one or more aspects thereof) may be used in combination with each other. For example, other embodiments may be used by those of ordinary skill in the art upon reading the above description. In addition, in the above detailed description, various features may be grouped together to streamline the disclosure. This is not to be interpreted as an intention that the disclosed features not being claimed are essential to any claim. Rather, the disclosed subject matter may include less than all of the features of a particular disclosed embodiment. Thus, the following claims are hereby incorporated into the detailed description as examples or embodiments, with each claim standing on its own as a separate embodiment, and it is contemplated that these embodiments may be combined with one another in various combinations or permutations. The scope of the disclosure should be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled.
While various embodiments of the present disclosure have been described in detail, the present disclosure is not limited to these specific embodiments, and various modifications and embodiments can be made by those skilled in the art on the basis of the concepts of the present disclosure, and these modifications and modifications should be within the scope of the present disclosure as claimed.

Claims (10)

1. A method for recovering an internet protocol address, comprising:
acquiring and responding to the recovery instruction, and sending a plurality of detection messages to each Internet protocol address according to the time interval;
determining whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition according to each internet protocol address, wherein the response message is obtained by the user terminal responding to the detection message, and the first condition is that the ratio of the first number of the response messages to the second number of the detection messages is smaller than a preset threshold;
updating a current identifier of the internet protocol address under the condition that a response message returned by the user terminal corresponding to the internet protocol address meets the first condition, wherein the current identifier represents the times that the response message returned by the user terminal corresponding to the internet protocol address continuously meets the first condition;
determining whether to reclaim the corresponding internet protocol address based on the updated identification;
the current identifier is a numerical value, and the updating the current identifier of the internet protocol address includes:
and adding 1 to the current identification to update the current identification of the Internet protocol address.
2. The reclamation method as recited in claim 1, wherein obtaining the reclamation instruction comprises:
determining whether a preset period is reached;
and generating the recycling instruction under the condition that the preset period is reached.
3. The reclamation method as recited in claim 1, wherein acquiring the reclamation instruction further comprises:
determining whether an address allocation request is received, wherein the address allocation request is sent by a new user terminal which is not accessed to the current network;
and generating the recycling instruction under the condition that the address allocation request is received.
4. A reclamation method as recited in claim 3, wherein generating the reclamation instruction if the address allocation request is received comprises:
under the condition that the address allocation request is received, determining whether unallocated internet protocol addresses in the current network meet a second condition, wherein the second condition is that the proportion of the unallocated internet protocol addresses to all internet protocol addresses is smaller than a preset proportion;
and generating the recycling instruction under the condition that the unassigned internet protocol address meets the second condition.
5. The reclamation method as recited in claim 1, wherein the determining whether to reclaim its corresponding internet protocol address based on the updated identification comprises:
and recovering the preset number of internet protocol addresses according to the descending order of the times that the response messages returned by the user terminals corresponding to the internet protocol addresses continuously meet the first condition.
6. The reclamation method as recited in claim 1, wherein the determining whether to reclaim its corresponding internet protocol address based on the updated identification further comprises:
determining the number of received address allocation requests;
and recovering the Internet protocol addresses of the request number according to the descending order of the times that the response messages returned by the user terminals corresponding to the Internet protocol addresses continuously meet the first condition.
7. The recycling method according to claim 1, further comprising:
determining whether the current identifier of the internet protocol address is a preset identifier or not under the condition that a response message returned by the user terminal corresponding to the internet protocol address does not meet the first condition;
if not, changing the current identification of the Internet protocol address into the preset identification, wherein the preset identification represents that the Internet protocol address is allocated.
8. The recycling method according to claim 1, further comprising:
and responding to the address allocation request, and reallocating the recovered Internet protocol address.
9. An electronic device, comprising:
a transmitting module configured to acquire and respond to the reclamation instruction, and transmit a plurality of detection messages to each internet protocol address according to a time interval;
a first determining module, configured to determine, for each internet protocol address, whether a response message returned by a user terminal corresponding to the internet protocol address meets a first condition, where the response message is obtained by the user terminal responding to the probe message, and the first condition is that a ratio of a first number of the response messages to a second number of the probe messages is smaller than a preset threshold;
the updating module is configured to update a current identifier of the internet protocol address under the condition that a response message returned by the user terminal corresponding to the internet protocol address meets the first condition, wherein the current identifier represents the number of times that the response message returned by the user terminal corresponding to the internet protocol address continuously meets the first condition;
A reclamation module configured to determine whether to reclaim its corresponding internet protocol address based on the updated identification;
the current identifier is a numerical value, and the updating module is specifically configured to:
and adding 1 to the current identification to update the current identification of the Internet protocol address.
10. A storage medium having a computer program stored thereon, which when executed by a processor performs the steps of:
acquiring and responding to the recovery instruction, and sending a plurality of detection messages to each Internet protocol address according to the time interval;
determining whether a response message returned by a user terminal corresponding to each internet protocol address meets a first condition according to each internet protocol address, wherein the response message is obtained by the user terminal responding to the detection message, and the first condition is that the ratio of the first number of the response messages to the second number of the detection messages is smaller than a preset threshold;
updating a current identifier of the internet protocol address under the condition that a response message returned by the user terminal corresponding to the internet protocol address meets the first condition, wherein the current identifier represents the times that the response message returned by the user terminal corresponding to the internet protocol address continuously meets the first condition;
Determining whether to reclaim the corresponding internet protocol address based on the updated identification;
the current identifier is a numerical value, and the updating the current identifier of the internet protocol address includes:
and adding 1 to the current identification to update the current identification of the Internet protocol address.
CN202210691448.7A 2022-06-17 2022-06-17 Internet protocol address recycling method, electronic equipment and storage medium Active CN115065664B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210691448.7A CN115065664B (en) 2022-06-17 2022-06-17 Internet protocol address recycling method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210691448.7A CN115065664B (en) 2022-06-17 2022-06-17 Internet protocol address recycling method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115065664A CN115065664A (en) 2022-09-16
CN115065664B true CN115065664B (en) 2024-01-26

Family

ID=83202518

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210691448.7A Active CN115065664B (en) 2022-06-17 2022-06-17 Internet protocol address recycling method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115065664B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101146029A (en) * 2006-09-13 2008-03-19 华为技术有限公司 A packet resorting method and system
CN104486452A (en) * 2014-09-23 2015-04-01 华为技术有限公司 Address processing method and related equipment and system
CN106331190A (en) * 2015-06-19 2017-01-11 中兴通讯股份有限公司 IP address withdrawing method and device, and dynamic host configuration protocol server
CN106470253A (en) * 2016-11-21 2017-03-01 杭州迪普科技股份有限公司 IP address recovery method and device
WO2017054526A1 (en) * 2015-09-28 2017-04-06 中兴通讯股份有限公司 Arp entry generation method and device
CN109086219A (en) * 2017-06-14 2018-12-25 北京忆恒创源科技有限公司 It removes distribution command handling method and its stores equipment
CN109284234A (en) * 2018-09-05 2019-01-29 珠海昇生微电子有限责任公司 A kind of memory address allocation method and system
CN110502451A (en) * 2019-07-10 2019-11-26 深圳市金泰克半导体有限公司 Solid state hard disk rubbish recovering method, device, solid state hard disk and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10681003B2 (en) * 2018-11-02 2020-06-09 EMC IP Holding Company LLC Rebalancing internet protocol (IP) addresses using distributed IP management

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101146029A (en) * 2006-09-13 2008-03-19 华为技术有限公司 A packet resorting method and system
CN104486452A (en) * 2014-09-23 2015-04-01 华为技术有限公司 Address processing method and related equipment and system
CN106331190A (en) * 2015-06-19 2017-01-11 中兴通讯股份有限公司 IP address withdrawing method and device, and dynamic host configuration protocol server
WO2017054526A1 (en) * 2015-09-28 2017-04-06 中兴通讯股份有限公司 Arp entry generation method and device
CN106470253A (en) * 2016-11-21 2017-03-01 杭州迪普科技股份有限公司 IP address recovery method and device
CN109086219A (en) * 2017-06-14 2018-12-25 北京忆恒创源科技有限公司 It removes distribution command handling method and its stores equipment
CN109284234A (en) * 2018-09-05 2019-01-29 珠海昇生微电子有限责任公司 A kind of memory address allocation method and system
CN110502451A (en) * 2019-07-10 2019-11-26 深圳市金泰克半导体有限公司 Solid state hard disk rubbish recovering method, device, solid state hard disk and storage medium

Also Published As

Publication number Publication date
CN115065664A (en) 2022-09-16

Similar Documents

Publication Publication Date Title
US11586673B2 (en) Data writing and reading method and apparatus, and cloud storage system
CN109361526B (en) Policy-controlled routing method, PCRF/PCF and DRA
CN110677492B (en) Access request processing method and device, electronic equipment and storage medium
CN107547565B (en) Network access authentication method and device
CN106790746B (en) Distributed domain name storage and analysis method and system
CN111431912B (en) Method and device for detecting DHCP hijacking
CN112380072A (en) Multi-data center access method and system
CN114745356B (en) Domain name resolution method, device, equipment and readable storage medium
CN109446791A (en) New equipment recognition methods, device, server and computer readable storage medium
CN115065664B (en) Internet protocol address recycling method, electronic equipment and storage medium
CN110830492B (en) Method and system for mutually scheduling edge applications based on CoreDNS registration service
CN111930482A (en) Task processing method, device and equipment based on node cluster and storage medium
CN114338630B (en) Domain name access method, device, electronic equipment, storage medium and program product
CN114356925A (en) Identification generation method and device, electronic equipment and storage medium
CN110489568B (en) Method and device for generating event graph, storage medium and electronic equipment
US11604877B1 (en) Nested courses of action to support incident response in an information technology environment
CN111092966A (en) Domain name system, domain name access method and device
CN110191205A (en) IPV6 network address controller method and system
CN105978865B (en) application package name verification method and device
CN113891385B (en) Method, device and equipment for detecting link state of network equipment
CN112804161B (en) Domain name processing method
CN111147618B (en) Communication method, communication device, electronic equipment and storage medium
CN109981660B (en) Information processing method and electronic equipment
CN110365723B (en) Asymmetric service discovery method and device
CN111371602B (en) Alarm information processing method and equipment

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