The invention discloses a UPnP network port mapping method, an electronic device, a network system, and a storage medium, wherein the method includes obtaining a mapping result of an intranet device, sending a connection request to the intranet device according to the mapping result, and sending a mapping instruction to the intranet device if the connection to the intranet device fails. By sending connection requests to intranet devices according to the mapping results, and sending mapping instructions to intranet devices when the connection fails, the port mapping between intranet devices and gateway devices can be re-established; thus the validity of the port mapping between intranet devices and gateway devices can be detected in real time, and the port mapping can be performed. Re-establishing port mapping between control intranet devices and gateway devices after firing failure enables intranet devices and their users to make maximum use of the UPnP network environment.
【技术实现步骤摘要】
UPnP网络端口映射方法、电子设备、网络系统和存储介质
本专利技术涉及网络技术,尤其涉及UPnP网络端口映射方法、电子设备、网络系统和存储介质。
技术介绍
UPnP(UniversalPlugandPlay,通用即插即用),是针对智能家电、无线设备以及各种外观尺寸的个人电脑的普遍对等(peer-to-peer)网络连接而设计的一种架构,旨在为家庭、小型企业、公共场所中或连接到互联网的ad-hoc网或未管理网络提供易于使用、灵活且基于标准的连接。UPnP的使用场景如图1所示,包含以下三个角色:内网设备:是指一般放在家庭局域网内的设备,比如用户的NAS、机顶盒或PC等;UPnPIGD:是指UPnP网关设备,比如:路由器、光猫等支持UPnP功能的网络设备;外网设备:是指通过UPnPIGD的WAN口访问内网设备的网络设备,例如服务器或者其他具有网络连接功能的载有软件程序的装置。三个角色之间的交互过程如下:1、内网设备先和UPnPIGD申请端口映射,如图1所示,内网设备的IP为192.168.1.100,端口为20000;UPnP端口映射成功后,在UPnPIGD上映射至6728端口。2、外网设备如果想访问内网设备,网络包的目的地址为UPnPIGD的外网IP地址,如图1所示,为110.85.66.205,对应端口为6728。3、UPnPIGD收到外网设备的请求后,会转发网络包到内网的IP地址:端口为192.168.1.100:20000的内网设备中。但是在实际应用中,并非所有的路由器等网关设备都支持UPnP功能,或者不是所有支持UPnP的网关设备都打开了UPnP功能。 ...
【技术保护点】
1.UPnP网络端口映射方法,其特征在于,包括以下步骤:获取内网设备的映射结果;根据所述映射结果向所述内网设备发送连接请求;若连接所述内网设备失败,则向所述内网设备发送映射指令。
【技术特征摘要】
1.UPnP网络端口映射方法,其特征在于,包括以下步骤:获取内网设备的映射结果;根据所述映射结果向所述内网设备发送连接请求;若连接所述内网设备失败,则向所述内网设备发送映射指令。2.如权利要求1所述的UPnP网络端口映射方法,其特征在于:所述根据所述映射结果向所述内网设备发送连接请求,具体为:通过网关设备向所述内网设备发送连接请求,所述连接请求是根据所述映射结果得到的。3.如权利要求2所述的UPnP网络端口映射方法,其特征在于:所述若连接所述内网设备失败,则向所述内网设备发送映射指令,具体为:若接收到网关设备发送的连接失败信息,则向所述内网设备发送映射指令。4.如权利要求3所述的UPnP网络端口映射方法,其特征在于:所述映射结果包括所述内网设备映射的外网IP和外网端口。5.如权利要求3所述的UPnP网络端口映射方法,其特征在于:所述根据所述映射结果向所述内网设备发送连接请求,具体为:周期性的根据所述映射结果向所述内网设备发送连接请求。6.如权利要求5所述的UPnP网络端口映射方法,其特征在于:所述内网设备包括探测单元和第一协议单元;所述获取内网设备的映射结果,具体为:接收所述内网设备的探测单元发送的映射结果。7.如权利要求6所述的UPnP网络端口映射方法,其特征在于:所述根据所述映射结果向所述内网设备发送连接请求,具体为:通过网关设备向所述内网设备的第一协议单元发送连接请求。8.如权利要求7所述的UPnP网络端口映射方法,...
【专利技术属性】
技术研发人员:韩少阳,
申请(专利权)人:深圳市网心科技有限公司,
类型:发明
国别省市:广东,44
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。