Network communication method, network video recorder and intelligent monitoring system
By obtaining and updating the network address of the network camera in the network video recorder, the problem of association loss caused by IPC dynamic IP address changes is solved, and the stability and reliability of the monitoring system are improved.
Patent Information
- Application Number
- CN202410814890.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-10-25
AI Technical Summary
The network communication stability between existing network video recorders and network cameras is poor, especially when the IPC uses DHCP to obtain a dynamic IP address. Changes in the IP address cause the NVR to lose its association and interrupt the video surveillance service.
By obtaining the preset network address of the target network camera, sending broadcast information if the access times out, parsing the response information to determine the first network address, and updating the preset network address, achieving a stable association between the NVR and IPC.
Improved the robustness of the association and communication stability between network video recorders and network cameras, ensuring the continuity and reliability of the monitoring system.
Smart Images

Figure CN118842875A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a network communication method, a network video recorder and an intelligent monitoring system. Background Art
[0002] With the rapid development of information technology, network video surveillance systems have become an indispensable part of modern security systems. As the core components of the system, the stability and reliability of network video recorders (NVR) and network cameras (IP Cameras, IPC) directly affect the performance of the entire monitoring system.
[0003] In the prior art, NVR and IPC achieve interoperability through standardized methods such as the Open Network Video Interface Forum (ONVIF). NVR and IPC association technology is usually based on the ONVIF protocol, and the association and binding between devices are performed through IP addresses. Existing IPC devices are configured by default to obtain dynamic IP addresses through the DHCP protocol when they leave the factory to simplify the deployment process and reduce the need for manual configuration.
[0004] However, since IPC uses DHCP to obtain dynamic IP addresses, any change in IP address may cause NVR to lose its association with IPC, thus interrupting video surveillance service. It can be seen that relying on DHCP dynamic allocation has the problem of poor network communication stability between NVR and IPC. Summary of the invention
[0005] The present application provides a network communication method, a network video recorder and an intelligent monitoring system, which are used to solve the problem of poor stability of network communication between an NVR and an IPC.
[0006] In a first aspect, the present application provides a network communication method, comprising:
[0007] Obtain a target network camera and a preset network address corresponding to the target network camera;
[0008] If a response to accessing the target network camera through the preset network address times out, sending broadcast information through at least one path;
[0009] Acquire response information returned according to the broadcast information, and determine the first network address according to the response information;
[0010] The preset network address is updated using the first network address.
[0011] Optionally, sending the broadcast information through at least one path includes:
[0012] Set up and send broadcast messages through the Layer 2 protocol;
[0013] and / or, sending broadcast data packets in a multicast manner;
[0014] And / or, sending a broadcast data packet in a broadcast mode.
[0015] Optionally, the setting and sending of a broadcast message through a layer 2 protocol includes:
[0016] Generate protocol messages through layer 2 protocol;
[0017] The destination access address of the protocol message is set to all Fs, and the broadcast message is generated.
[0018] Optionally, the acquiring response information returned according to the broadcast information, and determining the first network address according to the response information, includes:
[0019] Obtaining the first response information returned according to the broadcast information;
[0020] The source address of the response information is parsed to obtain the first network address.
[0021] Optionally, before using the first network address to update the preset network address, the method further includes:
[0022] Verify that the first network camera corresponding to the first network address is consistent with the target network camera.
[0023] Optionally, the verifying that the first network camera corresponding to the first network address is consistent with the target network camera includes:
[0024] Obtaining the preset account and preset password of the target network camera;
[0025] Requesting access to the first network camera according to the first network address, and requesting connection to the first network camera using the preset account and the preset password;
[0026] If the connection is successful, it is determined that the first network camera is consistent with the target network camera.
[0027] Optionally, the verifying that the first network camera corresponding to the first network address is consistent with the target network camera includes:
[0028] Requesting access to the first network camera according to the first network address, and requesting to obtain identification information of the first network camera;
[0029] If the identification information of the first network camera is consistent with the identification information pre-stored in the target network camera, it is determined that the first network camera is consistent with the target network camera.
[0030] Optionally, the requesting to obtain identification information of the first network camera includes:
[0031] Acquire identification information of the first network camera through a function included in a standard interface between the network video recorder and the first network camera;
[0032] or,
[0033] The identification information of the first network camera is obtained through an interface function of a private protocol between the network video recorder and the first network camera.
[0034] Optionally, the identification information includes at least model, serial number and version information.
[0035] Optionally, if it is verified that the first network camera corresponding to the first network address is inconsistent with the target network camera, the method further includes:
[0036] Other response information returned by the broadcast information is sequentially acquired and verified until the first network camera corresponding to the first network address obtained by parsing the response information is verified to be consistent with the target network camera.
[0037] Optionally, if it is verified that the first network camera corresponding to the first network address is inconsistent with the target network camera, the method further includes:
[0038] The broadcast information is resent through at least one path.
[0039] In a second aspect, the present application provides a network communication device, including:
[0040] An acquisition module, used to acquire a target network camera and a preset network address corresponding to the target network camera;
[0041] A processing module is used to send broadcast information through at least one path if a response to accessing the target network camera through the preset network address times out; obtain response information returned based on the broadcast information, and determine a first network address based on the response information; and use the first network address to update the preset network address.
[0042] Optionally, the processing module is used to:
[0043] Set up and send broadcast messages through the Layer 2 protocol;
[0044] and / or, sending broadcast packets in a multicast manner;
[0045] And / or, sending a broadcast data packet in a broadcast mode.
[0046] Optionally, the processing module is used to:
[0047] Generate protocol messages through layer 2 protocol;
[0048] The destination access address of the protocol message is set to all Fs, and the broadcast message is generated.
[0049] Optionally, the processing module is used to:
[0050] Obtaining the first response information returned according to the broadcast information;
[0051] The source address of the response information is parsed to obtain the first network address.
[0052] Optionally, the processing module is further configured to:
[0053] Verify that the first network camera corresponding to the first network address is consistent with the target network camera.
[0054] Optionally, the processing module is used to:
[0055] Obtaining the preset account and preset password of the target network camera;
[0056] Requesting access to the first network camera according to the first network address, and requesting connection to the first network camera using the preset account and the preset password;
[0057] If the connection is successful, it is determined that the first network camera is consistent with the target network camera.
[0058] Optionally, the processing module is used to:
[0059] Requesting access to the first network camera according to the first network address, and requesting to obtain identification information of the first network camera;
[0060] If the identification information of the first network camera is consistent with the identification information pre-stored in the target network camera, it is determined that the first network camera is consistent with the target network camera.
[0061] Optionally, the processing module is used to:
[0062] Acquire identification information of the first network camera through a function included in a standard interface between the network video recorder and the first network camera;
[0063] or,
[0064] The identification information of the first network camera is obtained through an interface function of a private protocol between the network video recorder and the first network camera.
[0065] Optionally, the identification information includes at least model, serial number and version information.
[0066] Optionally, the processing module is used to:
[0067] If it is verified that the first network camera corresponding to the first network address is inconsistent with the target network camera, other response information returned by the broadcast information is sequentially obtained and verified until the first network camera corresponding to the first network address obtained by parsing the response information is verified to be consistent with the target network camera.
[0068] Optionally, the processing module is used to:
[0069] If it is verified that the first network camera corresponding to the first network address is inconsistent with the target network camera, the method resends the broadcast information through at least one path.
[0070] In a third aspect, the present application provides a network video recorder, comprising: a memory and a processor;
[0071] The memory is used to store computer programs; the processor is used to execute the method in the first aspect and any possible design of the first aspect according to the computer program stored in the memory.
[0072] In a fourth aspect, the present application provides an intelligent monitoring system, comprising: a network camera and a network video recorder in the third aspect and any possible design of the third aspect; the network camera and the network video recorder are connected via network communication.
[0073] In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When at least one processor of a network video recorder executes the computer program, the network video recorder executes the method in the first aspect and any possible design of the first aspect.
[0074] In a sixth aspect, the present application provides a computer program product, comprising a computer program. When at least one processor of a network video recorder executes the computer program, the network video recorder executes the method in the first aspect and any possible design of the first aspect.
[0075] The network communication method, network video recorder and intelligent monitoring system provided by the present application take the network camera currently to be accessed as the target network camera and obtain the preset network address stored in the target network camera; access the target network camera according to the preset network address; when the response times out, search for the target network camera by sending broadcast information through multiple channels; obtain the response information returned by the broadcast information, and parse it to obtain the first network address; use the first network address to update the preset network address recorded in the network video recorder, so as to realize the association of the network camera in the DHCP mode, enhance the robustness of the association between the network video recorder and the network camera, and improve the stability of the communication between the network video recorder and the network camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0077] Figure 1 A schematic diagram of network interaction between an NVR and an IPC in an intelligent monitoring system provided in one embodiment of the present application;
[0078] Figure 2 A network communication method provided in accordance with an embodiment of the present invention Figure 1 ;
[0079] Figure 3 A schematic diagram of a response timeout provided in an embodiment of the present application;
[0080] Figure 4 A schematic diagram of communication between an NVR and an IPC provided in one embodiment of the present application;
[0081] Figure 5 A network communication method provided in accordance with an embodiment of the present invention Figure 2 ;
[0082] Figure 6 A network communication method provided in accordance with an embodiment of the present invention Figure 3 ;
[0083] Figure 7 A newly added page of a network camera provided in one embodiment of the present application;
[0084] Figure 8 A newly added device list page provided in an embodiment of the present application;
[0085] Fig. 9 A schematic diagram of the structure of a network communication device provided in one embodiment of the present application;
[0086] Fig.10 A schematic diagram of the hardware structure of a network video recorder provided in one embodiment of the present application. DETAILED DESCRIPTION
[0087] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0088] Terminology explanation:
[0089] Network Video Recorder (NVR): A dedicated network device used to receive, store, and manage video streams from network cameras. Also known as backend equipment.
[0090] IP Camera (IPC): A digital video capture device that can be directly connected to the network and transmit the video stream to the NVR through the IP network. It is also called a front-end device.
[0091] Open Network Video Interface Forum (ONVIF): defines a set of standard specifications to enable NVRs and IPCs from different manufacturers to be used in conjunction with each other.
[0092] Web Services Dynamic Discovery (WS-Discovery): is a network protocol that allows devices and services to discover each other without pre-configuration. WS-Discovery is part of the ONVIF standard and ensures compatibility between devices of different brands.
[0093] Multicast DNS (mDNS): is a multicast-based domain name service that allows devices to discover other devices and services within a local area network without configuring a traditional DNS server.
[0094] Universal Plug and Play (UPnP): is a network protocol that allows devices to discover each other and work together within a local area network without complex configuration.
[0095] Dynamic Host Configuration Protocol (DHCP): is a network protocol that allows network administrators to automatically assign IP addresses and other network configuration parameters to devices on the network. For example, the device can be a terminal device such as an IPC.
[0096] Layer 2 protocol (Open Systems Interconnection, OSI): specifically refers to the protocol of the data link layer. The data link layer is responsible for transmitting data frames between two directly connected devices in the network. It involves the identification of physical addresses (such as MAC addresses) and the reliable transmission of data.
[0097] Multicast: It is an efficient network transmission protocol that allows a single sender to send data to multiple receivers simultaneously. The receivers can be confirmed by adding them to a specific multicast group or by agreeing on a multicast address and port.
[0098] Broadcast: It is an efficient network transmission protocol that can send information to all devices in the local area network.
[0099] As a key technology for security and information management, intelligent monitoring systems are developing rapidly and are widely used in many fields such as commerce, industry and home. With the development of intelligence and networking, monitoring systems are increasingly dependent on the close cooperation of NVR and IPC to achieve efficient video data storage and analysis. These intelligent monitoring systems achieve interoperability between devices through protocols such as ONVIF standards, ensuring that devices from different manufacturers can work together and meet the market demand for efficient and flexible monitoring solutions.
[0100] At present, the association between NVR and IPC is usually based on ONVIF protocol and bound by IP address. A common method is to establish a control channel through the layer 2 protocol to detect the MAC address and achieve the initial connection between devices. However, this method is usually effective in the local area network, mainly focusing on the device discovery in the local area network, but the focus is on the establishment of the control channel, and the description of the data channel interaction process is insufficient. In addition, this method has limited processing capabilities for IP address changes and has problems with insufficient stability and reliability.
[0101] However, when the IPC uses DHCP to obtain a dynamic IP address, the change in the IP address may cause the existing association on the NVR to be lost, thereby affecting the continuity and stability of the monitoring system. In addition, when the IP address of the IPC changes, most of the existing technologies do not provide an effective mechanism to handle the situation after the IP change, and often cannot effectively update the information in the NVR, which easily leads to the loss of association between monitoring terminals. In addition, when the IPC uses DHCP to obtain a dynamic IP address, IP conflict problems may also occur after the IP is fixed. In addition, the existing technology rarely makes full use of other network communication methods such as Layer 2 protocols, multicast, and broadcast, which greatly reduces the applicability and flexibility in different network environments. Moreover, in the process of associating NVR and IPC, the existing methods also lack detailed descriptions and solutions for the interactive verification of data channels, which may affect the integrity and accuracy of the data.
[0102] Therefore, it is necessary to develop a more stable and reliable method for associating NVR and IPC to adapt to the dynamic IP environment and ensure the efficient operation of the monitoring system. To this end, the inventive concept of the network communication method provided in the embodiment of the present application is to realize a method for automatically re-associating and verifying the association relationship between NVR and IPC in the intelligent monitoring system. The method is mainly executed on the NVR side. When the NVR does not receive a response after the IP-associated connection to IPC times out, the NVR can actively discover the first network address of the IPC through a variety of methods such as layer 2 protocol, multicast, and broadcast. The NVR can verify the IPC by verifying the identification information such as model, serial number, and version information based on the first network address using the ONVIF standard protocol or private protocol. After the verification is passed, the NVR can update the preset network address of the IPC in the database according to the first network address, thereby restoring and maintaining a stable association with the IPC. Through the above method, the present application significantly improves the reliability and flexibility of the intelligent monitoring system and solves some major defects in the prior art.
[0103] Figure 1 A schematic diagram of network interaction between an NVR and an IPC in an intelligent monitoring system provided by an embodiment of the present application is shown. As shown in the figure, the intelligent monitoring system may include a network video recorder (NVR) and a network camera (IPC). Both the NVR and the IPC include an application layer, a network layer, and a data link layer. The NVR is associated with the IPC through the open network video interface standard (ONVIF) or a private protocol of the application layer, and the association and binding are performed through IP. The IPC can obtain a dynamic IP by using the dynamic host configuration protocol (DHCP) by default when leaving the factory. The NVR and the IPC can also communicate at the network layer through multicast or broadcast.
[0104] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0105] Figure 2 The flow chart of a network communication method provided by an embodiment of the present application is shown as follows Figure 1 .exist Figure 1 Based on the embodiment shown, Figure 2 As shown, with the network video recorder as the execution subject, the method of this embodiment may include the following steps:
[0106] S101, obtaining a target network camera and a preset network address corresponding to the target network camera.
[0107] In this embodiment, the network video recorder can be associated with multiple network cameras. The network video recorder can store preset network addresses of the associated network cameras. The network video recorder can access the network cameras through the preset network addresses and network communication.
[0108] When the network video recorder needs to access a network camera, the network video recorder can use the network camera currently needed to be accessed as the target network camera and determine the preset network address stored in the target network camera according to the target network camera.
[0109] S102: If a response to accessing the target network camera through the preset network address times out, broadcast information is sent through at least one path.
[0110] In this embodiment, the network video recorder can access the target network camera according to the preset network address. The network video recorder can wait for and obtain the response information fed back by the target network camera. Optionally, the response information can be a prompt information of successful communication. Alternatively, the response information can also be the video information fed back by the target network camera according to the access request of the network video recorder.
[0111] When the network video recorder does not obtain the response information of the target network camera within the preset time, the network video recorder determines that the target network camera has timed out. Optionally, the response timeout may be caused by a change in the network address of the target network camera. Alternatively, the response timeout may also be caused by an abnormality of the target network camera itself.
[0112] The network video recorder can find the target network camera by sending broadcast information. If the network video recorder can find the target network camera by broadcasting information, it means that the response timeout is caused by the change of the network address. Otherwise, if the network video recorder cannot find the target network camera by broadcasting information, it means that the target network camera has been offline. That is, the target network camera has an abnormality.
[0113] Optionally, the broadcast information may include information of the target network camera. Optionally, the information may be identification information.
[0114] Optionally, the above operation can be performed as follows Figure 3 Optionally, the network video recorder may send broadcast information in the following manner: Figure 4 shown.
[0115] In one example, the network video recorder can set and send a broadcast message through a layer 2 protocol. The network camera can receive the broadcast message. Optionally, the broadcast message can include information of the target network camera.
[0116] The network camera can obtain the information of the target network camera through the broadcast message. The network camera can determine whether it is the target network camera based on the information of the target network camera. If yes, the network camera that receives the broadcast message can send a response message. If no, the network camera that receives the broadcast message does not respond to the broadcast message.
[0117] Optionally, after generating a protocol message through the layer 2 protocol, the network video recorder may set the destination access address of the protocol message to all Fs, so that the protocol message becomes a broadcast message.
[0118] In another example, the network video recorder can send a broadcast data packet in a multicast manner. Optionally, the broadcast data packet can include information of the target network camera.
[0119] The network camera can obtain the information of the target network camera through the received broadcast data packet. The network camera can determine whether it is the target network camera based on the information of the target network camera. If yes, the network camera that receives the broadcast data packet can send a response message. If not, the network camera that receives the broadcast data packet does not respond to the broadcast message.
[0120] Optionally, the multicast range of the network video recorder can be determined according to a multicast group preset in the network video recorder. Alternatively, the multicast range of the network video recorder can be determined according to an address and an interface agreed in the network video recorder.
[0121] In another example, the network video recorder may send a broadcast data packet in a broadcast manner. Optionally, the broadcast data packet may include information of the target network camera.
[0122] The network camera can obtain the information of the target network camera through the received broadcast data packet. The network camera can determine whether it is the target network camera based on the information of the target network camera. If yes, the network camera that receives the broadcast data packet can send a response message. If not, the network camera that receives the broadcast data packet does not respond to the broadcast message.
[0123] Optionally, the broadcast range may be all network cameras within the network communication range.
[0124] S103: Acquire response information returned according to the broadcast information, and determine the first network address according to the response information.
[0125] In this embodiment, the network video recorder can obtain the response information returned by the broadcast information, parse the response information, and determine the first network address, which is the network address of the network camera that returns the response information.
[0126] In one example, the network video recorder may stop obtaining other response information after obtaining the first response information returned. The network video recorder may parse the source address of the response information to obtain the first network address.
[0127] S104: Use the first network address to update the preset network address.
[0128] In this embodiment, the network video recorder can use the first network address to update the preset network address recorded in the network video recorder, so that the first network address becomes the new preset network address. In subsequent use, the network video recorder can access the target network camera through the new preset network address.
[0129] The network communication method provided by the present application is that the network video recorder can take the network camera that currently needs to be accessed as the target network camera and obtain the preset network address stored by the target network camera. The network video recorder can access the target network camera according to the preset network address. When the response times out, the network video recorder can search for the target network camera by sending broadcast information through a variety of channels. The network video recorder can obtain the response information returned by the broadcast information and parse it to obtain the first network address. The network video recorder can use the first network address to update the preset network address recorded in the network video recorder. In the present application, the adaptive association between the network video recorder and the network camera is realized by sending broadcast information through a variety of channels, so that the network video recorder no longer requires the network camera to have a fixed network address, and the association of the network camera in the DHCP mode is realized, which enhances the robustness of the association between the network video recorder and the network camera and improves the stability of the communication between the network video recorder and the network camera.
[0130] Figure 5 The flow chart of a network communication method provided by an embodiment of the present application is shown as follows Figure 2 .exist Figures 2 to 4 On the basis of the embodiment shown, this embodiment can also verify the first network address to achieve the effect of improving the security of the intelligent monitoring system. Figure 5 As shown, with the network video recorder as the execution subject, the method of this embodiment may include the following steps:
[0131] S201, obtaining a target network camera and a preset network address corresponding to the target network camera.
[0132] S202: If a response to accessing the target network camera through the preset network address times out, broadcast information is sent through at least one path.
[0133] S203: Acquire response information returned according to the broadcast information, and determine the first network address according to the response information.
[0134] Among them, steps S201 to S203 are Figure 2 The implementation of steps S101 to S103 in the embodiment is similar, and will not be repeated here in this embodiment.
[0135] S204: Verify that the first network camera corresponding to the first network address is consistent with the target network camera.
[0136] In this embodiment, the network video recorder can verify the first network address after obtaining the first network address. After obtaining the first network address, the network video recorder can determine the first network camera that can establish communication through the first network address based on the first network address. The network video recorder can further determine whether the first network camera is consistent with the target network camera. If they are consistent, the network video recorder completes the verification of this step and continues to execute step S205. Otherwise, if they are inconsistent, the network video recorder needs to jump to S206 or S207.
[0137] In one example, the network video recorder can attempt to log in when accessing the first network camera through the preset account and preset password of the target network camera to achieve consistency with the target network camera, including:
[0138] Step 11: Get the preset account and password of the target network camera.
[0139] In this step, the network video recorder can obtain the preset account and preset password stored in the target network camera. The preset account and preset password are used to remotely log in to the target network camera. Optionally, one target network camera can correspond to one preset account. Optionally, each preset account can correspond to one preset password. Optionally, the user can set the preset account and preset password of the target network camera when connecting the target network camera to the network video recorder. Optionally, one preset account can be used to log in to at least one network camera. Optionally, there can be at least one preset account with the same preset password. Optionally, one preset account can set different preset passwords on different network cameras.
[0140] Step 12: Request access to the first network camera according to the first network address, and use a preset account and a preset password to request connection to the first network camera.
[0141] In this step, the network video recorder can request to access the first network camera according to the first network address. The access request may include a preset account and a preset password. The network video recorder can request to log in on the first network camera using the preset account and the preset password through the access request. When the first network camera completes the login using the preset account and the preset password, the first network camera can be connected to the network video recorder, and the network video recorder can monitor through the first network camera. Otherwise, the network video recorder cannot monitor through the network using the first network camera.
[0142] Step 13: If the connection is successful, it is determined that the first network camera is consistent with the target network camera.
[0143] In this step, the network video recorder can determine that the first network camera is the target network camera when the connection is successful, that is, the first network camera is consistent with the target network camera.
[0144] Optionally, in some scenarios, there may be a situation where a preset account is used in multiple network cameras. In this case, using the preset account and preset password of the target network camera cannot complete the verification that the first network camera is consistent with the target network camera. In this case, the network video recorder can implement more detailed verification through the following example.
[0145] In another example, the network video recorder can implement the consistency verification by verifying whether the identification information of the first network camera is consistent with the target network camera. The specific process may include:
[0146] Step 21: Request access to a first network camera according to the first network address, and request to obtain identification information of the first network camera.
[0147] In this step, the network video recorder can access the first network camera through the first network address. Through the access request, the network video recorder can request to obtain the identification information of the first network camera. Optionally, the acquisition of the identification information can be achieved through a communication protocol, and it is not necessary to complete the login on the first network camera.
[0148] Optionally, the network video recorder can communicate with the first network camera through a standard interface such as an open network video interface standard. The network video recorder can use the function functions included in the standard interface to obtain the identification information of the first network camera. Alternatively, the network video recorder can obtain the identification information of the first network camera through an interface function of a private protocol.
[0149] Optionally, the identification information includes at least a model, a serial number and a version information. Optionally, the identification information is used to uniquely identify a network camera.
[0150] Step 22: If the identification information of the first network camera is consistent with the identification information pre-stored in the target network camera, it is determined that the first network camera is consistent with the target network camera.
[0151] In this step, the identification information of the target network camera may be pre-stored in the network video recorder. The network video recorder may use the pre-stored identification information of the target network camera to compare with the identification information of the first network camera obtained in step 21. If the identification information of the target network camera is consistent with the identification information of the first network camera, it means that the first network camera is the target network camera. That is, the first network camera is consistent with the target network camera. Otherwise, if the identification information of the target network camera is inconsistent with the identification information of the first network camera, it means that the first network camera and the target network camera are not the same machine. That is, the first network camera is inconsistent with the target network camera.
[0152] S205: Use the first network address to update the preset network address.
[0153] Among them, step S205 and Figure 2 The implementation of step S104 in the embodiment is similar and will not be described in detail in this embodiment.
[0154] S206: If the identification information of the first network camera is inconsistent with the identification information pre-stored in the target network camera, sequentially obtain and verify other response information returned by the broadcast information until the first network camera corresponding to the first network address obtained by parsing the response information is verified to be consistent with the target network camera.
[0155] In this embodiment, if S204 verifies that the identification information of the first network camera is inconsistent with the identification information pre-stored in the target network camera, the network video recorder needs to re-acquire the first network address. This step implements a method for re-acquiring the first network address. In the process of using this step to obtain the first network address, if all the response information fails to be verified, the network video recorder needs to continue to execute step S207.
[0156] Since in this embodiment, the network video recorder sends the broadcast information through at least one path in step S202. Therefore, the actual network video recorder can obtain the response information of at least one path. That is, each path can obtain a response message. In the above step S203, the network video recorder only obtains the first response information and determines the first network address based on the first response information. When the network video recorder determines that the verification of the first network address corresponding to the first response information fails according to step S204, the network video recorder can re-acquire the first network address based on other response information.
[0157] Optionally, the network video recorder can sort the response information according to the time sequence of obtaining the response information. Optionally, when it is determined that the first network address corresponding to the first response information fails to be verified, the network video recorder can obtain the second response information and determine the first network address according to the second response information. The network video recorder can return to step S204 and use the first network address determined according to the second response information for verification.
[0158] Optionally, the network video recorder can record the network address with inconsistent verification results. Optionally, before obtaining the first network address and executing step S204, the network video recorder can first determine whether the first network address is a network address with inconsistent verification results. If so, the network video recorder can directly obtain the next response information.
[0159] If the verification is successful, the network video recorder will execute step S205 and complete the execution of this embodiment. If the verification fails, the network video recorder will continue to obtain the third response information according to the time sequence of obtaining the response information, and determine the first network address according to the third response information.
[0160] By analogy, the network video recorder can verify the consistency in step S204 and end the loop when executing step S205. Alternatively, the network video recorder can execute step S207 after all the response information of the broadcast information fails to be verified.
[0161] S207: Resend the broadcast information through at least one path.
[0162] In this embodiment, another method for re-obtaining the first network address is implemented. Figure 5 As shown, if all the response information verifications in step S206 are inconsistent, the network video recorder can re-acquire the first network address by the method shown in this step. Figure 6 As shown, if step S204 verifies that the identification information of the first network camera is inconsistent with the identification information pre-stored in the target network camera, the network video recorder can re-acquire the first network address by the method shown in this step.
[0163] The network video recorder can send broadcast information according to at least one preset method and obtain response information of the new broadcast information.
[0164] The network communication method provided by the present application further improves the system security and reduces the probability of abnormality of the preset network address by verifying the consistency of the first network camera and the target network camera before using the first network address to replace the preset network address. In addition, the present application also realizes the re-acquisition of the first network address in the case of an error in the first network address by sequentially acquiring response information, retransmitting broadcast information, etc., further improving the probability of acquiring an accurate first network address and improving the stability of communication between the network video recorder and the network camera of the intelligent monitoring system.
[0165] Based on the above embodiments, Figure 7 The following is the page for adding a new network camera associated with the network video recorder. Figure 7 As shown, a table may be provided in the upper part of the page, and a plurality of network cameras are displayed in the table. The network cameras in the table are the network cameras that are currently in use, can be detected by the network video recorder, and are not associated with the network video recorder. The table may include a plurality of fields such as channel number, IP address, status, encoding setting, management number, device number, etc.
[0166] The middle part of the page includes multiple input boxes. The user can enter the corresponding content in the input box according to the prompt characters in front of the input box. For example, the input box may include the IPR address, encoding settings, IP address, management number, account number, and camera password of the network camera. A switch button for the camera password may also be included after the above input box. When the switch button for the camera password is on, the network video recorder needs to connect to the network camera through the camera account and camera password. When the switch button for the camera password is off, the network video recorder can only connect to the network camera through the camera account. Alternatively, the user can also click on the network camera in the table to automatically fill in the information of the selected network camera into the input box.
[0167] The page may include three buttons at the bottom: Add More, Add, and Cancel. When the user completes the above input box and clicks Add More, the content in the input box can be added to the table on the page. The current page for adding new network cameras will be closed, and the new page for adding new network cameras will be opened. When the user completes the above input box and clicks Add, the content in the input box can be added to the table on the page. At the same time, the current page for adding new network cameras will be closed. When the user clicks Cancel, the current page for adding new network cameras will be closed.
[0168] Based on the above embodiments, Figure 8The list of newly added devices is shown in the figure. The newly added devices are network cameras that have been managed by the network video recorder. Figure 8 As shown in the figure, a network camera has been associated with the network video recorder. After the connection is completed, the status of the network camera is a green √ icon, indicating that the network camera is online. If the IP of the network camera changes, the network video recorder will not be able to connect to the network camera according to the current IP address. At this time, the status of the network camera in the table is displayed as a red × icon, indicating that the network camera has been offline. When the network video recorder re-acquires the IP address of the network camera through the above method and uses the new IP address to overwrite the original IP address, the network video recorder can access the network camera through the IP address again. At this time, the status of the network camera in the table changes back to a green √ icon, indicating that the network camera is online again.
[0169] Optionally, based on the above embodiment, if the IP address of the network camera associated with the network video recorder changes, and the network video recorder can adaptively re-associate with the network camera, the information sent by the network video recorder can be obtained by packet capture or other means, so as to determine whether the broadcast information in the above embodiment is used based on the information.
[0170] Fig. 9 A schematic diagram of the structure of a network communication device provided by an embodiment of the present application is shown. Fig. 9 As shown, the network communication device 10 of this embodiment is used to implement the operation corresponding to the network video recorder in any of the above method embodiments, and is applied to the network video recorder. The network communication device 10 of this embodiment includes:
[0171] The acquisition module 11 is used to acquire the target network camera and the preset network address corresponding to the target network camera;
[0172] The processing module 12 is used to send broadcast information through at least one path if the response to accessing the target network camera through the preset network address times out; obtain response information returned according to the broadcast information, and determine the first network address according to the response information; and use the first network address to update the preset network address.
[0173] Optionally, the processing module 12 is used to:
[0174] Set up and send broadcast messages through the Layer 2 protocol;
[0175] and / or, sending broadcast packets in a multicast manner;
[0176] And / or, sending a broadcast data packet in a broadcast mode.
[0177] Optionally, the processing module 12 is used to:
[0178] Generate protocol messages through layer 2 protocol;
[0179] Set the destination access address of the protocol message to all Fs to generate a broadcast message.
[0180] Optionally, the processing module 12 is used to:
[0181] Get the first response information returned according to the broadcast information;
[0182] The source address of the response information is parsed to obtain the first network address.
[0183] Optionally, the processing module 12 is further configured to:
[0184] Verify that the first network camera corresponding to the first network address is consistent with the target network camera.
[0185] Optionally, the processing module 12 is used to:
[0186] Get the preset account and password of the target network camera;
[0187] Requesting access to the first network camera according to the first network address, and requesting connection to the first network camera using a preset account and a preset password;
[0188] If the connection is successful, it is determined that the first network camera is consistent with the target network camera.
[0189] Optionally, the processing module 12 is used to:
[0190] Requesting access to a first network camera according to the first network address, and requesting to obtain identification information of the first network camera;
[0191] If the identification information of the first network camera is consistent with the identification information pre-stored in the target network camera, it is determined that the first network camera is consistent with the target network camera.
[0192] Optionally, the processing module 12 is used to:
[0193] Acquire identification information of the first network camera through a function included in a standard interface between the network video recorder and the first network camera;
[0194] or,
[0195] The identification information of the first network camera is obtained through an interface function of a private protocol between the network video recorder and the first network camera.
[0196] Optionally, the identification information includes at least model, serial number and version information.
[0197] Optionally, the processing module 12 is used to:
[0198] If it is verified that the first network camera corresponding to the first network address is inconsistent with the target network camera, other response information returned by the broadcast information is sequentially obtained and verified until the first network camera corresponding to the first network address obtained by parsing the response information is verified to be consistent with the target network camera.
[0199] Optionally, the processing module 12 is used to:
[0200] If it is verified that the first network camera corresponding to the first network address is inconsistent with the target network camera, the method resends the broadcast information through at least one path.
[0201] The network communication device 10 provided in the embodiment of the present application can execute the above method embodiment. Its specific implementation principle and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.
[0202] Fig.10 FIG. 1 shows a schematic diagram of the hardware structure of a network video recorder provided in an embodiment of the present application. Fig.10 As shown, the network video recorder 20 is used to implement the operations corresponding to the network video recorder in any of the above method embodiments. The network video recorder 20 of this embodiment may include: a memory 21, a processor 22 and a communication interface 24.
[0203] The memory 21 is used to store computer programs. The memory 21 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk.
[0204] The processor 22 is used to execute the computer program stored in the memory to implement the network communication method in the above embodiment. For details, please refer to the relevant description in the above method embodiment. The processor 22 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the invention can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0205] Optionally, the memory 21 may be independent or integrated with the processor 22 .
[0206] When the memory 21 is a device independent of the processor 22, the network video recorder 20 may further include a bus 23. The bus 23 is used to connect the memory 21 and the processor 22. The bus 23 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0207] The communication interface 24 may be connected to the processor 21 via the bus 23. The processor 22 may control the communication interface 24 to implement the communication function with the camera.
[0208] The network video recorder provided in this embodiment can be used to execute the above-mentioned network communication method. Its implementation method and technical effect are similar, and this embodiment will not be repeated here.
[0209] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the methods provided in the various embodiments described above.
[0210] Among them, the computer-readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. For example, a computer-readable storage medium is coupled to a processor so that the processor can read information from the computer-readable storage medium and write information to the computer-readable storage medium. Of course, the computer-readable storage medium can also be a component of the processor. The processor and the computer-readable storage medium can be located in an application-specific integrated circuit (ASIC). In addition, the ASIC can be located in a user device. Of course, the processor and the computer-readable storage medium can also exist in a communication device as discrete components.
[0211] Specifically, the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0212] The present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of a device can read the computer program from the computer-readable storage medium, and at least one processor executes the computer program so that the device implements the methods provided in the various embodiments described above.
[0213] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0214] Among them, each module can be physically separated, for example, installed in different locations of a device, or installed on different devices, or distributed on multiple network units, or distributed on multiple processors. Each module can also be integrated together, for example, installed in the same device, or integrated in a set of codes. Each module can exist in the form of hardware, or can also exist in the form of software, or can also be implemented in the form of software plus hardware. The present application can select some or all of the modules according to actual needs to achieve the purpose of the present embodiment.
[0215] When each module is implemented as an integrated module in the form of a software function module, it can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of each embodiment of the present application.
[0216] It should be understood that, although the various steps in the flowcharts in the above-described embodiments are sequentially displayed according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily to be carried out sequentially, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0217] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0218] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the above embodiments can still be modified, or some or all of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A network communication method, characterized in that: Applied to a network video recorder, the method comprises: Obtain a target network camera and a preset network address corresponding to the target network camera; If a response to accessing the target network camera through the preset network address times out, sending broadcast information through at least one path; Acquire response information returned according to the broadcast information, and determine the first network address according to the response information; The preset network address is updated using the first network address.
2. The method according to claim 1, characterized in that The sending of broadcast information through at least one path includes: Set up and send broadcast messages through the Layer 2 protocol; and / or, sending broadcast data packets in a multicast manner; And / or, sending a broadcast data packet in a broadcast mode.
3. The method according to claim 2, characterized in that The step of setting and sending a broadcast message through a layer 2 protocol includes: Generate protocol messages through layer 2 protocol; The destination access address of the protocol message is set to all Fs, and the broadcast message is generated.
4. The method according to claim 1, characterized in that The acquiring response information returned according to the broadcast information, and determining the first network address according to the response information, includes: Obtaining the first response information returned according to the broadcast information; The source address of the response information is parsed to obtain the first network address.
5. The method according to any one of claims 1 to 4, characterized in that Before using the first network address to update the preset network address, the method further includes: Verify that the first network camera corresponding to the first network address is consistent with the target network camera.
6. The method according to claim 5, characterized in that The verifying that the first network camera corresponding to the first network address is consistent with the target network camera includes: Obtaining the preset account and preset password of the target network camera; Requesting access to the first network camera according to the first network address, and requesting connection to the first network camera using the preset account and the preset password; If the connection is successful, it is determined that the first network camera is consistent with the target network camera.
7. The method according to claim 6, characterized in that The verifying that the first network camera corresponding to the first network address is consistent with the target network camera includes: Requesting access to the first network camera according to the first network address, and requesting to obtain identification information of the first network camera; If the identification information of the first network camera is consistent with the identification information pre-stored in the target network camera, it is determined that the first network camera is consistent with the target network camera.
8. The method according to claim 7, characterized in that The request to obtain the identification information of the first network camera includes: Acquire identification information of the first network camera through a function included in a standard interface between the network video recorder and the first network camera; or, The identification information of the first network camera is obtained through an interface function of a private protocol between the network video recorder and the first network camera.
9. The method according to claim 7, characterized in that: The identification information includes at least model number, serial number and version information.
10. The method according to claim 5, characterized in that If it is verified that the first network camera corresponding to the first network address is inconsistent with the target network camera, the method further includes: Other response information returned by the broadcast information is sequentially acquired and verified until the first network camera corresponding to the first network address obtained by parsing the response information is verified to be consistent with the target network camera.
11. The method according to claim 5, characterized in that If it is verified that the first network camera corresponding to the first network address is inconsistent with the target network camera, the method further includes: The broadcast information is resent through at least one path.
12. A network video recorder, characterized in that: The network video recorder comprises: a memory and a processor; The memory is used to store a computer program; the processor is used to implement the method according to any one of claims 1 to 11 according to the computer program stored in the memory.
13. An intelligent monitoring system, characterized in that: The intelligent monitoring system comprises: a network camera and a network video recorder as claimed in claim 12; the network camera and the network video recorder are connected via network communication.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program is used to implement the method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Cited By
Equipment connection method and device, storage medium and electronic equipment
CN119342086A
Network camera adding method and device and storage medium
CN121691769A
