Based on method of transmitting video data, the Apparatus and system of data link layer
Technical field
The present invention relates to communication technique field, in particular to a kind of method of transmitting video data based on data link layer, Apparatus and system.
Background technology
In recent years, along with the fast development of IP (Internet Protocol, Internet protocol) network, Video Surveillance Industry also progressively entered the full networked epoch.Current, the Video Surveillance Industry in full networked epoch just progressively shows the feature of IT industry, as the core product NVR (Network Video Recorder, network video recorder) of networked control, it inherently becomes IT product.
The topmost function of NVR is by network reception IPC (IP Camera, web camera) equipment or claim the digital video bit stream of IP camera transmissions, and these data are stored and managed, thus realize the distributed structure/architecture advantage that networking brings.
NVR is the network equipment based on IP agreement, and its correlation function runs and all realizes based on IP framework, and therefore, it can carry out remote side administration through local area network (LAN) or wide area network, in framework network video monitor and control system, possess great flexibility.
But, the communication protocol taked when performing video data transmission between current IP video camera and NVR be all generally based on IP layer on communication protocol, as shown in Figure 1, it illustrates the data flow figure carrying out transfer of data in prior art between IP video camera and NVR, can find out, the existing method performing video data transmission between IP video camera and NVR is:
IP camera application layer is after getting video data, be sent to IP video camera TCP/UDP layer, IP video camera IP layer is sent to again by IP video camera TCP/UDP layer, IP camera data link layer is delivered to again afterwards by IP video camera IP layer, follow-uply say the NVR data link layer of video data transmission to corresponding NVR by IP camera data link layer, then be transferred to NVR application layer successively at NVR end, complete the transmission of video data with this.
Inventor finds, carries out video data transmission can bring following drawback based on above-mentioned prior art:
The first, when IP address exists conflict time, video data to be transmitted can be caused to go out the situation of active, target ip address can not be transferred to exactly;
The second, in data transmission procedure, easily there is larger network delay;
3rd, when carrying out larger data amount video data transmission, need to consume more cpu resource.
Summary of the invention
In order at least one in solving the problem, the object of the embodiment of the present invention is to provide a kind of method of transmitting video data based on data link layer, Apparatus and system.
The embodiment of the present invention realizes by the following technical solutions:
Based on a method of transmitting video data for data link layer, comprising:
Video data is directly passed to IP camera data link layer according to video data transmission instruction by IP camera application layer;
Described video data is passed to the NVR data link layer of corresponding network video recorder NVR by IP camera data link layer based on data link layer protocol, and by NVR data link layer, video data is directly passed to NVR application layer.
Preferably, described video data is passed to the NVR data link layer of corresponding NVR by IP camera data link layer based on data link layer protocol and according to the hardware address MAC Address of target NVR.
Preferably, described video data transmission instruction is configured to automatically be generated by the transmission of video custom strategies of IP video camera self, or obtains from outside.
Based on a video data transmission device for data link layer, it is deployed on IP video camera, and it comprises:
IP camera application layer module, for being directly passed to IP camera data link layer module according to video data transmission instruction by video data;
IP camera data link layer module, for described video data being passed to based on data link layer protocol the NVR data link layer of corresponding NVR, and is directly passed to NVR application layer by NVR data link layer by video data.
Preferably, described video data is passed to the NVR data link layer of corresponding NVR by IP camera data link layer module based on data link layer protocol and according to the MAC Address of target NVR.
Preferably, the described video data transmission device based on data link layer also comprises:
Customized module, for automatically generating described video data transmission instruction according to the transmission of video custom strategies customized in advance;
Or,
Acquisition module, for obtaining described video data transmission instruction from outside.
Based on a video data transmission device for data link layer, it is deployed on NVR, and it comprises:
NVR Data Link Layer Module, obtain video data for the IP camera data link layer from corresponding IP video camera and be passed to NVR application layer module, wherein, described video data directly to be transmitted to IP camera data link layer according to video data transmission instruction by the IP camera application layer of IP video camera provides;
NVR application layer module, for obtaining video data.
Preferably, video data is passed to the NVR Data Link Layer Module of corresponding NVR by the IP camera data link layer of IP video camera based on data link layer protocol and according to the MAC Address of target NVR.
Preferably, described video data transmission instruction is configured to automatically be generated by the transmission of video custom strategies of IP video camera self, or obtains from outside.
Based on a video-frequency data transmission system for data link layer, it comprises:
IP video camera, video data is directly passed to IP camera data link layer according to video data transmission instruction by its IP camera application layer, and described video data is passed to the NVR data link layer of corresponding NVR by IP camera data link layer based on data link layer protocol;
NVR, its NVR data link layer receives the video data that IP video camera sends, and by NVR data link layer, described video data is directly passed to NVR application layer.
Can be found out by the technical scheme of the invention described above, the present invention adopts network data link layer protocol transmitting video data, due to the communication mode that data link layer protocol is based on MAC Address, particularly, for each network equipment, its MAC Address is globally unique, therefore adopts the present invention thoroughly can avoid the problem of the video data loss caused because IP address clashes in prior art.Secondly, when adopting the present invention to carry out video data transmission, the packet of data link layer does not need to enter IP layer, therefore greatly reduces the participation of kernel yet, thus effectively can reduce network latency problems.In addition, equally because the packet of data link layer does not need to enter IP layer, and decrease the participation of kernel, thus effectively can reduce the CPU overhead on NVR.
Accompanying drawing explanation
Fig. 1 is the data flow figure carrying out transfer of data in prior art between IP video camera and NVR;
The data flow figure of the method for transmitting video data based on data link layer that Fig. 2 provides for the embodiment of the present invention.
The realization of the object of the invention, functional characteristics and excellent effect, be described further below in conjunction with specific embodiment and accompanying drawing.
Embodiment
Below in conjunction with the drawings and specific embodiments, technical scheme of the present invention is described in further detail, can better understand the present invention to make those skilled in the art and can be implemented, but illustrated embodiment is not as a limitation of the invention.
Shown in figure 2, a kind of method of transmitting video data based on data link layer that the embodiment of the present invention provides, comprises following implementation step:
Video data is directly passed to IP camera data link layer according to video data transmission instruction by S10, IP camera application layer;
Described video data is passed to the NVR data link layer of corresponding network video recorder NVR by S20, IP camera data link layer based on data link layer protocol, and by NVR data link layer, video data is directly passed to NVR application layer.
At IP video camera end, the prior art that the processing mode that IP camera application layer obtains video data according to video data transmission instruction is grasped for those skilled in the art.Wherein, described video data transmission instruction is configured to automatically be generated by the transmission of video custom strategies of IP video camera self, or IP camera application layer obtains from outside, and described outside can be the NVR of request video data, also can be other third-party platforms.
The prior art that the information processing manner that video data is directly passed to IP camera data link layer by its IP camera application layer is grasped for those skilled in the art.
At NVR end, the prior art that the information processing manner that video data is directly passed to NVR application layer by its NVR data link layer is grasped for those skilled in the art.
The prior art that NVR application layer those skilled in the art such as process, application to described video data grasp.
In described step S20, described video data is passed to the NVR data link layer of corresponding NVR by IP camera data link layer based on data link layer protocol and according to the hardware address MAC Address of target NVR.
Accordingly, the embodiment of the present invention additionally provides a kind of video data transmission device based on data link layer, and it is deployed on IP video camera, and it comprises:
IP camera application layer module, for being directly passed to IP camera data link layer module according to video data transmission instruction by video data;
IP camera data link layer module, for described video data being passed to based on data link layer protocol the NVR data link layer of corresponding NVR, and is directly passed to NVR application layer by NVR data link layer by video data.Particularly, in the present embodiment, described video data is passed to the NVR data link layer of corresponding NVR by IP camera data link layer module based on data link layer protocol and according to the MAC Address of target NVR.
Similarly, at IP video camera end, the prior art that the processing mode that IP camera application layer module obtains video data according to video data transmission instruction is grasped for those skilled in the art.
The prior art that the information processing manner that video data is directly passed to IP camera data link layer module by its IP camera application layer module is grasped for those skilled in the art.
At NVR end, the prior art that the information processing manner that video data is directly passed to NVR application layer by its NVR data link layer is grasped for those skilled in the art.
The prior art that NVR application layer those skilled in the art such as process, application to described video data grasp.
Wherein, described video data transmission instruction is configured to automatically be generated by the transmission of video custom strategies of IP video camera self, or IP camera application layer module obtains from outside, described outside can be the NVR of request video data, also can be other third-party platforms.
Particularly, in the present embodiment, the described video data transmission device based on data link layer also comprises:
Customized module, for automatically generating described video data transmission instruction according to the transmission of video custom strategies customized in advance;
Or,
Acquisition module, for obtaining described video data transmission instruction from outside.
A kind of video data transmission device based on data link layer that another embodiment of the present invention provides, it is deployed on NVR, and it comprises:
NVR Data Link Layer Module, obtain video data for the IP camera data link layer from corresponding IP video camera and be passed to NVR application layer module, wherein, described video data directly to be transmitted to IP camera data link layer according to video data transmission instruction by the IP camera application layer of IP video camera provides;
NVR application layer module, for obtaining video data.
Similarly, at IP video camera end, the prior art that the processing mode that IP camera application layer obtains video data according to video data transmission instruction is grasped for those skilled in the art.
The prior art that the information processing manner that video data is directly passed to IP camera data link layer by its IP camera application layer is grasped for those skilled in the art.
At NVR end, the prior art that the information processing manner that video data is directly passed to NVR application layer module by its NVR Data Link Layer Module is grasped for those skilled in the art.
The prior art that NVR application layer module those skilled in the art such as process, application to described video data grasp.
Preferably, video data is passed to the NVR Data Link Layer Module of corresponding NVR by the IP camera data link layer module of IP video camera based on data link layer protocol and according to the MAC Address of target NVR.
Preferably, described video data transmission instruction is configured to automatically be generated by the transmission of video custom strategies of IP video camera self, or obtains from outside, and such as, described outside can be the NVR of request video data, also can be other third-party platforms.
The embodiment of the present invention additionally provides a kind of video-frequency data transmission system based on data link layer, and it comprises:
IP video camera, video data is directly passed to IP camera data link layer according to video data transmission instruction by its IP camera application layer, and described video data is passed to the NVR data link layer of corresponding NVR by IP camera data link layer based on data link layer protocol;
NVR, its NVR data link layer receives the video data that IP video camera sends, and by NVR data link layer, described video data is directly passed to NVR application layer.
In the present embodiment, described video data is passed to the NVR data link layer of corresponding NVR by the IP camera data link layer of IP video camera based on data link layer protocol and according to the hardware address MAC Address of target NVR.
Preferably, described video data transmission instruction is configured to automatically be generated by the transmission of video custom strategies of IP video camera self, or is obtained from outside by IP camera application layer, such as, described outside can be the NVR of request video data, also can be other third-party platforms.
At IP video camera end, the prior art that the processing mode that IP camera application layer obtains video data according to video data transmission instruction is grasped for those skilled in the art.
The prior art that the information processing manner that video data is directly passed to IP camera data link layer by its IP camera application layer is grasped for those skilled in the art.
At NVR end, the prior art that the information processing manner that video data is directly passed to NVR application layer by its NVR data link layer is grasped for those skilled in the art.
The prior art that NVR application layer those skilled in the art such as process, application to described video data grasp.
The foregoing is only the preferred embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every utilize specification of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.