技术领域technical field
本发明涉及视频监控技术领域,尤其涉及一种网络摄像机控制方法及装置。The invention relates to the technical field of video surveillance, in particular to a network camera control method and device.
背景技术Background technique
目前有很多安防组网环境均是存在管理服务器(常用设备如NVR(Network VideoRecorder,网络硬盘录像机)等)和前端设备(即IPC(IP Camera,网络摄像机))组合而成。如何快捷、迅速地将设备之间的管理关系和从属配置好是视频监控技术领域中面临的一个难题。At present, many security networking environments are composed of management servers (commonly used equipment such as NVR (Network Video Recorder, Network Video Recorder), etc.) and front-end equipment (ie IPC (IP Camera, network camera)). How to quickly and quickly configure the management relationship and subordination between devices is a difficult problem in the field of video surveillance technology.
针对上述难题,目前比较常用的解决方案是ONVIF(Open Network VideoInterface Forum,开放型网络视频接口论坛)设备发现协议,在协议中,NVR通过多播UDP(User Datagram Protocol,用户数据协议)发现请求报文,以使接收到该UDP发现请求报文的IPC单播UDP响应报文,从而使得NVR发现组网中的IPC,并对其进行添加和管理操作。Aiming at the above problems, the more commonly used solution at present is the ONVIF (Open Network Video Interface Forum, Open Network Video Interface Forum) device discovery protocol. text, so that the IPC that receives the UDP discovery request message unicasts the UDP response message, so that the NVR can discover the IPCs in the networking, and add and manage them.
然而实践发现,ONVIF设备发现协议需要依赖组网环境支持IP(InternetProtocol,互联网协议)层多播,需要路由器等网关设备实现消息分发,对于只有NVR和IPC组网(即NVR充当路由器的环境)就无法实现。However, it has been found in practice that the ONVIF device discovery protocol needs to rely on the networking environment to support IP (Internet Protocol, Internet Protocol) layer multicast, and requires gateway devices such as routers to implement message distribution. can not achieve.
发明内容Contents of the invention
本发明提供一种网络摄像机控制方法及装置,以实现在管理服务器充当路由器角色的组网中网络摄像机的发现和管理。The invention provides a method and device for controlling a network camera to realize the discovery and management of the network camera in a network in which a management server acts as a router.
根据本发明实施例的第一方面,提供一种网络摄像机控制方法,包括:According to a first aspect of an embodiment of the present invention, a network camera control method is provided, including:
广播反向地址转换协议RARP请求报文;Broadcast reverse address translation protocol RARP request message;
接收RARP响应报文,并根据所述RARP响应报文获取报文发送方设备的互联网协议IP地址;Receive the RARP response message, and obtain the Internet Protocol IP address of the message sender device according to the RARP response message;
对于任一报文发送方设备,根据该报文发送方设备的IP地址向该报文发送方设备发送资源服务地址获取请求报文;For any message sender device, send a resource service address acquisition request message to the message sender device according to the IP address of the message sender device;
当接收到该报文发送方设备发送的资源服务地址获取响应报文时,确定该报文发送方设备为网络摄像机,并将该网络摄像机加入管理服务。When receiving the resource service address acquisition response message sent by the message sender device, it is determined that the message sender device is a network camera, and the network camera is added to the management service.
根据本发明实施例的第二方面,提供一种网络摄像机控制装置,包括:According to a second aspect of an embodiment of the present invention, a network camera control device is provided, including:
发送单元,用于广播反向地址转换协议RARP请求报文;A sending unit, configured to broadcast a reverse address translation protocol RARP request message;
接收单元,用于接收RARP响应报文;a receiving unit, configured to receive an RARP response message;
获取单元,用于根据所述RARP响应报文获取报文发送方设备的互联网协议IP地址;An acquisition unit, configured to acquire the Internet Protocol IP address of the message sender device according to the RARP response message;
所述发送单元,还用于对于任一报文发送方设备,根据该报文发送方设备的IP地址向该报文发送方设备发送资源服务地址获取请求报文;The sending unit is further configured to, for any message sender device, send a resource service address acquisition request message to the message sender device according to the IP address of the message sender device;
控制单元,用于当所述接收单元接收到该报文发送方设备发送的资源服务地址获取响应报文时,确定该报文发送方设备为网络摄像机,并将该网络摄像机加入管理服务。The control unit is configured to, when the receiving unit receives the resource service address acquisition response message sent by the message sender device, determine that the message sender device is a network camera, and add the network camera to the management service.
应用本发明实施例,通过广播RARP请求报文,并根据接收到的RARP响应报文获取报文发送方设备的IP地址,进而,根据获取到的IP地址向相应报文发送方设备发送资源服务地址获取请求报文,并当接收到资源服务地址获取响应报文时,确定该报文发送方设备为网络摄像机,并将该网络摄像机加入管理服务,由于RARP广播报文不需要依赖路由器转发消息,因而,在管理服务器充当路由器角色的组网中,也能够实现网络摄像机的发现和管理。Applying the embodiment of the present invention, by broadcasting the RARP request message, and obtaining the IP address of the message sender device according to the received RARP response message, and then sending the resource service to the corresponding message sender device according to the obtained IP address Address acquisition request message, and when receiving the resource service address acquisition response message, determine that the sender device of the message is a network camera, and add the network camera to the management service, because the RARP broadcast message does not need to rely on the router to forward the message , therefore, in the networking where the management server acts as a router, the discovery and management of network cameras can also be realized.
附图说明Description of drawings
图1是本发明实施例提供的一种网络摄像机控制方法的流程示意图;Fig. 1 is a schematic flow chart of a network camera control method provided by an embodiment of the present invention;
图2是本发明实施例提供的另一种网络摄像机控制方法的流程示意图;FIG. 2 is a schematic flowchart of another network camera control method provided by an embodiment of the present invention;
图3是本发明实施例提供的一种网络摄像机控制装置的结构示意图;3 is a schematic structural diagram of a network camera control device provided by an embodiment of the present invention;
图4是本发明实施例提供的另一种网络摄像机控制装置的结构示意图;4 is a schematic structural diagram of another network camera control device provided by an embodiment of the present invention;
图5是本发明实施例提供的另一种网络摄像机控制装置的结构示意图;5 is a schematic structural diagram of another network camera control device provided by an embodiment of the present invention;
图6是本发明实施例提供的另一种网络摄像机控制装置的结构示意图。Fig. 6 is a schematic structural diagram of another network camera control device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本发明实施例中的技术方案,并使本发明实施例的上述目的、特征和优点能够更加明显易懂,下面结合附图对本发明实施例中技术方案作进一步详细的说明。In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, and to make the above-mentioned purposes, features and advantages of the embodiments of the present invention more obvious and understandable, the following describes the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings For further detailed explanation.
请参见图1,图1为本发明实施例提供的一种网络摄像机控制方法的流程示意图,如图1所示,该网络摄像机控制方法可以包括以下步骤:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a network camera control method provided by an embodiment of the present invention. As shown in FIG. 1, the network camera control method may include the following steps:
步骤101、广播RARP请求报文。Step 101, broadcasting an RARP request message.
本发明实施例中,上述方法的执行主体可以为视频监控系统中的管理服务器,如NVR等。为便于描述,以下以上述方法的执行主体为NVR为例进行描述。In the embodiment of the present invention, the execution subject of the above method may be a management server in the video surveillance system, such as an NVR. For ease of description, the following description will be made by taking the NVR as an example for executing the above method.
本发明实施例中,视频监控系统初始化运行时,即NVR检测到自身管理的设备为空时,NVR可以通过广播RARP请求报文的方式,以发现系统中的前端设备(如IPC)。In the embodiment of the present invention, when the video monitoring system is initially running, that is, when the NVR detects that the equipment it manages is empty, the NVR can broadcast RARP request messages to discover the front-end equipment (such as IPC) in the system.
系统内前端设备接收到NVR发送的RARP请求报文后,可以向NVR返回RARP响应报文,该RARP响应报文中携带有报文发送方设备(即发送RARP响应报文的前端设备)的IP地址。After the front-end device in the system receives the RARP request message sent by the NVR, it can return an RARP response message to the NVR. The RARP response message carries the IP address of the sender device (that is, the front-end device that sent the RARP response message). address.
步骤102、接收RARP响应报文,并根据该RARP响应报文获取报文发送方设备的IP地址。Step 102: Receive the RARP response message, and obtain the IP address of the device sending the message according to the RARP response message.
本发明实施例中,NVR广播RARP请求报文后,可以根据接收到的RARP响应报文,获取报文发送方设备的IP地址。In the embodiment of the present invention, after the NVR broadcasts the RARP request message, it can obtain the IP address of the device sending the message according to the received RARP response message.
步骤103、对于任一报文发送方设备,根据该报文发送方设备的IP地址向该报文发送方设备发送资源服务地址获取请求报文。Step 103, for any message sender device, send a resource service address acquisition request message to the message sender device according to the IP address of the message sender device.
本发明实施例中,NVR根据接收到的RARP响应报文获取到各报文发送方设备的IP地址之后,可以分别根据各报文发送方设备的IP地址向相应的报文发送方设备发送资源服务获取请求报文。In the embodiment of the present invention, after the NVR obtains the IP address of each message sender device according to the received RARP response message, it can send resources to the corresponding message sender device according to the IP address of each message sender device. The service obtains the request message.
各报文发送方设备接收到该资源服务地址获取请求后,若自身可以提供视频资源服务,如IPC,该报文发送方设备可以向NVR发送携带有自身资源服务地址的资源服务地址获取响应报文。After each message sender device receives the resource service address acquisition request, if it can provide video resource services, such as IPC, the message sender device can send a resource service address acquisition response message carrying its own resource service address to the NVR. arts.
本发明实施例中,资源服务地址是指包括实况监控、视频轮切等视频监控服务的地址,例如,该资源服务地址可以为用于获取实况监控视频的URL(Uniform ResourceLocator,统一资源定位符)等。In the embodiment of the present invention, the resource service address refers to an address including video surveillance services such as live monitoring and video round-cutting. For example, the resource service address can be a URL (Uniform ResourceLocator, Uniform Resource Locator) for obtaining live monitoring video Wait.
步骤104、当接收到该报文发送方设备发送的资源服务地址获取响应报文时,确定该报文发送方设备为网络摄像机,并将该网络摄像机加入管理设备。Step 104: When receiving the resource service address acquisition response message sent by the message sender device, determine that the message sender device is a network camera, and add the network camera to the management device.
本发明实施例中,NVR向各报文发送方设备发送资源服务获取请求报文后,当接收到报文发送方设备发送的资源服务地址获取响应报文时,可以认为该报文发送方设备为网络摄像机,从而NVR可以获取该资源服务地址获取响应报文中携带的资源服务地址,并将该网络摄像机加入管理服务。In the embodiment of the present invention, after the NVR sends a resource service acquisition request message to each message sender device, when it receives a resource service address acquisition response message sent by the message sender device, it can be considered that the message sender device It is a network camera, so that the NVR can obtain the resource service address carried in the response message, and add the network camera to the management service.
进一步地,在本发明实施例中,NVR根据接收到的资源服务地址获取响应报文将相应的网络摄像机加入管理服务之后,还可以包括以下步骤:Further, in the embodiment of the present invention, after the NVR adds the corresponding network camera to the management service according to the received resource service address acquisition response message, the following steps may also be included:
展示加入管理服务的设备标识列表;Display a list of device identifiers that have joined the management service;
当接收到针对设备标识列表中目标设备标识的删除指令时,将该目标设备标识对应的设备从管理服务中删除。When a deletion instruction for the target device identifier in the device identifier list is received, the device corresponding to the target device identifier is deleted from the management service.
在本发明实施例中,为了避免将不需要添加视频服务器管理的设备加入到管理系统,NVR将网络摄像机加入管理之后,可以向用户展示加入管理服务的设备标识列表,由用户根据该设备标识列表判断是否存在不需要加入管理系统的设备;若存在,用户可以向NVR发送针对该不需要加入管理系统的设备的设备标识(目标设备标识)的删除指令;NVR接收到该删除指令时,可以将该目标设备标识对应的设备从管理服务中删除。In the embodiment of the present invention, in order to avoid adding devices that do not require video server management to the management system, after the NVR adds the network camera to the management, it can show the user a list of device identifications that have joined the management service. Judging whether there is a device that does not need to join the management system; if it exists, the user can send to the NVR a deletion instruction for the device identification (target device identification) of the equipment that does not need to join the management system; when the NVR receives the deletion instruction, it can be deleted. The device corresponding to the target device identifier is deleted from the management service.
进一步地,在本发明实施例中,NVR将上述网络摄像机加入管理服务之后,可以获取并记录加入管理服务的网络摄像机的MAC(Media Access Control,媒体访问控制)地址等信息。例如,NVR可以通过基于ONVIF标准接口GetDeviceInformation(获取设备信息)接口获取加入管理的设备的相关信息(如MAC地址、设备类型等)并记录维护。Further, in the embodiment of the present invention, after the NVR adds the network camera to the management service, it can obtain and record information such as the MAC (Media Access Control, Media Access Control) address of the network camera that has joined the management service. For example, the NVR can obtain relevant information (such as MAC address, device type, etc.) of the device added to the management through the GetDeviceInformation (obtain device information) interface based on the ONVIF standard interface, and record and maintain it.
可见,在图1所示的方法流程中,通过广播RARP请求报文,并根据接收到的RARP响应报文获取报文发送方设备的IP地址,进而,根据获取到的IP地址向相应报文发送方设备发送资源服务地址获取请求报文,并当接收到资源服务地址获取响应报文时,确定该报文发送方设备为网络摄像机,并将该网络摄像机加入管理服务,由于RARP广播报文不需要依赖路由器转发消息,因而,在管理服务器充当路由器角色的组网中,也能够实现网络摄像机的发现和管理。It can be seen that in the method flow shown in Figure 1, by broadcasting the RARP request message, and obtaining the IP address of the message sender device according to the received RARP response message, and then sending the corresponding message to the corresponding message according to the obtained IP address The sender device sends a resource service address acquisition request message, and when it receives a resource service address acquisition response message, it determines that the message sender device is a network camera, and adds the network camera to the management service. Due to the RARP broadcast message There is no need to rely on routers to forward messages. Therefore, in a network where the management server acts as a router, the discovery and management of network cameras can also be realized.
请参见图2,图2为本发明实施例提供的另一种网络摄像机控制方法的流程示意图,如图2所示,该网络摄像机控制方法可以包括以下步骤:Please refer to FIG. 2. FIG. 2 is a schematic flowchart of another network camera control method provided by an embodiment of the present invention. As shown in FIG. 2, the network camera control method may include the following steps:
步骤201、广播RARP请求报文Step 201, broadcast RARP request message
步骤202、接收RARP响应报文,并根据该RARP响应报文获取报文发送方设备的IP地址。Step 202: Receive the RARP response message, and obtain the IP address of the device sending the message according to the RARP response message.
步骤203、对于任一报文发送方设备,根据该报文发送方设备的IP地址向该报文发送方设备发送资源服务地址获取请求报文。Step 203 , for any message sender device, send a resource service address acquisition request message to the message sender device according to the IP address of the message sender device.
步骤204、当接收到该报文发送方设备发送的资源服务地址获取响应报文时,确定该报文发送方设备为网络摄像机,并将该网络摄像机加入管理设备。Step 204: When receiving the resource service address acquisition response message sent by the message sender device, determine that the message sender device is a network camera, and add the network camera to the management device.
本发明实施例中,步骤201~步骤204的具体实现可以参见上述步骤101~步骤104中的相关描述,本发明实施例在此不再赘述。In the embodiment of the present invention, for the specific implementation of steps 201 to 204, reference may be made to the relevant descriptions in the above steps 101 to 104, and details are not repeated in this embodiment of the present invention.
步骤205、当检测到任一加入管理服务的目标网络摄像机离线时,根据该目标网络摄像机的MAC地址单播RARP请求报文。Step 205, when it is detected that any target network camera joining the management service is offline, unicast the RARP request message according to the MAC address of the target network camera.
本发明实施例中,当NVR检测到任一加入管理服务的网络摄像机离线时(以下将该离线的网络摄像机称为目标网络摄像机),NVR可以根据该目标网络摄像机的MAC地址单播RARP请求报文。In the embodiment of the present invention, when the NVR detects that any network camera that joins the management service is offline (hereinafter the offline network camera is referred to as the target network camera), the NVR can unicast the RARP request report according to the MAC address of the target network camera arts.
步骤206、根据接收到的RARP响应报文获取该目标网络摄像机的IP地址。Step 206, obtain the IP address of the target network camera according to the received RARP response message.
本发明实施例中,当NVR接收到目标网络摄像机发送的RARP响应报文时,NVR可以根据该RARP响应报文获取该目标网络摄像机的IP地址。其中,该IP地址可能与NVR之前获取到的该目标网络摄像机的IP地址相同(网络摄像机由于断电离线),也可能与NVR之前获取到的该目标网络摄像机的IP地址不同(如DHCP(Dynamic Host Configuration Protocol,动态主机配置协议)失效导致IP地址变更导致网络摄像机离线)。In the embodiment of the present invention, when the NVR receives the RARP response message sent by the target network camera, the NVR can acquire the IP address of the target network camera according to the RARP response message. Wherein, the IP address may be the same as the IP address of the target network camera obtained by the NVR (the network camera is offline due to a power failure), or may be different from the IP address of the target network camera obtained by the NVR (such as DHCP (Dynamic Host Configuration Protocol (Dynamic Host Configuration Protocol) invalidation causes the IP address to change and causes the network camera to go offline).
需要注意的是,若NVR向目标网络摄像机单播RARP请求报文后,未在预设时间内接收到RARP响应报文,则NVR可以按照一定时间间隔重新单播RARP请求报文,直至接收到RARP响应报文为止。It should be noted that if the NVR does not receive the RARP response message within the preset time after unicasting the RARP request message to the target network camera, the NVR can re-unicast the RARP request message at a certain time interval until it receives RARP response message.
其中,若NVR单播RARP请求报文的次数达到一定阈值,则NVR一方面可以继续按照预设时间间隔单播RARP请求报文,另一方面,可以发送告警信息,以通知相关人员(如运维人员)进行相应处理,如故障维修等。Wherein, if the number of times of the NVR unicast RARP request message reaches a certain threshold, the NVR can continue to unicast the RARP request message according to the preset time interval on the one hand, and on the other hand, can send an alarm message to notify relevant personnel (such as operation maintenance personnel) to deal with it accordingly, such as troubleshooting.
步骤207、判断该目标网络摄像机的IP地址是否可达。若是,转至步骤208;否则,转至步骤209。Step 207, judging whether the IP address of the target network camera is reachable. If yes, go to step 208; otherwise, go to step 209.
本发明实施例中,NVR获取到目标发送方设备的IP地址之后,还需要进一步判断该目标网络摄像机的IP地址是否可达。In the embodiment of the present invention, after the NVR obtains the IP address of the target sender device, it needs to further determine whether the IP address of the target network camera is reachable.
作为一种可选的实施方式,在本发明实施例中,判断目标网络摄像机的IP地址是否可达,可以包括:As an optional implementation manner, in the embodiment of the present invention, judging whether the IP address of the target network camera is reachable may include:
以目标网络摄像机的IP地址为目的IP地址发送HTTP(HyperText TransferProtocol,超文本传输协议)请求报文;Send the HTTP (HyperText Transfer Protocol, hypertext transfer protocol) request message with the IP address of the target network camera as the destination IP address;
若在预设时间内接收到HTTP响应报文,则判断该目标网络摄像机的IP地址可达;If the HTTP response message is received within the preset time, it is judged that the IP address of the target network camera is reachable;
否则,判断该目标网络摄像机的IP地址不可达。Otherwise, it is determined that the IP address of the target network camera is unreachable.
在该实施方式中,NVR获取到目标网络摄像机的IP地址后,可以以该IP地址为目标IP地址向目标网络摄像机发送HTTP请求报文;若NVR在预设时间内接收到目标网络摄像机发送的HTTP响应报文,则判断该目标网络摄像机的IP地址可达;否则,即NVR未在预设时间内接收到目标网络摄像机发送的HTTP响应报文,则判断该目标网络摄像机的IP地址不可达。例如,NVR的IP地址与目标网络摄像机的IP地址不处于同一网段,以及NVR的网关的IP地址与目标网络摄像机的网关的IP地址不处于同一网段。In this embodiment, after the NVR obtains the IP address of the target network camera, it can use the IP address as the target IP address to send an HTTP request message to the target network camera; HTTP response message, it is judged that the IP address of the target network camera is reachable; otherwise, that is, the NVR does not receive the HTTP response message sent by the target network camera within the preset time, then it is judged that the IP address of the target network camera is unreachable . For example, the IP address of the NVR is not in the same network segment as the IP address of the target network camera, and the IP address of the gateway of the NVR is not in the same network segment as the IP address of the gateway of the target network camera.
需要注意的是,在本发明实施例中,上述通过发送HTTP请求报文,并接收HTTP响应报文的方式判断目标网络摄像机的IP地址是否可达的方式仅仅是本发明实施例中判断IP地址是否可达的实现方式的一种具体实现,在本发明实施例中,也可以通过其它方式判断IP地址是否可达,例如,NVR可以以目标网络摄像机IP地址为目的IP地址发送TCP(Transmission Control Protocol,传输控制协议)请求报文,并根据是否在预设时间内接收到TCP响应报文的方式确定目标网络摄像机的IP地址是否可达,其具体实现在此不再赘述。It should be noted that, in the embodiment of the present invention, the method of judging whether the IP address of the target network camera is reachable by sending the HTTP request message and receiving the HTTP response message is only the method of judging the IP address in the embodiment of the present invention. A kind of concrete realization of the implementation mode of whether reachable, in the embodiment of the present invention, also can judge whether IP address is reachable by other means, for example, NVR can send TCP (Transmission Control Protocol, transmission control protocol) request message, and determine whether the IP address of the target network camera is reachable according to whether the mode of receiving the TCP response message within the preset time, its specific implementation will not be repeated here.
步骤208、重新将该目标网络摄像机加入管理服务。Step 208, adding the target network camera to the management service again.
本发明实施例中,当NVR确定目标网络摄像机的IP地址可到时,NVR可以重新将该目标网络摄像机加入管理服务,如更新自身记录的目标网络摄像机的相关信息。In the embodiment of the present invention, when the NVR determines that the IP address of the target network camera is available, the NVR can re-add the target network camera to the management service, such as updating the relevant information of the target network camera recorded by itself.
步骤209、根据该目标网络摄像机的MAC地址发送IP地址修改指令,该IP地址修改指令中包括目标IP地址以及目标网关IP地址,以使目标网络摄像机接收到该IP地址修改指令后将自身的IP地址修改为该目标IP地址,并将网关地址修改为该目标网关IP地址。Step 209: Send an IP address modification instruction according to the MAC address of the target network camera, the IP address modification instruction includes the target IP address and the target gateway IP address, so that the target network camera will change its own IP address after receiving the IP address modification instruction. Change the address to the target IP address, and change the gateway address to the target gateway IP address.
本发明实施例中,当NVR确定目标网络摄像机的IP地址不可达时,NVR可以向该目标网络摄像机发送IP地址修改指令,以使该目标网络摄像机IP地址修改指令对自身IP地址以及网关IP地址进行修改。In the embodiment of the present invention, when the NVR determines that the IP address of the target network camera is unreachable, the NVR can send an IP address modification instruction to the target network camera, so that the IP address modification instruction of the target network camera is valid for its own IP address and the gateway IP address. to modify.
例如,NVR可以通过UDP广播协议,发送针对指定MAC地址(即目标网络摄像机的MAC地址)的IP地址修改指令的UDP广播报文,以使接收到该UDP广播报文的前端设备发现自身MAC地址与该UDP广播报文中包括的指定MAC地址相同时,进行IP地址修改。For example, the NVR can send a UDP broadcast packet of an IP address modification command for a specified MAC address (that is, the MAC address of the target network camera) through the UDP broadcast protocol, so that the front-end device that receives the UDP broadcast packet can discover its own MAC address. When it is the same as the specified MAC address included in the UDP broadcast message, modify the IP address.
目标网络摄像机接收到该IP地址修改指令后,可以获取该IP地址修改指令中包括的目标IP地址以及目标网关IP地址,并将自身IP地址修改为该目标IP地址,将网关IP地址修改为该目标网关IP地址。After the target network camera receives the IP address modification command, it can obtain the target IP address and the target gateway IP address included in the IP address modification command, and modify its own IP address to the target IP address, and modify the gateway IP address to the target IP address. Destination gateway IP address.
其中,IP地址修改指令中包括的目标IP地址与已加入管理服务的其它网络摄像机的IP地址处于同一网关,且互不相同;目标网关IP地址与NVR的网关IP地址处于同一网段。Wherein, the target IP address included in the IP address modification instruction is in the same gateway as the IP addresses of other network cameras that have joined the management service, and is different from each other; the target gateway IP address is in the same network segment as the gateway IP address of the NVR.
举例来说,假设NVR的IP地址为192.168.1.100,NVR的网关IP地址为192.168.1.1,目标网络摄像机的IP地址为200.168.1.100,目标网络摄像机的网关IP地址为200.168.1.1,则NVR获取到该目标网络摄像机的IP地址后,可以确定该IP地址将不可达,进而,NVR可以根据已加入NVR的其它网络摄像机的IP地址以及网关IP地址确定目标网络摄像机需要修改的目标IP地址和目标网关IP地址,以保证目标报文方法设备修改IP地址后,自身IP地址与其它已加入管理服务的网络摄像机的IP地址处于同一网段,且互不相同(目标网络摄像机修改后的IP地址与NVR其的IP地址也不相同),网关IP地址与NVR的网关IP地址处于同一网段(假设目标IP地址为192.168.1.150,目标网关IP地址为192.168.1.1),并向目标网络摄像机发送IP地址修改指令,该IP地址修改指令中包括目标IP地址和目标网关IP地址。目标网络摄像机接收到该IP地址修改指令后,将自身IP地址和网关IP地址分别修改为目标IP地址和目标网关IP地址,即将自身IP地址修改为192.168.1.150,将网关IP地址修改为192.168.1.1。For example, suppose the IP address of the NVR is 192.168.1.100, the gateway IP address of the NVR is 192.168.1.1, the IP address of the target IP camera is 200.168.1.100, and the gateway IP address of the target IP camera is 200.168.1.1, then the NVR obtains After getting the IP address of the target network camera, it can be determined that the IP address will be unreachable. Then, the NVR can determine the target IP address and target IP address of the target network camera to be modified according to the IP addresses of other network cameras that have joined the NVR and the gateway IP address. Gateway IP address to ensure that after the IP address is modified by the target packet method device, its own IP address is in the same network segment as the IP addresses of other network cameras that have joined the management service, and they are different from each other (the modified IP address of the target network camera is the same as that of other network cameras that have joined the management service. The IP address of the NVR is also different), the gateway IP address and the gateway IP address of the NVR are in the same network segment (assuming the target IP address is 192.168.1.150, and the target gateway IP address is 192.168.1.1), and send the IP An address modification instruction, where the IP address modification instruction includes a target IP address and a target gateway IP address. After receiving the IP address modification command, the target network camera modifies its own IP address and gateway IP address to the target IP address and target gateway IP address respectively, that is, modifies its own IP address to 192.168.1.150, and modifies the gateway IP address to 192.168. 1.1.
步骤210、重新将该目标网络摄像机加入管理服务。Step 210, adding the target network camera to the management service again.
本发明实施例中,NVR修改了目标报文发送方的IP地址和网关IP地址之后,可以重新将该目标网络摄像机加入管理服务。In the embodiment of the present invention, after the NVR modifies the IP address of the sender of the target message and the IP address of the gateway, the target network camera can be re-added to the management service.
可见,在图2所示的方法流程中,当目标网络摄像机的IP地址不可达时,管理服务器可以通过IP地址修改指令修改目标网络摄像机的IP地址,克服了管理服务器和被管理设备之间由于跨网关导致的单播不可达,并在被管理设备离线后重新上线时IP地址发送改变的场景中,可以实现重新上线的被管理设备即插即用,减少人工维护干涉,提高系统的鲁棒性。It can be seen that in the method flow shown in FIG. 2, when the IP address of the target network camera is unreachable, the management server can modify the IP address of the target network camera through an IP address modification command, which overcomes the problem between the management server and the managed device. In the scenario where unicast is unreachable due to cross-gateway, and the IP address is changed when the managed device goes offline and goes online again, it can realize the plug and play of the managed device that goes online again, reducing manual maintenance intervention and improving the robustness of the system sex.
通过以上描述可以看出,在本发明实施例提供的技术方案中,通过广播RARP请求报文,并根据接收到的RARP响应报文获取报文发送方设备的IP地址,进而,根据获取到的IP地址向相应报文发送方设备发送资源服务地址获取请求报文,并当接收到资源服务地址获取响应报文时,确定该报文发送方设备为网络摄像机,并将该网络摄像机加入管理服务,由于RARP广播报文不需要依赖路由器转发消息,因而,在管理服务器充当路由器角色的组网中,也能够实现网络摄像机的发现和管理。It can be seen from the above description that in the technical solution provided by the embodiment of the present invention, the IP address of the message sender device is obtained by broadcasting the RARP request message and according to the received RARP response message, and then, according to the obtained The IP address sends a resource service address acquisition request message to the corresponding message sender device, and when the resource service address acquisition response message is received, determine that the message sender device is a network camera, and add the network camera to the management service , because the RARP broadcast message does not need to rely on the router to forward the message, therefore, in the networking where the management server acts as a router, the discovery and management of the network camera can also be realized.
请参见图3,为本发明实施例提供的一种网络摄像机控制装置的结构示意图,其中,该网络摄像机控制装置可以应用于上述方法实施例中的管理服务器,如NVR,如图3所示,该网络摄像机控制装置可以包括:Please refer to FIG. 3 , which is a schematic structural diagram of a network camera control device provided by an embodiment of the present invention, wherein the network camera control device can be applied to the management server in the above method embodiment, such as NVR, as shown in FIG. 3 , The network camera control unit may include:
发送单元310,用于广播反向地址转换协议RARP请求报文;A sending unit 310, configured to broadcast a reverse address translation protocol RARP request message;
接收单元320,用于接收RARP响应报文;A receiving unit 320, configured to receive an RARP response message;
获取单元330,用于根据所述RARP响应报文获取报文发送方设备的互联网协议IP地址;An acquisition unit 330, configured to acquire the Internet Protocol IP address of the message sender device according to the RARP response message;
所述发送单元310,还用于对于任一报文发送方设备,根据该报文发送方设备的IP地址向该报文发送方设备发送资源服务地址获取请求报文;The sending unit 310 is further configured to, for any message sender device, send a resource service address acquisition request message to the message sender device according to the IP address of the message sender device;
控制单元340,用于当所述接收单元320接收到该报文发送方设备发送的资源服务地址获取响应报文时,确定该报文发送方设备为网络摄像机,并将该网络摄像机加入管理服务。The control unit 340 is configured to, when the receiving unit 320 receives the resource service address acquisition response message sent by the message sender device, determine that the message sender device is a network camera, and add the network camera to the management service .
在可选实施例中,所述获取单元330,还可以用于获取加入管理服务的网络摄像机的媒体访问控制MAC地址;In an optional embodiment, the acquiring unit 330 may also be configured to acquire a media access control MAC address of a network camera that joins the management service;
相应地,请一并参见图4,为本发明实施例提供的另一种网络摄像机控制装置的结构示意图,该实施例在前述图3所示实施例的基础上,图4所示网络摄像机控制装置还可以包括:记录单元350和判断单元360,其中:Correspondingly, please refer to FIG. 4 , which is a schematic structural diagram of another network camera control device provided by an embodiment of the present invention. On the basis of the embodiment shown in FIG. 3 , the network camera control device shown in FIG. 4 The device may also include: a recording unit 350 and a judging unit 360, wherein:
记录单元350,用于记录加入管理服务的网络摄像机的MAC地址;A recording unit 350, configured to record the MAC address of the network camera that joins the management service;
所述发送单元310,还用于当所述装置检测到任一加入管理服务的目标网络摄像机离线时,根据该目标网络摄像机的MAC地址单播RARP请求报文;The sending unit 310 is further configured to unicast the RARP request message according to the MAC address of the target network camera when the device detects that any target network camera joining the management service is offline;
所述获取单元330,还用于根据接收到的RARP响应报文获取该目标网络摄像机的IP地址;The obtaining unit 330 is also used to obtain the IP address of the target network camera according to the received RARP response message;
判断单元360,用于判断该目标网络摄像机的IP地址是否可达;Judging unit 360, used to judge whether the IP address of the target network camera is reachable;
所述控制单元340,还用于若所述判断单元360判断为可达,则重新将该目标网络摄像机加入管理服务。The control unit 340 is further configured to re-add the target IP camera to the management service if the judging unit 360 judges that it is reachable.
在可选实施例中,所述发送单元310,还可以用于若所述判断单元360判断为不可达,则根据该目标网络摄像机的MAC地址发送IP地址修改指令,所述IP地址修改指令中包括目标IP地址以及目标网关IP地址,以使目标网络摄像机接收到该IP地址修改指令后将自身的IP地址修改为该目标IP地址,并将网关地址修改为该目标网关IP地址;其中,所述目标IP地址与已加入管理服务的其它网络摄像机的IP地址处于同一网段,且互不相同;所述目标网关IP地址与管理服务器的网关IP地址处于同一网段;In an optional embodiment, the sending unit 310 may also be configured to send an IP address modification instruction according to the MAC address of the target network camera if the judging unit 360 judges that it is unreachable, and the IP address modification instruction Including the target IP address and the target gateway IP address, so that the target network camera modifies its own IP address to the target IP address after receiving the IP address modification instruction, and modifies the gateway address to the target gateway IP address; wherein, The target IP address and the IP addresses of other network cameras that have joined the management service are in the same network segment and are different from each other; the target gateway IP address is in the same network segment as the gateway IP address of the management server;
所述控制单元340,还可以用于重新将该目标网络摄像机加入管理服务。The control unit 340 can also be used to add the target network camera to the management service again.
请一并参见图5,为本发明实施例提供的另一种网络摄像机控制装置的结构示意图,该实施例在前述图4所示实施例的基础上,图5所示网络摄像机控制装置中,判断单元360可以包括:Please also refer to FIG. 5 , which is a schematic structural diagram of another network camera control device provided by an embodiment of the present invention. On the basis of the embodiment shown in FIG. 4 , in the network camera control device shown in FIG. 5 , Judgment unit 360 may include:
发送子单元361,用于以所述目标网络摄像机的IP地址为目的IP地址发送超文本传输协议HTTP请求报文;The sending subunit 361 is used to send a hypertext transfer protocol HTTP request message with the IP address of the target network camera as the destination IP address;
接收子单元362,用于接收目标网络摄像机发送的HTTP响应报文;The receiving subunit 362 is used to receive the HTTP response message sent by the target network camera;
判断子单元363,用于若所述接收子单元362在预设时间内接收到目标网络摄像机发送的HTTP响应报文,则判断该目标网络摄像机的IP地址可达;否则,判断该目标网络摄像机的IP地址不可达。The judging subunit 363 is used to determine that the IP address of the target network camera is reachable if the receiving subunit 362 receives the HTTP response message sent by the target network camera within a preset time; otherwise, judge that the target network camera The IP address of is unreachable.
请一并参见图6,为本发明实施例提供的另一种网络摄像机控制装置的结构示意图,该实施例在前述图3所示实施例的基础上,图6所示网络摄像机控制装置还可以包括:展示单元370;其中:Please also refer to FIG. 6, which is a schematic structural diagram of another network camera control device provided by an embodiment of the present invention. On the basis of the embodiment shown in FIG. 3, the network camera control device shown in FIG. 6 can also be Comprising: display unit 370; wherein:
展示单元370,用于展示加入管理服务的设备标识列表;A display unit 370, configured to display a list of device identifiers that join the management service;
所述控制单元340,还可以用于当所述接收单元320接收到针对所述设备标识列表中目标设备标识的删除指令时,将所述目标设备标识对应的设备从管理服务中删除。The control unit 340 may also be configured to delete the device corresponding to the target device identifier from the management service when the receiving unit 320 receives a deletion instruction for the target device identifier in the device identifier list.
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。For the implementation process of the functions and effects of each unit in the above device, please refer to the implementation process of the corresponding steps in the above method for details, and will not be repeated here.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本发明方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。As for the device embodiment, since it basically corresponds to the method embodiment, for related parts, please refer to the part description of the method embodiment. The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present invention. It can be understood and implemented by those skilled in the art without creative effort.
由上述实施例可见,通过广播RARP请求报文,并根据接收到的RARP响应报文获取报文发送方设备的IP地址,进而,根据获取到的IP地址向相应报文发送方设备发送资源服务地址获取请求报文,并当接收到资源服务地址获取响应报文时,确定该报文发送方设备为网络摄像机,并将该网络摄像机加入管理服务,由于RARP广播报文不需要依赖路由器转发消息,因而,在管理服务器充当路由器角色的组网中,也能够实现网络摄像机的发现和管理。It can be seen from the above embodiments that by broadcasting the RARP request message and obtaining the IP address of the message sender device according to the received RARP response message, and then sending the resource service to the corresponding message sender device according to the obtained IP address Address acquisition request message, and when receiving the resource service address acquisition response message, determine that the sender device of the message is a network camera, and add the network camera to the management service, because RARP broadcast messages do not need to rely on routers to forward messages , therefore, in the networking where the management server acts as a router, the discovery and management of network cameras can also be realized.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其它实施方案。本申请旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本发明未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。Other embodiments of the invention will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present invention, these modifications, uses or adaptations follow the general principles of the present invention and include common knowledge or conventional technical means in the technical field not disclosed in the present invention . The specification and examples are to be considered exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限制。It should be understood that the present invention is not limited to the precise constructions which have been described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610070403.2ACN105656680B (en) | 2016-01-29 | 2016-01-29 | Method and device for controlling a network camera |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610070403.2ACN105656680B (en) | 2016-01-29 | 2016-01-29 | Method and device for controlling a network camera |
| Publication Number | Publication Date |
|---|---|
| CN105656680A CN105656680A (en) | 2016-06-08 |
| CN105656680Btrue CN105656680B (en) | 2019-12-13 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610070403.2AActiveCN105656680B (en) | 2016-01-29 | 2016-01-29 | Method and device for controlling a network camera |
| Country | Link |
|---|---|
| CN (1) | CN105656680B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106412142B (en)* | 2016-08-30 | 2020-07-28 | 浙江宇视科技有限公司 | Resource equipment address obtaining method and device |
| CN106453370B (en)* | 2016-10-27 | 2020-10-20 | 浙江宇视科技有限公司 | Method and device for registering IPC (inter-programmable logic controller) to NVR (network video recorder) |
| CN108989896B (en)* | 2017-06-12 | 2020-02-21 | 视联动力信息技术股份有限公司 | Video-on-demand request processing method and device |
| CN108337333B (en)* | 2018-03-23 | 2021-10-15 | 普联技术有限公司 | IP address management method, management device, network video recorder and storage medium |
| CN111782664A (en)* | 2019-10-12 | 2020-10-16 | 西安宇视信息科技有限公司 | Camera management method, device, equipment and medium |
| CN113055217B (en)* | 2019-12-28 | 2023-03-24 | 浙江宇视科技有限公司 | Equipment offline repair method and device |
| CN113746945B (en)* | 2020-05-30 | 2023-09-12 | 华为技术有限公司 | Reverse address resolution method and electronic device |
| CN111757000B (en)* | 2020-06-29 | 2021-12-28 | 江苏邦融微电子有限公司 | Camera ad hoc network in local area network and video transmission method |
| CN112436950B (en)* | 2020-10-19 | 2022-07-12 | 中标慧安信息技术股份有限公司 | Method for discovering equipment in local area network based on UDP broadcast |
| CN112672140A (en)* | 2020-11-30 | 2021-04-16 | 新华三技术有限公司 | Camera identification method and device |
| CN112601024B (en)* | 2020-12-14 | 2021-08-31 | 中标慧安信息技术股份有限公司 | Management processing method and system for automatic intelligent monitoring video |
| CN112689167A (en)* | 2020-12-18 | 2021-04-20 | 杭州迪普科技股份有限公司 | Method and device for detecting change of network camera |
| CN112910986B (en)* | 2021-01-28 | 2022-07-08 | 浙江大华技术股份有限公司 | Network video recorder channel management method and network video recorder |
| CN113556467A (en)* | 2021-07-21 | 2021-10-26 | 中国电信股份有限公司 | Control method, control system, storage medium and electronic device of network camera |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104104926A (en)* | 2014-07-30 | 2014-10-15 | 浙江宇视科技有限公司 | Universal plug and play (UPnP) monitoring terminal access method and access device |
| CN104539902A (en)* | 2014-12-29 | 2015-04-22 | 浙江宇视科技有限公司 | IPC remote access method and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100560744B1 (en)* | 2003-09-25 | 2006-03-13 | 삼성전자주식회사 | IP Management System and Its Method in DCP Environment |
| CN101631146B (en)* | 2008-07-17 | 2013-02-13 | 华为技术有限公司 | Method and terminal for realizing address resolution of service platform |
| CN102025799A (en)* | 2010-12-17 | 2011-04-20 | 北京东土科技股份有限公司 | Method for discovery and automatic configuration for IP address of device |
| CN102348107A (en)* | 2011-10-27 | 2012-02-08 | 北京汉邦高科数字技术股份有限公司 | Method for realizing plug and play of network monitoring video |
| CN103327130B (en)* | 2012-03-22 | 2017-07-07 | 中兴通讯股份有限公司 | Method, terminal and system that MAC Address is multiplexed |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104104926A (en)* | 2014-07-30 | 2014-10-15 | 浙江宇视科技有限公司 | Universal plug and play (UPnP) monitoring terminal access method and access device |
| CN104539902A (en)* | 2014-12-29 | 2015-04-22 | 浙江宇视科技有限公司 | IPC remote access method and system |
| Publication number | Publication date |
|---|---|
| CN105656680A (en) | 2016-06-08 |
| Publication | Publication Date | Title |
|---|---|---|
| CN105656680B (en) | Method and device for controlling a network camera | |
| EP2975807B1 (en) | Method and apparatus for discovering openflow protocol-based control plane device | |
| US8250184B2 (en) | System, network entities and computer programs for configuration management of a dynamic host configuration protocol framework | |
| JP4072536B2 (en) | Network device dynamic port configuration | |
| JP4077330B2 (en) | Data generator | |
| WO2015003566A1 (en) | Method, device and system for transmitting packet in multicast domain name system | |
| US9641417B2 (en) | Proactive detection of host status in a communications network | |
| CN101473597A (en) | Method and system for remote access to universal plug and play device | |
| CN103347179B (en) | A kind of apparatus and method that realize monitoring frontend networking | |
| CN109391704B (en) | Cross-private-network access method and device for video monitoring equipment | |
| CN106716939B (en) | QOS improvement in data stream delivery | |
| CN103873301A (en) | System and method for automatically finding and adding devices | |
| WO2011150720A1 (en) | Method, network device and system for automatically configuring network device in internet protocol version 6 network | |
| JP5548696B2 (en) | Multicast quality of service module and method | |
| US11196631B2 (en) | Multi-unicast discovery of devices on a network | |
| WO2017185212A1 (en) | Multicast delay diagnosis method and apparatus | |
| US8396010B2 (en) | Self-configuration of a forwarding table in an access node | |
| US8711869B2 (en) | Message transfer apparatus, output method, and computer program product | |
| CN104539902A (en) | IPC remote access method and system | |
| CN105979202B (en) | Data transmission method and device | |
| CN105915662B (en) | A data transmission method and device | |
| US7325072B2 (en) | Inter-subnet multicast relaying service-a network infrastructure independent solution to cross subnet multicasting | |
| CN106230667A (en) | VTEP keep-alive detection method and device | |
| US20110235641A1 (en) | Communication apparatus, method of controlling the communication apparatus,and program | |
| CN108924506A (en) | Connection method and device of recording and broadcasting system, recording and broadcasting host and camera equipment |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |