CN108337333B - IP address management method, management device, network video recorder and storage medium - Google Patents

IP address management method, management device, network video recorder and storage medium Download PDF

Info

Publication number
CN108337333B
CN108337333B CN201810247858.6A CN201810247858A CN108337333B CN 108337333 B CN108337333 B CN 108337333B CN 201810247858 A CN201810247858 A CN 201810247858A CN 108337333 B CN108337333 B CN 108337333B
Authority
CN
China
Prior art keywords
address
video recorder
network video
dhcp server
network
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
CN201810247858.6A
Other languages
Chinese (zh)
Other versions
CN108337333A (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.)
TP Link Technologies Co Ltd
Original Assignee
TP Link Technologies 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 TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN201810247858.6A priority Critical patent/CN108337333B/en
Publication of CN108337333A publication Critical patent/CN108337333A/en
Application granted granted Critical
Publication of CN108337333B publication Critical patent/CN108337333B/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/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5076Update or notification mechanisms, e.g. DynDNS

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention discloses an IP address management method, which comprises the following steps: acquiring a first IP address distributed by a DHCP server; detecting the use duration of the first IP address; when the use duration reaches the preset use duration, sending a continuous lease request for continuously using the first IP address to the DHCP server; when a lease renewing response returned by the DHCP server is not received and the using time length reaches a preset using period, a first lease request for leasing a new IP address is sent to the DHCP server; when a second IP address allocated by the DHCP server based on the first renting request is received, modifying the IP address of the network video recorder according to the second IP address; when the second IP address allocated by the DHCP server is not received, the network video recorder continues to use the first IP address. The invention can prevent the interruption of network communication of the network video recorder and can quickly recover the network communication of the network video recorder so as to ensure the normal use of the security monitoring system. The invention also provides a network video recorder, an IP address management device and a storage medium.

Description

