CN106656659B - Network path selection method and network video recorder - Google Patents

Network path selection method and network video recorder Download PDF

Info

Publication number
CN106656659B
CN106656659B CN201611081651.3A CN201611081651A CN106656659B CN 106656659 B CN106656659 B CN 106656659B CN 201611081651 A CN201611081651 A CN 201611081651A CN 106656659 B CN106656659 B CN 106656659B
Authority
CN
China
Prior art keywords
ipc
nvr
network card
network
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611081651.3A
Other languages
Chinese (zh)
Other versions
CN106656659A (en
Inventor
何承娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Yushi Intelligent Technology Co ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201611081651.3A priority Critical patent/CN106656659B/en
Publication of CN106656659A publication Critical patent/CN106656659A/en
Application granted granted Critical
Publication of CN106656659B publication Critical patent/CN106656659B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/70Routing based on monitoring results
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Environmental & Geological Engineering (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method for selecting a network path, which comprises the steps of sending a first message to an IPC through a first network card of an NVR (network video recorder) and sending a second message to the IPC through a second network card of the NVR when receiving a control instruction for connecting the IPC; and if the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC, performing data interaction with the IPC through the second network card of the NVR. Therefore, the network card of the NVR sends the detection message to the IPC, the state of a network link between each network card and the IPC is detected, when the network card in the same network segment with the IPC cannot perform normal network transmission, the network card which is not in the same network segment with the IPC and can perform data interaction with the IPC is selected to perform network communication with the IPC, and therefore the fussy process of modifying the network card address of the NVR is avoided, and the NVR can be guaranteed to correctly receive data traffic of the IPC.

Description

Network path selection method and network video recorder
Technical Field
The invention relates to the technical field of communication, in particular to a network path selection method, and also particularly relates to a network video recorder.
Background
In recent years, with the rapid development of IP networks, the video monitoring industry has also entered the full-network era. The Video monitoring industry in the full networking era gradually shows characteristics of the IT industry, and as a core product NVR (Network Video Recorder) for networking monitoring, the NVR has a main function of receiving, storing and managing digital Video code streams transmitted by devices such as IPCs (Network cameras) and DVSs (Video encoders) through a Network.
With the increase of the traffic volume, the application of the multi-network card NVR is more and more extensive. In the application process of the multi-network card NVR, according to a preset routing forwarding rule, the NVR transmits network data with the IPC through the network card which is in the same network segment with the IPC. However, when the NVR cannot perform network data transmission through the network card a and the IPC which are in the same network segment as the IPC (the network port corresponding to the network card a of the NVR is not connected with the network cable, that is, the IPC cannot be connected, but the state of the corresponding network port displayed on the NVR is UP, so that the NVR still communicates with the IPC through the network card a which is not connected at all times). In order to solve the above problems, on the premise that the default route in NVR routes network card B (i.e. network cards in different network segments that can communicate with IPC), the prior art usually modifies the address of network card a manually; or directly down (turning off) the network card A of the NVR to enable the data interaction between the NVR and the IPC to be recovered.
In the process of implementing the present application, the inventor finds that the above solution of the prior art has at least the following problems:
1. by adopting the method for modifying the address of the network card, the IP address of the network card needs to be modified manually, so the operation is very complicated, the labor and the time are wasted, and the use experience of a user is not facilitated.
2. The direct method of down-dropping the NVR network card may affect the use of the multiple network card NVR fault-tolerant capability and the load balancing mode, and may even damage the NVR, thereby being unfavorable for the normal use of the device.
Therefore, when the network card in the same network segment as the IPC cannot perform normal network transmission, how to automatically select a network path for the IPC by the NVR is achieved to avoid a tedious process of modifying the network card address of the NVR, and further ensure that the NVR can correctly receive data traffic of the IPC becomes a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The invention provides a method for selecting a network path, which is used for automatically selecting the network path for IPC by NVR when a network card in the same network segment with the IPC can not carry out normal network transmission, so as to avoid the fussy process of modifying the network card address of the NVR and further ensure that the NVR can correctly receive the data traffic of the IPC, and the method is applied to a system comprising a network video recorder NVR and a network camera IPC, wherein the NVR comprises a first network card and a second network card, the first network card of the NVR and the IPC are in the same network segment, and the second network card of the NVR and the IPC are in different network segments, and the method at least comprises the following steps:
when a control instruction for connecting the IPC is received, sending a first detection message to the IPC through a first network card of the NVR, and sending a second detection message to the IPC through a second network card of the NVR;
and if the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC, performing data interaction with the IPC through the second network card of the NVR.
Preferably, the method further comprises:
if the first network card of the NVR receives a first response message returned by the IPC, performing data interaction with the IPC through the first network card of the NVR;
and if the first network card of the NVR does not receive the first response message returned by the IPC and the second network card of the NVR does not receive the second response message returned by the IPC, performing fault check on a network link between the NVR and the IPC.
Preferably, the data interaction with the IPC through the second network card of the NVR specifically includes:
establishing a host route between the second network card and the IP address of the IPC in a host route table of the NVR;
and performing data interaction with the IPC through a network path represented by the host routing.
Preferably, the method further comprises the step of,
and receiving a registration message sent by the IPC, and analyzing the registration message to obtain the IP address of the IPC.
Preferably, the type of the first detection message is an ARP message; the type of the second detection message is a Ping message.
Correspondingly, the present application provides a network video recorder NVR, which is characterized in that the NVR is applied to a system including the NVR and a network camera IPC, the NVR includes a first network card and a second network card, the first network card of the NVR and the IPC are in the same network segment, the second network card of the NVR and the IPC are in different network segments, and the NVR includes:
the sending module sends a first detection message to the IPC through a first network card of the NVR and sends a second detection message to the IPC through a second network card of the NVR when receiving a control instruction for connecting the IPC;
and the first selection module performs data interaction with the IPC through the second network card of the NVR when the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC.
Preferably, the method further comprises the following steps:
the second selection module is used for performing data interaction with the IPC through the first network card of the NVR when the first network card of the NVR receives a first response message returned by the IPC;
and the detection module is used for carrying out fault detection on a network link between the NVR and the IPC when the first network card of the NVR does not receive the first response message returned by the IPC and the second network card of the NVR does not receive the second response message returned by the IPC.
Preferably, the first selection module is specifically configured to:
establishing a host route between the second network card and the IP address of the IPC in a host route table of the NVR;
and performing data interaction with the IPC through a network path represented by the host routing.
Preferably, the NVR further comprises:
and the receiving module is used for receiving the registration message sent by the IPC and analyzing the registration message to obtain the IP address of the IPC.
Preferably, the type of the first detection message is an ARP message; the type of the second detection message is a Ping message.
By applying the technical scheme of the application, when a control instruction for connecting IPC is received, a first message is sent to the IPC through a first network card of an NVR (network video recorder), and a second message is sent to the IPC through a second network card of the NVR; and if the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC, performing data interaction with the IPC through the second network card of the NVR. Therefore, the network card of the NVR sends the detection message to the IPC, the state of a network link between each network card and the IPC is detected, when the network card in the same network segment with the IPC cannot perform normal network transmission, the network card which is not in the same network segment with the IPC and can perform data interaction with the IPC is selected to perform network communication with the IPC, and therefore the fussy process of modifying the network card address of the NVR is avoided, and the NVR can be guaranteed to correctly receive data traffic of the IPC.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for selecting a network path according to an embodiment of the present disclosure;
fig. 2 is a schematic networking diagram of an NVR according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating establishment of a host route of the network card 1 according to an embodiment of the present application;
FIG. 4 is a general flow diagram of network routing according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an NVR according to an embodiment of the present application.
Detailed Description
As described in the background art, in the application process, according to the preset routing forwarding rule, the multi-network card NVR performs network data interaction with the IPC through the network card a in the same network segment with the IPC. When the network card a in the same network segment with the IPC is in an UP state but the network with the IPC is not connected (e.g., no network cable is connected, the network cable is abnormal, etc.), the prior art does not have a corresponding handling mechanism, and the NVR continuously tries to transmit network data through the network card a and the IPC in the same network segment with the IPC. At this time, in order to enable the NVR to exchange different network cards to perform network data interaction with the IPC, on the premise that the default route in the NVR walks the network card B (i.e. the network card in different network segments communicated with the IPC), the prior art scheme is to modify the address of the network card manually; or directly down (turning off) the NVR network card. On one hand, the scheme is time-consuming and labor-consuming and is not easy to implement, and on the other hand, the use of the multi-network-card NVR fault-tolerant capability and the load balancing mode can be influenced, so that the normal use of the NVR is not facilitated.
Therefore, in order to enable the NVR to automatically select a network path for the IPC when the network card in the same network segment with the IPC cannot perform normal network transmission, so as to avoid a complicated process of modifying the network card address of the NVR and further ensure that the NVR can correctly receive the data traffic of the IPC, the application provides a network path selection method, when a control instruction for connecting the IPC is received, a first message is sent to the IPC through the first network card of the NVR, and a second message is sent to the IPC through the second network card of the NVR; and if the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC, performing data interaction with the IPC through the second network card of the NVR. Therefore, the network card of the NVR sends the detection message to the IPC, the state of a network link between each network card and the IPC is detected, when the network card in the same network segment with the IPC cannot perform normal network transmission, the network card which is not in the same network segment with the IPC and can perform data interaction with the IPC is selected to perform network communication with the IPC, and therefore the fussy process of modifying the network card address of the NVR is avoided, and the NVR can be guaranteed to correctly receive data traffic of the IPC.
Fig. 1 is a schematic flow chart of a method for selecting a network path according to the present application, and it should be noted that the present application is applied to a system including a network video recorder NVR and a network camera IPC, where the NVR includes a first network card and a second network card, the first network card and the IPC of the NVR are in the same network segment, and the second network card and the IPC of the NVR are in different network segments. Specifically, the present application includes the steps of:
s101, when a control instruction for connecting IPC is received, a first detection message is sent to the IPC through a first network card of the NVR, and a second detection message is sent to the IPC through a second network card of the NVR.
In the existing multi-network card NVR, the NVR performs data interaction through a network card in the same network segment with the IPC, and generally does not actively perform network card switching. When a network card in the same network segment with the IPC is not available, the NVR will try to repeatedly connect with the IPC through the network card. At this time, if the connection between the NVR and the IPC is to be restored again, the prior art manually modifies the address of the network card to make the network card and the IPC address not in the same network segment; or a method of directly down (turning off) the network card. Therefore, in the existing NVR, when a network card in the same network segment as the IPC is unavailable, a corresponding network path (network card) selection mechanism is not provided, so that the connection between the NVR and the IPC is interrupted, and the loss is serious. In the embodiment of the application, a network path (network card) selection mechanism for correspondingly selecting the network path (network card) for the NVR is provided, so that when the network card in the same network segment with the IPC is unavailable, a proper network path (network card) is selected for the NVR in time to interact with the IPC, and therefore stable connection between the NVR and the IPC is ensured. This mechanism will be described in detail below.
First, it should be noted that the first network card of the NVR and the IPC are in the same network segment, and the second network card of the NVR and the IPC are in different network segments. According to the routing mechanism of the NVR, the NVR selects the first network card by default to perform data interaction with the IPC.
In the embodiment of the application, when a control instruction for connecting the IPC is received, a first detection message is sent to the IPC through a first network card of the NVR, and a second detection message is sent to the IPC through a second network card of the NVR.
When a control instruction for connecting the IPC is received, the NVR sends a first detection message to the IPC through a first network card of the NVR, and sends a second detection message to the IPC through a second network card of the NVR.
The first detection message is used for detecting whether a network path between a first network card of the NVR and the IPC is available. If the path is available, the IPC sends a first response message to the first network card of the NVR when receiving the first detection message, which indicates that the IPC can perform data interaction with the first network card of the NVR. At this time, the first network card of the NVR is available. On the contrary, if the path is unavailable, the IPC cannot receive the first detection message, so that the first response message cannot be sent to the first network card of the NVR, indicating that the IPC cannot perform data interaction with the first network card of the NVR.
The second detection message is used for detecting whether a network path between the second network card of the NVR and the IPC is available. If the path is available, the IPC sends a second response message to the second network card of the NVR when receiving the second detection message, which indicates that the IPC can perform data interaction with the second network card of the NVR. At this time, the second network card of the NVR is available. On the contrary, if the path is unavailable, the IPC cannot receive the second detection message, so that the IPC cannot send a second response message to the second network card of the NVR, which indicates that the IPC cannot perform data interaction with the second network card of the NVR.
In the preferred embodiment of the present application, the type of the first detection packet is an ARP packet; the type of the second detection message is a Ping message.
Because the first network card of the NVR and the IPC are in the same network segment, whether a path between the first network card and the IPC is available can be detected through an ARP (Address Resolution Protocol) message.
Because the second network card of the NVR and the IPC are in different network segments, it is necessary to detect whether a path between the first network card and the IPC is available through the Ping message. The Ping message can be sent between different network segments, so that the second network card of the NVR can perform data interaction with the IPC through the Ping message.
It should be noted that the above scheme for selecting a message is only a preferred embodiment provided in the present application, and based on the core idea of the present application, a person skilled in the art may also adopt other methods for selecting a message, which does not affect the protection scope of the present application.
S102, if the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC, performing data interaction with the IPC through the second network card of the NVR.
In the embodiment of the application, if the second network card of the NVR receives the second response message returned by the IPC, and the first network card of the NVR does not receive the first response message returned by the IPC, it indicates that the IPC can receive the second detection message sent by the second network card and cannot receive the first detection message sent by the first network card, that is, the path between the IPC and the second network card is in an available state, and the path between the IPC and the first network card is in an unavailable state. Therefore, data interaction is performed between the second network card of the NVR and the IPC, so that a complex process of modifying the network card address of the NVR in the prior art is avoided, and the NVR can correctly receive data traffic of the IPC.
In the preferred embodiment of the application, if the first network card of the NVR receives the first response message returned by the IPC, data interaction is performed with the IPC through the first network card of the NVR.
If the first network card of the NVR receives the first reply message returned by the IPC, it indicates that the IPC can receive the first detection message sent by the first network card, that is, the path between the IPC and the first network card is available. At this time, according to the network segment routing and the two-layer and three-layer forwarding rules, no matter whether the second network card of the NVR can receive the second response message returned by the IPC, data interaction is performed with the IPC through the first network card of the NVR.
And if the first network card of the NVR does not receive the first response message returned by the IPC and the second network card of the NVR does not receive the second response message returned by the IPC, performing fault check on the network link between the NVR and the IPC.
If the second network card of the NVR does not receive the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC, it indicates that the IPC cannot receive the second detection message sent by the second network card and cannot receive the first detection message sent by the first network card, that is, the path between the IPC and the second network card is in an unavailable state and the path between the IPC and the first network card is also in an unavailable state. At this time, the IPC or NVR device, or the network between the devices is abnormal, and the network link between the NVR and the IPC needs to be checked for failure. And repeating the process of adding IPC by NVR after the investigation is finished.
In a preferred embodiment of the present application, the data interaction between the second network card of the NVR and the IPC may be specifically implemented by the following method. Specifically, the method comprises the following steps:
(1) and establishing host routing between the second network card and the IP address of the IPC in a host routing table of the NVR.
Firstly, a host route between the second network card and the IP address of the IPC needs to be established in a host route table of the NVR, and then the NVR can perform data interaction with the IPC through the host route.
(2) The network path represented by the host route interacts data with the IPC.
After the host route between the second network card and the IP address of the IPC is established, the NVR performs data interaction with the IPC through the network path represented by the host route, so that the process of selecting the network path is completed, and the data flow between the NVR and the IPC is ensured not to be interrupted.
In addition, the network segment route of the first network card and the IPC same network segment is required to be reserved. When the first network card is available and data interaction between the first network card and the IPC is recovered, according to the routing forwarding rule, when the NVR is communicated with the IPC, the network segment routing forwarding corresponding to the first network card is matched preferentially.
It should be noted that, the above-mentioned solution for performing data interaction with an IPC through a second network card is only a preferred embodiment provided in the present application, and based on the core idea of the present application, a person skilled in the art may also adopt other methods for performing data interaction with an IPC through a second network card, which does not affect the protection scope of the present application.
In a preferred embodiment of the present application, the method of the present application further comprises the following preferred steps:
and receiving a registration message sent by the IPC, and analyzing the registration message to obtain the IP address of the IPC.
When the IPC is on line, a registration message is sent to the NVR. In the preferred embodiment of the present application, the NVR analyzes the registration message to further obtain the IP address of the IPC. The NVR can establish host routing to the IPC after the IP address of the IPC is obtained.
As can be seen from the description of the above embodiment, when a control instruction for connecting to an IPC is received, a first message is sent to the IPC through a first network card of an NVR, and a second message is sent to the IPC through a second network card of the NVR; and if the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC, performing data interaction with the IPC through the second network card of the NVR. Therefore, the network card of the NVR sends the detection message to the IPC, the state of a network link between each network card and the IPC is detected, when the network card in the same network segment with the IPC cannot perform normal network transmission, the network card which is not in the same network segment with the IPC and can perform data interaction with the IPC is selected to perform network communication with the IPC, and therefore the fussy process of modifying the network card address of the NVR is avoided, and the NVR can be guaranteed to correctly receive data traffic of the IPC.
In order to further illustrate the technical idea of the present invention, the technical solution of the present invention will now be described with reference to the specific implementation flow diagram.
Before executing the steps of the application, IPC needs to be added to NVR, specifically, the NVR adds IPC in three ways, i.e., INOS, ONVIF and GB, and the processing mechanism of each adding way is different.
In the first ONVIF adding mode, a user manually adds information such as an IP, a user name, a password and the like of the IPC on an interface of the NVR, and the NVR actively sends an ARP detection message, a Ping message and the like to the IPC after obtaining the IP of the IPC, so as to select a corresponding network card to send.
And in the second IMOS private protocol adding step, the user manually adds an IPC code, a user name and a password, and the IPC modifies the IP of the management server, wherein the code is the only standard for IPC registration. The IPC actively sends registered SIP messages (IP, coding information and the like) to the server, and the NVR confirms the IP through matching the information such as the coding and the like after obtaining the IP of the IPC. If the IPC is off-line abnormally or power is lost in the adding process, the NVR finds that the response message of the IPC cannot be received, the IPC is considered to be off-line, the NVR actively sends a registration SIP message after the IPC is recovered, and the NVR continues to respond.
And the third national standard protocol is added, and the basic steps are the same as the IMOS addition.
After the NVR actively obtains the IP of the IPC or the IPC actively reports the IP of the NVR, the NVR then starts to perform network routing, in the first step, according to the network segment routing of the NVR and the address matching of the IPC, the NVR selects to interact with the IPC through a network card 2 of a network segment, at the moment, the NVR starts to respectively send a detection ARP message to the IPC through the network card 2, and simultaneously sends Ping messages to the IPC through the network card 1, wherein one message is sent every 1S.
At this time, if the network card 1 receives the Ping message responded by the IPC, but the network card 2 in the same network segment as the NVR does not receive the corresponding ARP detection response, it indicates that the network card 2 is not through, but the network card 1 is normal.
Corresponding to the networking in fig. 2, network card 2 and IPC of the dual-network card NVR are in the same network segment 192.168.2.X, but the network card actually connected to the three-layer switch for forwarding is network card 1.
As shown in FIG. 3, NVR sends a 32-bit host route to IPC (192.168.2.35) on network card 1, and then traffic from NVR to IPC goes through network card 1. Then NVR and IPC start normal registration interaction flow, IPC successfully gets online on NVR.
Besides the networking described above, if the access network card of the NVR side changes or the IPC network changes, the NVR side can perform network routing by ARP detection of the network card in the same network segment and Ping message detection of the network cards in different network segments. There are three specific cases:
the network card 1 and the network card 2 both receive the ARP response message of the IPC, and the flow from the NVR to the IPC is routed through the network card 2 according to the network segment routing and the two-layer and three-layer forwarding rules.
The network card 1 does not receive the response, the network card 2 receives the response, and as in the former case, according to the network segment routing and the two-layer and three-layer forwarding rules, the flow from the NVR to the IPC is all routed through the network card 2.
If neither network card 1 nor network card 2 receives a response, it indicates that IPC or NVR devices, or network abnormality between devices needs to be checked. And repeating the process of adding IPC by NVR after the investigation is finished.
Therefore, no matter whether other front end IPC or NVR network cards are accessed into the network in the following process, the subsequent operation steps are obtained by comparing the 4 conditions of the network route selection. If the two network cards can detect that the IPC or the network card in the same network segment with the IPC is also accessed into the three-layer networking and the IPC for mutual communication, the network cards are forwarded according to the routing table entry of the NVR, and the fault tolerance and load sharing of the subsequent NVR cannot be influenced.
Specifically, as shown in fig. 4, which is a flowchart of the entire application, it can be seen that the method mainly includes the following steps:
(1) the IPC is added to NVR firstly, and the main adding methods include INOS, ONVIF and GB, which have been described in detail above and are not described herein again.
(2) Then NVR starts to send a detection ARP message to the IPC through the network card 2 (in the same network segment with the IPC) and simultaneously sends a Ping message to the IPC through the network card 1 (in a different network segment with the IPC).
(3) And executing the network routing process of the IPC according to the condition that the IPC returns a response message.
(4) And the IPC is successfully registered, and normal data communication is realized.
After the IPC is online, a corresponding keep-alive mechanism exists between the NVR and the IPC, and the specific flow is as follows:
(1) after the IPC is on line, the keep-alive time of 30S exists between the NVR and the IPC, the keep-alive interval is 10S, namely, the Ping detection message is sent by the NVR every 10S. If the keep-alive response message of the IPC is not received after 30S, the NVR considers that the IPC is abnormally offline or powered off, and then locally deletes the host route corresponding to the IPC.
(2) After the IPC actively sends IP or NVR obtains IP of the IPC according to different registration modes, the IPC actively sends detection ARP and Ping messages, and then network routing is carried out.
As can be seen from the description of the above specific embodiment, when a control instruction for connecting an IPC is received, a first message is sent to the IPC through a first network card of an NVR, and a second message is sent to the IPC through a second network card of the NVR; and if the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC, performing data interaction with the IPC through the second network card of the NVR. Therefore, the network card of the NVR sends the detection message to the IPC, the state of a network link between each network card and the IPC is detected, when the network card in the same network segment with the IPC cannot perform normal network transmission, the network card which is not in the same network segment with the IPC and can perform data interaction with the IPC is selected to perform network communication with the IPC, and therefore the fussy process of modifying the network card address of the NVR is avoided, and the NVR can be guaranteed to correctly receive data traffic of the IPC.
In order to achieve the above technical objective, the present application provides a network video recorder NVR, where the NVR is applied to a system including the NVR and a network camera IPC, the NVR includes a first network card and a second network card, the first network card of the NVR and the IPC are in the same network segment, the second network card of the NVR and the IPC are in different network segments, as shown in fig. 5, the NVR includes:
a sending module 501, configured to send a first detection message to the IPC through the first network card of the NVR and send a second detection message to the IPC through the second network card of the NVR when receiving a control instruction for connecting the IPC;
the first selection module 502 performs data interaction with the IPC through the second network card of the NVR when the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC.
In a specific embodiment, the method further comprises:
the second selection module is used for performing data interaction with the IPC through the first network card of the NVR when the first network card of the NVR receives a first response message returned by the IPC;
and the detection module is used for carrying out fault detection on a network link between the NVR and the IPC when the first network card of the NVR does not receive the first response message returned by the IPC and the second network card of the NVR does not receive the second response message returned by the IPC.
In a specific embodiment, the first selection module is specifically configured to:
establishing a host route between the second network card and the IP address of the IPC in a host route table of the NVR;
and performing data interaction with the IPC through a network path represented by the host routing.
In a specific embodiment, the NVR further comprises:
and the receiving module is used for receiving the registration message sent by the IPC and analyzing the registration message to obtain the IP address of the IPC.
In a specific embodiment, the type of the first detection packet is an ARP packet; the type of the second detection message is a Ping message.
As can be known from the description of the above specific devices, when a control instruction for connecting an IPC is received, a first message is sent to the IPC through a first network card of an NVR, and a second message is sent to the IPC through a second network card of the NVR; and if the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC, performing data interaction with the IPC through the second network card of the NVR. Therefore, the network card of the NVR sends the detection message to the IPC, the state of a network link between each network card and the IPC is detected, when the network card in the same network segment with the IPC cannot perform normal network transmission, the network card which is not in the same network segment with the IPC and can perform data interaction with the IPC is selected to perform network communication with the IPC, and therefore the fussy process of modifying the network card address of the NVR is avoided, and the NVR can be guaranteed to correctly receive data traffic of the IPC.
Finally, the description is as follows: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, those skilled in the art will appreciate that; the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions and scope of the present invention as defined in the appended claims.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present invention may be implemented by hardware, or by software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present invention.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present invention.
Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above-mentioned invention numbers are merely for description and do not represent the merits of the implementation scenarios.
The above disclosure is only a few specific implementation scenarios of the present invention, however, the present invention is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present invention.

Claims (10)

1. A method for selecting a network path is applied to a system comprising a Network Video Recorder (NVR) and a network camera IPC, wherein the NVR comprises a first network card and a second network card, the first network card of the NVR and the IPC are in the same network segment, and the second network card of the NVR and the IPC are in different network segments, and the method at least comprises the following steps:
when a control instruction for connecting the IPC is received, sending a first detection message to the IPC through a first network card of the NVR, and sending a second detection message to the IPC through a second network card of the NVR;
and if the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC, performing data interaction with the IPC through the second network card of the NVR.
2. The method of claim 1, wherein the method further comprises:
if the first network card of the NVR receives a first response message returned by the IPC, performing data interaction with the IPC through the first network card of the NVR;
and if the first network card of the NVR does not receive the first response message returned by the IPC and the second network card of the NVR does not receive the second response message returned by the IPC, performing fault check on a network link between the NVR and the IPC.
3. The method of claim 1, wherein the data interaction with the IPC through the second network card of the NVR specifically comprises:
establishing a host route between the second network card and the IP address of the IPC in a host route table of the NVR;
and performing data interaction with the IPC through a network path represented by the host routing.
4. The method of claim 3, further comprising,
and receiving a registration message sent by the IPC, and analyzing the registration message to obtain the IP address of the IPC.
5. The method of claim 1,
the type of the first detection message is an ARP message; the type of the second detection message is a Ping message.
6. The NVR is applied to a system comprising the NVR and an IPC (Internet protocol Camera), the NVR comprises a first network card and a second network card, the first network card of the NVR and the IPC are in the same network segment, the second network card of the NVR and the IPC are in different network segments, and the NVR comprises:
the sending module sends a first detection message to the IPC through a first network card of the NVR and sends a second detection message to the IPC through a second network card of the NVR when receiving a control instruction for connecting the IPC;
and the first selection module performs data interaction with the IPC through the second network card of the NVR when the second network card of the NVR receives the second response message returned by the IPC and the first network card of the NVR does not receive the first response message returned by the IPC.
7. The NVR of claim 6, further comprising:
the second selection module is used for performing data interaction with the IPC through the first network card of the NVR when the first network card of the NVR receives a first response message returned by the IPC;
and the detection module is used for carrying out fault detection on a network link between the NVR and the IPC when the first network card of the NVR does not receive the first response message returned by the IPC and the second network card of the NVR does not receive the second response message returned by the IPC.
8. The NVR of claim 6, wherein the first selection module is specifically configured to:
establishing a host route between the second network card and the IP address of the IPC in a host route table of the NVR;
and performing data interaction with the IPC through a network path represented by the host routing.
9. The NVR of claim 8, further comprising:
and the receiving module is used for receiving the registration message sent by the IPC and analyzing the registration message to obtain the IP address of the IPC.
10. The NVR of claim 8,
the type of the first detection message is an ARP message; the type of the second detection message is a Ping message.
CN201611081651.3A 2016-11-30 2016-11-30 Network path selection method and network video recorder Active CN106656659B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611081651.3A CN106656659B (en) 2016-11-30 2016-11-30 Network path selection method and network video recorder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611081651.3A CN106656659B (en) 2016-11-30 2016-11-30 Network path selection method and network video recorder

Publications (2)

Publication Number Publication Date
CN106656659A CN106656659A (en) 2017-05-10
CN106656659B true CN106656659B (en) 2020-12-29

Family

ID=58813539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611081651.3A Active CN106656659B (en) 2016-11-30 2016-11-30 Network path selection method and network video recorder

Country Status (1)

Country Link
CN (1) CN106656659B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107919999A (en) * 2017-11-21 2018-04-17 天津英田视讯科技有限公司 The discovery of different segment digital camera and connection method in a kind of LAN
CN111083176B (en) * 2018-10-18 2023-02-03 浙江宇视科技有限公司 Cloud self-adaptive online method and device for monitoring camera
CN113852974A (en) * 2021-03-31 2021-12-28 天翼智慧家庭科技有限公司 Fast topology detection method based on 802.11 wireless frame
CN114679296A (en) * 2022-02-09 2022-06-28 浙江远望信息股份有限公司 Method for discovering multi-network card equipment based on specific video protocol

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100474706B1 (en) * 2002-09-11 2005-03-10 삼성전자주식회사 Apparatus of inter processor communication using tcp/ip in communication system
CN102104470A (en) * 2009-12-17 2011-06-22 研祥智能科技股份有限公司 Multi-network-card double-redundancy device and system under VxWorks system
CN102404418B (en) * 2011-11-18 2015-01-28 北京华为数字技术有限公司 Method, device and system for distributing IP (internet protocol) address for user terminal
KR102143620B1 (en) * 2014-02-17 2020-08-11 삼성전자주식회사 Apparatus and method for handling request of application layer using multiple interface in electronic device
CN103944750B (en) * 2014-03-14 2017-08-29 华为技术有限公司 One kind binding net card failure processing method and processing device
CN104639913B (en) * 2015-02-12 2018-05-01 浙江宇视科技有限公司 A kind of network video recorder and its method for automatically accessing IPC
CN105099771B (en) * 2015-07-02 2018-04-24 北京东土科技股份有限公司 A kind of active/standby link switchover, realize link redundancy backup method and device

Also Published As

Publication number Publication date
CN106656659A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
US11223514B2 (en) Method and system of a dynamic high-availability mode based on current wide area network connectivity
CN106656659B (en) Network path selection method and network video recorder
US8270306B2 (en) Fault management apparatus and method for identifying cause of fault in communication network
KR20140116161A (en) Redundant network connections
EP2252093B1 (en) Method for enabling mobility of client devices in large scale unified networks
CN102349277B (en) The intrusion detection of virtual two layers of service
CN104144124B (en) Data forwarding method, Apparatus and system
CN106559280A (en) Bidirectional forwarding detection (BFD) method and device
CN108306824B (en) Message sending method and device
CN102916897A (en) Method and equipment for realizing VRRP load sharing
US8559431B2 (en) Multiple label based processing of frames
EP2613500A1 (en) Content-centric network and method of performing routing between domains therefor
CN108289044B (en) Data forwarding method, link state method for determining static route and network equipment
WO2016124117A1 (en) Method, switching device and network controller for protecting links in software-defined network (sdn)
CN109743758B (en) Multi-link communication method, communication device and communication system
US8612626B2 (en) Group member detection among nodes of a network
CN102447703B (en) A kind of heat backup method and system, CGN equipment
CN104243473A (en) Data transmission method and device
CN112822088B (en) Network connection method and device, electronic equipment, processor and storage medium
WO2021098806A1 (en) Message transmission path switching method, device and system
CN110545240B (en) Method for establishing label forwarding table and forwarding message based on distributed aggregation system
CN109257444B (en) Load sharing method, device and system
CN114268578A (en) Data transmission method, device and equipment for switching line and storage medium
CN108600075B (en) Fault processing method and device
CN110224950A (en) Stacking system detection system, method, apparatus and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221110

Address after: 250101 4th floor, building 5, zone A2, Hanyu Jingu, Shunhua South Road, high tech Zone, Jinan City, Shandong Province

Patentee after: Jinan Yushi Intelligent Technology Co.,Ltd.

Address before: 2 / F, South Block, building 10, wanlun Science Park, 88 Jiangling Road, Binjiang District, Hangzhou City, Zhejiang Province, 310051

Patentee before: ZHEJIANG UNIVIEW TECHNOLOGIES Co.,Ltd.