Summary of the invention
The invention provides a kind of transmission method and equipment of video data, public network equipment can be checked the video data of private network device, reduces the performance pressure of gateway device.
In order to achieve the above object, the invention provides a kind of transmission method of video data, be applied to the situation of the video data in the public network device request private network device, the gateway device that connects public network and private network is safeguarded the corresponding relation of each private network device identification information and IP address information, and this method may further comprise the steps:
Described gateway device receives the request message of checking the private network device video data from described public network equipment, carries the identification information of described private network device in the described request message;
Described gateway device is determined the IP address information of described private network device according to the described corresponding relation of described identification information and maintenance, and to notify described private network device according to described IP address information be that destination address sends video data with the IP address of described public network equipment;
Described gateway device receives the video data that described private network device sends, and the purpose IP address of this video data is the IP address of described public network equipment;
Described gateway device is transmitted described video data and is given described public network equipment.
This method further comprises: described gateway device is determined the IP address information of described private network device according to the described corresponding relation of described identification information and maintenance, and to notify described private network device according to described IP address information be that source IP address sends video data with the IP address of described gateway device.
Described gateway device is transmitted described video data and is given described public network equipment, specifically comprise: the purpose IP address that described gateway device is judged described video data for before the source IP address of the request message that receives and/or the port that receives this video data during for the port of the connection private network device determined, then this video data directly is transmitted to described public network equipment from the public network interface.
The corresponding relation of described each private network device identification information and IP address information is based on that the UPnP agreement sets up: described gateway device receives that each private network device reports based on the UPnP agreement self identification information, IP address information, and preserve the corresponding relation of each private network device identification information and IP address information, wherein, self identification information, the IP address information that report based on the UPnP agreement of described each private network device be each private network device receive report after the notice that gateway device sends based on the UPnP agreement or each private network device self initiatively report.
Also safeguard the first code stream bandwidth information and first video code model of each private network device current video data in the corresponding relation of described gateway device, also carry the second code stream bandwidth information and second video code model of described public network equipment expectation in the described request message; This method further comprises:
When the first code stream bandwidth information identical with the second code stream bandwidth information, and when first video code model is identical with second video code model, described gateway device sends to described private network device according to the IP address information of described private network device with the IP address of described public network equipment, is that destination address sends video data by described private network device with the IP address of described public network equipment;
And/or first video code model different with the second code stream bandwidth information and second video code model are not simultaneously when the first code stream bandwidth information, described gateway device is according to the IP address information of the described private network device IP address with described public network equipment, the second code stream bandwidth information, second video code model sends to described private network device, by described private network device the code stream bandwidth information and the video code model of current video data is adjusted into the described second code stream bandwidth information and second video code model, and is that destination address sends adjusted video data with the IP address of described public network equipment.
The first code stream bandwidth information and/or first video code model different with the second code stream bandwidth information and second video code model are not simultaneously, described method also comprises: described gateway device is updated to the second code stream bandwidth information with the first code stream bandwidth information of safeguarding in the corresponding relation, and first video code model is updated to second video code model.
The corresponding relation of the identification information of each private network device, IP address information, the first code stream bandwidth information and first video code model is based on the foundation of UPnP agreement; Described gateway device receives that each private network device reports based on the UPnP agreement self identification information, IP address information, the first code stream bandwidth information and first video code model, and preserve the corresponding relation of identification information, IP address information, the first code stream bandwidth information and first video code model of each private network device; Wherein, self identification information, IP address information, the first code stream bandwidth information and first video code model that report based on the UPnP agreement of described each private network device be each private network device receive report after the notice that gateway device sends based on the UPnP agreement or each private network device self initiatively report.
Described method further comprises: described gateway device is transmitted the video data of described private network device to behind the described public network equipment, for described private network device the user mode sign is set in corresponding relation;
If described gateway device receives the request message of checking described private network device video data that other public network equipment send again, when inquiring after described private network device is provided with user mode sign, described gateway device sends to described private network device according to the IP address information of described private network device with the IP address of described public network equipment, is that destination address send video data according to the current code stream bandwidth information of using and video code model with the IP address of described public network equipment by described private network device.
A kind of gateway device that connects public network and private network is applied to the situation of the video data in the public network device request private network device, and described gateway device comprises:
Maintenance module is used to safeguard the corresponding relation of each private network device identification information and IP address information;
First receiver module is used to receive the request message of checking the private network device video data from described public network equipment, carries the identification information of described private network device in the described request message;
Determination module is used for determining according to the described corresponding relation of described identification information and maintenance the IP address information of described private network device;
First sending module, being used for notifying described private network device according to described IP address information is that destination address sends video data with the IP address of described public network equipment;
Second receiver module is used to receive the video data that described private network device sends, and the purpose IP address of this video data is the IP address of described public network equipment;
Second sending module is used to transmit described video data and gives described public network equipment.
Described first sending module, also being used for notifying described private network device according to described IP address information is that source IP address sends video data with the IP address of described gateway device.
Described second sending module, specifically be used for when the purpose IP address of judging described video data for before the source IP address of the request message that receives and/or the port that receives this video data during for the port of the connection private network device determined, then this video data directly is transmitted to described public network equipment from the public network interface.
Each the private network device identification information safeguarded in the described maintenance module and the corresponding relation of IP address information are based on the foundation of UPnP agreement, be specially: self identification information, the IP address information that receives that each private network device reports based on the UPnP agreement, and preserve the corresponding relation of each private network device identification information and IP address information, wherein, self identification information, the IP address information that report based on the UPnP agreement of described each private network device be each private network device receive report after the notice that gateway device sends based on the UPnP agreement or each private network device self initiatively report.
Also carry the second code stream bandwidth information and second video code model of described public network equipment expectation in the described request message; Described maintenance module also is used for safeguarding at corresponding relation the first code stream bandwidth information and first video code model of each private network device current video data;
Described first sending module, it is identical with the second code stream bandwidth information specifically to be used for working as the first code stream bandwidth information, and when first video code model is identical with second video code model, according to the IP address information of described private network device the IP address of described public network equipment being sent to described private network device, is that destination address sends video data by described private network device with the IP address of described public network equipment;
And/or first video code model different with the second code stream bandwidth information and second video code model are not simultaneously when the first code stream bandwidth information, according to the IP address information of described private network device IP address with described public network equipment, the second code stream bandwidth information, second video code model sends to described private network device, by described private network device the code stream bandwidth information and the video code model of current video data is adjusted into the described second code stream bandwidth information and second video code model, and is that destination address sends adjusted video data with the IP address of described public network equipment.
The corresponding relation of the identification information of each private network device of safeguarding in the described maintenance module, IP address information, the first code stream bandwidth information and first video code model is based on the foundation of UPnP agreement; Be specially: self identification information, IP address information, the first code stream bandwidth information and first video code model that receives that each private network device reports based on the UPnP agreement, and preserve the corresponding relation of identification information, IP address information, the first code stream bandwidth information and first video code model of each private network device; Wherein, self identification information, IP address information, the first code stream bandwidth information and first video code model that report based on the UPnP agreement of described each private network device be each private network device receive report after the notice that gateway device sends based on the UPnP agreement or each private network device self initiatively report.
Described maintenance module, the video data that also is used to transmit described private network device are provided with user mode sign for described private network device to behind the described public network equipment in corresponding relation;
Described first sending module, if specifically be used for receiving again the request message of checking described private network device video data that other public network equipment send, when inquiring after described private network device is provided with user mode sign, according to the IP address information of described private network device the IP address of described public network equipment being sent to described private network device, is that destination address send video data according to the current code stream bandwidth information of using and video code model with the IP address of described public network equipment by described private network device.
Compared with prior art, the present invention has the following advantages at least: the video data of private network device does not need passing through NAT, has reduced the pressure of gateway device, simplifies forwarding process, can improve forward efficiency on the whole.
Embodiment
The present invention proposes a kind of transmission method of video data, and this method is applied to the situation of the video data in the public network device request private network device.Below in conjunction with accompanying drawing, specific embodiments of the present invention is described in detail.
With Fig. 1 is the grid of reference illustraton of model, private network device is that example describes with IPC in Fig. 1, certainly IPC only is an example, can also be that other have the equipment that obtains or preserve video capability, and public network equipment promptly refers to ask the subscriber equipment of video data in Fig. 1.As shown in Figure 2, this method comprises:
Step 201, the gateway device that connects public network and private network is safeguarded the corresponding relation of each IPC equipment mark information and IP address information.
Preferably, consider user's impression, in the process of carrying out video Data Transmission, the user can also own selection video data information (as parameters such as the code stream bandwidth information of video data, video code model, luminance videos), and IPC need be according to the video data information encapsulate video data of user's selection, to satisfy user's demand.In order to realize above-mentioned preferred process, gateway device also can be safeguarded the video data information of each IPC equipment in this corresponding relation.
In the present embodiment, in order on gateway device, to safeguard the relevant information of each IPC equipment, can use UPnP (Universal Plug and Play, UPnP) agreement, promptly gateway device utilizes the UPnP agreement to obtain the code stream bandwidth information (being the code stream amount of bandwidth) of each IPC equipment mark information, address information, video data and video code model etc.
UPnP protocol architecture schematic diagram as shown in Figure 3, the TCP of the bottom (Transmission ControlProtocol, transmission control protocol)/the IP agreement is the basis of UPnP agreement, be structured on the ICP/IP protocol is HTTP (Hyper Text Transfer Protocol, HTML (Hypertext Markup Language)) agreement and mutation thereof, all UPnP message all are encapsulated among the http protocol.In the UPnP agreement, different classes of application uses different upper-layer protocols to control; For example, SSDP (Simple Service DiscoveryProtocol, SSDP) has defined the UPnP control point and how to have found how UPnP service, UPnP equipment on the network issue the service that self can provide to network.
Based on above-mentioned UPnP agreement, when gateway device and each IPC equipment support UPnP protocol frame, gateway device is as the role at control point, IPC is as the role of node, can be undertaken alternately by the SSDP agreement of UPnP in the IPC device start stage, and on gateway device, safeguard the relevant information of each IPC equipment.
Concrete, in the addressing and discovery phase process of UPnP, IPC equipment can be by DHCP (Dynamic Host Configuration Protocol after being linked into network, DynamicHost is provided with agreement) or the manual static configuration mode obtain the IP address, after IPC equipment obtains the IP address, provide the relevant information of self to gateway device; Same, gateway device also can obtain self information of interest from IPC equipment by the SSDP agreement.
Therefore, gateway device can be set up the corresponding relation of each private network device identification information and IP address information based on the UPnP agreement; Perhaps, set up the corresponding relation of each private network device identification information, IP address information, code stream bandwidth information and video code model based on the UPnP agreement; Two kinds of schemes to set up process similar, just report the difference of parameter, be that example is elaborated with the latter's the process of setting up.
Concrete, gateway device receives that each private network device reports based on the UPnP agreement self identification information, IP address information, the first code stream bandwidth information and first video code model, and preserve the corresponding relation of identification information, IP address information, the first code stream bandwidth information and first video code model of each private network device; Each private network device reports based on the UPnP agreement self identification information, IP address information, the first code stream bandwidth information and first video code model be each private network device receive report after the notice that gateway device sends based on the UPnP agreement or each private network device self initiatively report.
In the practical application, gateway device can write down and safeguard each IPC equipment mark information (as the IPC device name), IP address by the mode of list item, and parameters such as code stream bandwidth information, video code model are as shown in table 1; As IPC equipment exit network or relevant information change after, based on the UPnP agreement, gateway device can in time be known these situations, and maintenance list item in view of the above.
Table 1
Step 202, gateway device receives the request message of checking IPC equipment video data (as the HTTP request message) from subscriber equipment, carries IPC equipment mark information in this request message.
Preferably, consider user's impression, in the process of carrying out video Data Transmission, but user self selects video data information, so goes back the code stream bandwidth information and the video code model of the expectation of portability subscriber equipment in this request message.In order to distinguish conveniently, with record in the table 1 be called the first code stream bandwidth information and first video code model, be called the second code stream bandwidth information and second video code model with what carry in the request message.
Step 203, gateway device be according to identification information and the corresponding relation of safeguarding the in advance address information of determining to wait to check IPC equipment, and be that destination address sends video data with the user device IP address according to this address information notice IPC equipment.For example, when knowing that identification information is IPC-1, according to table 1 as can be known address information be 10.0.0.1, then the pairing IPC equipment of gateway device notice 10.0.0.1 is that destination address sends video data with the user device IP address.
Preferably, when carrying the second code stream bandwidth information and second video code model in the request message, if the first code stream bandwidth information is identical with the second code stream bandwidth information, and first video code model is identical with second video code model, then gateway device (is a user device IP address with the source IP address of request message, be designated as IP_USER) the pairing IPC equipment of notice 10.0.0.1 is that destination address sends video data with IP_USER by IPC equipment.
If the first code stream bandwidth information is different with the second code stream bandwidth information and/or first video code model is different with second video code model, then gateway device is notified to the pairing IPC equipment of 10.0.0.1 with the second code stream bandwidth information, second video code model, IP_USER, by IPC equipment the code stream bandwidth information and the video code model of current video data is adjusted into the second code stream bandwidth information and second video code model, and is that destination address sends adjusted video data with IP_USER.
Concrete, in the description and the control stage of UPnP agreement, gateway device can be controlled IPC equipment, by send the relevant order of URL operation requests to IPC equipment, can adjust the information such as frequency coded format, code stream amount of bandwidth of IPC equipment as gateway device according to the actual requirements.Therefore, after gateway device sends to IPC equipment by the UPnP agreement with the second code stream bandwidth information and second video code model, IPC equipment can be according to the second code stream bandwidth information and the second video code model encapsulate video data, and are the video data that destination address sends this encapsulation with IP_USER.
Among the present invention, and/or first video code model different with the second code stream bandwidth information and second video code model are not simultaneously when the first code stream bandwidth information, the first code stream bandwidth information that this gateway device also needs to safeguard in the corresponding relation with table 1 is updated to the second code stream bandwidth information, and first video code model is updated to second video code model.
It should be noted that, consider in the process that video data transmits on public network, if being furnished with certain strategy, the routing device on the public network to check source IP address, if find that the source IP address of video data is a private net address, then the routing device on the public network can abandon video data, needs therefore to guarantee that the source IP address of video data is a public network address.Be that destination address sends in the process of video data with the user device IP address at notice IPC equipment promptly, it is that source IP address sends video data with the IP address of gateway device that gateway device also can be notified IPC equipment.
Step 204, IPC equipment are that destination address sends video data with IP_USER.Preferential, the source IP address of this video data can be the public network IP address of gateway device.
Concrete, if the first code stream bandwidth information is identical with the second code stream bandwidth information and first video code model is identical with second video code model, then IPC equipment directly is that destination address sends video data with IP_USER; Otherwise IPC equipment is with the second code stream bandwidth information and the second video code model encapsulate video data, and is the video data after destination address sends encapsulation with IP_USER.
Step 205, the destination address that gateway device receives from IPC equipment is the video data of IP_USER, and gives subscriber equipment by public network interface forwarding video data.
Concrete, when the purpose IP address of video data for before the source IP address (being IP_USER) of the request message that receives and/or the port that receives this video data during for the port of the connection IPC equipment determined, without the NAT conversion, directly give subscriber equipment from public network interface forwarding video data.
Need to prove, after giving subscriber equipment by public network interface forwarding video data, gateway device can also be configured such that the FLAG field in the table 1 that with status indicator (as *) show this list item in user mode, existing subscriber's equipment is at the video data of checking IPC equipment.
In this case, if gateway device receives the request message of checking this IPC equipment video data that other public network equipment send again, when inquiring after this IPC equipment is provided with user mode sign, even the code stream bandwidth information in the request message and video code model and table 1 is inconsistent at this moment, do not reinform IPC equipment change code stream amount of bandwidth and video code model yet, gateway device directly sends to IPC equipment according to the IP address information of IPC equipment with the IP address of other public network equipment, is that destination address send video data according to the current code stream bandwidth information of using and video code model with the IP address of other public network equipment by IPC equipment.
Based on the inventive concept same with said method, the invention allows for a kind of gateway device that connects public network and private network, be applied to the situation of the video data in the public network device request private network device, as shown in Figure 4, this gateway device comprises:
Maintenance module 41 is used to safeguard the corresponding relation of each private network device identification information and IP address information;
First receiver module 42 is used to receive the request message of checking the private network device video data from described public network equipment, carries the identification information of described private network device in the described request message;
Determination module 43 is used for determining according to the described corresponding relation of described identification information and maintenance the IP address information of described private network device;
First sending module 44, being used for notifying described private network device according to described IP address information is that destination address sends video data with the IP address of described public network equipment;
Second receiver module 45 is used to receive the video data that described private network device sends, and the purpose IP address of this video data is the IP address of described public network equipment;
Second sending module 46 is used to transmit described video data and gives described public network equipment.
Described first sending module 44, also being used for notifying described private network device according to described IP address information is that source IP address sends video data with the IP address of described gateway device.
Described second sending module 46, specifically be used for when the purpose IP address of judging described video data for before the source IP address of the request message that receives and/or the port that receives this video data during for the port of the connection private network device determined, then this video data directly is transmitted to described public network equipment from the public network interface.
Each the private network device identification information safeguarded in the described maintenance module 41 and the corresponding relation of IP address information are based on the foundation of UPnP agreement, be specially: self the identification information that receives that each private network device reports based on the UPnP agreement, the IP address information, and preserve the corresponding relation of each private network device identification information and IP address information, wherein, self the identification information that reports based on the UPnP agreement of described each private network device, the IP address information be each private network device receive report after the notice that gateway device sends based on the UPnP agreement or each private network device self initiatively report.
Also carry the second code stream bandwidth information and second video code model of described public network equipment expectation in the described request message; Described maintenance module 41 also is used for safeguarding at corresponding relation the first code stream bandwidth information and first video code model of each private network device current video data;
Described first sending module 44, it is identical with the second code stream bandwidth information specifically to be used for working as the first code stream bandwidth information, and when first video code model is identical with second video code model, according to the IP address information of described private network device the IP address of described public network equipment being sent to described private network device, is that destination address sends video data by described private network device with the IP address of described public network equipment;
And/or first video code model different with the second code stream bandwidth information and second video code model are not simultaneously when the first code stream bandwidth information, according to the IP address information of described private network device IP address with described public network equipment, the second code stream bandwidth information, second video code model sends to described private network device, by described private network device the code stream bandwidth information and the video code model of current video data is adjusted into the described second code stream bandwidth information and second video code model, and is that destination address sends adjusted video data with the IP address of described public network equipment.
The corresponding relation of identification information, IP address information, the first code stream bandwidth information and first video code model of each private network device of safeguarding in the described maintenance module 41 is based on the foundation of UPnP agreement; Be specially: self identification information, IP address information, the first code stream bandwidth information and first video code model that receives that each private network device reports based on the UPnP agreement, and preserve the corresponding relation of identification information, IP address information, the first code stream bandwidth information and first video code model of each private network device; Wherein, self identification information, IP address information, the first code stream bandwidth information and first video code model that report based on the UPnP agreement of described each private network device be each private network device receive report after the notice that gateway device sends based on the UPnP agreement or each private network device self initiatively report.
Described maintenance module 41, the video data that also is used to transmit described private network device are provided with user mode sign for described private network device to behind the described public network equipment in corresponding relation;
Described first sending module 44, if specifically be used for receiving again the request message of checking described private network device video data that other public network equipment send, when inquiring after described private network device is provided with user mode sign, according to the IP address information of described private network device the IP address of described public network equipment being sent to described private network device, is that destination address send video data according to the current code stream bandwidth information of using and video code model with the IP address of described public network equipment by described private network device.
Wherein, each module of apparatus of the present invention can be integrated in one, and also can separate deployment.Above-mentioned module can be merged into a module, also can further split into a plurality of submodules.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by hardware, also can realize by the mode that software adds necessary general hardware platform.Based on such understanding, technical scheme of the present invention can embody with the form of software product, it (can be CD-ROM that this software product can be stored in a non-volatile memory medium, USB flash disk, portable hard drive etc.) in, comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
It will be appreciated by those skilled in the art that accompanying drawing is the schematic diagram of a preferred embodiment, module in the accompanying drawing or flow process might not be that enforcement the present invention is necessary.
It will be appreciated by those skilled in the art that the module in the device among the embodiment can be distributed in the device of embodiment according to the embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from present embodiment.The module of the foregoing description can be merged into a module, also can further split into a plurality of submodules.
The invention described above sequence number is not represented the quality of embodiment just to description.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.