IP address management method, management device, network video recorder and storage medium
Technical Field
The invention relates to the technical field of security protection, in particular to an IP address management method of a network video recorder, the network video recorder, IP address management equipment and a computer readable storage medium.
Background
With the rapid development of internet technology, security technology also enters the networked and intelligent era. In a networked and intelligent security system, a network camera is accessed to a network video recorder through a network, and converts a collected video image into a compressed video code stream and sends the compressed video code stream to the network video recorder, and the network video recorder receives the video code stream transmitted by the network camera and stores, previews, plays back and forwards the video code stream, so that the distributed architecture advantage brought by networking is realized.
The network video recorder is adopted to construct the security monitoring system, and the method has the advantages of wider selection range of front-end equipment, more network adaptability, stronger application capability and the like. In a security monitoring system which is constructed by taking a network video recorder as a main body, the network video recorder often needs to acquire an IP address from a DHCP server and renewedly rent the IP address before the IP address expires, and when the IP address is acquired or the renewal fails, the network video recorder can release the IP address, so that the communication of the network video recorder is abnormal, the security monitoring is interrupted, and the monitoring effect is influenced.
When the network segment of the address pool in the DHCP server is changed, the network video recorder acquires the IP address of a new network segment in the subsequent process, so that the IP address of the network video recorder and the IP address of the network camera are in different network segments, communication between the network video recorder and the network camera is abnormal, security monitoring is interrupted, monitoring effect is influenced, and user experience is influenced.
In conclusion, how to prevent the network abnormality of the network video recorder in the security process and ensure the normal use or the rapid recovery of the security monitoring system becomes a problem to be solved urgently by technical personnel in the field.
Disclosure of Invention
The embodiment of the invention provides an IP address management method, management equipment, a network video recorder and a storage medium of the network video recorder, which can prevent the network communication of the network video recorder from being interrupted and can quickly recover the network communication of the network video recorder so as to ensure the normal use of a security monitoring system, ensure the security monitoring effect and improve the use experience of a user.
In a first aspect of the embodiments of the present invention, a method for managing an IP address of a network video recorder is provided, including:
acquiring a first IP address distributed by a DHCP server;
detecting the use duration of the first IP address;
when the use duration reaches a preset use duration, sending a lease renewal request for continuously using the first IP address to the DHCP server;
when a lease renewing response returned by the DHCP server is not received and the use duration reaches a preset use period, sending a first lease request for leasing a new IP address to the DHCP server;
when a second IP address allocated by the DHCP server based on the first lease request is received, modifying the IP address of the network video recorder according to the second IP address;
and when the second IP address allocated by the DHCP server is not received, the network video recorder continues to use the first IP address.
Further, when receiving a second IP address allocated by the DHCP server based on the first lease request, modifying an IP address of the network video recorder according to the second IP address, including:
when a second IP address allocated by the DHCP server based on the first lease request is received, judging whether the second IP address and the first IP address are in the same network segment;
if the second IP address and the first IP address are in the same network segment, modifying the IP address of the network video recorder into the second IP address;
if the second IP address is not in the same network segment with the first IP address, sending an inquiry message for judging whether to use the second IP address;
when receiving a confirmation message using the second IP address, modifying the IP address of the network video recorder into the second IP address;
when the confirmation message is not received, the network video recorder continues to use the first IP address.
Optionally, after modifying the IP address of the network video recorder to the second IP address when receiving the confirmation message using the second IP address, the method includes:
and modifying the IP address of the network camera in communication connection with the network video recorder according to the second IP address.
Preferably, the modifying the IP address of the network camera communicatively connected to the network video recorder according to the second IP address includes:
creating an address pool in the same network segment with the second IP address;
sending an ARP request message to detect whether each IP address in the address pool is occupied or not;
when the IP address in the address pool is occupied, deleting the occupied IP address from the address pool to obtain an available IP address segment;
and modifying the IP address of the network camera which is in communication connection with the network video recorder according to the available IP address field.
Further, before acquiring the first IP address assigned by the DHCP server, the method includes:
sending a DHCP broadcast message;
and when receiving a reply message returned by the DHCP server, sending a second lease request for leasing the first IP address to the DHCP server.
A second aspect of an embodiment of the present invention provides a network video recorder, including:
the IP address acquisition module is used for acquiring a first IP address distributed by the DHCP server;
the service time detection module is used for detecting the service time of the first IP address;
a lease renewal request sending module, configured to send a lease renewal request for continuing to use the first IP address to the DHCP server when the usage duration reaches a preset usage duration;
the lease request sending module is used for sending a first lease request for leasing a new IP address to the DHCP server when a lease renewal response returned by the DHCP server is not received and the use duration reaches a preset use period;
the IP address modification module is used for modifying the IP address of the network video recorder according to a second IP address allocated by the DHCP server based on the first lease request when the second IP address is received;
and the IP address using module is used for continuously using the first IP address when the second IP address allocated by the DHCP server is not received.
In a third aspect of the embodiments of the present invention, there is provided an IP address management apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the IP address management method of the network video recorder according to the first aspect when executing the computer program.
In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the IP address management method for a network video recorder according to the first aspect.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the embodiment of the invention, after acquiring a first IP address distributed by a DHCP server, a network video recorder monitors the use duration of the first IP address in real time, when the use duration reaches the preset use duration, the first IP address is continuously leased to the DHCP service, and if the lease continuation is successful, the first IP address is continuously used; if the lease renewal fails, a new second IP address is leased from the DHCP server upon expiration of the usage. If the second IP address is leased successfully, the network video recorder modifies the own IP address based on the second IP address so as to quickly recover the network communication of the network video recorder, thereby ensuring the normal use of the security monitoring system; if the second IP address fails to be rented, the network video recorder continues to use the first IP address so as to prevent the interruption of network communication of the network video recorder, ensure the normal use of the security monitoring system, ensure the security monitoring effect and improve the use experience of users.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of a method for managing an IP address of a network video recorder according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an IP address management method in an application scenario according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a process of modifying an IP address of a network camera in an application scenario by using an IP address management method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a network video recorder according to a second embodiment of the present invention;
fig. 5 is a schematic diagram of an IP address management device according to a third embodiment of the present invention.
Detailed Description
The embodiment of the invention provides an IP address management method, management equipment, a network video recorder and a storage medium of the network video recorder, which are used for preventing the network communication of the network video recorder from being interrupted and quickly recovering the network communication of the network video recorder so as to ensure the normal use of a security monitoring system, ensure the security monitoring effect and improve the use experience of a user.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention provides an IP address management method for a network video recorder, where the IP address management method includes:
and step S101, acquiring a first IP address allocated by the DHCP server.
Here, the IP address management method provided in this embodiment, before acquiring the first IP address allocated by the DHCP server, further includes: step a, sending a DHCP broadcast message; and step b, when receiving a reply message returned by the DHCP server, sending a second lease request for leasing the first IP address to the DHCP server.
In other words, in this embodiment, after the network video recorder is started, the network video recorder first records and stores its own initial default IP address; and then, sending a DHCP broadcast message to detect whether a front end has a DHCP server, and when detecting that the front end has the DHCP server, establishing communication connection with the DHCP server and switching the front end into a DHCP mode to acquire the first IP address allocated by the DHCP server.
Specifically, when the network video recorder receives a reply message returned by a DHCP server at the front end, it indicates that the DHCP server exists at the front end, and the network video recorder immediately establishes a communication connection with the DHCP server and sends a second lease request for requesting to lease the first IP address to the DHCP server after the connection is established. And after responding to the second lease request, the DHCP server automatically allocates a first IP address to the network video recorder, and the network video recorder receives the first IP address and modifies the IP address of the network video recorder from an initial default IP address to the first IP address so as to communicate with the corresponding network video recorder through the first IP address.
It will be appreciated that the initial default IP address is maintained when the network video recorder does not detect a DHCP server. Similarly, when the DHCP server does not respond to the second lease request, that is, does not assign the first IP address to the network video recorder, the network video recorder also keeps using the initial default IP address, and at this time, the network video recorder communicates with the corresponding network video recorder through the initial default IP address.
And step S102, detecting the service time of the first IP address.
It can be understood that the IP address allocated by the DHCP server often has a certain preset lifetime, and if the IP address is still to be used after the preset lifetime expires, a lease renewal request for renewing the IP address needs to be sent to the DHCP server before the preset lifetime expires. Therefore, in this embodiment, after acquiring and using the first IP address, the network video recorder detects, in real time, a usage duration of the first IP address, so as to determine whether to send a lease renewal request for renewing the lease of the first IP address to the DHCP server according to the usage duration.
Step S103, when the use duration reaches a preset use duration, sending a lease renewal request for continuing to use the first IP address to the DHCP server.
In this embodiment, the preset duration may be determined according to a preset lifetime of the first IP address, that is, when a lease renewal request for continuing to use the first IP address is sent to the DHCP server according to the preset lifetime of the first IP address. Specifically, when the usage duration of the first IP address reaches the preset usage duration, the network video recorder sends a lease renewal request for continuing to use the first IP address to the DHCP server.
For example, in this embodiment, the preset lifetime of the first IP address is 8 hours, and thus it can be determined that the preset lifetime is 4 hours and 6 hours, when the lifetime of the first IP address reaches 4 hours, the network video recorder first sends a lease renewal request for renewing lease of the first IP address to the DHCP server, and when the lease renewal request does not obtain a lease renewal response of the DHCP server and the lifetime of the first IP address reaches 6 hours, the network video recorder sends a lease renewal request for renewing lease of the first IP address to the DHCP server for the second time.
And step S104, when a lease renewal response returned by the DHCP server is not received and the use duration reaches a preset use period, sending a first lease request for leasing a new IP address to the DHCP server.
After receiving the lease renewing request of the network video recorder, the DHCP server judges whether the lease renewing request of the network video recorder can be met according to the address condition of the DHCP server, if the lease renewing request can be met, a successful lease renewing response is returned to the network video recorder, the service life of the first IP address is updated, and the network video recorder continues to use the first IP address; if the DHCP server cannot meet the lease renewing request of the network video recorder or does not receive the lease renewing request, no lease renewing response is returned to the network video recorder, so that the network video recorder can send a first lease request for leasing a new IP address to the DHCP server to request the DHCP server to reallocate a new second IP address when the lease renewing response returned by the DHCP server is not received and the use of the first IP address reaches the preset use period determined by the DHCP server.
It can be understood that, after receiving the first lease request sent by the network video recorder, the DHCP server determines whether a new second IP address can be allocated to the network video recorder according to the IP address condition in its own address pool, and if the new second IP address can be allocated to the network video recorder, the network video recorder receives the second IP address allocated by the DHCP server; and if the new second IP address cannot be allocated to the network video recorder, the network video recorder cannot receive the second IP address allocated by the DHCP server. Therefore, in this embodiment, in step S104, when a lease renewal response returned by the DHCP server is not received and the usage duration reaches the preset usage period, after sending the first lease request for leasing the new IP address to the DHCP server, step S105 is further included to determine whether the second IP address allocated by the DHCP server is received.
And S106, when receiving a second IP address distributed by the DHCP server based on the first lease request, modifying the IP address of the network video recorder according to the second IP address.
It can be understood that, after the DHCP server reassigns the second IP address to the network video recorder based on the first lease request, the network video recorder may modify the original IP address according to the second IP address, and if the original IP address is changed from the original first IP address to the second IP address, the network video recorder uses the second IP address to implement network communication in the subsequent process, and recovers the network communication of the network video recorder quickly, so as to ensure normal use of the security monitoring system and improve the user experience.
And step S107, when the second IP address distributed by the DHCP server is not received, the network video recorder continues to use the first IP address.
In this embodiment, when the network video recorder fails to renew the lease of the first IP address and does not lease a new IP address from the DHCP server, that is, does not receive the second IP address allocated by the DHCP server, the network video recorder does not release the first IP address and continues to use the first IP address for network communication, so as to prevent interruption of network communication of the network video recorder, thereby ensuring normal use of the security monitoring system and ensuring security monitoring effect.
For convenience of understanding, according to the embodiment described in fig. 1, an IP address management method in the embodiment of the present invention is described in the following practical application scenario:
fig. 2 is a schematic flowchart illustrating an IP address management method in an application scenario according to an embodiment of the present invention. As shown in fig. 2, in this scenario, the IP address management method includes step S201, step S202, step S203, step S204, step S205, step S206, step S207, step S208, step S209, and step S210.
Step S201, obtaining a first IP address allocated by the DHCP server is similar to step S101; step S202, detecting that the service life of the first IP address is similar to that of the step S102; step S203, when the usage duration reaches a preset usage duration, sending a lease renewal request for continuing to use the first IP address to the DHCP server, similar to step S103; step S204, when a lease renewal response returned by the DHCP server is not received and the use duration reaches a preset use period, sending a first lease request for leasing a new IP address to the DHCP server, similar to the step S104; step S205, determining whether the second IP address allocated by the DHCP server is received is similar to step S105. Accordingly, for the sake of brevity, further description is omitted herein.
Step S06, when receiving a second IP address allocated by the DHCP server based on the first lease request, judging whether the second IP address and the first IP address are in the same network segment;
step S207, if the second IP address and the first IP address are in the same network segment, modifying the IP address of the network video recorder into the second IP address;
step S208, if the second IP address is not in the same network segment as the first IP address, sending an inquiry message for judging whether to use the second IP address;
step S209, when receiving the confirmation message using the second IP address, modifying the IP address of the network video recorder to the second IP address;
step S210, when the confirmation message is not received, the network video recorder continues to use the first IP address.
In this scenario, after receiving a second IP address allocated by the DHCP server, the network video recorder first determines whether the second IP address and the first IP address are in the same network segment, and when the second IP address and the first IP address are in the same network segment, the network video recorder directly uses the second IP address, that is, the original IP address of the network video recorder is changed from the first IP address to the second IP address; and when the second IP address and the first IP address are not in the same network segment, indicating that the network segment of the DHCP server is changed, the IP address obtained by the network video recorder is also changed, and at the moment, whether the network video recorder uses the second IP address after the network segment is changed or not needs to be confirmed by a user, namely when the second IP address and the first IP address are not in the same network segment, the network video recorder sends an inquiry message whether the second IP address is used or not, and the user confirms whether the network segment is changed or not. When the user confirms that the network segment is changed, the network video recorder modifies the own IP address based on the confirmation message of the user, namely the original IP address of the network video recorder is changed from the first IP address to the second IP address; and if the user does not want to change the network segment, namely the network video recorder does not receive the confirmation message of using the second IP address, the network video recorder does not release the first IP address and continues to use the first IP address.
It can be understood that, after the network video recorder acquires the first IP address from the DHCP server and is in communication connection with the corresponding network camera, the network camera has an IP address in the same network segment as the first IP address. And after the network video recorder acquires and confirms to use the second IP address of the new network segment, the IP address of the network video recorder is in a different network segment with the IP address of the network camera, so that the communication between the network video recorder and the network camera is interrupted, therefore, the communication between the network video recorder and the network camera is ensured to be normal, the normal use of the security monitoring system is ensured, and the IP address of the network camera needs to be modified at the moment.
Further, in this embodiment, after modifying the IP address of the network video recorder to the second IP address when receiving the confirmation message using the second IP address, the method further includes: and modifying the IP address of the network camera in communication connection with the network video recorder according to the second IP address.
As shown in fig. 3, modifying the IP address of the network camera communicatively connected to the network video recorder according to the second IP address specifically includes:
step S301, creating an address pool in the same network segment with the second IP address;
step S302, an ARP request message is sent to detect whether each IP address in the address pool is occupied or not;
step S303, when the IP address in the address pool is occupied, deleting the occupied IP address from the address pool to obtain an available IP address segment;
and S304, modifying the IP address of the network camera which is in communication connection with the network video recorder according to the available IP address field.
Here, when the IP address of the network video recorder is determined to be modified to the second IP address, in order to ensure that the corresponding network video camera can also access the network video recorder at this time to maintain normal communication between the network video recorder and the network video recorder, the network video recorder needs to modify the IP address of the network video camera based on the second IP address of the network video recorder. Specifically, the network video recorder firstly creates an address pool which is in the same network segment with a second IP address of the network video recorder, wherein the address pool does not comprise the second IP address of the network video recorder, a gateway IP address and other special IP addresses; secondly, after the address pool is established, the network video recorder sends ARP request messages in batch to detect whether each IP address in the address pool is occupied by other equipment, when a certain IP address in the address pool is occupied by other equipment, the IP address is deleted from the address pool to obtain an available IP address field in the address pool, and the certain IP address in the available IP address field can be allocated to the network video recorder, the network video recorder can set the IP address of the network video recorder according to the allocated IP address, if the network video recorder uses an SLP platform equipment management protocol to set the IP address of the network video recorder, the normal communication between the network video recorder and the network video recorder is quickly recovered, thereby ensuring the normal use of a security monitoring system and ensuring the security monitoring effect, the use experience of the user is improved.
For example, in a practical scenario, assume that the second IP address is 192.168.1.200, and the gateway IP address is: 192.168.1.1, an address pool 192.168.1.2-192.168.1.240 for the same network segment as the second IP address is created, wherein the address pool does not include the second IP address: 192.168.1.200, in addition, the network video recorder sends an ARP request message to detect that the IP addresses 192.168.1.100 to 192.168.1.240 are occupied by other devices, so in this scenario, an available IP address field of the address pool is 192.168.1.2 to 192.168.1.99, the network video recorder can select any one IP address from the available IP address field, for example, 192.168.1.70 is selected and allocated to the network video camera, and the IP address of the network video camera is set to 192.168.1.70 through an SLP platform device management protocol, thereby ensuring that the network video camera and the network video recorder are in the same network segment to ensure normal use of the security monitoring system.
In the embodiment of the invention, after acquiring a first IP address distributed by a DHCP server, a network video recorder monitors the use duration of the first IP address in real time, when the use duration reaches the preset use duration, the first IP address is continuously leased to the DHCP service, and if the lease continuation is successful, the first IP address is continuously used; if the lease renewal fails, a new second IP address is leased from the DHCP server upon expiration of the usage. If the second IP address is leased successfully, the network video recorder modifies the own IP address based on the second IP address so as to quickly recover the network communication of the network video recorder, thereby ensuring the normal use of the security monitoring system; if the second IP address is failed to rent, the network video recorder continues to use the first IP address so as to prevent the interruption of network communication of the network video recorder, ensure the normal use of the security monitoring system, ensure the security monitoring effect and improve the use experience of users.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
The above mainly describes a method for managing an IP address of a network video recorder, and a network video recorder will be described in detail below.
Fig. 4 is a block diagram showing an embodiment of a network video recorder according to the second embodiment of the present invention. As shown in fig. 4, the network camera includes:
an IP address obtaining module 401, configured to obtain a first IP address allocated by a DHCP server;
a use duration detection module 402, configured to detect a use duration of the first IP address;
a lease renewal request sending module 403, configured to send a lease renewal request for continuing to use the first IP address to the DHCP server when the usage duration reaches a preset usage duration;
a lease request sending module 404, configured to send a first lease request for leasing a new IP address to the DHCP server when a lease renewal response returned by the DHCP server is not received and the usage duration reaches a preset usage period;
an IP address modification module 405, configured to, when receiving a second IP address allocated by the DHCP server based on the first lease request, modify an IP address of the network video recorder according to the second IP address;
an IP address using module 406, configured to continue to use the first IP address when the second IP address allocated by the DHCP server is not received.
Further, the IP address modification module 405 includes:
a network segment judging unit, configured to, when a second IP address allocated by the DHCP server based on the first lease request is received, judge whether the second IP address and the first IP address are in the same network segment;
the first IP address modifying unit is used for modifying the IP address of the network video recorder into the second IP address if the second IP address and the first IP address are in the same network segment;
an inquiry message sending unit, configured to send an inquiry message indicating whether the second IP address is used if the second IP address is not in the same network segment as the first IP address;
the second modification unit of the IP address is used for modifying the IP address of the network video recorder into the second IP address when receiving the confirmation message using the second IP address;
and the IP address continuous using unit is used for continuously using the first IP address when the confirmation message is not received.
Optionally, the network video recorder further includes:
and the IP address modification module of the network camera is used for modifying the IP address of the network camera which is in communication connection with the network video recorder according to the second IP address.
Preferably, the IP address modification module of the network camera includes:
an address pool creating unit, configured to create an address pool in the same network segment as the second IP address;
an ARP message sending unit, which is used for sending an ARP request message to detect whether each IP address in the address pool is occupied;
the IP address deleting unit is used for deleting the occupied IP address from the address pool to obtain an available IP address section when the IP address in the address pool is occupied;
and the IP address modifying unit of the network camera is used for modifying the IP address of the network camera which is in communication connection with the network video recorder according to the available IP address field.
Still further, the network video recorder further comprises:
a DHCP broadcast message sending unit, configured to send a DHCP broadcast message;
and the second lease request sending unit is used for sending a second lease request for leasing the first IP address to the DHCP server when receiving a reply message returned by the DHCP server.
Fig. 5 is a schematic diagram of an IP address management device according to a third embodiment of the present invention. As shown in fig. 5, the IP address management device 500 of this embodiment includes: a processor 501, a memory 502 and a computer program 503, such as an IP address management program of a network video recorder, stored in said memory 502 and operable on said processor 501. The processor 501 executes the computer program 503 to implement the steps in the above-described embodiments of the IP address management method, such as the steps S101 to S107 shown in fig. 1. Alternatively, the processor 502 may implement the functions of each module/unit in the above device embodiments, for example, the functions of the modules 401 to 406 shown in fig. 4, when executing the computer program 503.
Illustratively, the computer program 503 may be partitioned into one or more modules/units that are stored in the memory 502 and executed by the processor 501 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 503 in the IP address management device 500. For example, the computer program 503 may be divided into an IP address obtaining module, a usage duration detecting module, a lease renewal request sending module, a lease request sending module, an IP address modifying module, and an IP address using module, and the specific functions of each module are as follows:
the IP address acquisition module is used for acquiring a first IP address distributed by the DHCP server;
the service time detection module is used for detecting the service time of the first IP address;
a lease renewal request sending module, configured to send a lease renewal request for continuing to use the first IP address to the DHCP server when the usage duration reaches a preset usage duration;
the lease request sending module is used for sending a first lease request for leasing a new IP address to the DHCP server when a lease renewal response returned by the DHCP server is not received and the use duration reaches a preset use period;
the IP address modification module is used for modifying the IP address of the network video recorder according to a second IP address allocated by the DHCP server based on the first lease request when the second IP address is received;
and the IP address using module is used for continuously using the first IP address when the second IP address allocated by the DHCP server is not received.
The IP address management device 500 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The IP address management device 500 may include, but is not limited to, a processor 501, a memory 502. Those skilled in the art will appreciate that fig. 5 is merely an example of the IP address management device 500 and does not constitute a limitation of the IP address management device 500 and may include more or less components than those shown, or combine some components, or different components, for example, the IP address management device 500 may also include an input-output device, a network access device, a bus, etc.
The Processor 501 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 502 may be an internal storage unit of the IP address management device 500, such as a hard disk or a memory of the IP address management device 500. The memory 502 may also be an external storage device of the IP address management device 500, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the IP address management device 500. Further, the memory 502 may also include both an internal storage unit and an external storage device of the IP address management device 500. The memory 502 is used to store the computer programs and other programs and data required by the IP address management device 500. The memory 502 may also be used to temporarily store data that has been output or is to be output.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the modules, elements, and/or method steps of the various embodiments described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (6)

