[go: up one dir, main page]

CN105634810A - Method, system and accessing device for accessing universal plug-and-play device - Google Patents

Method, system and accessing device for accessing universal plug-and-play device Download PDF

Info

Publication number
CN105634810A
CN105634810A CN201511026093.6A CN201511026093A CN105634810A CN 105634810 A CN105634810 A CN 105634810A CN 201511026093 A CN201511026093 A CN 201511026093A CN 105634810 A CN105634810 A CN 105634810A
Authority
CN
China
Prior art keywords
address
access
upnp
upnp device
connection
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.)
Granted
Application number
CN201511026093.6A
Other languages
Chinese (zh)
Other versions
CN105634810B (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.)
TCL Corp
Original Assignee
TCL Corp
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 TCL Corp filed Critical TCL Corp
Priority to CN201511026093.6A priority Critical patent/CN105634810B/en
Publication of CN105634810A publication Critical patent/CN105634810A/en
Application granted granted Critical
Publication of CN105634810B publication Critical patent/CN105634810B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0806Configuration setting for initial configuration or provisioning, e.g. plug-and-play
    • H04L41/0809Plug-and-play configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明适用于通信领域,提供了一种访问通用即插即用设备的方法和系统、访问设备。所述方法包括:访问设备从服务器获取UPnP设备的设备信息;如果访问设备从设备信息中未获取到第一IP地址,则根据设备信息中的设备号获取对应的第二IP地址,并通过第二IP地址建立与UPnP设备的访问连接,所述第一IP地址是指用于通过广域网访问所述UPnP设备的IP地址,所述第二IP地址是指用于与所述UPnP设备建立点对点通信的IP地址。在UPnP设备连接在二级路由或者更低级别路由的情况下,UPnP设备通常没有第一IP地址,因此也不能向服务器上传该第一IP地址,此时,访问设备可通过第二IP地址来建立与UPnP设备的访问连接。

The invention is applicable to the field of communication, and provides a method and system for accessing a universal plug and play device, and an access device. The method includes: the access device obtains the device information of the UPnP device from the server; if the access device does not obtain the first IP address from the device information, obtains the corresponding second IP address according to the device number in the device information, and passes the first IP address Two IP addresses establish an access connection with the UPnP device, the first IP address refers to the IP address used to access the UPnP device through the wide area network, and the second IP address refers to the IP address used to establish point-to-point communication with the UPnP device IP address. When a UPnP device is connected to a second-level route or a lower-level route, the UPnP device usually does not have a first IP address, so it cannot upload the first IP address to the server. At this time, the access device can use the second IP address. Establish an access connection with a UPnP device.

Description

一种访问通用即插即用设备的方法和系统、访问设备Method and system for accessing universal plug and play device, access device

技术领域technical field

本发明属于通信领域,尤其涉及一种访问通用即插即用设备的方法和系统、访问设备。The invention belongs to the communication field, and in particular relates to a method and system for accessing a universal plug and play device, and an access device.

背景技术Background technique

现在的网络应用中,通用即插即用(UniversalPlugandPlay,简称UPnP)技术运用的场景越来越多;比如家里设置有一个UPnP设备,该UPnP设备处于在一级路由下(即设备向上最多只连接一个路由器),这种情况下,利用UPnP服务,访问设备可通过该一级路由成功访问该UPnP设备。但是如果UPnP设备是连接在二级路由或者更低级别路由的,这时访问设备无法通过UPnP服务访问到UPnP设备的。In current network applications, Universal Plug and Play (UPnP) technology is used in more and more scenarios; In this case, using the UPnP service, the access device can successfully access the UPnP device through the first-level route. However, if the UPnP device is connected to a second-level route or a lower-level route, the access device cannot access the UPnP device through the UPnP service.

发明内容Contents of the invention

鉴于此,本发明提供一种访问通用即插即用设备的方法和系统、访问设备,以使得即使UPnP设备连接在二级路由或者更低级别路由的情况下,访问设备仍可建立与UPnP设备的访问连接。In view of this, the present invention provides a method and system for accessing UPnP devices, and an access device, so that even if the UPnP device is connected to a second-level route or a lower-level route, the access device can still establish a connection with the UPnP device. access connection.

一方面,本发明提供一种访问UPnP设备的方法,所述方法包括:In one aspect, the present invention provides a method for accessing a UPnP device, the method comprising:

访问设备从服务器获取所述通用即插即用UPnP设备的设备信息;The access device obtains the device information of the Universal Plug and Play UPnP device from the server;

如果所述访问设备从所述设备信息中未获取到第一网络之间互连的协议IP地址,所述访问设备根据所述设备信息中的设备号获取对应的第二IP地址,并通过所述第二IP地址建立与所述UPnP设备的访问连接;If the access device does not obtain the IP address of the interconnection protocol between the first networks from the device information, the access device obtains the corresponding second IP address according to the device number in the device information, and uses the The second IP address establishes an access connection with the UPnP device;

其中,所述第一IP地址是指用于通过广域网访问所述UPnP设备的IP地址,所述第二IP地址是指用于与所述UPnP设备建立点对点P2P通信的IP地址。Wherein, the first IP address refers to an IP address used to access the UPnP device through a wide area network, and the second IP address refers to an IP address used to establish point-to-point P2P communication with the UPnP device.

另一方面,本发明提供一种访问设备,所述访问设备包括:In another aspect, the present invention provides an access device, and the access device includes:

信息获取单元,用于访问设备从服务器获取所述UPnP设备的设备信息;An information obtaining unit, configured for the access device to obtain the device information of the UPnP device from the server;

访问建立单元,用于如果所述访问设备从所述设备信息中未获取到第一网络之间互连的协议IP地址,所述访问设备根据所述设备信息中的设备号获取对应的第二IP地址,并通过所述第二IP地址建立与所述UPnP设备的访问连接,其中,所述第一IP地址是指用于通过广域网访问所述UPnP设备的IP地址,所述第二IP地址是指用于与所述UPnP设备建立点对点P2P通信的IP地址。An access establishment unit, configured to obtain, according to the device number in the device information, the corresponding second IP address, and establish an access connection with the UPnP device through the second IP address, wherein the first IP address refers to the IP address used to access the UPnP device through a wide area network, and the second IP address refers to the IP address used to access the UPnP device through a wide area network, and the second IP address refers to the IP address used to access the UPnP device through a wide area network, and the second IP address establishes an access connection with the UPnP device. Refers to the IP address used to establish point-to-point P2P communication with the UPnP device.

另一方面,本发明提供一种访问通用即插即用设备的系统,所述系统包括:In another aspect, the present invention provides a system for accessing UPnP devices, the system comprising:

UPnP设备、服务器以及访问设备;UPnP devices, servers and access devices;

所述UPnP设备,用于检测当前连接的路由器WAN口的IP地址,如果所述WAN口的IP地址属于TCP/IP协议中的局域网地址,则向服务器上报包含所述UPnP设备的设备号的设备信息;如果所述WAN口的IP地址不属于局域网地址,则向服务器上报包含所述WAN口的IP和所述UPNPUPnP设备的设备号的设备信息;The UPnP device is used to detect the IP address of the currently connected router WAN port, if the IP address of the WAN port belongs to the local area network address in the TCP/IP protocol, then report to the server the device containing the device number of the UPnP device Information; if the IP address of the WAN port does not belong to the LAN address, then report to the server the device information including the IP of the WAN port and the device number of the UPNP UPnP device;

所述服务器,用于存储所述UPnP设备上报的所述设备信息;The server is configured to store the device information reported by the UPnP device;

所述访问设备,用于从所述服务器获取所述通用即插即用UPnP设备的设备信息,所述设备信息包括设备号;如果所述访问设备从所述设备信息中未获取到第一网络之间互连的协议IP地址,则根据所述设备信息中的设备号获取对应的第二IP地址,并通过所述第二IP地址建立与所述UPnP设备的访问连接;其中,所述第一IP地址是指用于通过广域网访问所述UPnP设备的IP地址,所述第二IP地址是指用于与所述UPnP设备建立点对点P2P通信的IP地址。The access device is configured to obtain the device information of the Universal Plug and Play UPnP device from the server, the device information includes a device number; if the access device does not obtain the first network from the device information The IP address of the interconnection protocol, then obtain the corresponding second IP address according to the device number in the device information, and establish an access connection with the UPnP device through the second IP address; wherein, the first An IP address refers to an IP address used to access the UPnP device through a wide area network, and the second IP address refers to an IP address used to establish point-to-point P2P communication with the UPnP device.

本发明与现有技术相比存在的有益效果是:在UPnP设备连接在二级路由或者更低级别路由的情况下,UPnP设备通常没有第一IP地址,因此也不能向服务器上传该第一IP地址,此时,访问设备可通过第二IP地址来建立与UPnP设备的访问连接。Compared with the prior art, the present invention has the beneficial effects that: when a UPnP device is connected to a second-level route or a lower-level route, the UPnP device usually does not have a first IP address, so the first IP address cannot be uploaded to the server. In this case, the access device can establish an access connection with the UPnP device through the second IP address.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the descriptions of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only of the present invention. For some embodiments, those of ordinary skill in the art can also obtain other drawings based on these drawings without paying creative efforts.

图1是本发明实施例提供的访问UPnP设备的方法的一种示意性流程图;FIG. 1 is a schematic flowchart of a method for accessing a UPnP device provided by an embodiment of the present invention;

图2是本发明实施例提供的访问UPnP设备的方法的一种示意性流程图;FIG. 2 is a schematic flowchart of a method for accessing a UPnP device provided by an embodiment of the present invention;

图3是本发明实施例提供的访问设备的组成结构图;FIG. 3 is a structural diagram of an access device provided by an embodiment of the present invention;

图4是本发明实施例提供的访问UPnP设备的系统的组成结构图。Fig. 4 is a structural diagram of a system for accessing UPnP devices provided by an embodiment of the present invention.

具体实施方式detailed description

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

为了说明本发明所述的技术方案,下面通过具体实施例来进行说明。In order to illustrate the technical solutions of the present invention, specific examples are used below to illustrate.

本发明实施例适用的场景中,包含访问设备、服务器、路由器和UPnP设备;访问设备可以是期望通过网络访问UPnP设备的任何可通信设备;其中服务器仅是本发明实施例的举例,可以用其它具有处理能力和存储能力的设备替换该服务器;对于路由器和UPnP设备这两种设备的定义,可参见通信领域的官方定义,当然,此处不限定路由器和UPnP设备的具体类型以及具体型号。该UPnP设备可能连接在一级路由下,也可能在在二级路由或者更低级路由下;现有技术中,如果UPnP设备是连接在二级路由或者更低级别路由的,这时访问设备通过UPnP服务是访问不到UPnP设备的;但在本发明实施例中,会采用P2P通信的方式来建立访问设备与UPnP设备的访问连接;本发明实施例中所述的访问连接是指使用UPnP设备的IP地址建立与所述UPnP设备的通信连接。The applicable scene of the embodiment of the present invention includes access device, server, router and UPnP device; the access device can be any communicable device that expects to access the UPnP device through the network; wherein the server is only an example of the embodiment of the present invention, and other Devices with processing and storage capabilities replace the server; for the definitions of routers and UPnP devices, refer to the official definitions in the field of communications. Of course, the specific types and models of routers and UPnP devices are not limited here. The UPnP device may be connected to a first-level route, or a second-level route or a lower-level route; in the prior art, if the UPnP device is connected to a second-level route or a lower-level route, then the access device passes The UPnP service cannot access the UPnP device; but in the embodiment of the present invention, the access connection between the access device and the UPnP device will be established by means of P2P communication; the access connection described in the embodiment of the present invention refers to the use of the UPnP device The IP address establishes a communication connection with the UPnP device.

如果UPnP设备连接在二级路由或者更低级别路由下,访问设备无法通过广域网IP地址访问到UPnP设备的原因可能是以下两种。If the UPnP device is connected to a second-level route or a lower-level route, the reason why the access device cannot access the UPnP device through the WAN IP address may be the following two reasons.

第一种,UPnP设备获取其具有的广域网(WideAreaNetwork,简称WAN)口的IP地址,如果获取到的所述IP地址属于TCP/IP协议中的局域网地址,则判定UPnP设备连接在非一级路由器下(即UPnP设备连接在二级路由或者更低级别路由下),UPnP设备不向服务器上报该IP地址,只上报设备号;这时,访问设备无法从服务器获取到载有广域网IP地址的设备信息,因此无法与UPnP设备通过广域网建立访问连接。First, the UPnP device obtains the IP address of the Wide Area Network (WAN) port it has, and if the obtained IP address belongs to the LAN address in the TCP/IP protocol, it is determined that the UPnP device is connected to a non-level router (that is, the UPnP device is connected to the second-level route or a lower-level route), the UPnP device does not report the IP address to the server, but only the device number; at this time, the access device cannot obtain the device carrying the WAN IP address from the server information, so it is impossible to establish an access connection with UPnP devices through the WAN.

根据传输控制协议/因特网互联协议(TransmissionControlProtocol/InternetProtocol,简称TCP/IP),IP地址分为5类,其中A、B、C三类中各保留了3个区域作为局域网地址,也就是局域网用的IP地址,局域网地址不能在广域网上出现,只能用在内部网路中,所有的路由器都不能外发目标地址为局域网地址的数据报;这三个局域网地址段,如下:According to Transmission Control Protocol/Internet Protocol (Transmission Control Protocol/Internet Protocol, referred to as TCP/IP), IP addresses are divided into 5 categories, of which 3 areas are reserved in each of the three categories A, B, and C as LAN addresses, which are used for LANs. IP addresses and LAN addresses cannot appear on the WAN, and can only be used in the internal network. All routers cannot send out datagrams whose destination address is the LAN address; these three LAN address segments are as follows:

