CN103957249A - Remote control method, server and control device and system - Google Patents
Remote control method, server and control device and system Download PDFInfo
- Publication number
- CN103957249A CN103957249A CN201410167082.9A CN201410167082A CN103957249A CN 103957249 A CN103957249 A CN 103957249A CN 201410167082 A CN201410167082 A CN 201410167082A CN 103957249 A CN103957249 A CN 103957249A
- Authority
- CN
- China
- Prior art keywords
- server
- facility information
- control
- controlled device
- device information
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title abstract description 34
- 238000011161 development Methods 0.000 abstract description 14
- 230000006870 function Effects 0.000 description 36
- 238000010586 diagram Methods 0.000 description 13
- 230000003993 interaction Effects 0.000 description 5
- 238000012795 verification Methods 0.000 description 4
- 238000012544 monitoring process Methods 0.000 description 3
- 239000000284 extract Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Selective Calling Equipment (AREA)
- Telephonic Communication Services (AREA)
Abstract
Description
技术领域technical field
本发明涉及控制领域,尤其涉及一种遥控方法、服务器、控制设备及系统。The invention relates to the field of control, in particular to a remote control method, server, control equipment and system.
背景技术Background technique
用户拥有越来越多的设备,大多数设备都各自配有遥控器,如常见的电视机、机顶盒、DVD播放机、功放和音响等,由于各个设备之间的遥控器无法兼容,每个设备都需要配置一个遥控器,遥控器的数量会非常多,用户操作起来十分繁琐。Users have more and more devices, most of which are equipped with remote controls, such as common TVs, set-top boxes, DVD players, power amplifiers and stereos, etc. Since the remote controls between devices are not compatible, each device A remote controller needs to be configured, and the number of remote controllers will be very large, which is very cumbersome for users to operate.
现有技术中解决上述问题的方法是,在移动终端上安装特定的应用程序,移动终端通过安装的应用程序控制需要控制的设备,然而这种方案存在的问题是,不同的操作平台的移动终端都需要单独开发一套特定的应用程序,同时移动终端上安装的应用程序只能控制专有的设备,针对不同的设备,开发人员需要开发出不同的应用程序来进行匹配,这样对于开发人员来说需要花费大量时间。The method to solve the above problems in the prior art is to install a specific application program on the mobile terminal, and the mobile terminal controls the device to be controlled through the installed application program. However, the problem with this solution is that mobile terminals with different operating platforms Each needs to develop a set of specific applications separately, and the applications installed on the mobile terminal can only control proprietary devices. For different devices, developers need to develop different applications to match, so for developers Said it takes a lot of time.
发明内容Contents of the invention
本发明实施例所要解决的技术问题在于,提供一种遥控方法、服务器、控制设备及系统。可解决降低遥控器开发的成本。The technical problem to be solved by the embodiments of the present invention is to provide a remote control method, server, control device and system. It can solve the problem of reducing the cost of remote controller development.
为了解决上述技术问题,本发明实施例第一方面提供了一种遥控方法,包括:In order to solve the above technical problems, the first aspect of the embodiment of the present invention provides a remote control method, including:
服务器接收控制设备通过网页Web发送的控制指令和所述控制设备的第一设备信息;The server receives the control instruction sent by the control device through the web page and the first device information of the control device;
所述服务器在预设的绑定关系中查询与所述第一设备信息相关联的第二设备信息;The server queries the second device information associated with the first device information in the preset binding relationship;
所述服务器将所述控制指令发送至所述第二设备信息指向的被控设备,以使所述被控设备执行所述控制指令指示的操作。The server sends the control instruction to the controlled device pointed to by the second device information, so that the controlled device performs the operation indicated by the control instruction.
结合第一方面,在第一种可能的实现方式中,所述服务器接收控制设备通过网页Web发送的控制指令和所述控制设备的第一设备信息的步骤之前,还包括:With reference to the first aspect, in a first possible implementation manner, before the step of receiving the control instruction sent by the control device through the web page and the first device information of the control device, the server further includes:
服务器接收控制设备发送的第一登录请求,并验证所述控制设备合法后,通过WebSocket协议与所述控制设备建立连接;及The server receives the first login request sent by the control device, and after verifying that the control device is legal, establishes a connection with the control device through the WebSocket protocol; and
所述服务器接收被控设备发送的第二登录请求,并验证所述被控设备合法后,通过WebSocket协议与所述被控设备建立连接。The server receives the second login request sent by the controlled device, and after verifying that the controlled device is legal, establishes a connection with the controlled device through the WebSocket protocol.
结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中,还包括:In combination with the first possible implementation of the first aspect, the second possible implementation further includes:
所述服务器获取所述控制设备的第一设备信息,并将所述第一设备信息推送至所述被控设备;及The server obtains first device information of the controlling device, and pushes the first device information to the controlled device; and
所述服务器获取所述被控设备的第二设备信息,并将所述第二设备信息推送至所述控制设备。The server obtains the second device information of the controlled device, and pushes the second device information to the controlling device.
结合第一方面的第二种可能的实现方式,在第三种可能的实现方式中,还包括:In combination with the second possible implementation of the first aspect, the third possible implementation also includes:
所述服务器接收所述控制设备发送的绑定请求,所述绑定请求中包括所述控制设备的第一设备信息和所述被控设备的第二设备信息;The server receives a binding request sent by the control device, where the binding request includes first device information of the control device and second device information of the controlled device;
所述服务器将所述第一设备信息和第二设备信息进行关联后存储至所述绑定关系中。The server associates the first device information with the second device information and stores them in the binding relationship.
结合第一方面至第三种可能的实现方式中的任意一种,在第四种可能的实现方式中,所述第一设备信息包所述控制设备的主机名和IP地址,所述第二设备信息包括所述被控设备的主机名和IP地址。With reference to any one of the first aspect to the third possible implementation manner, in a fourth possible implementation manner, the first device information includes the host name and IP address of the control device, and the second device The information includes the hostname and IP address of the controlled device.
本发明实施例第二方面提供了一种遥控方法,包括:The second aspect of the embodiment of the present invention provides a remote control method, including:
控制设备通过网页Web接收操作指令;The control device receives operation instructions through the web page;
所述控制设备根据所述操作指令生成控制指令,并向服务器发送所述控制指令和自身的第一设备信息。The control device generates a control instruction according to the operation instruction, and sends the control instruction and its own first device information to the server.
结合第二方面,在第一种可能的实现方式中,所述控制设备通过网页Web接收操作指令的步骤之前,还包括:With reference to the second aspect, in a first possible implementation manner, before the step of receiving the operation instruction through the web page, the control device further includes:
控制设备向服务器发送第一登录请求,以使所述服务器根据所述第一登录请求验证所述控制设备的合法性;The control device sends a first login request to the server, so that the server verifies the legitimacy of the control device according to the first login request;
若接收到所述服务器验证合法的消息,所述控制设备通过WebSocket协议与所述服务器建立连接。If the message that the server is verified to be legal is received, the control device establishes a connection with the server through the WebSocket protocol.
结合第二方面的第一种可能的实现方式,在第二种可能的实现方式中,还包括:In combination with the first possible implementation of the second aspect, the second possible implementation also includes:
所述控制设备接收所述服务器发送的设备信息集合,并将该设备信息集合存储至本地,所述设备信息集合包括至少一个与所述服务器建立连接的其他客户端的设备信息。The control device receives the device information set sent by the server, and stores the device information set locally, where the device information set includes at least one device information of other clients that establish a connection with the server.
结合第二方面的第二种可能的实现方式,在第三种可能的实现方式中,所述控制设备将所述第一设备信息与所述设备信息集合中选取的第二设备信息进行绑定;With reference to the second possible implementation of the second aspect, in a third possible implementation, the control device binds the first device information with the second device information selected in the device information set ;
所述控制设备向所述服务器发送绑定请求,所述绑定请求包括所述第一设备信息和所述第二设备信息。The control device sends a binding request to the server, where the binding request includes the first device information and the second device information.
本发明实施例第三方面提供了一种服务器,包括:The third aspect of the embodiment of the present invention provides a server, including:
接收模块,用于接收控制设备通过网页Web发送的控制指令和所述控制设备的第一设备信息;A receiving module, configured to receive the control instruction sent by the control device through the web page and the first device information of the control device;
查询模块,用于在预设的绑定关系中查询与所述第一设备信息相关联的第二设备信息;a query module, configured to query second device information associated with the first device information in a preset binding relationship;
发送模块,用于将所述控制指令发送至所述第二设备信息指向的被控设备,以使所述被控设备执行所述控制指令指示的操作。A sending module, configured to send the control instruction to the controlled device to which the second device information points, so that the controlled device performs the operation indicated by the control instruction.
结合第三方面,在第一种可能的实现方式中,还包括:In combination with the third aspect, the first possible implementation also includes:
连接模块,用于接收控制设备发送的第一登录请求,并验证所述控制设备合法后,通过WebSocket协议与所述控制设备建立连接;及A connection module, configured to receive the first login request sent by the control device, and establish a connection with the control device through the WebSocket protocol after verifying that the control device is legal; and
接收被控设备发送的第二登录请求,并验证所述被控设备合法后,通过WebSocket协议与所述被控设备建立连接。After receiving the second login request sent by the controlled device and verifying that the controlled device is legal, a connection is established with the controlled device through the WebSocket protocol.
结合第三方面的第一种可能的实现方式,在第二种可能的实现方式中,还包括:In combination with the first possible implementation of the third aspect, the second possible implementation also includes:
设备信息获取模块,用于获取所述控制设备的第一设备信息,并将所述第一设备信息推送至所述被控设备;及a device information acquiring module, configured to acquire first device information of the controlling device, and push the first device information to the controlled device; and
获取所述被控设备的第二设备信息,并将所述第二设备信息推送至所述控制设备。Acquiring second device information of the controlled device, and pushing the second device information to the controlling device.
结合第三方面的第二种可能的实现方式,在第三种可能的实现方式中,关联模块,用于接收所述控制设备发送的绑定请求,所述绑定请求中包括所述控制设备的第一设备信息和所述被控设备的第二设备信息;With reference to the second possible implementation manner of the third aspect, in a third possible implementation manner, the associating module is configured to receive a binding request sent by the control device, and the binding request includes the binding request sent by the control device The first device information and the second device information of the controlled device;
将所述第一设备信息和第二设备信息进行关联后存储至所述绑定关系中。The first device information and the second device information are associated and stored in the binding relationship.
结合第三方面至第三种可能的实现方式中的任意一种,在第四种可能的实现方式中,所述第一设备信息包所述控制设备的主机名和IP地址,所述第二设备信息包括所述被控设备的主机名和IP地址。With reference to any one of the third aspect to the third possible implementation manner, in a fourth possible implementation manner, the first device information includes the host name and IP address of the control device, and the second device The information includes the hostname and IP address of the controlled device.
本发明第四方面提供了一种控制设备,包括:A fourth aspect of the present invention provides a control device, including:
监听模块,用于通过网页Web接收操作指令;The monitoring module is used to receive operation instructions through the web page;
指令发送模块,用于根据所述操作指令生成控制指令,并向服务器发送所述控制指令和自身的第一设备信息,以使所述服务器在预设的绑定关系中查询与所述第一设备信息相关联的第二设备信息以及将所述控制指令发送至所述第二设备信息指向的被控设备,以使所述被控设备执行所述控制指令指示的操作。An instruction sending module, configured to generate a control instruction according to the operation instruction, and send the control instruction and its own first device information to the server, so that the server can inquire about the device associated with the first device in a preset binding relationship. The second device information associated with the device information, and the control instruction is sent to the controlled device to which the second device information is directed, so that the controlled device performs the operation indicated by the control instruction.
结合第四方面,在第一种可能的实现方式中,还包括:In combination with the fourth aspect, the first possible implementation also includes:
登录模块,用于向服务器发送第一登录请求,以使所述服务器根据所述第一登录请求验证合法性;A login module, configured to send a first login request to a server, so that the server verifies the legitimacy according to the first login request;
若接收到所述服务器验证合法的消息,通过WebSocket协议与所述服务器建立连接。If the message that the server is verified to be legal is received, a connection is established with the server through the WebSocket protocol.
结合第四方面的第一种可能的实现方式,在第二种可能的实现方式中,还包括:In combination with the first possible implementation of the fourth aspect, the second possible implementation also includes:
第二接收模块,用于接收所述服务器发送的设备信息集合,并将该设备信息集合存储至本地,所述设备信息集合包括至少一个与所述服务器建立连接的其他客户端的设备信息。The second receiving module is configured to receive the device information set sent by the server, and store the device information set locally, where the device information set includes at least one device information of other clients that establish a connection with the server.
结合第四方面的第二种可能的实现方式,在第三种可能的实现方式中,还包括:In combination with the second possible implementation of the fourth aspect, the third possible implementation also includes:
绑定模块,用于将所述第一设备信息与所述设备信息集合中选取的第二设备信息进行绑定;A binding module, configured to bind the first device information with the second device information selected in the device information set;
向所述服务器发送绑定请求,所述绑定请求包括所述第一设备信息和所述第二设备信息,以使所述服务器根据所述绑定请求建立所述控制设备和所述被控设备的绑定关系。sending a binding request to the server, where the binding request includes the first device information and the second device information, so that the server establishes the control device and the controlled device according to the binding request The binding relationship of the device.
本发明第五方面提供了一种控制系统,包括上述任意一种服务器、上述任意一种控制设备和被控设备,其中,所述被控设备用于向服务器发送第二登录请求,以使所述服务器根据所述第二登录请求验证所述被控设备的合法性;若接收到所述服务器验证合法的消息,所述被控设备通过WebSocket协议与所述服务器建立连接;The fifth aspect of the present invention provides a control system, including any of the above-mentioned servers, any of the above-mentioned control devices, and a controlled device, wherein the controlled device is configured to send a second login request to the server, so that all The server verifies the legitimacy of the controlled device according to the second login request; if a message that the server verifies legality is received, the controlled device establishes a connection with the server through the WebSocket protocol;
所述被控设备接收所述服务器发送的控制指令,并执行所述控制指令指示的操作。The controlled device receives the control instruction sent by the server, and executes the operation indicated by the control instruction.
实施本发明实施例,具有如下有益效果:Implementing the embodiment of the present invention has the following beneficial effects:
控制设备通过网页Web向服务器发送控制指令和自身的设备信息,服务器在绑定关系中查询与控制设备的设备信息相关联的被控设备的设备信息,将控制指令转发至被控设备,以使被控设备执行控制指令指示的操作,使控制设备实现了遥控多个设备的功能,控制设备不需要开发专有的客户端软件,只需要安装通用的浏览器就可以实现遥控器的功能,降低了开发成本。The control device sends the control command and its own device information to the server through the web page, and the server queries the device information of the controlled device associated with the device information of the control device in the binding relationship, and forwards the control command to the controlled device, so that The controlled device executes the operation indicated by the control command, so that the control device realizes the function of remote control of multiple devices. The control device does not need to develop proprietary client software, and only needs to install a common browser to realize the remote control function, reducing development costs.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1是本发明第一实施例的一种遥控方法的流程示意图;Fig. 1 is a schematic flow chart of a remote control method according to the first embodiment of the present invention;
图2是本发明第二实施例的一种遥控方法的流程示意图;Fig. 2 is a schematic flow chart of a remote control method according to the second embodiment of the present invention;
图3是本发明第三实施例的一种遥控方法的流程示意图;Fig. 3 is a schematic flow chart of a remote control method according to the third embodiment of the present invention;
图4是本发明第四实施例的一种遥控方法的流程示意图;4 is a schematic flowchart of a remote control method according to a fourth embodiment of the present invention;
图5是图4中控制设备显示的网页Web的示意图;Fig. 5 is a schematic diagram of the web page displayed by the control device in Fig. 4;
图6是本发明第一实施例的一种服务器的结构示意图;FIG. 6 is a schematic structural diagram of a server according to the first embodiment of the present invention;
图7是本发明第二实施例的一种服务器的结构示意图;FIG. 7 is a schematic structural diagram of a server according to a second embodiment of the present invention;
图8是本发明第三实施例的一种服务器的结构示意图;FIG. 8 is a schematic structural diagram of a server according to a third embodiment of the present invention;
图9是本发明第一实施例的一种控制设备的结构示意图;Fig. 9 is a schematic structural diagram of a control device according to the first embodiment of the present invention;
图10是本发明第二实施例的一种控制设备的结构示意图;FIG. 10 is a schematic structural diagram of a control device according to a second embodiment of the present invention;
图11是本发明第三实施例的一种控制设备的结构示意图;Fig. 11 is a schematic structural diagram of a control device according to a third embodiment of the present invention;
图12是本发明一种控制系统的交互流程图。Fig. 12 is an interaction flowchart of a control system of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
参见图1,为本发明第一实施例的一种遥控方法的流程示意图,在本实施例中,所述方法包括:Referring to FIG. 1 , it is a schematic flow chart of a remote control method according to the first embodiment of the present invention. In this embodiment, the method includes:
S101、服务器接收控制设备通过网页Web发送的控制指令和控制设备的第一设备信息。S101. The server receives a control instruction and first device information of the control device sent by the control device through a web page.
具体的,控制设备可以为智能手机、平板电脑、游戏机或Mp4等移动终端,控制设备与服务器可以通过WebSocket协议建立连接,WebSocket协议是HTML5中的一种通信协议,可实现浏览器与服务器全双工通信。Specifically, the control device can be a mobile terminal such as a smart phone, a tablet computer, a game console or Mp4, and the control device and the server can establish a connection through the WebSocket protocol. duplex communication.
同时,控制设备的显示装置上显示有服务器响应的网页Web,网页Web上设置有供用户控制操作对应的目的终端的操作控件,例如,控制设备监听网页Web上用户触发的操作指令(如用户使用触摸屏生成的触摸屏操作指令或使用鼠标生成的鼠标操作指令等),通过上述操作指令获取对应的控制指令。控制设备获取自身的第一设备信息,该第一设备信息用于表示控制设备在网络中的唯一身份信息,例如,控制设备的主机名和IP地址。At the same time, the display device of the control device displays the webpage Web responded by the server, and the webpage Web is provided with an operation control for the user to control and operate the corresponding destination terminal. A touch screen operation instruction generated by a touch screen or a mouse operation instruction generated by using a mouse, etc.), the corresponding control instruction is obtained through the above operation instruction. The control device obtains its own first device information, where the first device information is used to represent the unique identity information of the control device in the network, for example, the host name and IP address of the control device.
S102、服务器在预设的绑定关系中查询与第一设备信息相关联的第二设备信息。S102. The server searches for second device information associated with the first device information in a preset binding relationship.
具体的,服务器中预先存储有表示控制设备和被控设备的绑定关系,在绑定关系中,控制设备和被控设备的设备信息进行映射,服务器接收到控制设备发送的第一设备信息,在该绑定关系中查询第一设备信息关联的第二设备信息。Specifically, the server pre-stores a binding relationship representing the control device and the controlled device. In the binding relationship, the device information of the control device and the controlled device is mapped, and the server receives the first device information sent by the control device. The second device information associated with the first device information is queried in the binding relationship.
S103、服务器将控制指令发送至第二设备信息指向的被控设备,以使被控设备执行控制指令指示的操作。S103. The server sends the control instruction to the controlled device pointed to by the second device information, so that the controlled device performs the operation indicated by the control instruction.
具体的,服务器根据查询到的第二设备信息,将控制设备发送的控制指令转发至第二设备信息指示的被控设备,被控设备根据控制指令执行相应的操作。例如,控制指令为节目调节、音量调节、开机或待机等。Specifically, the server forwards the control instruction sent by the control device to the controlled device indicated by the second device information according to the queried second device information, and the controlled device performs corresponding operations according to the control instruction. For example, the control instruction is program adjustment, volume adjustment, power on or standby, and the like.
被控设备可为机顶盒、PC或智能电视等设备,本发明不作限制,被控设备可以通过WebSocket协议与服务器建立连接,服务器和被控设备之间的数据交互通过上述已建立的连接进行传输。The controlled device can be a set-top box, PC, or smart TV. The present invention is not limited. The controlled device can establish a connection with the server through the WebSocket protocol, and the data interaction between the server and the controlled device is transmitted through the established connection.
通过本发明的实施例,控制设备通过网页Web向服务器发送控制指令和自身的设备信息,服务器在绑定关系中查询与控制设备的设备信息相关联的被控设备的设备信息,将控制指令转发至被控设备,以使被控设备执行控制指令指示的操作,使控制设备实现了遥控多个设备的功能,控制设备不需要开发专有的客户端软件,只需要安装通用的浏览器就可以实现遥控器的功能,降低了开发成本。Through the embodiment of the present invention, the control device sends the control instruction and its own device information to the server through the web page, and the server queries the device information of the controlled device associated with the device information of the control device in the binding relationship, and forwards the control instruction To the controlled device, so that the controlled device performs the operation indicated by the control command, so that the control device realizes the function of remote control of multiple devices. The control device does not need to develop proprietary client software, only needs to install a common browser. The function of the remote controller is realized, and the development cost is reduced.
参见图2,为本发明第二实施例的一种遥控方法的流程示意图,在本实施例中,所述方法包括:Referring to FIG. 2 , it is a schematic flowchart of a remote control method according to the second embodiment of the present invention. In this embodiment, the method includes:
S201、服务器接收控制设备发送的第一登录请求,并验证控制设备合法后,通过WebSocket协议与控制设备建立连接;及服务器接收被控设备发送的第二登陆请求,并验证被控设备合法后,通过WebSocket协议与被控设备建立连接。S201. The server receives the first login request sent by the control device, and after verifying that the control device is legal, establishes a connection with the control device through the WebSocket protocol; and the server receives the second login request sent by the controlled device, and after verifying that the controlled device is legal, Establish a connection with the controlled device through the WebSocket protocol.
具体的,服务器上安装有WebSocket Server,用来与控制设备和被控设备的上安装的浏览器进行握手与信息交互,控制设备和被控设备上安装的浏览器支持WebSocket协议。Specifically, a WebSocket Server is installed on the server, which is used for handshaking and information interaction with the browsers installed on the control device and the controlled device, and the browsers installed on the control device and the controlled device support the WebSocket protocol.
服务器上同时安装有Web Server,用来接收控制设备和被控设备上安装的浏览器发送来的URL资源请求,并发送网页Web至控制设备和被控设备。A Web Server is installed on the server at the same time, which is used to receive the URL resource requests sent by the browsers installed on the control device and the controlled device, and send the web page to the control device and the controlled device.
服务器接收控制设备发送的第一登录请求,例如第一登录请求为Start消息,服务器根据第一登录请求验证控制设备的身份是否合法,具体可采用账号密码验证方式进行验证,服务器验证控制设备合法后,与控制设备通过WebSocket协议的建立全双工的连接。The server receives the first login request sent by the control device. For example, the first login request is a Start message. The server verifies whether the identity of the control device is legal according to the first login request. Specifically, the account password verification method can be used for verification. After the server verifies that the control device is legal , establish a full-duplex connection with the control device through the WebSocket protocol.
服务器接收被控设备发送的第二登录请求,服务器根据第二登录请求验证被控设备的身份是否合法,具体可采用账号密码验证方式进行验证,服务器验证被控设备合法后,与被控设备通过WebSocket协议建立全双工的连接。The server receives the second login request sent by the controlled device, and the server verifies whether the identity of the controlled device is legal according to the second login request. Specifically, the account password verification method can be used for verification. After the server verifies that the controlled device is legal, it passes through the The WebSocket protocol establishes a full-duplex connection.
S201、服务器获取控制设备的第一设备信息,并将第一设备信息推送至被控设备;及服务器获取被控设备的第二设备信息,并将第二设备信息推送至控制设备。S201. The server obtains first device information of the control device, and pushes the first device information to the controlled device; and the server obtains second device information of the controlled device, and pushes the second device information to the control device.
具体的,第一登录请求中携带控制设备的第一设备信息,服务器从第一登录请求中提取控制设备的第一设备信息,并将获得的第一设备信息发送至被控设备。第二登录请求中携带被控设备的第二设备信息,服务器从第二登录请求中提取被控设备的第二设备信息,并将获得的第二设备信息发送至控制设备。Specifically, the first login request carries the first device information of the control device, and the server extracts the first device information of the control device from the first login request, and sends the obtained first device information to the controlled device. The second login request carries the second device information of the controlled device, and the server extracts the second device information of the controlled device from the second login request, and sends the obtained second device information to the control device.
可以理解的是,服务器还可以利用WebSocket协议中的函数获得设备信息,例如,服务器通过BSD Socket getpeername函数获取客户端的IP地址,通过BSDSocket gethostbyaddr函数获取客户端的hostname主机名,服务器获得IP地址与hostname主机名发送到控制设备和被控设备。It is understandable that the server can also use the functions in the WebSocket protocol to obtain device information. For example, the server obtains the IP address of the client through the BSD Socket getpeername function, obtains the hostname of the client through the BSDSocket gethostbyaddr function, and the server obtains the IP address and hostname of the host The name is sent to the controlling device and the controlled device.
S203、服务器接收控制设备发送的绑定请求,绑定请求中包括控制设备的第一设备信息和被控设备的第二设备信息;服务器将第一设备信息和第二设备信息进行关联后存储至绑定关系中。S203. The server receives the binding request sent by the control device, and the binding request includes the first device information of the control device and the second device information of the controlled device; the server associates the first device information and the second device information and stores them in in a binding relationship.
具体的,控制设备在显示的网页Web上的网络拓扑图上选择一个客户端作为被控设备进行绑定,该网络拓扑图用于显示与服务器建立连接的其他客户端的设备信息。服务器接收控制设备发送的绑定请求,绑定请求中包括需要绑定的控制设备的第一设备信息和被控设备的第二设备信息,服务器将二者的设备信息进行映射后存储至绑定关系中。Specifically, the control device selects a client as the controlled device for binding on the network topology map displayed on the webpage, and the network topology map is used to display device information of other clients that have established connections with the server. The server receives the binding request sent by the control device. The binding request includes the first device information of the control device to be bound and the second device information of the controlled device. The server maps the two device information and stores them in the binding in relationship.
S204、服务器接收控制设备通过网页Web发送的控制指令和控制设备的第一设备信息。S204. The server receives the control instruction and the first device information of the control device sent by the control device through the web page.
具体的,控制设备的显示装置上显示有服务器响应的网页Web,网页Web上设置有供用户控制操作对应的目的终端的操作控件,例如,控制设备监听网页Web上用户触发的操作指令(如触摸屏操作指令或鼠标操作指令等),通过上述操作指令获取对应的控制指令。控制设备获取自身的第一设备信息,该第一设备信息用于表示控制设备在网络中的唯一身份信息,例如,控制设备的主机名和IP地址。服务器可socketobject.onmessage函数接收控制设备发送的控制指令和第一设备信息。Specifically, the display device of the control device displays the web page Web responded by the server, and the web page is provided with an operation control for the user to control and operate the corresponding destination terminal. operation instruction or mouse operation instruction, etc.), the corresponding control instruction is acquired through the above operation instruction. The control device obtains its own first device information, where the first device information is used to represent the unique identity information of the control device in the network, for example, the host name and IP address of the control device. The server can receive the control instruction and the first device information sent by the control device through the socketobject.onmessage function.
S205、服务器在预设的绑定关系中查询与第一设备信息相关联的第二设备信息。S205. The server queries the second device information associated with the first device information in the preset binding relationship.
具体的,服务器中预先存储有表示控制设备和被控设备的设备的绑定关系,在绑定关系中,控制设备和被控设备的设备信息进行映射,服务器接收到控制设备发送的第一设备信息,在该绑定关系中查询第一设备信息关联的第二设备信息。Specifically, the server pre-stores a binding relationship between the control device and the controlled device. In the binding relationship, the device information of the control device and the controlled device is mapped, and the server receives the first device information sent by the control device. information, and query the second device information associated with the first device information in the binding relationship.
S206、服务器将控制指令发送至第二设备信息指向的被控设备,以使被控设备执行控制指令指示的操作。S206. The server sends the control instruction to the controlled device pointed to by the second device information, so that the controlled device performs the operation indicated by the control instruction.
具体的,服务器根据查询到的第二设备信息,将控制设备发送的控制指令转发至第二设备信息指示的被控设备,被控设备根据控制指令执行相应的操作。例如,控制指令为节目调节、音量调节、开机或待机等。Specifically, the server forwards the control instruction sent by the control device to the controlled device indicated by the second device information according to the queried second device information, and the controlled device performs corresponding operations according to the control instruction. For example, the control instruction is program adjustment, volume adjustment, power on or standby, and the like.
在本实施例中,控制设备和被控设备直接使用自身安装的通用浏览器,不需要开发和安装专用的客户端控制软件,开发工作集中在服务器上的WebSocketServer与WebSocket HTML application,以及用于网页Web的请求与响应的WebServer。具体可采用lighttpd开源组件进行开发,并定制lighttpd.conf配置文件满足开发要求。In this embodiment, the control device and the controlled device directly use the general-purpose browser installed by themselves, without the need to develop and install special client control software, and the development work is concentrated on the WebSocketServer and WebSocket HTML application on the server, as well as the browser used for web pages. Web requests and responses to the WebServer. Specifically, lighttpd open source components can be used for development, and the lighttpd.conf configuration file can be customized to meet development requirements.
例如,定制lighttpd开源组件中的以下函数:For example, customize the following functions in the lighttpd open source component:
libwebsocket_create_context函数,用于建立WebSocket上下文;The libwebsocket_create_context function is used to establish a WebSocket context;
libwebsocket_context_destroy函数,用于销毁上下文;The libwebsocket_context_destroy function is used to destroy the context;
libwebsocket_service函数,用于提供WebSocket服务;The libwebsocket_service function is used to provide WebSocket services;
libwebsocket_write函数,用于将buffer缓冲发送到指定的客户端;The libwebsocket_write function is used to send the buffer buffer to the specified client;
libwebsocket_callback_on_writable_all_protocol函数,用于给WebSocket注册的协议回调函数发送消息。The libwebsocket_callback_on_writable_all_protocol function is used to send messages to the protocol callback function registered by WebSocket.
WebSocket HTML application,用于实现客户端与服务器交互、数据互访,以及协议解析,使用的函数主要为:onopen函数、onmessage函数、onclose函数、onerror回调函数和onmessage函数。WebSocket HTML application is used to realize client-server interaction, data exchange, and protocol analysis. The functions used are mainly: onopen function, onmessage function, onclose function, onerror callback function and onmessage function.
通过本发明的实施例,控制设备通过网页Web向服务器发送控制指令和自身的设备信息,服务器在绑定关系中查询与控制设备的设备信息相关联的被控设备的设备信息,将控制指令转发至被控设备,以使被控设备执行控制指令指示的操作,使控制设备实现了遥控多个设备的功能,控制设备不需要开发专有的客户端软件,只需要安装通用的浏览器就可以实现遥控器的功能,降低了开发成本。Through the embodiment of the present invention, the control device sends the control instruction and its own device information to the server through the web page, and the server queries the device information of the controlled device associated with the device information of the control device in the binding relationship, and forwards the control instruction To the controlled device, so that the controlled device performs the operation indicated by the control command, so that the control device realizes the function of remote control of multiple devices. The control device does not need to develop proprietary client software, only needs to install a common browser. The function of the remote controller is realized, and the development cost is reduced.
参见图3,为本发明第三实施例的一种遥控方法的流程示意图,在本实施例中,所述方法包括:Referring to FIG. 3 , it is a schematic flowchart of a remote control method according to the third embodiment of the present invention. In this embodiment, the method includes:
S301、控制设备通过网页Web接收操作指令。S301. The control device receives an operation instruction through a web page.
具体的,控制设备上显示有其向服务器请求的网页Web,Web上设置有操作控件,控制设备检测操作控件上的发生操作指令,例如,Web上显示有音量控制、节目控制或开关机控制等操作控件,控制设备检测操作控件上发生的触摸屏操作指令、鼠标操作指令或键盘事件等操作指令。Specifically, the webpage Web requested by the server is displayed on the control device, and operation controls are set on the Web, and the control device detects the operation instructions generated on the operation controls. For example, volume control, program control, or power on/off control are displayed on the Web. The control device detects operation instructions such as touch screen operation instructions, mouse operation instructions, or keyboard events that occur on the operation controls.
S302、控制设备根据操作指令生成控制指令,并向服务器发送控制指令和自身的第一设备信息,以使服务器在预设的绑定关系中查询与第一设备信息相关联的第二设备信息以及将控制指令发送至第二设备信息指向的被控设备,以使被控设备执行控制指令指示的操作。S302. The control device generates a control instruction according to the operation instruction, and sends the control instruction and its own first device information to the server, so that the server can query the second device information associated with the first device information in the preset binding relationship and Sending the control instruction to the controlled device pointed to by the second device information, so that the controlled device performs the operation indicated by the control instruction.
具体的,控制设备根据不同的操作控件上的操作指令生成对应的控制指令,例如控制指令为节目调节指令、音量调节指令或开关机指令等,控制设备获取自身的第一设备信息,将控制指令和第一设备信息通过已经建立的WebSocket协议连接发送至服务器,具体的,控制设备可以通过WebSocket协议中的socketobject.send函数发送控制指令。服务器中预先存储有表示控制设备和被控设备的绑定关系,在绑定关系中,控制设备和被控设备的设备信息进行映射,服务器接收到控制设备发送的第一设备信息,在该绑定关系中查询第一设备信息关联的第二设备信息。服务器根据查询到的第二设备信息,将控制设备发送的控制指令转发至第二设备信息指向的被控设备,被控设备根据控制指令执行相应的操作。Specifically, the control device generates corresponding control instructions according to the operation instructions on different operation controls. For example, the control instructions are program adjustment instructions, volume adjustment instructions, or power on/off instructions. The control device obtains its own first device information, and converts the control instructions The first device information is sent to the server through the established WebSocket protocol connection. Specifically, the control device can send a control command through the socketobject.send function in the WebSocket protocol. The server pre-stores the binding relationship between the control device and the controlled device. In the binding relationship, the device information of the control device and the controlled device is mapped, and the server receives the first device information sent by the control device. Query the second device information associated with the first device information in the given relationship. According to the queried second device information, the server forwards the control instruction sent by the control device to the controlled device pointed to by the second device information, and the controlled device performs corresponding operations according to the control instruction.
通过本发明的实施例,控制设备通过网页Web向服务器发送控制指令和自身的设备信息,服务器在绑定关系中查询与控制设备的设备信息相关联的被控设备的设备信息,将控制指令转发至被控设备,以使被控设备执行控制指令指示的操作,使控制设备实现了遥控多个设备的功能,控制设备不需要开发专有的客户端软件,只需要安装通用的浏览器就可以实现遥控器的功能,降低了开发成本。Through the embodiment of the present invention, the control device sends the control instruction and its own device information to the server through the web page, and the server queries the device information of the controlled device associated with the device information of the control device in the binding relationship, and forwards the control instruction To the controlled device, so that the controlled device performs the operation indicated by the control command, so that the control device realizes the function of remote control of multiple devices. The control device does not need to develop proprietary client software, only needs to install a common browser. The function of the remote controller is realized, and the development cost is reduced.
参见图4和图5,为本发明第四实施例的一种遥控方法的流程示意图,在本实施例中,所述方法包括:Referring to Fig. 4 and Fig. 5, it is a schematic flowchart of a remote control method according to the fourth embodiment of the present invention. In this embodiment, the method includes:
S401、控制设备向服务器发送第一登录请求,以使服务器根据第一登录请求验证控制设备的合法性;若接收到服务器验证合法的消息,控制设备通过WebSocket协议与服务器建立连接。S401. The control device sends a first login request to the server, so that the server verifies the legitimacy of the control device according to the first login request; if the server verifies legality is received, the control device establishes a connection with the server through the WebSocket protocol.
S402、控制设备接收服务器发送的设备信息集合,并将该设备信息集合存储至本地。S402. The control device receives the device information set sent by the server, and stores the device information set locally.
S403、控制设备将第一设备信息与设备信息集合中选取的第二设备信息进行绑定。S403. The control device binds the first device information with the second device information selected in the device information set.
S404、控制设备向服务器发送绑定请求,绑定请求包括第一设备信息和第二设备信息,以使服务器根据绑定请求建立控制设备和被控设备的绑定关系。S404. The control device sends a binding request to the server, where the binding request includes first device information and second device information, so that the server establishes a binding relationship between the control device and the controlled device according to the binding request.
S405、控制设备通过网页Web接收操作指令。S405. The control device receives the operation instruction through the web page.
具体的,控制设备上显示有向服务器请求的网页Web,Web上设置有操作控件,控制设备监听操作控件上的发生操作指令,例如,控制设备监听操作控件上发生的触摸屏操作指令、鼠标操作指令或键盘事件等操作指令。如图5所示的例子,控制设备为触摸屏设备,控制设备预先向服务器请求Web,Web上有节目调节控件、音量调节控件和录音控件等,控制设备检测Web上各个控件上发生的触摸屏操作指令,根据该触摸屏操作指令生成对应的控制指令。Specifically, the control device displays a webpage Web requesting to the server, and an operation control is set on the Web, and the control device monitors the operation instructions on the operation control, for example, the control device monitors the touch screen operation instructions and mouse operation instructions on the operation control. or keyboard events and other operating instructions. In the example shown in Figure 5, the control device is a touch screen device, and the control device requests the Web from the server in advance. There are program adjustment controls, volume adjustment controls, and recording controls, etc. on the Web, and the control device detects the touch screen operation instructions that occur on each control on the Web. , generating a corresponding control instruction according to the touch screen operation instruction.
S406、控制设备根据操作指令生成控制指令,并向服务器发送控制指令和自身的第一设备信息。S406. The control device generates a control instruction according to the operation instruction, and sends the control instruction and its own first device information to the server.
通过本发明的实施例,控制设备通过网页Web向服务器发送控制指令和自身的设备信息,服务器在绑定关系中查询与控制设备的设备信息相关联的被控设备的设备信息,将控制指令转发至被控设备,以使被控设备执行控制指令指示的操作,使控制设备实现了遥控多个设备的功能,控制设备不需要开发专有的客户端软件,只需要安装通用的浏览器就可以实现遥控器的功能,降低了开发成本。Through the embodiment of the present invention, the control device sends the control instruction and its own device information to the server through the web page, and the server queries the device information of the controlled device associated with the device information of the control device in the binding relationship, and forwards the control instruction To the controlled device, so that the controlled device performs the operation indicated by the control command, so that the control device realizes the function of remote control of multiple devices. The control device does not need to develop proprietary client software, only needs to install a common browser. The function of the remote controller is realized, and the development cost is reduced.
参见图6,为本发明第一实施例的一种服务器的结构示意图,在本实施例中,所述服务器包括接收模块11、查询模块12和发送模块13。Referring to FIG. 6 , it is a schematic structural diagram of a server according to the first embodiment of the present invention. In this embodiment, the server includes a receiving module 11 , a query module 12 and a sending module 13 .
接收模块11,用于接收控制设备通过网页Web发送的控制指令和所述控制设备的第一设备信息;The receiving module 11 is configured to receive the control instruction sent by the control device through the web page and the first device information of the control device;
查询模块12,用于在预设的绑定关系中查询与所述第一设备信息相关联的第二设备信息;A query module 12, configured to query second device information associated with the first device information in a preset binding relationship;
发送模块13,用于将所述控制指令发送至所述第二设备信息指向的被控设备,以使所述被控设备执行所述控制指令指示的操作。The sending module 13 is configured to send the control instruction to the controlled device to which the second device information points, so that the controlled device performs the operation indicated by the control instruction.
本实施例和方法实施例一基于同一构思,具体请参数方法实施例一的描述,此处不再赘述。This embodiment and the method embodiment 1 are based on the same idea, please refer to the description of the method embodiment 1 for details, and will not repeat them here.
进一步的,参见图7,为本发明第二实施例的一种服务器的结构示意图,在本实施例中,所述服务器除包括接收模块11、查询模块12和发送模块13之外,还包括连接模块14、设备信息获取模块15和关联模块16。Further, referring to FIG. 7 , it is a schematic structural diagram of a server according to the second embodiment of the present invention. In this embodiment, in addition to the receiving module 11, the query module 12 and the sending module 13, the server also includes a connection module 14, device information acquisition module 15 and association module 16.
连接模块14,用于接收控制设备发送的第一登录请求,并验证所述控制设备合法后,通过WebSocket协议与所述控制设备建立连接;及The connection module 14 is configured to receive the first login request sent by the control device, and establish a connection with the control device through the WebSocket protocol after verifying that the control device is legal; and
接收被控设备发送的第二登录请求,并验证所述被控设备合法后,通过WebSocket协议与所述被控设备建立连接。After receiving the second login request sent by the controlled device and verifying that the controlled device is legal, a connection is established with the controlled device through the WebSocket protocol.
设备信息获取模块15,用于获取所述控制设备的第一设备信息,并将所述第一设备信息推送至所述被控设备;及A device information obtaining module 15, configured to obtain first device information of the controlling device, and push the first device information to the controlled device; and
获取所述被控设备的第二设备信息,并将所述第二设备信息推送至所述控制设备。Acquiring second device information of the controlled device, and pushing the second device information to the controlling device.
关联模块16,用于接收所述控制设备发送的绑定请求,所述绑定请求中包括所述控制设备的第一设备信息和所述被控设备的第二设备信息;An associating module 16, configured to receive a binding request sent by the control device, where the binding request includes first device information of the control device and second device information of the controlled device;
将所述第一设备信息和第二设备信息进行关联后存储至所述绑定关系中。The first device information and the second device information are associated and stored in the binding relationship.
本实施例和方法实施例二基于同一构思,具体请参数方法实施例二的描述,此处不再赘述。This embodiment and the second method embodiment are based on the same idea, please refer to the description of the second method embodiment for details, and will not repeat them here.
通过本发明的实施例,控制设备通过网页Web向服务器发送控制指令和自身的设备信息,服务器在绑定关系中查询与控制设备的设备信息相关联的被控设备的设备信息,将控制指令转发至被控设备,以使被控设备执行控制指令指示的操作,使控制设备实现了遥控多个设备的功能,控制设备不需要开发专有的客户端软件,只需要安装通用的浏览器就可以实现遥控器的功能,降低了开发成本。Through the embodiment of the present invention, the control device sends the control instruction and its own device information to the server through the web page, and the server queries the device information of the controlled device associated with the device information of the control device in the binding relationship, and forwards the control instruction To the controlled device, so that the controlled device performs the operation indicated by the control command, so that the control device realizes the function of remote control of multiple devices. The control device does not need to develop proprietary client software, only needs to install a common browser. The function of the remote controller is realized, and the development cost is reduced.
参见图8,为本发明第三实施例的一种服务器的结构示意图,在本实施例中,服务器1包括处理器61和存储器62,服务器1中的处理器61的数量可以是一个或多个,图8以一个处理器为例。本发明的一些实施例中,处理器61和存储器62可通过总线或其他方式连接,图8中以总线连接为例。Referring to FIG. 8, it is a schematic structural diagram of a server according to the third embodiment of the present invention. In this embodiment, the server 1 includes a processor 61 and a memory 62, and the number of processors 61 in the server 1 can be one or more , Figure 8 takes a processor as an example. In some embodiments of the present invention, the processor 61 and the memory 62 may be connected through a bus or in other ways, and bus connection is taken as an example in FIG. 8 .
其中,存储器62中存储一组程序代码,且处理器61用于调用存储器62中存储的程序代码,用于执行以下操作:Wherein, a set of program codes are stored in the memory 62, and the processor 61 is used to call the program codes stored in the memory 62 to perform the following operations:
接收控制设备通过网页Web发送的控制指令和所述控制设备的第一设备信息;receiving the control instruction sent by the control device through the web page and the first device information of the control device;
在预设的绑定关系中查询与所述第一设备信息相关联的第二设备信息;Querying second device information associated with the first device information in a preset binding relationship;
将所述控制指令发送至所述第二设备信息指向的被控设备,以使所述被控设备执行所述控制指令指示的操作。sending the control instruction to the controlled device pointed to by the second device information, so that the controlled device performs the operation indicated by the control instruction.
在本发明的一些实施例中,处理器61还用于执行:In some embodiments of the present invention, the processor 61 is also used to execute:
接收控制设备发送的第一登录请求,并验证所述控制设备合法后,通过WebSocket协议与所述控制设备建立连接;及receiving the first login request sent by the control device, and establishing a connection with the control device through the WebSocket protocol after verifying that the control device is legal; and
接收被控设备发送的第二登录请求,并验证所述被控设备合法后,通过WebSocket协议与所述被控设备建立连接。After receiving the second login request sent by the controlled device and verifying that the controlled device is legal, a connection is established with the controlled device through the WebSocket protocol.
在本发明的一些实施例中,处理器61还用于执行:In some embodiments of the present invention, the processor 61 is also used to execute:
获取所述控制设备的第一设备信息,并将所述第一设备信息推送至所述被控设备;及Acquiring first device information of the controlling device, and pushing the first device information to the controlled device; and
获取所述被控设备的第二设备信息,并将所述第二设备信息推送至所述控制设备。Acquiring second device information of the controlled device, and pushing the second device information to the controlling device.
在本发明的一些实施例中,处理器61还用于执行:In some embodiments of the present invention, the processor 61 is also used to execute:
接收所述控制设备发送的绑定请求,所述绑定请求中包括所述控制设备的第一设备信息和所述被控设备的第二设备信息;receiving a binding request sent by the controlling device, where the binding request includes first device information of the controlling device and second device information of the controlled device;
将所述第一设备信息和第二设备信息进行关联后存储至所述绑定关系中。The first device information and the second device information are associated and stored in the binding relationship.
在本发明的一些实施例中,所述第一设备信息包所述控制设备的括主机名和IP地址,所述第二设备信息包括所述被控设备的主机名和IP地址。In some embodiments of the present invention, the first device information includes the host name and IP address of the controlling device, and the second device information includes the host name and IP address of the controlled device.
通过本发明的实施例,控制设备通过网页Web向服务器发送控制指令和自身的设备信息,服务器在绑定关系中查询与控制设备的设备信息相关联的被控设备的设备信息,将控制指令转发至被控设备,以使被控设备执行控制指令指示的操作,使控制设备实现了遥控多个设备的功能,控制设备不需要开发专有的客户端软件,只需要安装通用的浏览器就可以实现遥控器的功能,降低了开发成本。Through the embodiment of the present invention, the control device sends the control instruction and its own device information to the server through the web page, and the server queries the device information of the controlled device associated with the device information of the control device in the binding relationship, and forwards the control instruction To the controlled device, so that the controlled device performs the operation indicated by the control command, so that the control device realizes the function of remote control of multiple devices. The control device does not need to develop proprietary client software, only needs to install a common browser. The function of the remote controller is realized, and the development cost is reduced.
参见图9,为本发明第一实施例的一种控制设备的结构示意图,在本发明实施例中,所述控制设备包括监听模块21和指令发送模块22。Referring to FIG. 9 , it is a schematic structural diagram of a control device according to the first embodiment of the present invention. In the embodiment of the present invention, the control device includes a monitoring module 21 and an instruction sending module 22 .
监听模块21,用于通过网页Web接收操作指令;Listening module 21, is used for receiving operation instruction through webpage Web;
指令发送模块22,用于根据所述操作指令生成控制指令,并向服务器发送所述控制指令和自身的第一设备信息,以使所述服务器在预设的绑定关系中查询与所述第一设备信息相关联的第二设备信息以及将所述控制指令发送至所述第二设备信息指向的被控设备,以使所述被控设备执行所述控制指令指示的操作。The instruction sending module 22 is configured to generate a control instruction according to the operation instruction, and send the control instruction and its own first device information to the server, so that the server can query the device related to the first device in the preset binding relationship. Second device information associated with one piece of device information, and sending the control instruction to the controlled device pointed to by the second device information, so that the controlled device executes the operation indicated by the control instruction.
参见图10,为本发明第二实施例的一种控制设备的结构示意图,在本发明实施例中,所述控制设备除包括监听模块21和指令发送模块22之外,还包括:登陆模块23、设备信息接收模块24和绑定模块25。Referring to FIG. 10 , it is a schematic structural diagram of a control device according to the second embodiment of the present invention. In the embodiment of the present invention, the control device includes, in addition to a monitoring module 21 and an instruction sending module 22 , a login module 23 , a device information receiving module 24 and a binding module 25.
登录模块23,用于向服务器发送第一登录请求,以使所述服务器根据所述第一登录请求验证合法性;The login module 23 is configured to send a first login request to the server, so that the server verifies the legitimacy according to the first login request;
若接收到所述服务器验证合法的消息,通过WebSocket协议与所述服务器建立连接。If the message that the server is verified to be legal is received, a connection is established with the server through the WebSocket protocol.
设备信息接收模块24,用于接收所述服务器发送的设备信息集合,并将该设备信息集合存储至本地,所述设备信息集合包括至少一个与所述服务器建立连接的其他客户端的设备信息。The device information receiving module 24 is configured to receive the device information set sent by the server, and store the device information set locally, the device information set includes at least one device information of other clients that establish a connection with the server.
绑定模块25,用于将所述第一设备信息与所述设备信息集合中选取的第二设备信息进行绑定;向所述服务器发送绑定请求,所述绑定请求包括所述第一设备信息和所述第二设备信息,以使所述服务器根据所述绑定请求建立所述控制设备和所述被控设备的绑定关系。Binding module 25, configured to bind the first device information with the second device information selected in the device information set; send a binding request to the server, the binding request includes the first device information and the second device information, so that the server establishes a binding relationship between the controlling device and the controlled device according to the binding request.
参见图11,为本发明第三实施例的一种控制设备的结构示意图,在本实施例中,控制设备2包括处理器71、存储器72、输入装置73和输出装置74,控制设备2中的处理器71的数量可以是一个或多个,图11以一个处理器为例。本发明的一些实施例中,处理器71、存储器72、输入装置73和输出装置74可通过总线或其他方式连接,图11中以总线连接为例。Referring to FIG. 11 , it is a schematic structural diagram of a control device according to the third embodiment of the present invention. In this embodiment, the control device 2 includes a processor 71, a memory 72, an input device 73 and an output device 74. The control device 2 The number of processors 71 may be one or more, and one processor is taken as an example in FIG. 11 . In some embodiments of the present invention, the processor 71 , the memory 72 , the input device 73 and the output device 74 may be connected via a bus or in other ways, and bus connection is taken as an example in FIG. 11 .
其中,存储器72中存储一组程序代码,且处理器71用于调用存储器72中存储的程序代码,用于执行以下操作:Wherein, a set of program codes are stored in the memory 72, and the processor 71 is used to call the program codes stored in the memory 72 to perform the following operations:
通过网页Web接收操作指令;Receive operation instructions through the web page;
根据所述操作指令生成控制指令,并向服务器发送所述控制指令和自身的第一设备信息,以使所述服务器在预设的绑定关系中查询与所述第一设备信息相关联的第二设备信息以及将所述控制指令发送至所述第二设备信息指向的被控设备,以使所述被控设备执行所述控制指令指示的操作。Generate a control instruction according to the operation instruction, and send the control instruction and its own first device information to the server, so that the server can query the first device information associated with the first device information in a preset binding relationship. and sending the control instruction to the controlled device pointed to by the second device information, so that the controlled device performs the operation indicated by the control instruction.
在本发明的一些实施例中,处理器71还用于执行:In some embodiments of the present invention, the processor 71 is also used to execute:
向服务器发送第一登录请求,以使所述服务器根据所述第一登录请求验证合法性;Sending a first login request to a server, so that the server verifies legitimacy according to the first login request;
若接收到所述服务器验证合法的消息,通过WebSocket协议与所述服务器建立连接。If the message that the server is verified to be legal is received, a connection is established with the server through the WebSocket protocol.
在本发明的一些实施例中,处理器71还用于执行:In some embodiments of the present invention, the processor 71 is also used to execute:
接收所述服务器发送的设备信息集合,并将该设备信息集合存储至本地,所述设备信息集合包括至少一个与所述服务器建立连接的其他客户端的设备信息。The device information set sent by the server is received, and the device information set is stored locally, the device information set includes at least one device information of other clients that establish a connection with the server.
在本发明的一些实施例中,处理器71还用于执行:In some embodiments of the present invention, the processor 71 is also used to execute:
将所述第一设备信息与所述设备信息集合中选取的第二设备信息进行绑定;Bind the first device information with the second device information selected in the device information set;
向所述服务器发送绑定请求,所述绑定请求包括所述第一设备信息和所述第二设备信息,以使所述服务器根据所述绑定请求建立所述控制设备和所述被控设备的绑定关系。sending a binding request to the server, where the binding request includes the first device information and the second device information, so that the server establishes the control device and the controlled device according to the binding request The binding relationship of the device.
通过本发明的实施例,控制设备通过网页Web向服务器发送控制指令和自身的设备信息,服务器在绑定关系中查询与控制设备的设备信息相关联的被控设备的设备信息,将控制指令转发至被控设备,以使被控设备执行控制指令指示的操作,使控制设备实现了遥控多个设备的功能,控制设备不需要开发专有的客户端软件,只需要安装通用的浏览器就可以实现遥控器的功能,降低了开发成本。Through the embodiment of the present invention, the control device sends the control instruction and its own device information to the server through the web page, and the server queries the device information of the controlled device associated with the device information of the control device in the binding relationship, and forwards the control instruction To the controlled device, so that the controlled device performs the operation indicated by the control command, so that the control device realizes the function of remote control of multiple devices. The control device does not need to develop proprietary client software, only needs to install a common browser. The function of the remote controller is realized, and the development cost is reduced.
参见图12,为本发明实施例的一种控制系统的交互流程图,控制系统包括控制设备2、服务器1和被控设备3,与服务器连接的被控设备的数量可以为多个,本实施例中以一个为例,交互流程包括:Referring to Fig. 12, it is an interactive flowchart of a control system according to an embodiment of the present invention. The control system includes a control device 2, a server 1 and a controlled device 3, and the number of controlled devices connected to the server may be multiple. This embodiment Take one as an example, the interaction process includes:
S501、控制设备向服务器发送第一登录请求。S501. The control device sends a first login request to a server.
S502、被控设备向服务器发送第二登录请求。S502. The controlled device sends a second login request to the server.
S503、服务器验证控制设备和被控设备的合法性。S503. The server verifies the legitimacy of the control device and the controlled device.
S504、服务器根据第一登录请求验证控制设备合法后,通过WebSocket协议与控制设备建立连接。S504. After verifying that the control device is legal according to the first login request, the server establishes a connection with the control device through the WebSocket protocol.
S505、服务器根据第二登录请求验证被控设备合法后,通过WebSocket协议与被控设备建立连接。S505. After verifying that the controlled device is legal according to the second login request, the server establishes a connection with the controlled device through the WebSocket protocol.
S506、服务器获取控制设备的第一设备信息和被控设备的第二设备信息。S506. The server acquires first device information of the controlling device and second device information of the controlled device.
S507、服务器向控制设备发送第二设备信息。S507. The server sends the second device information to the control device.
S508、服务器向被控设备发送第一设备信息。S508. The server sends the first device information to the controlled device.
S509、客户端向服务器发送绑定请求,绑定请求中携带第一设备信息和第二设备信息。S509. The client sends a binding request to the server, where the binding request carries the first device information and the second device information.
S510、服务器将第一设备信息和第二设备信息进行绑定,建立控制设备和被控设备的映射关系。S510. The server binds the first device information and the second device information, and establishes a mapping relationship between the control device and the controlled device.
S511、控制设备向服务器发送控制指令和第一设备信息。S511. The control device sends a control instruction and first device information to a server.
S512、服务器查询第一设备信息关联的第二设备信息。S512. The server queries the second device information associated with the first device information.
S513、服务器将控制指令转发至第二设备信息指向的被控设备。S513. The server forwards the control instruction to the controlled device pointed to by the second device information.
S514、被控设备执行控制指令指示的操作。S514. The controlled device executes the operation indicated by the control instruction.
通过本发明的实施例,控制设备通过网页Web向服务器发送控制指令和自身的设备信息,服务器在绑定关系中查询与控制设备的设备信息相关联的被控设备的设备信息,将控制指令转发至被控设备,以使被控设备执行控制指令指示的操作,使控制设备实现了遥控多个设备的功能,控制设备不需要开发专有的客户端软件,只需要安装通用的浏览器就可以实现遥控器的功能,降低了开发成本。Through the embodiment of the present invention, the control device sends the control instruction and its own device information to the server through the web page, and the server queries the device information of the controlled device associated with the device information of the control device in the binding relationship, and forwards the control instruction To the controlled device, so that the controlled device performs the operation indicated by the control command, so that the control device realizes the function of remote control of multiple devices. The control device does not need to develop proprietary client software, only needs to install a common browser. The function of the remote controller is realized, and the development cost is reduced.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the programs can be stored in a computer-readable storage medium. During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM), etc.
以上所揭露的仅为本发明一种较佳实施例而已,当然不能以此来限定本发明之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本发明权利要求所作的等同变化,仍属于发明所涵盖的范围。What is disclosed above is only a preferred embodiment of the present invention, and of course it cannot limit the scope of rights of the present invention. Those of ordinary skill in the art can understand all or part of the process for realizing the above embodiments, and according to the rights of the present invention The equivalent changes required still belong to the scope covered by the invention.
Claims (19)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410167082.9A CN103957249A (en) | 2014-04-23 | 2014-04-23 | Remote control method, server and control device and system |
| PCT/CN2015/077095 WO2015161786A1 (en) | 2014-04-23 | 2015-04-21 | Remote control method, server, control device and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410167082.9A CN103957249A (en) | 2014-04-23 | 2014-04-23 | Remote control method, server and control device and system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN103957249A true CN103957249A (en) | 2014-07-30 |
Family
ID=51334472
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201410167082.9A Pending CN103957249A (en) | 2014-04-23 | 2014-04-23 | Remote control method, server and control device and system |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN103957249A (en) |
| WO (1) | WO2015161786A1 (en) |
Cited By (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104615456A (en) * | 2014-12-30 | 2015-05-13 | 联想(北京)有限公司 | Information processing method and center control equipment |
| CN104618440A (en) * | 2014-12-31 | 2015-05-13 | 腾讯科技(深圳)有限公司 | Intelligent equipment control method and device |
| WO2015161786A1 (en) * | 2014-04-23 | 2015-10-29 | 华为终端有限公司 | Remote control method, server, control device and system |
| CN105072171A (en) * | 2015-07-31 | 2015-11-18 | 安一恒通(北京)科技有限公司 | Method and apparatus for remote control of terminal |
| CN105959187A (en) * | 2016-05-19 | 2016-09-21 | 青岛海信传媒网络技术有限公司 | Remote timing task control method and system |
| CN106161385A (en) * | 2015-04-15 | 2016-11-23 | 腾讯科技(上海)有限公司 | The long-range control method of a kind of equipment and device |
| CN106161341A (en) * | 2015-03-27 | 2016-11-23 | 上海科泰世纪科技有限公司 | Control method, control server and control system |
| CN106792058A (en) * | 2016-12-30 | 2017-05-31 | 新东网科技有限公司 | A kind of video screen long-distance remote-control method |
| CN106936935A (en) * | 2017-04-28 | 2017-07-07 | 新华三技术有限公司 | A kind of long-range control method and device |
| CN107509198A (en) * | 2017-08-31 | 2017-12-22 | 高创(苏州)电子有限公司 | A control method and related device of an electronic photo frame |
| CN107979524A (en) * | 2016-10-21 | 2018-05-01 | 李佰聪 | Method and device architecture for remote device control through instant communication system |
| CN108170536A (en) * | 2016-12-07 | 2018-06-15 | 北大医疗信息技术有限公司 | The expanding method and device of web program |
| CN109981891A (en) * | 2019-02-27 | 2019-07-05 | 维沃移动通信有限公司 | A kind of terminal control method, device and terminal device |
| CN113452588A (en) * | 2021-06-29 | 2021-09-28 | 青岛海尔科技有限公司 | Display method and device of equipment binding list, storage medium and electronic device |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111414237B (en) * | 2020-03-27 | 2024-12-20 | 西安万像电子科技有限公司 | Remote control method and system |
| CN118233445A (en) * | 2023-10-17 | 2024-06-21 | 厦门海辰储能科技股份有限公司 | Energy storage management method, energy storage management system, computer equipment and storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2009014375A1 (en) * | 2007-07-23 | 2009-01-29 | Lg Electronics Inc. | Remote controller, and system and method for remotely controlling digital television |
| CN102223402A (en) * | 2011-05-31 | 2011-10-19 | 佘培嘉 | Universal remote controller control system for virtual key control through non-man-machine interface |
| CN103024503A (en) * | 2012-07-05 | 2013-04-03 | 合一网络技术(北京)有限公司 | System and method for achieving remote control through mobile communication equipment terminal |
| CN103049190A (en) * | 2012-12-12 | 2013-04-17 | 北京奇虎科技有限公司 | Mobile communication terminal and method controlling device operation |
| CN103399548A (en) * | 2013-07-31 | 2013-11-20 | 惠州Tcl移动通信有限公司 | Remote controlling method of intelligent equipment, mobile terminal, intelligent equipment and system |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060112171A1 (en) * | 2004-11-19 | 2006-05-25 | Rader Shawn T | System and method to control devices using a remote control device via hypertext transfer protocol (HTTP) |
| CN103105944A (en) * | 2013-02-28 | 2013-05-15 | 用友软件股份有限公司 | Operating terminal and server and remote control system and remote control method |
| CN103957249A (en) * | 2014-04-23 | 2014-07-30 | 华为终端有限公司 | Remote control method, server and control device and system |
-
2014
- 2014-04-23 CN CN201410167082.9A patent/CN103957249A/en active Pending
-
2015
- 2015-04-21 WO PCT/CN2015/077095 patent/WO2015161786A1/en not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2009014375A1 (en) * | 2007-07-23 | 2009-01-29 | Lg Electronics Inc. | Remote controller, and system and method for remotely controlling digital television |
| CN102223402A (en) * | 2011-05-31 | 2011-10-19 | 佘培嘉 | Universal remote controller control system for virtual key control through non-man-machine interface |
| CN103024503A (en) * | 2012-07-05 | 2013-04-03 | 合一网络技术(北京)有限公司 | System and method for achieving remote control through mobile communication equipment terminal |
| CN103049190A (en) * | 2012-12-12 | 2013-04-17 | 北京奇虎科技有限公司 | Mobile communication terminal and method controlling device operation |
| CN103399548A (en) * | 2013-07-31 | 2013-11-20 | 惠州Tcl移动通信有限公司 | Remote controlling method of intelligent equipment, mobile terminal, intelligent equipment and system |
Cited By (24)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2015161786A1 (en) * | 2014-04-23 | 2015-10-29 | 华为终端有限公司 | Remote control method, server, control device and system |
| CN104615456A (en) * | 2014-12-30 | 2015-05-13 | 联想(北京)有限公司 | Information processing method and center control equipment |
| US10264424B2 (en) | 2014-12-30 | 2019-04-16 | Lenovo (Beijing) Co., Ltd. | Information processing method and central control device |
| CN104615456B (en) * | 2014-12-30 | 2019-02-05 | 联想(北京)有限公司 | A kind of information processing method and control device |
| CN104618440B (en) * | 2014-12-31 | 2018-03-23 | 腾讯科技(深圳)有限公司 | Smart machine control method and device |
| CN104618440A (en) * | 2014-12-31 | 2015-05-13 | 腾讯科技(深圳)有限公司 | Intelligent equipment control method and device |
| US10834237B2 (en) | 2014-12-31 | 2020-11-10 | Tencent Technology (Shenzhen) Company Limited | Method, apparatus, and storage medium for controlling cooperation of multiple intelligent devices with social application platform |
| US10326861B2 (en) | 2014-12-31 | 2019-06-18 | Tencent Technology (Shenzhen) Company Limited | Method for controlling cooperation of multiple intelligent devices and apparatus thereof |
| CN106161341A (en) * | 2015-03-27 | 2016-11-23 | 上海科泰世纪科技有限公司 | Control method, control server and control system |
| CN106161385B (en) * | 2015-04-15 | 2020-06-16 | 腾讯科技(上海)有限公司 | A kind of remote control method and device of equipment |
| CN106161385A (en) * | 2015-04-15 | 2016-11-23 | 腾讯科技(上海)有限公司 | The long-range control method of a kind of equipment and device |
| WO2017020523A1 (en) * | 2015-07-31 | 2017-02-09 | 安一恒通(北京)科技有限公司 | Method and apparatus for remote control of terminal |
| CN105072171A (en) * | 2015-07-31 | 2015-11-18 | 安一恒通(北京)科技有限公司 | Method and apparatus for remote control of terminal |
| CN105959187A (en) * | 2016-05-19 | 2016-09-21 | 青岛海信传媒网络技术有限公司 | Remote timing task control method and system |
| CN107979524A (en) * | 2016-10-21 | 2018-05-01 | 李佰聪 | Method and device architecture for remote device control through instant communication system |
| CN108170536A (en) * | 2016-12-07 | 2018-06-15 | 北大医疗信息技术有限公司 | The expanding method and device of web program |
| CN108170536B (en) * | 2016-12-07 | 2023-07-04 | 北大医疗信息技术有限公司 | Expanding method and device of WEB program |
| CN106792058A (en) * | 2016-12-30 | 2017-05-31 | 新东网科技有限公司 | A kind of video screen long-distance remote-control method |
| CN106936935A (en) * | 2017-04-28 | 2017-07-07 | 新华三技术有限公司 | A kind of long-range control method and device |
| CN106936935B (en) * | 2017-04-28 | 2021-02-23 | 新华三技术有限公司 | Remote control method and device |
| CN107509198A (en) * | 2017-08-31 | 2017-12-22 | 高创(苏州)电子有限公司 | A control method and related device of an electronic photo frame |
| US10831816B2 (en) | 2017-08-31 | 2020-11-10 | K-Tronics (Suzhou) Technology Co., Ltd. | Method for controlling electronic picture frame, electronic picture frame, electronic picture frame cloud platform and mobile terminal |
| CN109981891A (en) * | 2019-02-27 | 2019-07-05 | 维沃移动通信有限公司 | A kind of terminal control method, device and terminal device |
| CN113452588A (en) * | 2021-06-29 | 2021-09-28 | 青岛海尔科技有限公司 | Display method and device of equipment binding list, storage medium and electronic device |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2015161786A1 (en) | 2015-10-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103957249A (en) | Remote control method, server and control device and system | |
| CN103024503B (en) | System and method for achieving remote control through mobile communication equipment terminal | |
| CN103460670B (en) | Method and system for conducting a remote desktop session using an HTTP handler and a remote desktop client common interface | |
| CN103430164B (en) | Wei Si Technology Co., Ltd. | |
| CN104618435B (en) | Method for realizing remote desktop and remote desktop management system | |
| CN100444570C (en) | Information processing device, network system, and control method for network system | |
| JP5870471B2 (en) | Method, apparatus, and system for sharing software between terminals | |
| WO2014090016A1 (en) | Device control method and mobile communication terminal | |
| CN106028106A (en) | Television control method and device | |
| US10581993B2 (en) | Method for forwarding traffic in application on mobile intelligent terminal | |
| CA2925279C (en) | Method and apparatus for device-specific communication between application programs | |
| JP5976210B2 (en) | Monitoring system, facility management apparatus, monitoring method and program | |
| CN107580011B (en) | A data sharing method and desktop cloud server | |
| CN104539596A (en) | Method, device and system for streaming media transmission | |
| CN106679095B (en) | A kind of method, apparatus and intelligent air-conditioning system of interconnection access | |
| TW201442503A (en) | System and method for sharing data via cloud | |
| CN103051694B (en) | The method and mobile communication terminal of mobile communication terminal control device | |
| CN103067448B (en) | device control method and mobile communication terminal | |
| TW201339850A (en) | Remote desktop management system and method | |
| US20120030746A1 (en) | Devices and Methods for Using HTTP Encapsulation to Access Web Resources | |
| KR101857020B1 (en) | Apparatas and method for managing service of providing server in a terminal | |
| CN106570045B (en) | Data operation control method and system and user terminal | |
| CN114679486B (en) | Communication interaction method and system, application terminal, client terminal and transfer server terminal | |
| JP2018501572A (en) | Data communication method and apparatus | |
| CN105721251A (en) | Reconfigurable testing pile service method and system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140730 |
|
| RJ01 | Rejection of invention patent application after publication |