1. An IP address management method of a network video recorder is characterized by comprising the following steps:
acquiring a first IP address distributed by a DHCP server;
detecting the use duration of the first IP address;
when the use duration reaches a preset use duration, sending a lease renewal request for continuously using the first IP address to the DHCP server;
when a lease renewing response returned by the DHCP server is not received and the use duration reaches a preset use period, sending a first lease request for leasing a new IP address to the DHCP server;
when a second IP address allocated by the DHCP server based on the first lease request is received, modifying the IP address of the network video recorder according to the second IP address;
when the second IP address distributed by the DHCP server is not received, the network video recorder does not release the first IP address and continues to use the first IP address;
when receiving a second IP address allocated by the DHCP server based on the first lease request, modifying the IP address of the network video recorder according to the second IP address, including:
when a second IP address allocated by the DHCP server based on the first lease request is received, judging whether the second IP address and the first IP address are in the same network segment;
if the second IP address and the first IP address are in the same network segment, modifying the IP address of the network video recorder into the second IP address;
if the second IP address is not in the same network segment with the first IP address, sending an inquiry message for judging whether to use the second IP address;
when receiving a confirmation message using the second IP address, modifying the IP address of the network video recorder into the second IP address;
when the confirmation message is not received, the network video recorder continues to use the first IP address;
after modifying the IP address of the network video recorder to the second IP address when receiving the confirmation message using the second IP address, the method includes:
and modifying the IP address of the network camera in communication connection with the network video recorder according to the second IP address.
2. The IP address management method according to claim 1, wherein the modifying the IP address of the network camera communicatively connected to the network video recorder according to the second IP address comprises:
creating an address pool in the same network segment with the second IP address;
sending an ARP request message to detect whether each IP address in the address pool is occupied or not;
when the IP address in the address pool is occupied, deleting the occupied IP address from the address pool to obtain an available IP address segment;
and modifying the IP address of the network camera which is in communication connection with the network video recorder according to the available IP address field.
3. The IP address management method according to claim 1 or 2, wherein before acquiring the first IP address assigned by the DHCP server, the method includes:
sending a DHCP broadcast message;
and when receiving a reply message returned by the DHCP server, sending a second lease request for leasing the first IP address to the DHCP server.
4. A network video recorder, comprising:
the IP address acquisition module is used for acquiring a first IP address distributed by the DHCP server;
the service time detection module is used for detecting the service time of the first IP address;
a lease renewal request sending module, configured to send a lease renewal request for continuing to use the first IP address to the DHCP server when the usage duration reaches a preset usage duration;
the lease request sending module is used for sending a first lease request for leasing a new IP address to the DHCP server when a lease renewal response returned by the DHCP server is not received and the use duration reaches a preset use period;
the IP address modification module is used for modifying the IP address of the network video recorder according to a second IP address allocated by the DHCP server based on the first lease request when the second IP address is received;
the IP address using module is used for not releasing the first IP address and continuously using the first IP address when not receiving the second IP address distributed by the DHCP server;
the IP address modification module includes:
a network segment judging unit, configured to, when a second IP address allocated by the DHCP server based on the first lease request is received, judge whether the second IP address and the first IP address are in the same network segment;
the first IP address modifying unit is used for modifying the IP address of the network video recorder into the second IP address if the second IP address and the first IP address are in the same network segment;
an inquiry message sending unit, configured to send an inquiry message indicating whether the second IP address is used if the second IP address is not in the same network segment as the first IP address;
the second modification unit of the IP address is used for modifying the IP address of the network video recorder into the second IP address when receiving the confirmation message using the second IP address;
an IP address continuous use unit, configured to continue to use the first IP address when the acknowledgment message is not received;
the network video recorder further comprises:
and the IP address modification module of the network camera is used for modifying the IP address of the network camera which is in communication connection with the network video recorder according to the second IP address.
5. An IP address management apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the IP address management method of the network video recorder according to any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the IP address management method of the network video recorder according to any one of claims 1 to 3.
CN201810247858.6A 2018-03-23 2018-03-23 IP address management method, management device, network video recorder and storage medium Active CN108337333B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810247858.6A CN108337333B (en) 2018-03-23 2018-03-23 IP address management method, management device, network video recorder and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810247858.6A CN108337333B (en) 2018-03-23 2018-03-23 IP address management method, management device, network video recorder and storage medium