A类地址:10.0.0.0~10.255.255.255;Class A address: 10.0.0.0~10.255.255.255;

B类地址:172.16.0.0~172.31.255.255;Class B address: 172.16.0.0~172.31.255.255;

C类地址:192.168.0.0~192.168.255.255。Class C address: 192.168.0.0~192.168.255.255.

第二种,如果对WAN口的IP地址做过修改,修改后的IP地址不是局域网地址,这时UPnP设备会将该IP地址上报服务器;这时,访问设备从服务器获取到的设备信息载有该IP地址,只要该UPnP设备是连接在非一级路由器下的,即使访问设备使用该IP地址建立与该IP地址的访问连接,也为因为UPnP设备上报的该IP地址是无效的,导致建立访问连接失败。Second, if the IP address of the WAN port has been modified and the modified IP address is not a LAN address, then the UPnP device will report the IP address to the server; at this time, the device information obtained by the access device from the server contains This IP address, as long as the UPnP device is connected to a non-first-level router, even if the access device uses this IP address to establish an access connection with this IP address, it is because the IP address reported by the UPnP device is invalid, resulting in the establishment of a Access connection failed.

在本发明实施例中,UPnP设备启动后,UPnP设备会检查当前连接的路由器WAN口的IP地址;如果WAN口的IP地址属于TCP/IP协议中的局域网地址,则所述UPnP设备不向服务器上报该IP地址,只上报所述UPnP设备的设备号;如果WAN口的IP地址不属于局域网地址,则所述UPnP设备向服务器上报WAN口的IP和所述UPnP设备的设备号。In the embodiment of the present invention, after the UPnP device starts, the UPnP device will check the IP address of the router WAN port currently connected; To report the IP address, only the device number of the UPnP device is reported; if the IP address of the WAN port does not belong to the LAN address, the UPnP device reports the IP of the WAN port and the device number of the UPnP device to the server.

这样,服务器中会记录访问设备的设备号,还会记录访问设备的设备号与UPnP设备的设备号绑定关系,可能记录有一个访问设备的设备号分别与多个UPnP设备的设备号的多个绑定关系,这样便于访问设备访问多个UPnP设备。In this way, the server will record the device number of the access device, and also record the binding relationship between the device number of the access device and the device number of the UPnP device. A binding relationship, so that the access device can access multiple UPnP devices.

方法实施例method embodiment

访问通用即插即用设备的方法,参见图2,包括步骤S101和步骤S102。Referring to FIG. 2, the method for accessing a UPnP device includes step S101 and step S102.

步骤S101,访问设备从服务器获取所述UPnP设备的设备信息。In step S101, the access device acquires device information of the UPnP device from a server.

具体地,访问设备向服务器发送请求,该请求记录了该访问设备的设备号;后面,服务器根据该访问设备的设备号筛选出该访问设备与一个或多个UPnP设备的绑定关系;基于该访问设备的一个或多个绑定关系,用户可操作访问设备指定期望访问的UPnP设备,并从服务器下载期望访问的UPnP设备的设备信息,该设备信息可能包括有该UPnP设备的第一IP地址,所述第一IP地址是指用于通过广域网访问所述UPnP设备的IP地址;该设备信息还至少包括有该UPnP设备的设备号,所述设备号用于唯一标识所述UPnP设备。Specifically, the access device sends a request to the server, and the request records the device number of the access device; later, the server screens out the binding relationship between the access device and one or more UPnP devices according to the device number of the access device; One or more binding relationships of the access device, the user can operate the access device to specify the desired UPnP device, and download the device information of the desired UPnP device from the server, the device information may include the first IP address of the UPnP device , the first IP address refers to the IP address used to access the UPnP device through the wide area network; the device information also includes at least a device number of the UPnP device, and the device number is used to uniquely identify the UPnP device.

步骤S102,如果所述访问设备从所述设备信息中未获取到第一IP地址,所述访问设备根据所述设备信息中的设备号获取对应的第二IP地址,并通过所述第二IP地址建立与所述UPnP设备的访问连接。Step S102, if the access device does not obtain the first IP address from the device information, the access device obtains the corresponding second IP address according to the device number in the device information, and uses the second IP address to establish an access connection with the UPnP device.

如果步骤S102没有从所述设备信息中获取到第一IP地址,代表所述访问设备没法使用第一IP地址通过广域网建立与UPnP设备的访问连接;这时,本发明实施例换了一个角度来建立访问连接,所述访问设备使用第二IP地址来尝试与所述UPnP设备建立P2P通信的访问连接。If step S102 does not obtain the first IP address from the device information, it means that the access device cannot use the first IP address to establish an access connection with the UPnP device through the wide area network; at this time, the embodiment of the present invention changes the angle To establish an access connection, the access device uses the second IP address to try to establish a P2P communication access connection with the UPnP device.

如果所述访问设备使用所述设备信息记录的第二IP地址成功与所述UPnP设备建立访问连接,所述访问设备将第二IP地址作为默认访问所述UPnP设备的IP地址。If the access device successfully establishes an access connection with the UPnP device using the second IP address recorded in the device information, the access device uses the second IP address as an IP address for accessing the UPnP device by default.

其中,所述第二IP地址是指用于与所述UPnP设备建立P2P通信的IP地址。需要说明的是,在P2P网络中,由于其IP地址具有固定的编码格式,因此接入P2P网络的设备可以根据其设备号获得对应的IP地址。Wherein, the second IP address refers to an IP address used to establish P2P communication with the UPnP device. It should be noted that, in a P2P network, since its IP address has a fixed encoding format, a device connected to the P2P network can obtain a corresponding IP address according to its device number.

可选地,参见图2,所述方法包括步骤S103和步骤S104。Optionally, referring to FIG. 2 , the method includes step S103 and step S104.

步骤S103,如果所述访问设备从所述设备信息中获取到所述第一IP地址,所述访问设备使用所述第一IP地址请求与所述UPnP设备建立访问连接。Step S103, if the access device obtains the first IP address from the device information, the access device uses the first IP address to request to establish an access connection with the UPnP device.

具体地,所述访问设备使用所述第一IP地址向所述UPnP设备发送建立连接请求,如果该建立连接请求经过所述UPnP设备连接的路由器转发至所述UPnP设备;所述UPnP设备接收到该建立连接请求,并向所述访问设备返回访问正确的状态码,当然,该状态码仍需要经过所述UPnP设备连接的路由器转发后才能到达所述访问设备;访问设备接收到该状态码,并根据该状态码确定已成功与所述UPnP设备建立起访问连接。如果所述访问设备使用所述第一IP地址成功与所述UPnP设备建立访问连接,所述访问设备将第一IP地址作为默认访问所述UPnP设备的IP地址。Specifically, the access device uses the first IP address to send a connection establishment request to the UPnP device, if the connection establishment request is forwarded to the UPnP device through the router connected to the UPnP device; the UPnP device receives The establishment of the connection request, and return to the access device to access the correct status code, of course, the status code still needs to be forwarded by the router connected to the UPnP device before reaching the access device; the access device receives the status code, And according to the status code, it is determined that the access connection has been successfully established with the UPnP device. If the access device uses the first IP address to successfully establish an access connection with the UPnP device, the access device uses the first IP address as an IP address for accessing the UPnP device by default.