Publications (2)

Publication Number Publication Date
CN108337333A CN108337333A (en) 2018-07-27
CN108337333B true CN108337333B (en) 2021-10-15

Family

ID=62932173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810247858.6A Active CN108337333B (en) 2018-03-23 2018-03-23 IP address management method, management device, network video recorder and storage medium

Country Status (1)

Country Link
CN (1) CN108337333B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385367B (en) * 2018-12-27 2022-07-19 浙江宇视科技有限公司 Method and device for keeping access equipment on line
CN111294416A (en) * 2020-01-16 2020-06-16 Oppo(重庆)智能科技有限公司 Method for obtaining IP address and related product
WO2021163873A1 (en) * 2020-02-18 2021-08-26 Arris Enterprises Llc Apparatus, system, method, and computer-readable recording media for establishing connections between a network device and remote data servers
CN112333731B (en) * 2020-10-19 2021-07-20 广州爱浦路网络技术有限公司 Network layer address resource allocation method, computer device and storage medium
CN112615942A (en) * 2020-12-09 2021-04-06 广州广哈通信股份有限公司 Remote configuration method and device for E1 looped network address code and storage medium
CN114679483B (en) * 2022-03-01 2023-07-25 南京巨鲨显示科技有限公司 Communication method, system and storage medium for distributed service communication system
CN114726828B (en) * 2022-05-10 2023-08-08 普联技术有限公司 IP address allocation method, device, equipment and storage medium
CN114980273A (en) * 2022-06-06 2022-08-30 普联技术有限公司 Wireless network configuration method and device, readable storage medium and terminal equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202767A (en) * 2006-12-29 2008-06-18 深圳市同洲电子股份有限公司 Method and device for hiring IP address
CN104601959A (en) * 2015-01-29 2015-05-06 浙江宇视科技有限公司 Video monitoring system and method for rapidly accessing web camera
CN105656680A (en) * 2016-01-29 2016-06-08 浙江宇视科技有限公司 Method and device for controlling web camera

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030065064A (en) * 2002-01-29 2003-08-06 삼성전자주식회사 Method for managing domain name

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202767A (en) * 2006-12-29 2008-06-18 深圳市同洲电子股份有限公司 Method and device for hiring IP address
CN104601959A (en) * 2015-01-29 2015-05-06 浙江宇视科技有限公司 Video monitoring system and method for rapidly accessing web camera
CN105656680A (en) * 2016-01-29 2016-06-08 浙江宇视科技有限公司 Method and device for controlling web camera