相反,如果所述UPnP设备未接收到所述访问设备发送的该建立连接请求,或者访问设备未在第一时间(可以根据业界规定设定该第一时间,当然也可以人为设定该第一时间)内接收到该状态码,都会导致访问设备确定使用所述第一IP地址未成功与所述UPnP设备建立起访问连接,即所述访问设备请求失败。On the contrary, if the UPnP device does not receive the connection establishment request sent by the access device, or the access device does not set the first time at the first time (the first time can be set according to industry regulations, of course, the first time can also be set artificially) Time) will cause the access device to determine that the access connection with the UPnP device has not been successfully established using the first IP address, that is, the access device request fails.

步骤S104,如果所述访问设备请求失败,所述访问设备使用所述第二IP地址建立与所述UPnP设备的访问连接。Step S104, if the access device request fails, the access device uses the second IP address to establish an access connection with the UPnP device.

具体地,如果所述访问设备请求失败,所述访问设备改为使用第二IP地址请求与所述UPnP设备建立P2P通信的访问连接,此处建立访问连接的方式与上述使用第一IP地址请求与所述UPnP设备建立访问连接的实现方式类似,在此不再赘述。如果访问设备接收到UPnP设备反馈的建立P2P通信访问连接所使用的状态码,访问设备确定成功与所述UPnP设备建立起P2P通信的访问连接。Specifically, if the request of the access device fails, the access device uses the second IP address to request to establish a P2P communication access connection with the UPnP device. It is similar to the implementation manner of establishing an access connection with the UPnP device, and will not be repeated here. If the access device receives the status code used to establish the P2P communication access connection fed back by the UPnP device, the access device determines that the P2P communication access connection is successfully established with the UPnP device.

如果所述访问设备使用所述第二IP地址成功与所述UPnP设备建立访问连接,所述访问设备将所述第二IP地址作为默认访问所述UPnP设备的IP地址。If the access device successfully establishes an access connection with the UPnP device by using the second IP address, the access device uses the second IP address as an IP address for accessing the UPnP device by default.

相反,如果所述UPnP设备未接收到所述访问设备发送的建立P2P通信的建立连接请求,或者访问设备未在第二时间(可以根据业界规定设定该第二时间,当然也可以人为设定该第二时间)内接收到状态码(UPnP设备反馈的建立P2P通信访问连接所使用的状态码),则访问设备判定为建立P2P连接超时,访问设备使用所述第二IP地址与所述UPnP设备建立P2P连接失败。On the contrary, if the UPnP device does not receive the connection establishment request for establishing P2P communication sent by the access device, or the access device fails to set the second time within the second time (the second time can be set according to industry regulations, of course, it can also be set artificially) If the status code (the status code used by the UPnP device to establish the P2P communication access connection fed back by the UPnP device) is received within the second time), the access device determines that the establishment of the P2P connection has timed out, and the access device uses the second IP address to communicate with the UPnP The device failed to establish a P2P connection.

本发明实施例中,如果所述访问设备使用所述第一IP地址成功与所述UPnP设备建立起访问连接,在所述访问设备访问所述UPnP设备的过程中发生访问连接断开,本发明实施例提供了第一种应对方式。In this embodiment of the present invention, if the access device successfully establishes an access connection with the UPnP device using the first IP address, and the access connection is disconnected during the process of the access device accessing the UPnP device, the present invention The embodiment provides the first solution.

第一种应对方式,在所述访问设备使用所述第一IP地址访问所述UPnP设备的过程中发生访问连接断开时,所述访问设备使用所述第二IP地址建立与所述UPnP设备的访问连接。对第一种应对方式的具体实现,举例如下:In the first solution, when the access connection is disconnected during the process of the access device using the first IP address to access the UPnP device, the access device uses the second IP address to establish a connection with the UPnP device access connection. The specific implementation of the first coping method is as follows:

访问设备使用第一IP地址向UPnP设备发送HTTP请求,但未得到UPnP设备的响应;The access device sends an HTTP request to the UPnP device using the first IP address, but does not get a response from the UPnP device;

访问设备将访问UPnP设备的IP地址更改为P2P通信的第二IP地址,使用第二IP地址向UPnP设备重新发送HTTP请求;如果UPnP设备如果收到该HTTP请求,则返回访问正确的状态码。The access device changes the IP address of the access UPnP device to the second IP address of the P2P communication, and uses the second IP address to resend the HTTP request to the UPnP device; if the UPnP device receives the HTTP request, it returns the correct access status code.

如果访问设备在第二时间内没收到UPnP设备返回的状态码,则判定为连接超时。如果访问设备在第二时间内成功收到UPnP设备返回的状态码,则将访问UPnP设备的默认IP地址改为与UPnP设备建立P2P通信所使用的第二IP地址。If the access device does not receive the status code returned by the UPnP device within the second time, it is determined that the connection has timed out. If the access device successfully receives the status code returned by the UPnP device within the second time, the default IP address of the access UPnP device is changed to the second IP address used for establishing P2P communication with the UPnP device.

本发明实施例中,如果所述访问设备使用所述第二IP地址成功与所述UPnP设备建立起访问连接,在所述访问设备访问所述UPnP设备的过程中发生访问连接断开,本发明实施例提供了第二种应对方式。In the embodiment of the present invention, if the access device uses the second IP address to successfully establish an access connection with the UPnP device, and the access connection is disconnected during the process of the access device accessing the UPnP device, the present invention The embodiment provides a second solution.

第二种应对方式,在所述访问设备使用所述第二IP地址访问所述UPnP设备的过程中发生访问连接断开时,所述访问设备重新从所述服务器获取所述UPnP设备的设备信息;如果所述访问设备从重新获取的设备信息中获取到新的所述第一IP地址,所述访问设备使用新的所述第一IP地址请求与所述UPnP设备建立访问连接。对第二种应对方式的具体实现,举例如下:In the second solution, when the access connection is disconnected during the process of the access device using the second IP address to access the UPnP device, the access device obtains the device information of the UPnP device from the server again ; If the access device obtains the new first IP address from the reacquired device information, the access device uses the new first IP address to request to establish an access connection with the UPnP device. The specific implementation of the second coping method is as follows:

访问设备使用第二IP地址向UPnP设备发送HTTP请求,但未得到UPnP设备对该HTTP请求的响应。The access device uses the second IP address to send an HTTP request to the UPnP device, but does not get a response to the HTTP request from the UPnP device.

访问设备访问服务器,获取最新的所述UPnP设备的设备信息。The access device accesses the server to obtain the latest device information of the UPnP device.

如果最新的设备信息没有新的第一IP地址,或者最新的设备信息记录的第一IP地址与原来使用的一样,则判定为连接超时。If the latest device information does not have a new first IP address, or the first IP address recorded in the latest device information is the same as the original one, then it is determined that the connection has timed out.

如果最新的设备信息中记录有新的第一IP地址,则通过新的第一IP地址向UPnP设备发送建立连接请求;如果UPnP设备如果收到该建立连接请求,则返回访问正确的状态码。If there is a new first IP address recorded in the latest device information, a connection establishment request is sent to the UPnP device through the new first IP address; if the UPnP device receives the connection establishment request, it returns a correct access status code.

如果访问设备在第一时间内没收到UPnP设备返回的状态码,则判定为连接超时。如果访问设备在第一时间内成功收到UPnP设备返回的状态码,则将访问UPnP设备的默认IP地址改为最新的第一IP地址。If the access device does not receive the status code returned by the UPnP device within the first time, it is determined that the connection has timed out. If the access device successfully receives the status code returned by the UPnP device within the first time, change the default IP address of the access UPnP device to the latest first IP address.

设备实施例:Device example:

需要说明的是,设备实施例提供的访问设备,与上述方法实施例对应,可实现上述方法实施例,因此该访问设备包括的各个单元的具体实现,可参见方法实施例中对应的描述。It should be noted that the access device provided by the device embodiment corresponds to the above method embodiment and can implement the above method embodiment. Therefore, for the specific implementation of each unit included in the access device, refer to the corresponding description in the method embodiment.

本设备实施例提供的访问设备,参见图3,所述访问设备包括:The access device provided by this device embodiment, see Figure 3, the access device includes:

信息获取单元31,用于访问设备从服务器获取所述UPnP设备的设备信息;An information obtaining unit 31, configured for the access device to obtain the device information of the UPnP device from the server;

访问建立单元32,用于如果所述访问设备从所述设备信息中未获取到第一IP地址,所述第一IP地址是指用于通过广域网访问所述UPnP设备的IP地址,所述访问设备根据所述设备信息中的设备号获取对应的第二IP地址,并通过所述第二IP地址建立与所述UPnP设备的访问连接,所述第二IP地址是指用于与所述UPnP设备建立P2P通信的IP地址。An access establishment unit 32, configured to if the access device does not obtain a first IP address from the device information, the first IP address refers to an IP address used to access the UPnP device through a wide area network, and the access The device obtains a corresponding second IP address according to the device number in the device information, and establishes an access connection with the UPnP device through the second IP address, where the second IP address refers to the The IP address for the device to establish P2P communication.

可选地,所述访问建立单元32,还用于如果所述访问设备从所述设备信息中获取到所述第一IP地址,所述访问设备使用所述第一IP地址请求与所述UPnP设备建立访问连接;如果所述访问设备请求失败,所述访问设备使用所述第二IP地址建立与所述UPnP设备的访问连接。Optionally, the access establishment unit 32 is further configured to: if the access device obtains the first IP address from the device information, the access device uses the first IP address to request a connection with the UPnP The device establishes an access connection; if the access device request fails, the access device uses the second IP address to establish an access connection with the UPnP device.

可选地,所述访问建立单元32,还用于如果所述访问设备使用所述第一IP地址成功与所述UPnP设备建立访问连接,所述访问设备将第一IP地址作为默认访问所述UPnP设备的IP地址;如果所述访问设备使用所述第二IP地址成功与所述UPnP设备建立访问连接,所述访问设备将第二IP地址作为默认访问所述UPnP设备的IP地址。Optionally, the access establishment unit 32 is further configured to: if the access device successfully establishes an access connection with the UPnP device using the first IP address, the access device uses the first IP address as a default access to the UPnP device. The IP address of the UPnP device; if the access device uses the second IP address to successfully establish an access connection with the UPnP device, the access device uses the second IP address as the IP address for accessing the UPnP device by default.

可选地,所述访问建立单元32,还用于在所述访问设备使用所述第一IP地址访问所述UPnP设备的过程中发生访问连接断开时,所述访问设备使用所述第二IP地址建立与所述UPnP设备的访问连接。Optionally, the access establishing unit 32 is further configured to: when the access connection is disconnected during the process of the access device using the first IP address to access the UPnP device, the access device uses the second IP address to access the UPnP device. IP address to establish an access connection with the UPnP device.

可选地,所述访问建立单元32,还用于在所述访问设备使用所述第二IP地址访问所述UPnP设备的过程中发生访问连接断开时,所述访问设备重新从所述服务器获取所述UPnP设备的设备信息;如果所述访问设备从重新获取的设备信息中获取到新的所述第一IP地址,所述访问设备使用新的所述第一IP地址请求与所述UPnP设备建立访问连接。Optionally, the access establishment unit 32 is further configured to, when the access connection is disconnected during the process of the access device using the second IP address to access the UPnP device, the access device restarts the UPnP device from the server. Obtaining the device information of the UPnP device; if the access device obtains the new first IP address from the reacquired device information, the access device uses the new first IP address to request a connection with the UPnP device. The device establishes an access connection.

本领域技术人员可以理解为上述设备实施例包括的各个单元只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。Those skilled in the art can understand that the various units included in the above-mentioned device embodiments are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are also It is only for the convenience of distinguishing each other, and is not intended to limit the protection scope of the present invention.

系统实施例:System embodiment:

图4为本发明实施例提供的访问通用即插即用UPnP设备的系统的组成结构图。为了便于说明,仅示出了与本发明实施例相关的部分。FIG. 4 is a structural diagram of a system for accessing UPnP devices provided by an embodiment of the present invention. For ease of description, only parts related to the embodiments of the present invention are shown.

所述访问UPnP设备的系统包括通用即插即用UPnP设备1、服务器2以及访问设备3;The system for accessing UPnP devices includes a Universal Plug and Play UPnP device 1, a server 2 and an access device 3;

所述UPnP设备1,用于检测当前连接的路由器WAN口的IP地址,如果所述WAN口的IP地址属于TCP/IP协议中的局域网地址,则向服务器2上报包含所述UPnP设备的设备号的设备信息;如果所述WAN口的IP地址不属于局域网地址,则向服务器2上报包含所述WAN口的IP和所述UPNPUPnP设备的设备号的设备信息;The UPnP device 1 is used to detect the IP address of the currently connected router WAN port, if the IP address of the WAN port belongs to the local area network address in the TCP/IP protocol, then report the device number containing the UPnP device to the server 2 If the IP address of the WAN port does not belong to the LAN address, then report to the server 2 the device information that includes the IP of the WAN port and the device number of the UPNP UPnP device;

所述服务器2,用于存储所述UPnP设备上报的所述设备信息;The server 2 is configured to store the device information reported by the UPnP device;