Also Published As

Publication number Publication date
CN108337333A (en) 2018-07-27

Similar Documents

Publication Publication Date Title
CN108337333B (en) IP address management method, management device, network video recorder and storage medium
CN111132120B (en) Method, system and equipment for identifying camera device in room local area network
CN111552450A (en) Screen projection method and device
CN108737484B (en) Media data storage method and system
CN112188227A (en) Streaming media data distribution method and device
CN111459749A (en) Prometous-based private cloud monitoring method and device, computer equipment and storage medium
CN109348434B (en) Scene information sending method, sending device and terminal equipment
CN110996056B (en) Video storage method and device of cascade monitoring system
CN111263338A (en) Network distribution method of Bluetooth Mesh network and related network distribution equipment and system
CN112954088A (en) Equipment address allocation method and equipment of CAN network and electronic equipment
CN111193900A (en) Monitoring video sharing method and device and storage medium
CN114980273A (en) Wireless network configuration method and device, readable storage medium and terminal equipment
CN103501338A (en) Lock recovery method, equipment and network file system
TWI619031B (en) Metadata server, network device and automatic resource management method
CN115914411A (en) Method and device for converting ONVIF equipment into GB28181 equipment and storage medium
CN112788265B (en) Video data storage method and device, image acquisition equipment and readable storage medium
CN114077409A (en) Screen projection method and device, electronic equipment and computer readable medium
CN110837431A (en) Service control method, service control device, computer equipment and computer-readable storage medium
CN112100017A (en) Memory resource monitoring method and device
CN113709408B (en) Data acquisition method and device and video processing equipment
CN113411367B (en) Method, device, equipment, system and storage medium for establishing connection of monitoring equipment
CN114245052B (en) Video data storage method and device, storage medium and electronic device
JP6216138B2 (en) Image management system and center device
CN113568719B (en) Service fault processing method and device, electronic equipment and storage medium
CN113873485B (en) Communication method and communication system

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