所述访问设备3,用于从所述服务器2获取所述通用即插即用UPnP设备1的设备信息,所述设备信息包括设备号;如果所述访问设备3从所述设备信息中未获取到第一网络之间互连的协议IP地址,则根据所述设备信息中的设备号获取对应的第二IP地址,并通过所述第二IP地址建立与所述UPnP设备1的访问连接;其中,所述第一IP地址是指用于通过广域网访问所述UPnP设备1的IP地址,所述第二IP地址是指用于与所述UPnP设备1建立点对点P2P通信的IP地址。The access device 3 is configured to obtain the device information of the Universal Plug and Play UPnP device 1 from the server 2, the device information includes a device number; if the access device 3 is not obtained from the device information To the protocol IP address interconnected between the first network, obtain the corresponding second IP address according to the device number in the device information, and establish an access connection with the UPnP device 1 through the second IP address; Wherein, the first IP address refers to an IP address used to access the UPnP device 1 through a wide area network, and the second IP address refers to an IP address used to establish point-to-point P2P communication with the UPnP device 1 .

进一步的,所述访问设备3还用于:Further, the access device 3 is also used for:

如果所述访问设备从所述设备信息中获取到所述第一IP地址,所述访问设备使用所述第一IP地址请求与所述UPnP设备建立访问连接;If the access device obtains the first IP address from the device information, the access device uses the first IP address to request to establish an access connection with the UPnP device;

如果所述访问设备请求失败,所述访问设备使用所述第二IP地址建立与所述UPnP设备的访问连接。If the access device request fails, the access device uses the second IP address to establish an access connection with the UPnP device.

进一步的,所述访问设备3还用于:Further, the access device 3 is also used for:

如果所述访问设备使用所述第一IP地址成功与所述UPnP设备建立访问连接,所述访问设备将第一IP地址作为默认访问所述UPnP设备的IP地址;If the access device uses the first IP address to successfully establish an access connection with the UPnP device, the access device uses the first IP address as an IP address for accessing the UPnP device by default;

如果所述访问设备使用所述第二IP地址成功与所述UPnP设备建立访问连接,所述访问设备将所述第二IP地址作为默认访问所述UPnP设备的IP地址。If the access device successfully establishes an access connection with the UPnP device by using the second IP address, the access device uses the second IP address as an IP address for accessing the UPnP device by default.

进一步的,所述访问设备3还用于:Further, the access device 3 is also used for:

在所述访问设备使用所述第一IP地址访问所述UPnP设备的过程中发生访问连接断开时,所述访问设备使用所述第二IP地址建立与所述UPnP设备的访问连接。When the access connection is disconnected during the process of the access device using the first IP address to access the UPnP device, the access device uses the second IP address to establish an access connection with the UPnP device.

进一步的,所述访问设备3还用于:Further, the access device 3 is also used for:

在所述访问设备使用所述第二IP地址访问所述UPnP设备的过程中发生访问连接断开时,所述访问设备重新从所述服务器获取所述UPnP设备的设备信息;When the access connection is disconnected when the access device uses the second IP address to access the UPnP device, the access device obtains the device information of the UPnP device from the server again;

如果所述访问设备从重新获取的设备信息中获取到新的所述第一IP地址,所述访问设备使用新的所述第一IP地址请求与所述UPnP设备建立访问连接。If the access device acquires the new first IP address from the newly obtained device information, the access device uses the new first IP address to request to establish an access connection with the UPnP device.

上述系统中各设备的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。For the specific working process of each device in the above system, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.

本领域普通技术人员还可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以在存储于一计算机可读取存储介质中,所述的存储介质,包括ROM/RAM、磁盘、光盘等。Those of ordinary skill in the art can also understand that all or part of the steps in the method of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, so The storage medium mentioned above includes ROM/RAM, magnetic disk, optical disk, etc.

以上内容是结合具体的优选实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术领域的普通技术人员来说,在不脱离本发明构思的前提下做出若干等同替代或明显变型,而且性能或用途相同,都应当视为属于本发明由所提交的权利要求书确定的专利保护范围。The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be assumed that the specific implementation of the present invention is limited to these descriptions. For those of ordinary skill in the technical field to which the present invention belongs, several equivalent substitutions or obvious modifications are made without departing from the concept of the present invention, and the performance or use is the same, all should be regarded as belonging to the present invention by the submitted claims The scope of patent protection determined by the book.

Claims (10)

1.一种访问通用即插即用设备的方法,其特征在于,所述方法包括:1. A method for accessing a Universal Plug and Play device, characterized in that the method comprises: 访问设备从服务器获取所述通用即插即用UPnP设备的设备信息,所述设备信息包括设备号;The access device acquires device information of the Universal Plug and Play UPnP device from a server, where the device information includes a device number; 如果所述访问设备从所述设备信息中未获取到第一网络之间互连的协议IP地址,所述访问设备根据所述设备信息中的设备号获取对应的第二IP地址,并通过所述第二IP地址建立与所述UPnP设备的访问连接;If the access device does not obtain the IP address of the interconnection protocol between the first networks from the device information, the access device obtains the corresponding second IP address according to the device number in the device information, and uses the The second IP address establishes an access connection with the UPnP device; 其中,所述第一IP地址是指用于通过广域网访问所述UPnP设备的IP地址,所述第二IP地址是指用于与所述UPnP设备建立点对点P2P通信的IP地址。Wherein, the first IP address refers to an IP address used to access the UPnP device through a wide area network, and the second IP address refers to an IP address used to establish point-to-point P2P communication with the UPnP device. 2.如权利要求1所述的访问通用即插即用设备的方法,其特征在于,所述方法包括:2. The method for accessing a UPnP device as claimed in claim 1, wherein the method comprises: 如果所述访问设备从所述设备信息中获取到所述第一IP地址,所述访问设备使用所述第一IP地址请求与所述UPnP设备建立访问连接;If the access device obtains the first IP address from the device information, the access device uses the first IP address to request to establish an access connection with the UPnP device; 如果所述访问设备请求失败,所述访问设备使用所述第二IP地址建立与所述UPnP设备的访问连接。If the access device request fails, the access device uses the second IP address to establish an access connection with the UPnP device. 3.如权利要求2所述的访问通用即插即用设备的方法,其特征在于,所述方法还包括:3. The method for accessing a UPnP device as claimed in claim 2, wherein the method further comprises: 如果所述访问设备使用所述第一IP地址成功与所述UPnP设备建立访问连接,所述访问设备将第一IP地址作为默认访问所述UPnP设备的IP地址;If the access device uses the first IP address to successfully establish an access connection with the UPnP device, the access device uses the first IP address as an IP address for accessing the UPnP device by default; 如果所述访问设备使用所述第二IP地址成功与所述UPnP设备建立访问连接,所述访问设备将所述第二IP地址作为默认访问所述UPnP设备的IP地址。If the access device successfully establishes an access connection with the UPnP device by using the second IP address, the access device uses the second IP address as an IP address for accessing the UPnP device by default. 4.如权利要求1所述的访问通用即插即用设备的方法,其特征在于,所述方法还包括:4. The method for accessing a UPnP device as claimed in claim 1, wherein the method further comprises: 在所述访问设备使用所述第一IP地址访问所述UPnP设备的过程中发生访问连接断开时,所述访问设备使用所述第二IP地址建立与所述UPnP设备的访问连接。When the access connection is disconnected during the process of the access device using the first IP address to access the UPnP device, the access device uses the second IP address to establish an access connection with the UPnP device. 5.如权利要求1至4任一项所述的访问通用即插即用设备的方法,其特征在于,所述方法还包括:5. The method for accessing a Universal Plug and Play device according to any one of claims 1 to 4, wherein the method further comprises: 在所述访问设备使用所述第二IP地址访问所述UPnP设备的过程中发生访问连接断开时,所述访问设备重新从所述服务器获取所述UPnP设备的设备信息;When the access connection is disconnected when the access device uses the second IP address to access the UPnP device, the access device obtains the device information of the UPnP device from the server again; 如果所述访问设备从重新获取的设备信息中获取到新的所述第一IP地址,所述访问设备使用新的所述第一IP地址请求与所述UPnP设备建立访问连接。If the access device acquires the new first IP address from the newly obtained device information, the access device uses the new first IP address to request to establish an access connection with the UPnP device. 6.如权利要求1所述的访问通用即插即用设备的方法,其特征在于,在访问设备从服务器获取所述通用即插即用UPnP设备的设备信息之前,还包括:6. The method for accessing a UPnP device as claimed in claim 1, further comprising: before the accessing device obtains the device information of the UPnP device from a server: 所述UPnP设备检测当前连接的路由器WAN口的IP地址;The UPnP device detects the IP address of the currently connected router WAN port; 如果所述WAN口的IP地址属于TCP/IP协议中的局域网地址,则所述UPnP设备向服务器上报包含所述UPnP设备的设备号的设备信息;如果所述WAN口的IP地址不属于局域网地址,则所述UPnP设备向服务器上报包含所述WAN口的IP和所述UPNPUPnP设备的设备号的设备信息。If the IP address of the WAN port belongs to the local area network address in the TCP/IP protocol, the UPnP device reports to the server the device information comprising the device number of the UPnP device; if the IP address of the WAN port does not belong to the local area network address , the UPnP device reports to the server device information including the IP of the WAN port and the device number of the UPnP device. 7.一种访问设备,其特征在于,所述访问设备包括:7. An access device, characterized in that the access device comprises: 信息获取单元,用于访问设备从服务器获取所述UPnP设备的设备信息,所述设备信息包括设备号;An information obtaining unit, configured for the access device to obtain device information of the UPnP device from a server, where the device information includes a device number; 访问建立单元,用于如果所述访问设备从所述设备信息中未获取到第一网络之间互连的协议IP地址,所述访问设备根据所述设备信息中的设备号获取对应的第二IP地址,并通过所述第二IP地址建立与所述UPnP设备的访问连接,其中,所述第一IP地址是指用于通过广域网访问所述UPnP设备的IP地址,所述第二IP地址是指用于与所述UPnP设备建立点对点P2P通信的IP地址。An access establishment unit, configured to obtain, according to the device number in the device information, the corresponding second IP address, and establish an access connection with the UPnP device through the second IP address, wherein the first IP address refers to the IP address used to access the UPnP device through a wide area network, and the second IP address refers to the IP address used to access the UPnP device through a wide area network, and the second IP address refers to the IP address used to access the UPnP device through a wide area network, and the second IP address establishes an access connection with the UPnP device. Refers to the IP address used to establish point-to-point P2P communication with the UPnP device. 8.如权利要求7所述的访问设备,其特征在于,8. The access device of claim 7, wherein: 所述访问建立单元,还用于如果所述访问设备从所述设备信息中获取到所述第一IP地址,所述访问设备使用所述第一IP地址请求与所述UPnP设备建立访问连接;如果所述访问设备请求失败,所述访问设备使用所述第二IP地址建立与所述UPnP设备的访问连接;The access establishment unit is further configured to, if the access device obtains the first IP address from the device information, the access device uses the first IP address to request to establish an access connection with the UPnP device; If the access device request fails, the access device uses the second IP address to establish an access connection with the UPnP device; 所述访问建立单元,还用于如果所述访问设备使用所述第一IP地址成功与所述UPnP设备建立访问连接,所述访问设备将第一IP地址作为默认访问所述UPnP设备的IP地址;如果所述访问设备使用所述第二IP地址成功与所述UPnP设备建立访问连接,所述访问设备将所述第二IP地址作为默认访问所述UPnP设备的IP地址。The access establishment unit is further configured to use the first IP address as the default IP address for accessing the UPnP device if the access device successfully establishes an access connection with the UPnP device using the first IP address ; If the access device uses the second IP address to successfully establish an access connection with the UPnP device, the access device uses the second IP address as an IP address for accessing the UPnP device by default. 9.如权利要求7所述的访问设备,其特征在于,9. The access device of claim 7, wherein: 所述访问建立单元,还用于在所述访问设备使用所述第一IP地址访问所述UPnP设备的过程中发生访问连接断开时,所述访问设备使用所述第二IP地址建立与所述UPnP设备的访问连接;The access establishment unit is further configured to use the second IP address to establish a connection with the UPnP device when the access connection is disconnected when the access device uses the first IP address to access the UPnP device. The access connection of the UPnP device; 所述访问建立单元,还用于在所述访问设备使用所述第二IP地址访问所述UPnP设备的过程中发生访问连接断开时,所述访问设备重新从所述服务器获取所述UPnP设备的设备信息;如果所述访问设备从重新获取的设备信息中获取到新的所述第一IP地址,所述访问设备使用新的所述第一IP地址请求与所述UPnP设备建立访问连接。The access establishment unit is further configured to reacquire the UPnP device from the server when the access connection is disconnected during the process of the access device using the second IP address to access the UPnP device device information; if the access device obtains the new first IP address from the reacquired device information, the access device uses the new first IP address to request to establish an access connection with the UPnP device. 10.一种访问通用即插即用设备的系统,其特征在于,所述系统包括:10. A system for accessing UPnP devices, characterized in that the system comprises: UPnP设备、服务器以及访问设备;UPnP devices, servers and access devices; 所述UPnP设备,用于检测当前连接的路由器WAN口的IP地址,如果所述WAN口的IP地址属于TCP/IP协议中的局域网地址,则向服务器上报包含所述UPnP设备的设备号的设备信息;如果所述WAN口的IP地址不属于局域网地址,则向服务器上报包含所述WAN口的IP和所述UPNPUPnP设备的设备号的设备信息;The UPnP device is used to detect the IP address of the currently connected router WAN port, if the IP address of the WAN port belongs to the local area network address in the TCP/IP protocol, then report to the server the device containing the device number of the UPnP device Information; if the IP address of the WAN port does not belong to the LAN address, then report to the server the device information including the IP of the WAN port and the device number of the UPNP UPnP device; 所述服务器,用于存储所述UPnP设备上报的所述设备信息;The server is configured to store the device information reported by the UPnP device; 所述访问设备,用于从所述服务器获取所述通用即插即用UPnP设备的设备信息,所述设备信息包括设备号;如果所述访问设备从所述设备信息中未获取到第一网络之间互连的协议IP地址,则根据所述设备信息中的设备号获取对应的第二IP地址,并通过所述第二IP地址建立与所述UPnP设备的访问连接;其中,所述第一IP地址是指用于通过广域网访问所述UPnP设备的IP地址,所述第二IP地址是指用于与所述UPnP设备建立点对点P2P通信的IP地址。The access device is configured to obtain device information of the Universal Plug and Play UPnP device from the server, where the device information includes a device number; if the access device does not obtain the first network from the device information The IP address of the interconnection protocol, then obtain the corresponding second IP address according to the device number in the device information, and establish an access connection with the UPnP device through the second IP address; wherein, the first An IP address refers to an IP address used to access the UPnP device through a wide area network, and the second IP address refers to an IP address used to establish point-to-point P2P communication with the UPnP device.
CN201511026093.6A 2015-12-29 2015-12-29 Method and system for accessing universal plug and play device, access device Expired - Fee Related CN105634810B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511026093.6A CN105634810B (en) 2015-12-29 2015-12-29 Method and system for accessing universal plug and play device, access device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511026093.6A CN105634810B (en) 2015-12-29 2015-12-29 Method and system for accessing universal plug and play device, access device

Publications (2)

Publication Number Publication Date
CN105634810A true CN105634810A (en) 2016-06-01
CN105634810B CN105634810B (en) 2019-12-13

Family

ID=56049348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511026093.6A Expired - Fee Related CN105634810B (en) 2015-12-29 2015-12-29 Method and system for accessing universal plug and play device, access device

Country Status (1)

Country Link
CN (1) CN105634810B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106888130A (en) * 2017-04-21 2017-06-23 新华三技术有限公司 The method to set up and device of router
CN115589412A (en) * 2022-10-09 2023-01-10 成都康胜思科技有限公司 Method and system for solving device discovery in local area network

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5867495A (en) * 1996-11-18 1999-02-02 Mci Communications Corporations System, method and article of manufacture for communications utilizing calling, plans in a hybrid network
CN1767445A (en) * 2004-10-25 2006-05-03 任东海 Network game voice intercommunicating system
CN101431511A (en) * 2007-11-09 2009-05-13 友讯科技股份有限公司 Method for establishing online channel between network terminal devices by penetrating firewall
CN101478505A (en) * 2009-01-23 2009-07-08 建汉科技股份有限公司 Network system and network connection method established among network devices of different private networks
CN101971573A (en) * 2008-01-15 2011-02-09 三星电子株式会社 Remote access method in network including network address translation device
CN102461124A (en) * 2009-06-03 2012-05-16 高通股份有限公司 System and method for generating a virtual universal plug and play system
CN103457857A (en) * 2012-06-04 2013-12-18 正文科技股份有限公司 Cross-domain multimedia resource identification system and method
CN103457858A (en) * 2012-06-04 2013-12-18 正文科技股份有限公司 Cross-domain equipment list exchange system and method thereof

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5867495A (en) * 1996-11-18 1999-02-02 Mci Communications Corporations System, method and article of manufacture for communications utilizing calling, plans in a hybrid network
CN1767445A (en) * 2004-10-25 2006-05-03 任东海 Network game voice intercommunicating system
CN101431511A (en) * 2007-11-09 2009-05-13 友讯科技股份有限公司 Method for establishing online channel between network terminal devices by penetrating firewall
CN101971573A (en) * 2008-01-15 2011-02-09 三星电子株式会社 Remote access method in network including network address translation device
CN101478505A (en) * 2009-01-23 2009-07-08 建汉科技股份有限公司 Network system and network connection method established among network devices of different private networks
CN102461124A (en) * 2009-06-03 2012-05-16 高通股份有限公司 System and method for generating a virtual universal plug and play system
CN103457857A (en) * 2012-06-04 2013-12-18 正文科技股份有限公司 Cross-domain multimedia resource identification system and method
CN103457858A (en) * 2012-06-04 2013-12-18 正文科技股份有限公司 Cross-domain equipment list exchange system and method thereof

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106888130A (en) * 2017-04-21 2017-06-23 新华三技术有限公司 The method to set up and device of router
CN106888130B (en) * 2017-04-21 2019-11-12 新华三技术有限公司 The setting method and device of router
CN115589412A (en) * 2022-10-09 2023-01-10 成都康胜思科技有限公司 Method and system for solving device discovery in local area network

Also Published As

Publication number Publication date
CN105634810B (en) 2019-12-13

Similar Documents

Publication Publication Date Title
US20250158925A1 (en) Network validation with dynamic tunneling
CN106452857B (en) Method for generating configuration information and network control unit
US20160285820A1 (en) Method for processing address resolution protocol message, switch, and controller
CN103327137B (en) Router domain name access method
CN104243210A (en) Method and system for remotely having access to administrative web pages of routers
CN103237024B (en) Data conversion transmission method between TCP/IP (transmission control protocol/Internet protocol) and NDN (named data networking) protocol
CN105979022B (en) NAT (network Address translation) penetrating method and system based on UPnP (Universal plug and Play) protocol
CN104426680A (en) Data transmission method, device and system
US9118608B2 (en) Communication apparatus, control method therefor, and computer-readable storage medium
CN101621548A (en) Method and system for realizing terminal resource sharing based on peer connection system
US10003543B2 (en) Communication device, communication system, and communication method
CN105376299A (en) A network communication method, an apparatus and a network attached storage apparatus
CN105704042A (en) Message processing method, BNG and BNG cluster system
WO2014101661A1 (en) Service flow mirroring method and mirroring device
US9894032B1 (en) Method and apparatus of establishing a connection between devices using cached connection information
CN111614505A (en) Packet processing method and gateway device
CN105991377A (en) Discovery and communication method between universal plug and play (UPnP) devices
CN106302230A (en) A kind of data transmission method and device
CN105634810B (en) Method and system for accessing universal plug and play device, access device
US9124598B2 (en) Method and apparatus of establishing a connection between devices using cached connection information
CN105635181B (en) A kind of data transmission method of decentralization
CN110830598B (en) Method and network equipment for establishing and transmitting interface address and alias in BGP (Border gateway protocol) session
TWI603599B (en) Data sharing method and electronic device using same
CN117176673A (en) Method, system, device and computer equipment for realizing peer-to-peer connection between subnets
CN105792385B (en) Communication method and device based on wireless local area network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20191213

CF01 Termination of patent right due to non-payment of annual fee