CN103200070B - A kind of control terminal and its control method - Google Patents

A kind of control terminal and its control method Download PDF

Info

Publication number
CN103200070B
CN103200070B CN201310109664.7A CN201310109664A CN103200070B CN 103200070 B CN103200070 B CN 103200070B CN 201310109664 A CN201310109664 A CN 201310109664A CN 103200070 B CN103200070 B CN 103200070B
Authority
CN
China
Prior art keywords
target device
control
lan
wide area
area network
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.)
Expired - Fee Related
Application number
CN201310109664.7A
Other languages
Chinese (zh)
Other versions
CN103200070A (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 CN201310109664.7A priority Critical patent/CN103200070B/en
Publication of CN103200070A publication Critical patent/CN103200070A/en
Application granted granted Critical
Publication of CN103200070B publication Critical patent/CN103200070B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

A kind of control terminal and its control method provided in an embodiment of the present invention, the control terminal control method include:Log on request is sent to server, after logging in successfully, establishes the communication link based on XMPP protocol with server;The information and record of wide area network online equipment terminal are obtained, the online device end of scanning LAN simultaneously records the information of LAN online equipment terminal;Judge whether that producing target device selectes event, if producing target device selectes event, device end target device selected in event is chosen to be target device;Communication pattern is determined according to the presence of predetermined control model and target device.The automatic switchover of control model can be realized by the control terminal and its control method of the present invention.

Description

A kind of control terminal and its control method
Technical field
The present invention relates to the communications field, more particularly to a kind of control terminal and its control method.
Background technology
With the development of the development and popularization, especially cloud computing technology of Internet technology, there are so-called cloud household electrical appliances Intelligent appliance product.Cloud appliance system is typically to be made of device end and cloud server, control terminal three parts.Equipment is whole While end provides complete household electrical appliances functions, it is responsible for the functions such as data acquisition, command response processing, data receiver, state reporting;Cloud End server mainly realizes message, data sending, various data minings, analysis and valued added applications;Control terminal mainly provides use The function of family remote control and query facility state.
In existing cloud appliance system, control terminal is mainly based upon XMPP protocol and home appliance terminal is remotely grasped Control, even if user stays at home, control command is still to be forwarded by cloud server, when network is bad, be might have very serious Delay.In addition, also there are some home appliance terminals to add local area network control module, but these home appliance terminals are usual Wide area network control path and local network control path are separately handled, to avoid mutual exclusion conflict, but it is more also therefore to cause interface Sample, disunity, software development difficulty are big.
The content of the invention
An embodiment of the present invention provides a kind of control terminal control method, it is intended to the control of home appliance control terminal is solved, it is real The automatic switchover of current situation domain net control model and wide area network control model.
The control terminal control method, includes the following steps:
Log on request is sent to server, after logging in successfully, establishes the communication chain based on XMPP protocol with server Road;
The information and record of wide area network online equipment terminal are obtained, the online device end of scanning LAN simultaneously records local The information of net online equipment terminal;
Judge whether that producing target device selectes event, if producing target device selectes event, target device is selected The device end determined in event is chosen to be target device;
Communication pattern is determined according to the presence of predetermined control model and target device.
The step of presence according to predetermined control model and target device determines communication pattern includes:Sentence Predetermined control model of breaking is LAN control model or wide area network control model, and to belong to LAN online for target device Equipment or wide area network online equipment, when predetermined control model is LAN control model and target device belongs to LAN and exists During line equipment, notice communication unit establishes the communication link based on UPnP protocol with target device, sends and controls to target device Request, obtains the description information of target device, establishes the communication link based on UPnP protocol with target device;When predetermined control Molding formula is wide area network control model and when target device belongs to wide area network online equipment, inquires about the status information of target device, Receive the status information for the target device that server returns and storage.
It is described to judge that predetermined control model is LAN control model or wide area network control model, and target device Belong to LAN online equipment or wide area network online equipment, when predetermined control model is LAN control model and target is set For when belonging to LAN online equipment, notice communication unit establishes the communication link based on UPnP protocol with target device, to mesh Marking device sends control data, obtains the description information of target device, establishes the communication based on UPnP protocol with target device Link;When predetermined control model is wide area network control model and target device belongs to wide area network online equipment, target is inquired about The step of status information of equipment, the status information and the storage that receive the target device that server returns, further comprises:When pre- Fixed control model is LAN control model and when target device belongs to wide area network online equipment, inquires about the state of target device Information, receives status information and the storage of the target device that server returns;When predetermined control model is wide area network control mould When formula and target device belong to LAN online equipment, notice communication unit establishes the communication based on UPnP protocol with target device Link, sends control data to target device, obtains the description information of target device, establishes and is assisted with target device based on UPnP The communication link of view.
It is described when predetermined control model is LAN control model and target device belongs to LAN online equipment, lead to Know that communication unit establishes the communication link based on UPnP protocol with target device, send control data to target device, obtain mesh Further include and will control after the step of description information of marking device, foundation and communication link based on UPnP protocol of target device Mode record is LAN control model, performs the operation of local network control molding formula;When predetermined control model is wide area network control When pattern and target device belong to wide area network online equipment, the status information of target device is inquired about, receives the mesh that server returns Further included after the step of status information of marking device and storage and control model is recorded as wide area network control model, perform wide area Net control model operates;When predetermined control model is LAN control model and target device belongs to wide area network online equipment When, after the step of inquiring about the status information of target device, receiving status information and the storage for the target device that server returns Further include and control model is recorded as wide area network control model, perform the operation of wide area network control model;When predetermined control model It is wide area network control model and when target device belongs to LAN online equipment, notice communication unit is based on target device foundation The communication link of UPnP protocol, control data is sent to target device, obtains the description information of target device, and foundation is set with target Further included after the step of standby communication link based on UPnP protocol and control model is recorded as LAN control model, performed LAN control model operates.
The LAN control model operation includes:
The control of performance objective equipment is monitored;
Judge whether to produce target device control event, if producing target device control event, handle target device Control event, is then back to and continues to execute target device control action listener;If not producing target device control event, According to the online device end of predetermined time cycle scanning LAN, the information record of renewal LAN online equipment terminal;
Judge whether target device belongs to LAN and set online according to the information of the LAN online equipment terminal after renewal It is standby, if LAN online equipment, then return and continue to execute target device control action listener;It is online if not LAN Equipment, then judge whether target device belongs to wide area network online equipment, if target device belongs to wide area network online equipment, will control Molding formula is recorded as wide area network control model, performs the operation of wide area network control model;Exist if target device is not belonging to wide area network Line equipment then judges that target device is not online, releases the selected of target device, returns and performs acquisition wide area network online equipment terminal Information and record, the online device end of scanning LAN and the step of record the information of LAN online equipment terminal.
Under LAN control model, the processing target device control event specifically includes:
Event is controlled to receive the control command to target device according to the target device;
The control command is forwarded to communication unit;
By the control command be converted into after the control command based on UPnP protocol by with target device based on UPnP The communication link of agreement sends target device to.
It is described by the control command be converted into after the control command based on UPnP protocol by with target device based on The step of communication link of UPnP protocol sends target device to further includes:It is converted into when by the control command based on UPnP associations When sending target device failure to by the communication link based on UPnP protocol with target device after the control command of view, it will control Molding formula is recorded as wide area network control model, after the control command to be converted into the control command based on XMPP protocol, passes through Server is sent to the communication link based on XMPP protocol of server.
The wide area network control model operation includes:
Performance objective equipment controls action listener;
Judge whether to produce target device control event, if producing target device control event, performance objective equipment Event handling is controlled, is then back to and continues to execute target device control action listener;If target device control thing is not produced Part, then obtain the information and more new record of wide area network online equipment terminal according to the predetermined time cycle;
Judge whether target device belongs to wide area network and set online according to the information of the wide area network online equipment terminal after renewal It is standby, if wide area network online equipment, then return and continue to execute target device control action listener;It is online if not wide area network Equipment, then judge whether target device belongs to LAN online equipment, if target device belongs to LAN online equipment, will control Molding formula is recorded as LAN control model, performs the operation of local network control molding formula;Exist if target device is not belonging to LAN Line equipment then judges that target device is not online, releases the selected of target device and returns to execution acquisition wide area network online equipment terminal Information and record, the online device end of scanning LAN and the step of record the information of LAN online equipment terminal.
Under wide area network control model, the processing target device control event specifically includes:
Event is controlled to receive the control command to target device according to the target device;
The control command is forwarded to communication unit;
The control command is converted into after the control command based on XMPP protocol by being assisted with server based on XMPP The communication link of view sends server to.
It is described by the control command be converted into after the control command based on XMPP protocol by with server based on The step of communication link of XMPP protocol sends server to further includes:When the control command is converted into be based on XMPP protocol Control command after when sending server failure to by the communication link based on XMPP protocol with server, by control model LAN control model is recorded as, the control command is converted into after the control command based on UPnP protocol by being set with target The standby communication link based on UPnP protocol sends target device to.
It is described to judge whether that producing target device selectes event, if producing target device selectes event, target is set The step of alternative device end determined in event is chosen to be target device further comprises:If do not produce target device to select Event, then judge whether the target device being selected, if there is the target device being selected, then according to pre- Fixed control model and the presence of the target device being selected determine the need for switching control pattern;If The target device not being selected, then return to the information and record for performing and obtaining wide area network online equipment terminal, scanning office The step of domain nets online device end and records the information of LAN online equipment terminal.
The presence according to predetermined control model and the target device being selected determines whether need The step of wanting switching control pattern includes:When predetermined control model is LAN control model and the mesh being selected When marking device belongs to LAN online equipment, control model is recorded as LAN control model, performs local network control molding formula Operation;When predetermined control model be wide area network control model and the target device being selected to belong to wide area network online During equipment, control model is recorded as wide area network control model, performs the operation of wide area network control model;It has been selected when described Target device be not only not belonging to LAN online equipment, but also when being not belonging to wide area network online equipment, return to perform and obtain wide area network The information and record of online equipment terminal, the online device end of scanning LAN simultaneously record the letter of LAN online equipment terminal The step of breath.
The presence according to predetermined control model and the target device being selected determines whether need The step of wanting switching control pattern further includes:When predetermined control model is LAN control model and described has been selected When target device belongs to wide area network online equipment, control model is recorded as wide area network control model, performs wide area network control mould Formula operates;When predetermined control model is wide area network control model and the target device being selected belongs to LAN and exists During line equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula.
It is described to send log on request to server, after logging in successfully, establish logical based on XMPP protocol with server Further included before the step of believing link:Initialize control terminal.
The predetermined control model refers to the predetermined control model for needing preferentially to use of control terminal, Huo Zheyong The control model for needing preferentially to use that family determines.
The embodiment of the present invention additionally provides a kind of control terminal, which includes:
Log-in module, for sending log on request to server, after logging in successfully, is established with server based on XMPP The communication link of agreement;
Online equipment end message logging modle, for obtaining the information and record of wide area network online equipment terminal, and For scanning the online device end of LAN and recording the information of LAN online equipment terminal;
Target device selectes event judge module, for judging whether that producing target device selectes event, if producing mesh Marking device selectes event, then the device end selected target device in event is chosen to be target device;
Communication pattern determining module, for determining to communicate according to the presence of predetermined control model and target device Pattern.
The communication pattern determining module is specifically used for:Judge that predetermined control model is LAN control model or wide Domain net control model, and target device belong to LAN online equipment or wide area network online equipment, when predetermined control mould Formula is LAN control model and when target device belongs to LAN online equipment, and notice communication unit establishes base with target device In the communication link of UPnP protocol, control data is sent to target device, obtains the description information of target device, foundation and target The communication link based on UPnP protocol of equipment;When predetermined control model is wide area network control model and target device belongs to wide During the net online equipment of domain, the status information of target device is inquired about, the status information for the target device that server returns is received and deposits Storage.
The communication pattern determining module is further used for:When predetermined control model is LAN control model and target When equipment belongs to wide area network online equipment, the status information of target device is inquired about, receives the shape for the target device that server returns State information simultaneously stores;When predetermined control model is wide area network control model and target device belongs to LAN online equipment, Notify communication unit to establish the communication link based on UPnP protocol with target device, send control data to target device, obtain The description information of target device, establishes the communication link based on UPnP protocol with target device.
The communication pattern determining module is further additionally operable to:When predetermined control model is LAN control model and mesh When marking device belongs to LAN online equipment, notice communication unit establishes the communication link based on UPnP protocol with target device, Control data is sent to target device, obtain the description information of target device, establish with target device based on UPnP protocol Control model is recorded as LAN control model after communication link, performs the operation of local network control molding formula;When predetermined control Molding formula is wide area network control model and when target device belongs to wide area network online equipment, inquires about the status information of target device, Control model is recorded as wide area network control model after the status information for the target device that reception server returns and storage, is held Row wide area network control model operates;When predetermined control model be LAN control model and target device to belong to wide area network online During equipment, the status information of target device is inquired about, will after receiving the status information for the target device that server returns and storing Control model is recorded as wide area network control model, performs the operation of wide area network control model;When predetermined control model is wide area network When control model and target device belong to LAN online equipment, notice communication unit is established with target device and is based on UPnP protocol Communication link, send control data to target device, obtain the description information of target device, establish with target device based on Control model is recorded as LAN control model after the communication link of UPnP protocol, performs the operation of local network control molding formula.
The communication pattern determining module includes LAN control model operation module, the LAN control model operation Module specifically includes:
First monitors module, controls and monitors for performance objective equipment;
First judgment module, for judging whether to produce target device control event, if producing target device control thing Part, then handle target device control event, is then back to and continues to execute target device control action listener;If do not produce mesh Marking device controls event, then is set online according to the online device end of predetermined time cycle scanning LAN, renewal LAN The information record of standby terminal;
Second judgment module, for whether judging target device according to the information of the LAN online equipment terminal after renewal Belong to LAN online equipment, if LAN online equipment, then return and continue to execute target device control action listener;Such as Fruit is not LAN online equipment, then judges whether target device belongs to wide area network online equipment, if target device belongs to wide Domain net online equipment, wide area network control model is recorded as by control model, performs the operation of wide area network control model;If target is set Then judge that target device is not online for wide area network online equipment is not belonging to, release the selected of target device, return and perform acquisition extensively The information and record of domain net online equipment terminal, the online device end of scanning LAN simultaneously record LAN online equipment terminal Information.
The LAN control model operation module includes local network destination equipment control event processing module, the local Mesh marking device control event processing module is used for:Ordered according to the control that the target device controls event to receive to target device Order, forwards the control command to lead to communication unit after the control command is converted into the control command based on UPnP protocol Cross and send target device to the communication link based on UPnP protocol of target device.
The local network destination equipment control event processing module is additionally operable to:It is converted into being based on when by the control command Target device is sent to after the control command of UPnP protocol by the communication link based on UPnP protocol with target device to fail When, control model is recorded as wide area network control model, the control command is converted into the control command based on XMPP protocol Afterwards, server is sent to by the communication link based on XMPP protocol with server.
The communication pattern determining module includes wide area network control model operation module, the wide area network control model operation Module specifically includes:
Second monitors module, and action listener is controlled for performance objective equipment;
3rd judgment module, for judging whether to produce target device control event, if producing target device control thing Part, then performance objective equipment control event handling, is then back to and continues to execute target device control action listener;If do not produce Raw target device control event, then obtain the information of wide area network online equipment terminal according to the predetermined time cycle and update note Record;
4th judgment module, for whether judging target device according to the information of the wide area network online equipment terminal after renewal Belong to wide area network online equipment, if wide area network online equipment, then return and continue to execute target device control action listener;Such as Fruit is not wide area network online equipment, then judges whether target device belongs to LAN online equipment, if target device belongs to office Domain net online equipment, LAN control model is recorded as by control model, performs the operation of local network control molding formula;If target is set Then judge that target device is not online for LAN online equipment is not belonging to, release the selected of target device and return to execution acquisition extensively The information and record of domain net online equipment terminal, the online device end of scanning LAN simultaneously record LAN online equipment terminal Information.
The wide area network control model operation module further includes wide area network target device control event processing module, described wide Domain mesh marking device control event processing module is used for:Event is controlled to receive the control to target device according to the target device Order, forwards the control command to communication unit, after the control command to be converted into the control command based on XMPP protocol Server is sent to by the communication link based on XMPP protocol with server.
The wide area network target device control event processing module is additionally operable to:It is converted into being based on when by the control command , will when sending server failure to by the communication link based on XMPP protocol with server after the control command of XMPP protocol Control model is recorded as LAN control model, passes through after the control command is converted into the control command based on UPnP protocol Target device is sent to the communication link based on UPnP protocol of target device.
The target device is selected event judge module and is further used for:If not producing target device selectes event, The target device being selected then is judged whether, if there is the target device being selected, then according to predetermined The presence of control model and the target device being selected determines the need for switching control pattern;If no The target device being selected, then return to the information and record for performing and obtaining wide area network online equipment terminal, scan LAN Online device end simultaneously records the information of LAN online equipment terminal.
The target device, which selectes event judge module, includes control mode switch module, the control mode switch module For:When predetermined control model be LAN control model and the target device being selected to belong to LAN online During equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula;When predetermined control model It is wide area network control model and when the target device being selected belongs to wide area network online equipment, control model is recorded For wide area network control model, the operation of wide area network control model is performed;When the target device being selected both is not belonging to office Domain net online equipment, and when being not belonging to wide area network online equipment, return and perform the information for obtaining wide area network online equipment terminal simultaneously Record, the online device end of scanning LAN simultaneously record the information of LAN online equipment terminal.
The control mode switch module is additionally operable to:When predetermined control model be LAN control model and it is described When chosen target device belongs to wide area network online equipment, control model is recorded as wide area network control model, performs wide area Net control model operates;When predetermined control model is wide area network control model and the target device being selected belongs to During LAN online equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula.
The device end further includes initialization module, for initializing control terminal.
The predetermined control model refers to the predetermined control model for needing preferentially to use of control terminal, Huo Zheyong The control model for needing preferentially to use that family determines.
The embodiment of the present invention further provides for a kind of control terminal control method, includes the following steps:
Log on request is sent to server, after logging in successfully, establishes the communication chain based on XMPP protocol with server Road;
The information and record of wide area network online equipment terminal are obtained, the online device end of scanning LAN simultaneously records local The information of net online equipment terminal;
Judge whether that producing target device selectes event, if producing target device selectes event, target device is selected The device end determined in event is chosen to be target device;
Judge whether target device belongs to LAN online equipment terminal, when target device is LAN online equipment terminal When, notice communication unit establishes the communication link based on UPnP protocol with target device, sends control data to target device, obtains The description information of target device is taken, establishes the communication link based on UPnP protocol with target device.
It is described to judge whether target device belongs to LAN online equipment terminal, when target device is LAN online equipment During terminal, notice communication unit establishes the communication link based on UPnP protocol with target device, and sending control to target device please The step of asking, obtaining the description information of target device, establish the communication link based on UPnP protocol with target device further includes: When target device is wide area network online equipment terminal, the status information of target device is inquired about, receives the target that server returns The status information of equipment and storage.
It is described when target device is LAN online equipment terminal, notice communication unit and target device foundation is based on The communication link of UPnP protocol, control data is sent to target device, obtains the description information of target device, and foundation is set with target Further included after the step of standby communication link based on UPnP protocol and control model is recorded as LAN control model, performed LAN control model operates;It is described when target device is wide area network online equipment terminal, inquire about target device state letter The step of breath, the status information and the storage that receive the target device that server returns further includes afterwards is recorded as control model extensively Domain net control model, performs the operation of wide area network control model.
The LAN control model operation includes:
The control of performance objective equipment is monitored;
Judge whether to produce target device control event, if producing target device control event, handle target device Control event, is then back to and continues to execute target device control action listener;If not producing target device control event, According to the online device end of predetermined time cycle scanning LAN, the information record of renewal LAN online equipment terminal;
Judge whether target device belongs to LAN and set online according to the information of the LAN online equipment terminal after renewal It is standby, if LAN online equipment, then return and continue to execute target device control action listener;It is online if not LAN Equipment, then judge whether target device belongs to wide area network online equipment, if target device belongs to wide area network online equipment, will control Molding formula is recorded as wide area network control model, performs the operation of wide area network control model;Exist if target device is not belonging to wide area network Line equipment then judges that target device is not online, releases the selected of target device, returns and performs acquisition wide area network online equipment terminal Information and record, the online device end of scanning LAN and the step of record the information of LAN online equipment terminal.
Under LAN control model, the processing target device control event specifically includes:
Event is controlled to receive the control command to target device according to the target device;
The control command is forwarded to communication unit;
By the control command be converted into after the control command based on UPnP protocol by with target device based on UPnP The communication link of agreement sends target device to, leads to after the control command to be converted into the control command based on UPnP protocol Cross with the communication link based on UPnP protocol of target device send to target device failure when, control model is recorded as wide area Net control model, after the control command to be converted into the control command based on XMPP protocol, by with server based on The communication link of XMPP protocol sends server to.
The wide area network control model operation includes:
Performance objective equipment controls action listener;
Judge whether to produce target device control event, if producing target device control event, performance objective equipment Event handling is controlled, is then back to and continues to execute target device control action listener;If target device control thing is not produced Part, then obtain the information and more new record of wide area network online equipment terminal according to the predetermined time cycle;
Judge whether target device belongs to wide area network and set online according to the information of the wide area network online equipment terminal after renewal It is standby, if wide area network online equipment, then return and continue to execute target device control action listener;It is online if not wide area network Equipment, then judge whether target device belongs to LAN online equipment, if target device belongs to LAN online equipment, will control Molding formula is recorded as LAN control model, performs the operation of local network control molding formula;Exist if target device is not belonging to LAN Line equipment then judges that target device is not online, releases the selected of target device and returns to execution acquisition wide area network online equipment terminal Information and record, the online device end of scanning LAN and the step of record the information of LAN online equipment terminal.
Under wide area network control model, the processing target device control event specifically includes:
Event is controlled to receive the control command to target device according to the target device;
The control command is forwarded to communication unit;
The control command is converted into after the control command based on XMPP protocol by being assisted with server based on XMPP The communication link of view sends server to, after the control command to be converted into the control command based on XMPP protocol by with When the communication link based on XMPP protocol of server sends server failure to, control model is recorded as LAN control mould Formula, by the control command be converted into after the control command based on UPnP protocol by with target device based on UPnP protocol Communication link sends target device to.
It is described to judge whether that producing target device selectes event, if producing target device selectes event, target is set The step of alternative device end determined in event is chosen to be target device further comprises:If do not produce target device to select Event, then judge whether the target device being selected, if there is the target device being selected, then according to institute The presence for stating the target device being selected determines the need for switching control pattern;If without what is be selected Target device, then return to the information and record for performing and obtaining wide area network online equipment terminal, and the online equipment of scanning LAN is whole The step of holding and recording the information of LAN online equipment terminal.
The presence for the target device being selected described in the basis determines the need for switching control pattern Step includes:When the target device being selected belongs to LAN online equipment, local network control molding formula behaviour is performed Make;When the target device being selected belongs to wide area network online equipment, when being not belonging to LAN online equipment, execution is wide Domain net control model operation;When the target device being selected not only had been not belonging to LAN online equipment, but also it is not belonging to wide During the net online equipment of domain, the information and record for performing and obtaining wide area network online equipment terminal are returned to, scanning LAN is online to be set The step of for terminal and recording the information of LAN online equipment terminal.
Compared with prior art, control terminal of the invention can automatically select control mould according to the location of user Formula(LAN control model or wide area network control model), user can also by setting home mode and in external schema, if Determine priority acccess control pattern, it is small to give full play to LAN control network delay, it is not necessary to the advantages of expending surfing flow.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is attached drawing needed in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, without creative efforts, can be with Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of flow diagram of device end control method provided in an embodiment of the present invention;
Fig. 2 is the upflow schematic diagram of device end control method shown in Fig. 1;
Fig. 3 is a kind of system construction drawing of cloud appliance system provided in an embodiment of the present invention;
Fig. 4 is a kind of control flow chart of device end provided in an embodiment of the present invention;
Fig. 5 is a kind of flow diagram of control terminal control method provided in an embodiment of the present invention;
Fig. 6 is the flow diagram of another control terminal control method provided in an embodiment of the present invention;
Fig. 7 is a kind of control flow chart of control terminal provided in an embodiment of the present invention;
Fig. 8 is a kind of flow diagram of wide area network control model operation provided in an embodiment of the present invention;
Fig. 9 is a kind of flow diagram of LAN control model operation provided in an embodiment of the present invention;
Figure 10 is a kind of flow diagram for handling target device control event provided in an embodiment of the present invention;
Figure 11 is a kind of structure drawing of device of control terminal provided in an embodiment of the present invention;
Figure 12 is a kind of flow diagram of server control method provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other without creative efforts Embodiment, belongs to the scope of protection of the invention.
The embodiment of the present invention provides a kind of device end control method, and with reference to figure 1, device end control method includes as follows Step:
Step S101, receive server send based on XMPP protocol(Extensible Messageing and Presence Protocol, scalable message with there are agreement)Order and parse the order based on XMPP protocol;
Step S102, will be converted into being based on UPnP protocol by the order of parsing(Universal Plug and Play, Universal Plug and Play)Order;
Step S103, will send control module to after the command analysis based on UPnP protocol by data-interface.
The XMPP protocol order sent from server is converted into UPnP protocol by the device end control method first Order, is then converted into the order that the control module of device end can perform, such as serial port command by UPnP protocol order again Or parallel port order.Above-mentioned flow belongs to the downlink data flow that server sends data to device end, device end transmission Data to server upflow as shown in Fig. 2, its step is as follows:
Step S104, receives the command response that control module returns and is converted to the status information based on UPnP protocol and ring Should;
Step S105, parses the state information response based on UPnP protocol;
Step S106, will be converted to state information response and biography based on XMPP protocol by the state information response of parsing Give server.
The command response that the control module of device end is made is first converted into UPnP state information responses by the upflow The XMPP state information responses that reconvert can be received into server, mentioned order response can be the command responses of serial port form Or command response of parallel port form etc..
With reference to figure 3, Fig. 3 is a kind of system construction drawing of cloud appliance system, which includes device end, service Device and control terminal, device end can be the home appliances such as air-conditioning, refrigerator and washing machine, can also be TV, sound equipment and lamp The domestic electronic facility such as photosystem.Device end includes XMPP clients(XMPP Client)201st, UPnP control points(UPnP Control Point)202nd, UPnP device(UPnPDevice)203rd, message processing module(Message Handler)204 Hes Control module(MCU)205.Control terminal includes XMPP clients 206, UPnP control points 207, management module(Line Monitor)208 and interactive module(GUI Module)209.Server includes the communication server(IM Server)210 and data Processing server(Data Server)211.The server is Openfire IM servers, wherein, the communication server 210 is responsible for The reception forwarding of data message, data processing server 211 are responsible for analysis, storage and the various valued added applications of data.Due to this The device end of invention meets two kinds of communication patterns of XPMM and UPnP at the same time, and therefore, user can be led to respectively using control terminal Cross wide area network or LAN is controlled device end.
During using wide area network control model, device end forwards the data to device end by server, is set Ru above-mentioned Step S101-103 in standby terminal control method;The data that device end is sent send device end to also by server, Such as the step S104-106 in above-mentioned device end control method.Before above-mentioned steps S101-106 is carried out, device end is first Log on request first is sent to server, after logging in successfully, establishes the communication link based on XMPP protocol with server.Specifically Ground, the XMPP clients 201 of device end are connected to the communication server 210 according to the pre-assigned account of server, establish with The communication link of server, communication link of the device end to server is provided for wide area network control.
During using LAN pattern, control terminal can transmit data to device end by its UPnP control point 207 UPnP device 203, while pass through UPnP control points 207 receive UPnP device 203 return data.Corresponding above-mentioned local network control Molding formula, before step S103, the device end control method further include receive control terminal send based on UPnP The step of order of agreement, and receive the life based on UPnP protocol sent according to control terminal that control module returns The serial port command response responded or parallel port command response are made, is converted to state information response and biography based on UPnP protocol The step of giving control terminal.Before the data transfer of above-mentioned carry out LAN, device end firstly the need of with control terminal Connection is established, the operation specifically performed is as follows:Receive the control data of control terminal and respond;Obtain setting for control terminal Standby information, establishes the communication link based on UPnP protocol with control terminal.
With reference to figure 3, a kind of control terminal provided in an embodiment of the present invention includes:The base sent for receiving server In XMPP protocol order and parse the XMPP clients 201 of the order based on XMPP protocol, for by XMPP clients Parsed order is converted into the UPnP control points 202 of the order based on UPnP protocol, for by the order based on UPnP protocol Send the UPnP device 203 of control module after parsing to by data-interface.Above-mentioned UPnP device 203 is additionally operable to receive control mould The command response of block return is simultaneously converted to the state information response based on UPnP protocol.Above-mentioned UPnP control points 202 are additionally operable to connect Receive and parse the state information response based on UPnP protocol that UPnP device is sent.Above-mentioned XMPP clients 201 are also used The state information response based on XMPP protocol and transmission are converted in the state information response for parsing process UPnP control points 202 To server.
Specifically, UPnP control points 202 are that by UPnP control points function control device, are set for scan search UPnP Communication link is established for 203 and therewith, the data command that the data command from XMPP clients 201 is switched to UPnP is delivered to UPnP device 203, receives and parses through the UPnP data that UPnP device 203 is sent, objective to XMPP by the data sending obtained is parsed Family end 201.UPnP device 203 refers to the container of other services either equipment, includes UPnP control points 202 for parsing to come from And the data at the UPnP control points 207 of control terminal, and the interface function that message call processing module 204 provides passes data Device end control module 205 is delivered to, the device end status information that message processing module 204 is fed back is sent to UPnP controls Point 202.Above-mentioned status information can be operating status, air quantity and the design temperature of air-conditioning equipment, the temperature of refrigerating chamber of refrigerator, cold Freeze room temperature, the various washing parameters of washing machine etc..Message processing module 204 is responsible for returning the control module 205 of device end The various data returned are reported to UPnP device 203 by interface function, and the data that UPnP device 203 is sent are passed through Message Processing The interface function that module 204 provides is sent to control module 205 and is handled.Control module 205 is used for control unit end Hardware device is run, and realizes the various functions of various device ends, which can be air-conditioning, refrigerator and washing machine Deng the controller of home appliance, the operation of control air-conditioning, refrigerator and washing machine.
In the present embodiment, the XMPP clients 201 of device end, UPnP control points 202, UPnP device 203 and message Processing module 204 is run on independent SCM system, such as they can be arranged on to one piece and possess network connecting function External control panel on, the SCM system of external control panel passes through serial ports or parallel port and the control module 205 of device end Realize data interaction.Message processing module 204 is the interface mould between the SCM system of external control panel and control module 205 Block.But, in other embodiments, the XMPP clients 201 of device end, UPnP control points 202, UPnP device 203, message Processing module 204 and control module 205 can also use same control system, message processing module 204 and control module 205 it Between interface will change, data can be transmitted by defined function interface, message format can also be defined and pass through message Event realizes data interaction.
The control flow of device end is illustrated below, the present embodiment by taking the external control panel of serial port form as an example, External control panel possesses the linkage function of LAN and wide area network, can also allow control by wide area network game server Terminal establishes LAN connection by UPnP technology.As shown in figure 4, after the system electrification of device end, XMPP is completed first The initialization of client 201 and UPnP device 203.
XMPP clients 201 log on the communication server 210 according to default account first and keep online, that is, keep control Molding block 205 can use to the communication link between the communication server 210.With reference to the step 305-308 of figure 4, step 307 is ought Preceding XMPP line status is recorded in the state table of XMPP clients 201;The step 301-304 of Fig. 4 is the stream of UPnP device 203 Journey, XMPP clients 201 monitor command messages that the communication server 210 sends in step 306 and UPnP control points 202 report Message, with specific reference to the step 311-313 of Fig. 4.With reference to step 309, when XMPP clients 201 are connected to the communication server 210 Afterwards, thread is created by XMPP clients 201 and initializes UPnP control points 202.
In step 314 and step 315, UPnP control points 202 are established and UPnP device 203 according to UPnP standard interfaces Control link.Step 315 is UPnP action listeners, mainly monitors XMPP client events message and monitors in UPnP device Report event message.Step 316-320 is the flow chart of data processing at UPnP control points 202, and in step 316, UPnP control points 202 are sentenced It is disconnected whether to need reporting message, if judging to need reporting message, step 417 is performed, UPnP control points 202 judge XMPP links Whether normal, if judging, XMPP links are normal, perform step 318, and Event Package is forwarded to XMPP visitors by UPnP control points 202 Family end 201, if judging, XMPP links are abnormal, perform step 319, UPnP control points 202 cache event data, and timing converges Report for work server;If UPnP control points 202 judge reporting message is not required, step 320 is performed, UPnP control points 202 switch to UPnP controls event, is sent to UPnP device 203 and handles.
For wide area network downlink data process flow(Server sends data to the control module 205 of device end), Step 310, XMPP clients 201 will receive and parse through XMPP communication messages, obtain data message, and call UPnP control points 202 interface functions provided pass data to UPnP control points 202, as depicted at step 312.Monitor simultaneously at UPnP control points 202 After receiving UPnP event messages, UPnP device 203 is transmitted data to by step 320.UPnP device 203 is monitored and received After event message, the function that message call processing module 204 provides sends a message to control module 205.Control module 205 connects After receiving serial port message, the hardware device responsing control command of control unit end as requested.
For wide area network upstream data process flow(Control module 205 sends data to server), message processing module After the upstream data that 204 receiving device terminal control modules 205 are sent, parse and call the interface function that UPnP device provides will Upstream data is delivered to UPnP device 203.After UPnP device 203 listens to reporting message, analyze and call UPnP control points 202 The interface of offer(Function or message), UPnP control points 202 are sent a message to, specifically refer to step 301,302 and 304.After UPnP control points 202 receive the data that UPnP device 203 is sent, the receiver function of the offer of XMPP clients 201 is called Or send function and the data are switched into XMPP data messages and are sent to server.
In a local network, device end can be directly controlled by the UPnP control points 207 of control terminal, control terminal The function at UPnP control points 207 and the UPnP control points 202 of device end is substantially the same, can establish UPnP control links Equipment is controlled.The device end of the present invention is by building UPnP control points 202 so that UPnP control points 207 and equipment The UPnP control points 202 of terminal can use identical bottom module, pass through UPnP control points by what XMPP clients 201 transmitted The order of UPnP device 203 is sent to after 202 and the order of the transmission of UPnP control points 207 UPnP device 203 of control terminal exists It is the same in form, both unifications are sent to UPnP device 203 by UPnP protocol and handle.So as to which the device end of the present invention can So that underlying device interface is unified, when effectively prevent LAN and wide area network control unit end, the drawbacks of interface is inconsistent. Further, since UPNP protocol stacks have Line Procedure Mutually-exclusive mechanism in itself, so as to avoid more people at the same time by wide area network or local The conflict that net pattern operates underlying device and brings, simplifies programming.
The embodiment of the present invention also provides a kind of control terminal control method, and with reference to figure 5, which includes Following steps:
Step S401, log on request is sent to server, after logging in successfully, is established with server based on XMPP protocol Communication link;
Step S402, obtains the information and record of wide area network online equipment terminal, the online device end of scanning LAN And record the information of LAN online equipment terminal;
Step S403, receives the instruction of selected target equipment;
Step S404, judges whether target device belongs to LAN online equipment terminal, when target device is that LAN exists During line device end, notice communication unit establishes the communication link based on UPnP protocol with target device;Sent to target device Control data, obtains the description information of target device, establishes the communication link based on UPnP protocol with target device.
Above-mentioned control terminal control method is used to establish the communication connection between control terminal and device end, step S401 In log on request be that the XMPP clients 206 of control terminal are connected to the communication server according to the pre-assigned account of server 210, the communication link with the communication server 210 is established, forms the communication link that wide area network controls lower control terminal to server, For completing the data exchange of control terminal and server.After the communication link of wide area network is established, device end is from clothes The information for device acquisition wide area network online equipment terminal of being engaged in, may determine that currently which has by the information of wide area network online equipment terminal A little device ends are in wide area network presence, and the device end for being in wide area network presence, control terminal can lead to Cross server and connect these device ends, to realize the transmitting-receiving of data.Device end obtains wide area network online equipment terminal After information, by these information records into management module 208.The online device end of LAN and note are scanned in step S402 The information of record LAN online equipment terminal is the behaviour that control terminal is used to find LAN online equipment under LAN pattern Make.The operation is with obtaining wide area network online equipment information under above wide area network the step of can be carried out at the same time, and can also stagger and hold OK, both do not differentiate between sequencing.Control terminal can meet by the way that 207 scanning discovery LAN of UPnP control points is online The device end of UPnP protocol, and relevant information recorded in management module 208.Management module 208 is used to store one entirely Office communications status argument table and performance variable table interface function, record controlled device between area network link state, The priority mark of control model residing for wide area network link state, current control terminal and control model between server Will etc., and inquiry and modification that other modules carry out communications status are provided.
Control terminal can set the information of the above-mentioned wide area network online equipment terminal got and LAN online The information of standby terminal is presented to user by interactive module 209, the control terminal can be smart mobile phone, portable notebook and Tablet computer etc. moves equipment, and above- mentioned information can show user by Touch Screen, when user wants to control some equipment During terminal, the device end can be chosen from screen.
By control terminal, user can be controlled device end by wide area network or LAN, due to local Network control fixture has the network delay small, it is not necessary to which the advantages that expending surfing flow, therefore, in the present embodiment, control terminal is preferred Using the connection of LAN control model and control unit end, i.e., when user wants the device end of control(Target terminal)At the same time In LAN is online and during wide area network presence, control terminal will preferably use LAN control model.Therefore, in step In S404, control terminal first determines whether target can carry out LAN control, if the target device can carry out local During network control, management module 208 will notify communication unit to establish the communication link based on UPnP protocol, the communication with target device The function of unit can be realized that the communication of wide area network is by XMPP clients 206 by XMPP clients 206 and UPnP control points 207 Perform, the communication of LAN is by UPnP control points 207.For LAN control model, management module 208 will notify UPnP controls Point 207 establishes the communication link based on UPnP protocol with target device, and after being connected to above-mentioned notice, UPnP control points 207 are to target Equipment sends control data, obtains the device descriptive information that target device returns, is established according to device descriptive information and set with target The standby communication link based on UPnP protocol.After establishing communication link, user can by control terminal to target device into Row control operation.Specific execution step is as follows:
Step S405, receives the control command to target device;
Step S406, forwards the control command to communication module;
Step S407, by control command be converted into after the order based on UPnP protocol by with target device based on UPnP The communication link of agreement sends target device to.
The control command of user is obtained by interactive module 209 and is sent to management module 208, which can be empty Tune to open food information in machine, control air conditioner refrigerating and acquisition refrigerator etc., after management module 208 receives above-mentioned control command, root According to the information for establishing communication link before, control command is sent to corresponding communication unit, in the present embodiment, step S405 During execution, LAN control model is performed in step s 404, establishes the communication based on UPnP protocol with target device 208 control command of management module can be sent to UPnP control points 207 by link, therefore, management module 208, by UPnP control points 207 send the UPnP device 203 of device end to by area network link, then are sent to control module 205 by UPnP device 203 Perform.
Target device may be referred to aforementioned device terminal control method, target device to the process flow of above-mentioned control command Corresponding state information response may be returned to by having handled control command, and UPnP control points 207 will receive what target device returned The state information response based on UPnP protocol, and after the state information response parsing interaction will be sent to through management module 208 Module 209 is presented accordingly.
In above-mentioned steps S404 when judging whether target device belongs to LAN online equipment terminal, when management mould The information for the wide area network online equipment terminal that block 208 is stored according to it and the information of LAN online equipment terminal judge that target is set Standby is not LAN online equipment terminal, but during wide area network online equipment, notify communication unit(XMPP clients 206)With to Server sends the instruction for selecting the target device, is then sent to the instruction of selected target equipment by XMPP clients 206 Server, obtains the status information for the target device that server returns.
Control terminal is being established by above-mentioned steps with that after the associating of target device, can send phase by wide area network The control command answered gives the target device.The control command transmission flow specifically includes:
Receive the control command to target device;
The control command is forwarded to communication unit;
After control command to be converted into the target terminal control command based on XMPP protocol, pass through the communication chain with server Road sends server to.
After target device receives the above-mentioned target terminal control command that server forwards, XMPP clients will be passed through 201 --- --- the link biographies of UPnP device 203 --- message processing module 204 --- control module 205 of UPnP control points 202 It is sent to control module 205 and performs.Corresponding state information response can be sent to server by target device, by XMPP clients 206 receive the state information response based on XMPP protocol that server returns, through managing mould after which is parsed Block 208 sends interactive module 209 to and is presented accordingly.
Control terminal control method through this embodiment, control terminal both can by LAN control unit end, Again can be by wide area network control unit end, and the control terminal control method of this implementation can also be preferential according to LAN The device end that is linked in sequence, make connection more stable, and save flow.
The embodiment of the present invention also provides a kind of control terminal, which includes XMPP clients 206, UPnP control points 207th, management module 208 and interactive module 209, wherein:
XMPP clients 206, for sending log on request to server, after logging in successfully, establish the base with server In the communication link of XMPP protocol, the information and record of wide area network online equipment terminal are obtained, scans the online equipment of LAN Terminal and the information for recording LAN online equipment terminal;
Interactive module 209, for receiving the instruction of selected target equipment;
Management module 208, for judging whether target device belongs to LAN online equipment terminal, when target device is office During the net online equipment terminal of domain, notice communication unit establishes the communication link based on UPnP protocol with target device;
UPnP control points 207, for sending control data to target device, obtain the description information of target device, establish With the communication link based on UPnP protocol of target device.
Further, interactive module is additionally operable to receive the control command to target device, and management module 208 is additionally operable to hand over The control command that mutual module is sent is transmitted to communication module, and UPnP control points 207 are additionally operable to transmit management module 208 The control command come is converted into after the order based on UPnP protocol by the communication link based on UPnP protocol with target device Send target device to.
Further, it is not LAN online equipment terminal that management module 208, which is additionally operable to work as target device, but wide area network During online equipment, notice communication unit and the instruction that selected target equipment is sent to server;XMPP clients 206 be additionally operable to by The instruction of selected target equipment sends server to, obtains the target device status information that server returns.
Further, interactive module 209 is additionally operable to receive the control command to target device;Management module 208 is additionally operable to Control command is forwarded to communication module;XMPP clients 206 are additionally operable to control command being converted into the target based on XMPP protocol After terminal control order, server is sent to by the communication link with server.
The embodiment of the present invention also provides another control terminal control method, with reference to figure 6, the control terminal control method bag Include following steps:
Step S502, log on request is sent to server, after logging in successfully, is established with server based on XMPP protocol Communication link;
Step S504, obtains the information and record of wide area network online equipment terminal, the online device end of scanning LAN And record the information of LAN online equipment terminal;
Step S506, judges whether that producing target device selectes event, if producing target device selectes event, by mesh The device end that marking device is selected in event is chosen to be target device;
Step S508, communication pattern is determined according to the presence of predetermined control model and target device.
In the control terminal control method of the present embodiment, the control that is used when control terminal is controlled device end Pattern mainly includes LAN control model and wide area network control model, different from embodiment above, the control of the present embodiment It is preferential that terminal control method no longer gives tacit consent to LAN control model, but needs what is preferentially used so that control terminal is predetermined First choice of the control model for needing preferentially to use that control model or user determine as communication pattern, when first choosing Select to reattempt when can not perform and be switched to another control model.The free degree of system is enhanced, facilitates user according to specific Situation is reasonably selected.Since the presence of target device includes that LAN is online, wide area network is online and not online etc., Therefore, step S508 is specifically included upon execution judges that predetermined control model is LAN control model or wide area network control Pattern, and target device belong to LAN online equipment or wide area network online equipment, when predetermined control model is local When net control model and target device belong to LAN online equipment, communication unit is notified(UPnP control points 207)Set with target It is standby to establish the communication link based on UPnP protocol, control data is sent to target device, the description information of target device is obtained, builds The vertical communication link based on UPnP protocol with target device;When predetermined control model is wide area network control model and target is set For when belonging to wide area network online equipment, the status information of target device is inquired about, receives the state for the target device that server returns Information simultaneously stores.Above-mentioned two judgment step is related to control model situation corresponding with presence, the control mould actually used Formula is consistent with predetermined control model, determines whether inconsistent situation after the above step, i.e., when predetermined control mould Formula is LAN control model and when target device belongs to wide area network online equipment, inquires about the status information of target device, receives The status information for the target device that server returns and storage;When predetermined control model is wide area network control model and target is set For when belonging to LAN online equipment, notice communication unit establishes the communication link based on UPnP protocol with target device, to mesh Marking device sends control data, obtains the description information of target device, establishes the communication based on UPnP protocol with target device Link.In addition, if the not online then not executive control operation of target device, until target device is reached the standard grade.
Control model is determined by above-mentioned steps, establishes and after the associating of target device, control terminal will enter The specific control model operational phase, specifically, when predetermined control model is LAN control model and target device belongs to During LAN online equipment, notice communication unit establishes the communication link based on UPnP protocol with target device, to target device Control data is sent, obtains the description information of target device, is established and the communication link based on UPnP protocol of target device Control model is also recorded as LAN control model afterwards, performs the operation of local network control molding formula;When predetermined control model It is wide area network control model and when target device belongs to wide area network online equipment, inquires about the status information of target device, receive clothes Control model is also recorded as wide area network control model after the step of status information for the target device that business device returns and storage, Perform the operation of wide area network control model;When predetermined control model is LAN control model and target device belongs to wide area network and exists During line equipment, the status information of target device is inquired about, the step for receiving the status information for the target device that server returns and storing Control model is also recorded as wide area network control model after rapid, performs the operation of wide area network control model;When predetermined control mould Formula is wide area network control model and when target device belongs to LAN online equipment, and notice communication unit establishes base with target device In the communication link of UPnP protocol, control data is sent to target device, obtains the description information of target device, foundation and target Control model is also recorded as LAN control model, executive board after the step of communication link based on UPnP protocol of equipment Domain net control model operation.
With reference to figure 7, Fig. 7 is the specific control terminal flow formed according to control terminal control method above The operation of control terminal divide into the different thread of XMPP clients and two, UPnP control points by figure, the control terminal flow chart Perform, XMPP clients 206 periodically obtain wide area network online equipment list, 207 periodic scanning of UPnP control points from server LAN online equipment, obtains LAN online equipment list.After control terminal is started, each function module is completed first Initialization, initialization management module 208, initialization XMPP clients 206, initialization UPnP control points 207, initialization interaction mould Block 209.XMPP clients 206 log on the communication server 210 according to default account, and keep online, that is, keep control eventually The communication link of server is held to can use, step 601 with reference to figure 7,602,603,619,620.There is no selection target in user Before equipment, XMPP clients 206 will perform step 603 → 604 → 608 → 609 → 614 → 615 → 603.
Wherein, after step 604 " user select device A " refers to that interactive module 209 starts, display device list to user, One of them specific equipment is chosen in user's slave device list, then the equipment that user chooses is " device A ".List of devices lists The online equipment of wide area network and the online equipment of LAN, the list of devices can be by the online equipments of wide area network and LAN point Presented into two parts, relevant device can also be presented together and added whether online, in wide area network or LAN etc. Identification marking etc., this is not restricted for specific appearance form.Step 604 is to judge " whether user selects WAN equipment In device A ", step 609 be judge " whether user selects the device A in lan device ".
When user select WAN equipment list in device A after, according to step 605,606,607,611,612,613, 618 judge whether to be switched to LAN pattern, WAN equipment list refer in list of devices attribute for " wide area network can use " or The cluster tool of person " wide area network and LAN are all available ".Step 616,618 be according to predetermined control model to determine whether Need to be controlled pattern switching, which can be that LAN is preferential or wide area network is preferential.
Wherein, be switched to LAN control model refer to send data when, arrive UPnP device using UPnP control points 207 Control access between 203, and by changing the network state in management module 208, control XMPP threads are opened from step 603 Begin to carry out periodicity monitoring, path is step 603 → 604 → 608 → 609 → 610 → 616 → 617 → 615 → 603.It is switched to Wide area network control model refer to send data when, using XMPP clients 201, the communication server 210 and XMPP clients 206 it Between link, and control UPnP threads since step 621 periodically monitor, path for step 621 → 622 → 626 → 627 → 628→629→631→621。
When judging that target device is in LAN online equipment list, LAN control model is switched to.
Specifically, step 604 → 605 → 606 → 618 → 611 → 612 → 613 with reference to figure 6.
Step 604, judge the device A of user's selection whether in wide area network online equipment list;
Step 605, if device A is in wide area network online equipment list, it is online to obtain current LAN from management module List of devices;
Step 606, judge device A whether in current LAN online equipment list;
Step 618, when judging that device A in current LAN online equipment list, determines whether to be switched to local Net control model;
Step 611, pre-set that LAN is preferential, then XMPP clients are established and the LAN path of device A;
Step 612, LAN control model is switched to, performs the operation of local network control molding formula;
Step 613, the state parameters such as operating mode are recorded to management module.
Alternatively, the method further includes:
When judging target device in wide area network online equipment list, but not in LAN online equipment list when, then protect Hold wide area network control model.
Specifically, step 604 → 605 → 606 → 607 with reference to figure 6.
Step 604, judge the device A of user's selection whether in wide area network online equipment list;
Step 605, if device A is in wide area network online equipment list, it is online to obtain current LAN from management module List of devices;
Step 606, judge device A whether in current LAN online equipment list;
Step 607, if device A is not in current LAN online equipment list, wide area network control model is kept, is held Row wide area network control model operates.
Alternatively, the method further includes:
When judging target device not in wide area network online equipment list, then judge whether target device exists in LAN Line list of devices;
When judging target device not in LAN online equipment list, then perform step and start monitor timer, it is right Event message is monitored.
Specifically, step 604 → 608 → 609 → 614 → 615 with reference to figure 6.
Step 604, judge the device A of user's selection whether in wide area network online equipment list;
Step 608, when judging that device A in wide area network online equipment list, do not obtain current state from management module Parameter;
Step 609, judge device A whether in LAN online equipment list;
Step 614, when judging that device A not in LAN online equipment list, then deletes from online equipment list and set Standby A;
Step 615, step 701 → 702 → 703 → 603 are performed.
Alternatively, the method further includes:
When interpretation target device is not in wide area network online equipment list, but judge that target device is arranged in LAN online equipment When in table, continue to judge target device whether in wide area network online equipment list in the updated;
When judging in the wide area network online equipment list of target device in the updated, then LAN control model is switched to;
When judging in the wide area network online equipment list of target device not in the updated, then LAN control mould is switched to Formula.
Specifically, with reference to step 604 → 608 → 609 → 610 → 617 of figure 6 and step 604 → 608 → 609 → 610 → 616→617。
Step 604, judge the device A of user's selection whether in wide area network online equipment list;
Step 608, when judging that device A in wide area network online equipment list, do not obtain current state from management module Parameter;
Step 609, judge device A whether in LAN online equipment list;
Step 610, when device A is in LAN online equipment list, then judge device A whether wide area network in the updated In online equipment list;
Step 617, if in the wide area network online equipment list of device A not in the updated, it is switched to LAN Working mould Formula, performs the operation of local network control molding formula.And
Step 604, judge the device A of user's selection whether in wide area network online equipment list;
Step 608, when judging that device A in wide area network online equipment list, do not obtain current shape from management module 208 State parameter;
Step 609, judge device A whether in LAN online equipment list;
Step 610, when device A is in LAN online equipment list, then judge device A whether wide area network in the updated In online equipment list;
Step 616, when in device A wide area network online equipment list in the updated, judging whether to need to be switched to local Net operating mode;
Step 617, it is preferential to pre-set LAN pattern, then is switched to LAN operating mode, performs local network control system Pattern operates.
As a kind of optional embodiment, the method further includes:
If the current equipment control model of target device is wide area network control model, and according to the wide area network online equipment Information and LAN online equipment information judge that the target device had not only belonged to wide area network online equipment but also it is online to belong to LAN Equipment, then remain wide area network control model by equipment control model.
Specifically, assume priority for wide area network control it is preferential when, if the current equipment control model of target device is wide Domain net control model, and the target device is judged according to the wide area network online equipment information and LAN online equipment information Not only belong to wide area network online equipment but also belonged to LAN online equipment, then equipment control model is remained into wide area network control mould Formula.
Specifically, step 604 → 608 → 609 → 610 → 616 → 607 with reference to figure 6.
Step 604, judge the device A of user's selection whether in wide area network online equipment list;
Step 608, when judging that device A in wide area network online equipment list, do not obtain current state from management module Parameter;
Step 609, judge device A whether in LAN online equipment list;
Step 610, when device A is in LAN online equipment list, then judge device A whether wide area network in the updated In online equipment list;
Step 616, when in device A wide area network online equipment list in the updated, judging whether to need to be switched to local Net operating mode;
Step 617, it is preferential to pre-set wide area network control model, then keeps wide area network operating mode, performs wide area network control Molding formula operates.
As the first optional embodiment, the method further includes:
If the current equipment control model of target device is LAN control model, and according to the wide area network online equipment Information and LAN online equipment information judge that the target device has been not belonging to LAN online equipment, but belong to wide area Net online equipment, then be wide area network control model by equipment control mode switch.
Alternatively, if the current equipment control model of the target device is LAN control model, and according to described wide Domain net online equipment information and LAN online equipment information judge that the target device has been not belonging to LAN online equipment, But belong to wide area network online equipment, then it is wide area network control model by equipment control mode switch, including:
If the current equipment control model of target device is LAN control model, judge target device whether in LAN In online equipment list;
When judging target device not in LAN online equipment list, then judge whether target device exists in wide area network In line list of devices;
When judging that target device is in wide area network online equipment list, continue to judge whether the target device is updating In LAN online equipment list afterwards, if it is not, being then switched to wide area network control model.
Specifically, step 621 → 622 → 626 → 627 → 628 → 629 with reference to figure 6.
Step 621, local area network scan is carried out, obtains LAN online equipment list;
Step 622, judge device A whether in LAN online equipment list;
Step 626, if device A is not in LAN online equipment list, it is online that wide area network is obtained from management module List of devices;
Step 627, judge device A whether in wide area network online equipment list;
Step 628, if device A is in wide area network online equipment list, continue to judge whether device A sets online in LAN In standby list;
Step 629, if it is not, being then switched to wide area network control model, the operation of wide area network control model is performed.
The method further includes:
When judging in the LAN online equipment list of the target device in the updated, then LAN control mould is kept Formula.
Specifically, step 621 → 622 → 626 → 627 → 628 → 632 → 623 → 624 → 625 with reference to figure 6.
Step 621, local area network scan is carried out, obtains LAN online equipment list;
Step 622, judge device A whether in LAN online equipment list;
Step 626, if device A is not in LAN online equipment list, it is online that wide area network is obtained from management module List of devices;
Step 627, judge device A whether in wide area network online equipment list;
Step 628, if device A is in wide area network online equipment list, continue to judge whether device A sets online in LAN In standby list;
Step 632, when device A is in LAN online equipment list, judge whether to need to be switched to wide net mode;
Step 623, it is preferential to pre-set LAN, then keeps LAN control model, establishes the local Netcom with device A Road;
Step 624, LAN control model is switched to, performs the operation of local network control molding formula;
Step 625, facility information and LAN operating mode be recorded into management module.
The method further includes:
When judging target device not in LAN online equipment list, and judge target device not in wide area network online equipment During list, then perform step and start monitor timer, event message is monitored.
Specifically, step 621 → 622 → 626 → 627 → 630 → 631 → 621 with reference to figure 6.
Step 621, local area network scan is carried out, obtains LAN online equipment list;
Step 622, judge device A whether in LAN online equipment list;
Step 626, if device A is not in LAN online equipment list, it is online that wide area network is obtained from management module List of devices;
Step 627, judge device A whether in wide area network online equipment list;
Step 630, when device A is not in wide area network online equipment list, then device A is deleted from online equipment list Remove;
Step 631, step 701 → 702 → 703 → 621 are performed.
As second of optional embodiment, the method further includes:
If the current equipment control model of target device is LAN control model, and according to the wide area network online equipment List and LAN online equipment list judge that the target device had not only belonged to wide area network online equipment, but also to belong to LAN online Equipment, then be wide area network control model by equipment control mode switch.
If the current equipment control model of the target device is LAN control model, and online according to the wide area network List of devices and LAN online equipment list judge that the target device had not only belonged to wide area network online equipment, but also belong to LAN Online equipment, then be wide area network control model by equipment control mode switch, including:
If the current equipment control model of target device is LAN control model, judge target device whether in LAN In online equipment list;
When judging target device not in LAN online equipment list, then judge whether target device exists in wide area network In line list of devices;
When judging that target device is in wide area network online equipment list, continue to judge whether the target device is updating In LAN online equipment list afterwards;
If so, then it is switched to wide area network control model.
Specifically, assume priority for wide area network it is preferential when, if the current equipment control model of target device is LAN Control model, and judge that the target device had both belonged to according to the wide area network online equipment list and LAN online equipment list In wide area network online equipment, and belong to LAN online equipment, be then wide area network control model by equipment control mode switch.
Specifically, step 621 → 622 → 626 → 627 → 628 → 632 → 629 with reference to figure 6.
Step 621, local area network scan is carried out, obtains LAN online equipment list;
Step 622, judge device A whether in LAN online equipment list;
Step 626, if device A is not in LAN online equipment list, it is online that wide area network is obtained from management module List of devices;
Step 627, judge device A whether in wide area network online equipment list;
Step 628, if device A is in wide area network online equipment list, continue to judge whether device A sets online in LAN In standby list;
Step 632, when device A is in LAN online equipment list, judge whether to need to be switched to wide net mode;
Step 629, it is preferential to pre-set wide area network control, then is switched to wide area network control model, performs wide area network control Pattern operates.
Above-mentioned wide area network control model operation specifically includes:
Performance objective equipment controls action listener;
Judge whether to produce target device control event, if producing target device control event, performance objective equipment Event handling is controlled, is then back to and continues to execute target device control action listener;If target device control thing is not produced Part, then obtain the information and more new record of wide area network online equipment terminal according to the predetermined time cycle;
Judge whether target device belongs to wide area network and set online according to the information of the wide area network online equipment terminal after renewal It is standby, if wide area network online equipment, then return and continue to execute target device control action listener;It is online if not wide area network Equipment, then judge whether target device belongs to LAN online equipment, if target device belongs to LAN online equipment, will control Molding formula is recorded as LAN control model, performs the operation of local network control molding formula;Exist if target device is not belonging to LAN Line equipment then judges that target device is not online, releases the selected of target device and returns to execution acquisition wide area network online equipment terminal Information and record, the online device end of scanning LAN simultaneously record the information of LAN online equipment terminal.
The above-mentioned processing target device control specific flow of event includes:
Event is controlled to receive the control command to target device according to target device;
Control command is forwarded to communication unit;
By control command be converted into after the control command based on XMPP protocol by with server based on XMPP protocol Communication link sends server to.
Further, the flow of wide area network control model operation is as shown in figure 8, control terminal works in wide area network control at this time Molding formula, the processing target device control specific flow of event further include:
Receive the state information response based on XMPP protocol that server returns and parsing;
Corresponding status information data is sent to by display unit according to the state information response after parsing;
The status information data is presented by interactive interface.
In above-mentioned processing target device controls the specific flow of event, when control command is converted into be based on XMPP protocol Control command after when sending server failure to by the communication link based on XMPP protocol with server, by control model Be recorded as LAN control model, by control command be converted into after the control command based on UPnP protocol by with target device Communication link based on UPnP protocol sends target device to.
Under the dual-thread operating mode of Fig. 7, the flow of wide area network control model operation is as shown in figure 8, control at this time is whole End works in wide area network control model:
Step 701, monitor timer is started;
Step 702, event message is monitored;
Step 703, judge whether message belongs to timer supervisory messages, if otherwise representing that there are target device to control thing Part, performs step 704, if so then execute step 705;
Step 704, target device control event is handled, after treatment, which returns, performs step 702;
Step 705, wide area network online equipment list is obtained;
Step 706, judge whether device A belongs to online WAN equipment;
Step 707, current state parameter is obtained from management module;
Step 708, judge whether device A belongs to online lan device;
Step 709, LAN control model is switched to, the operation of local network control molding formula is performed, records network state information;
Step 710, prompting event is sent to interactive module;
Step 711, the device A selected in management module is removed;
Step 712, XMPP clients obtain wide area network online equipment list.
The flow of above-mentioned LAN control model operation specifically includes:
The control of performance objective equipment is monitored;
Judge whether to produce target device control event, if producing target device control event, handle target device Control event, is then back to and continues to execute target device control action listener;If not producing target device control event, According to the online device end of predetermined time cycle scanning LAN, the information record of renewal LAN online equipment terminal;
Judge whether target device belongs to LAN and set online according to the information of the LAN online equipment terminal after renewal It is standby, if LAN online equipment, then return and continue to execute target device control action listener;It is online if not LAN Equipment, then judge whether target device belongs to wide area network online equipment, if target device belongs to wide area network online equipment, will control Molding formula is recorded as wide area network control model, performs the operation of wide area network control model;Exist if target device is not belonging to wide area network Line equipment then judges that target device is not online, releases the selected of target device, returns and performs acquisition wide area network online equipment terminal Information and record, the online device end of scanning LAN simultaneously record the information of LAN online equipment terminal.
The flow of above-mentioned processing target device control event specifically includes:
Event is controlled to receive the control command to target device according to target device;
Control command is forwarded to communication unit;
By control command be converted into after the control command based on UPnP protocol by with target device based on UPnP protocol Communication link send target device to.
Further, the flow for handling target device control event further includes:
Receive the state information response based on UPnP protocol that target device returns and parsing;
Corresponding status information data is sent to by display unit according to the state information response after parsing;
The status information data is presented by interactive interface.
In above-mentioned processing target device controls the specific flow of event, when control command is converted into be based on UPnP protocol Control command after by the communication link based on UPnP protocol with target device send to target device fail when, will control Mode record is wide area network control model, after control command to be converted into the control command based on XMPP protocol, by with service The communication link based on XMPP protocol of device sends server to.
The flow of LAN control model operation is as shown in figure 9, control terminal works in LAN control model at this time:
Step 801, monitor timer is started;
Step 802, event message is monitored;
Step 803, judge whether message belongs to timer supervisory messages, if so, step 805 is then performed, if it is not, then performing Step 804;
Step 804, the target device control event handling of LAN is performed, return to step 802 is into behaviour after the completion of processing Part message is monitored;
Step 805, UPnP scans to obtain LAN online equipment list;
Step 806, judge device A whether in the list;
Step 807, current state parameter is obtained from the management module 208;
Step 808, judge device A whether in WAN equipment list;
Step 809, wide area network control model is switched to, the operation of wide area network control model is performed, records network state information;
Step 810, prompting event is sent to interactive module;
Step 811, device A selected in management module 208 is removed;
Step 812, the UPnP control points 207 carry out UPnP scannings, obtain LAN online equipment list, the LAN Online equipment list refers to cluster tool of the attribute for " local domain net is available " or " wide area network and LAN are all available ".
UPnP control points 207 do not select mesh according to UPnP protocol rule discovery equipment and recording equipment list in user Before marking device, UPnP control points will perform step 621 → 622 → 626 → 627 → 630 → 631 → 621.
After user runs control terminal software, UPnP control points 207 and XMPP clients 206 are respectively according to the flow of Fig. 7 Operation, and the online equipment information each obtained is saved in management module 208.
With reference to figure 10, Figure 10 is the idiographic flow for carrying out target device control event handling, and user is sent out by interactive interface After going out device end control command, interactive module is captured after user sends the event of control command by interface, calls management Module 208 sends data to device end control module 205, and transmission flow is as follows:
Step 901, interactive module transmits outgoing data;
Step 902, management module 208 sends data;
Specifically, since current control model is known, management module 208 can directly invoke corresponding logical Believe that passage carries out data sending.
Step 903, judge whether to send failure;
Specifically, data sending unsuccessfully refers to retransmission data after transmission timer time-out, still can not transmit data to Device end, at this point it is possible to think that network is obstructed, should reselect communication pattern.
Step 904, judge whether it is LAN control model, if it is not, step 905 is then performed, if so, then performing step 907;
Step 905, switch mode is to wide area network control model;
Step 906, XMPP clients 206 are controlled to attempt to connect to server;
In this step, control XMPP clients 206 re-establish communication link.
Step 907, switch mode is to LAN control model;
Step 908, UPnP control points 207 are controlled to rescan list of devices;
Step 909, recording status information;
Step 910, attempt to send data;
Step 911, judge whether to send successfully;
Step 912, notify interactive module system that there are network failure;
Step 913, this transmission flow is terminated.
In step 204 in the figure 7 or step 222, when judging that user does not select a target device, the present invention Control terminal control method can also further determine whether there is chosen target device, i.e., user whether herein it It is preceding to have have selected a target device, and the target device is in the control of control terminal.Specifically, control terminal control The target device that judges whether to produce in method processed selectes event, if producing target device selectes event, by target device The step of device end in selected event is chosen to be target device further comprises:If not producing target device selectes thing Part, then judge whether the target device being selected, if there is the target device being selected, then according to predetermined Control model and the presence of the target device being selected determine the need for switching control pattern;If without Through chosen target device, then the information and record for performing and obtaining wide area network online equipment terminal are returned to, scanning LAN exists The device end of line and the information for recording LAN online equipment terminal.
Wherein, need are determined whether according to the presence of predetermined control model and the target device being selected The step of wanting switching control pattern specifically includes:When predetermined control model is LAN control model and described has been selected Target device when belonging to LAN online equipment, control model is recorded as LAN control model, performs local network control system Pattern operates;When predetermined control model is wide area network control model and the target device being selected belongs to wide area network During online equipment, control model is recorded as wide area network control model, performs the operation of wide area network control model;When it is described by Selected target device had not only been not belonging to LAN online equipment, but also when being not belonging to wide area network online equipment, return perform obtain it is wide The information and record of domain net online equipment terminal, the online device end of scanning LAN simultaneously record LAN online equipment terminal Information the step of.
Further, determined according to the presence of predetermined control model and the target device being selected be No the step of needing switching control pattern, further includes:When predetermined control model is LAN control model and described has been chosen When fixed target device belongs to wide area network online equipment, control model is recorded as wide area network control model, performs wide area network control Molding formula operates;When predetermined control model is wide area network control model and the target device being selected belongs to local During net online equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula.
In the figure 7, control terminal control method of the invention is by step 608 → 609 → 610 and step 626 → 627 → 628 judge whether there is chosen target device, go forward side by side and carry out corresponding control mode switch operation as needed.
The control terminal control method of the present embodiment can automatically select LAN control according to specific use environment Pattern or wide area network control model, and the switching of pattern a can be automatically controlled when use environment changes.Assuming that User opens control terminal at home, selects " device A in list of devices ", it is assumed that is controlled preferentially, then controlled using LAN Termination management module is labeled as LAN control model(UPnP patterns), use UPnP control points 207 and the UPnP of device end The control passage that equipment 203 is established carries out data interaction.After user goes out, more than the effect model of family LAN network router Enclose, local area network communication link will be caused to disconnect, can be according to newest wide area network online equipment after control terminal listens to this event Information is controlled the switching of pattern, newest wide area network online equipment information can by 603 → 604 → 608 → 609 → 610 → 616 → 617 → 615 → 603 Monitoring and Updates;When user is returned to indoor, i.e., the sphere of action into LAN router by open air When interior, the LAN thread 621 → 622 → 626 → 627 → 628 → 629 → 631 → 621 of control terminal will monitor discovery, The condition of step 628 is set up, Dietary behavior switching judging, if LAN control is preferential, then perform step 632 → 623 → 624 → 625, it is switched to the work of LAN control model.
The present invention also proposes a kind of control that can switch automatically between LAN control model and wide area network control model Terminal processed, as shown in figure 11, the control terminal include:
Log-in module 1020, for sending log on request to server, after logging in successfully, establish with server based on The communication link of XMPP protocol;
Online equipment end message logging modle 1030, for obtaining the information and record of wide area network online equipment terminal, And for scanning the online device end of LAN and recording the information of LAN online equipment terminal;
Target device selectes event judge module 1040, for judging whether that producing target device selectes event, if production Raw target device selectes event, then the device end selected target device in event is chosen to be target device;
Communication pattern determining module 1050, for being determined according to the presence of predetermined control model and target device Communication pattern.
Wherein, which refers to the predetermined control model for needing preferentially to use of control terminal, or The control model for needing preferentially to use that person user determines.
The communication pattern determining module 1050 is additionally operable to:Judge that predetermined control model is LAN control model or wide Domain net control model, and target device belong to LAN online equipment or wide area network online equipment, when predetermined control mould Formula is LAN control model and when target device belongs to LAN online equipment, and notice communication unit establishes base with target device In the communication link of UPnP protocol, control data is sent to target device, obtains the description information of target device, foundation and target The communication link based on UPnP protocol of equipment;When predetermined control model is wide area network control model and target device belongs to wide During the net online equipment of domain, the status information of target device is inquired about, the status information for the target device that server returns is received and deposits Storage.
The communication pattern determining module 1050 is further used for:When predetermined control model is LAN control model and mesh When marking device belongs to wide area network online equipment, the status information of target device is inquired about, receives the target device that server returns Status information simultaneously stores;When predetermined control model is wide area network control model and target device belongs to LAN online equipment When, notice communication unit establishes the communication link based on UPnP protocol with target device, sends control data to target device, obtains The description information of target device is taken, establishes the communication link based on UPnP protocol with target device.
The communication pattern determining module 1050 is further additionally operable to:When predetermined control model be LAN control model and When target device belongs to LAN online equipment, notice communication unit establishes the communication chain based on UPnP protocol with target device Road, sends control data to target device, obtains the description information of target device, establishes with target device based on UPnP protocol Communication link after control model is recorded as LAN control model, perform the operation of local network control molding formula;When predetermined Control model is wide area network control model and when target device belongs to wide area network online equipment, inquires about the state letter of target device Cease, control model is recorded as wide area network control mould after the status information for the target device that reception server returns and storage Formula, performs the operation of wide area network control model;When predetermined control model is LAN control model and target device belongs to wide area During net online equipment, the status information of target device is inquired about, receives status information and the storage of the target device that server returns Control model is recorded as wide area network control model afterwards, performs the operation of wide area network control model;When predetermined control model is When wide area network control model and target device belong to LAN online equipment, notice communication unit is established with target device and is based on The communication link of UPnP protocol, control data is sent to target device, obtains the description information of target device, and foundation is set with target Control model is recorded as LAN control model after the standby communication link based on UPnP protocol, performs local network control molding Formula operates.
Communication pattern determining module 1050 includes LAN control model operation module 1080, LAN control model behaviour Make module 1080 to specifically include:
First monitors module 1081, controls and monitors for performance objective equipment;
First judgment module 1082, for judging whether to produce target device control event, if producing target device control Event processed, then handle target device control event, is then back to and continues to execute target device control action listener;If do not produce Raw target device control event, then exist according to the online device end of predetermined time cycle scanning LAN, renewal LAN The information record of line device end;
Second judgment module 1083, for judging target device according to the information of the LAN online equipment terminal after renewal Whether belong to LAN online equipment, if LAN online equipment, then return and continue to execute target device control event prison Listen;If not LAN online equipment, then judge whether target device belongs to wide area network online equipment, if target device category In wide area network online equipment, control model is recorded as wide area network control model, performs the operation of wide area network control model;If mesh Marking device is not belonging to wide area network online equipment and then judges that target device is not online, releases the selected of target device, returns to execution and obtains The information and record of wide area network online equipment terminal are taken, the online device end of scanning LAN simultaneously records LAN online equipment The information of terminal.
LAN control model operation module 1080 includes local network destination equipment control event processing module 1084, local Mesh marking device control event processing module 1084 is used for:Event is controlled to receive the control to target device according to the target device System order, forwards the control command that the control command is converted into the control command based on UPnP protocol to communication unit Target device is sent to by the communication link based on UPnP protocol with target device afterwards.
Local network destination equipment control event processing module 1084 is additionally operable to:It is converted into being based on when by the control command Target device is sent to after the control command of UPnP protocol by the communication link based on UPnP protocol with target device to fail When, control model is recorded as wide area network control model, the control command is converted into the control command based on XMPP protocol Afterwards, server is sent to by the communication link based on XMPP protocol with server.
The communication pattern determining module 1050 further includes wide area network control model operation module 1090, wide area network control model Operation module 1090 specifically includes:
Second monitors module 1091, and action listener is controlled for performance objective equipment;
3rd judgment module 1092, for judging whether to produce target device control event, if producing target device control Event processed, then performance objective equipment control event handling, is then back to and continues to execute target device control action listener;If not yet Have and produce target device control event, then information and the renewal of wide area network online equipment terminal are obtained according to the predetermined time cycle Record;
4th judgment module 1093, for judging target device according to the information of the wide area network online equipment terminal after renewal Whether belong to wide area network online equipment, if wide area network online equipment, then return and continue to execute target device control event prison Listen;If not wide area network online equipment, then judge whether target device belongs to LAN online equipment, if target device category In LAN online equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula;If mesh Marking device is not belonging to LAN online equipment and then judges that target device is not online, releases the selected of target device and returns to execution and obtains The information and record of wide area network online equipment terminal are taken, the online device end of scanning LAN simultaneously records LAN online equipment The information of terminal.
Wide area network control model operation module 1090 further includes wide area network target device control event processing module 1094, extensively Domain mesh marking device control event processing module 1094 is used for:Event is controlled to receive to target device according to the target device Control command, forwards the control command that the control command is converted into the control based on XMPP protocol and is ordered to communication unit Server is sent to by the communication link based on XMPP protocol with server after order.
Wide area network target device control event processing module 1094 is additionally operable to:It is converted into being based on when by the control command , will when sending server failure to by the communication link based on XMPP protocol with server after the control command of XMPP protocol Control model is recorded as LAN control model, passes through after the control command is converted into the control command based on UPnP protocol Target device is sent to the communication link based on UPnP protocol of target device.
The target device is selected event judge module 1040 and is further used for:If not producing target device selectes thing Part, then judge whether the target device being selected, if there is the target device being selected, then according to predetermined Control model and the presence of the target device being selected determine the need for switching control pattern;If not yet There is the target device being selected, then return to the information and record for performing and obtaining wide area network online equipment terminal, scan local Net online device end and record the information of LAN online equipment terminal.
Target device, which selectes event judge module 1040, includes control mode switch module 1041, control mode switch module 1041 are used for:When predetermined control model is LAN control model and the target device being selected belongs to LAN During online equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula;When predetermined control Pattern is wide area network control model and when the target device being selected belongs to wide area network online equipment, by control model Wide area network control model is recorded as, performs the operation of wide area network control model;When the target device being selected neither belongs to In LAN online equipment, and when being not belonging to wide area network online equipment, the letter for performing and obtaining wide area network online equipment terminal is returned Cease and record, the online device end of scanning LAN simultaneously records the information of LAN online equipment terminal.
Control mode switch module 1041 is additionally operable to:When predetermined control model be LAN control model and it is described When chosen target device belongs to wide area network online equipment, control model is recorded as wide area network control model, performs wide area Net control model operates;When predetermined control model is wide area network control model and the target device being selected belongs to During LAN online equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula.
Control terminal further includes initialization module 1010, for initializing control terminal.
In addition, the embodiment of the present invention also propose it is a kind of using LAN it is preferential possess control model automatic switching function Control terminal control method, which includes the following steps:
Log on request is sent to server, after logging in successfully, establishes the communication chain based on XMPP protocol with server Road;
The information and record of wide area network online equipment terminal are obtained, the online device end of scanning LAN simultaneously records local The information of net online equipment terminal;
Judge whether that producing target device selectes event, if producing target device selectes event, target device is selected The device end determined in event is chosen to be target device;
Judge whether target device belongs to LAN online equipment terminal, when target device is LAN online equipment terminal When, notice communication unit establishes the communication link based on UPnP protocol with target device, sends control data to target device, obtains The description information of target device is taken, establishes the communication link based on UPnP protocol with target device.
The above method just directly establishes base when determining target device and being LAN online equipment terminal with target device In the communication link of UPnP protocol, only when target device is not LAN online equipment terminal, this can be just determined whether Whether target device belongs to wide area network online equipment, its judgment step is as follows:When target device is wide area network online equipment terminal When, the status information of target device is inquired about, receives status information and the storage of the target device that server returns.
It is above-mentioned when target device is LAN online equipment terminal, notice communication unit and target device foundation is based on The communication link of UPnP protocol, control data is sent to target device, obtains the description information of target device, and foundation is set with target Further included after the step of standby communication link based on UPnP protocol and control model is recorded as LAN control model, performed LAN control model operates.It is above-mentioned when target device is wide area network online equipment terminal, inquire about target device state letter The step of breath, the status information and the storage that receive the target device that server returns further includes afterwards is recorded as control model extensively Domain net control model, performs the operation of wide area network control model.
Wherein, the flow of LAN control model operation includes:
The control of performance objective equipment is monitored;
Judge whether to produce target device control event, if producing target device control event, handle target device Control event, is then back to and continues to execute target device control action listener;If not producing target device control event, According to the online device end of predetermined time cycle scanning LAN, the information record of renewal LAN online equipment terminal;
Judge whether target device belongs to LAN and set online according to the information of the LAN online equipment terminal after renewal It is standby, if LAN online equipment, then return and continue to execute target device control action listener;It is online if not LAN Equipment, then judge whether target device belongs to wide area network online equipment, if target device belongs to wide area network online equipment, will control Molding formula is recorded as wide area network control model, performs the operation of wide area network control model;Exist if target device is not belonging to wide area network Line equipment then judges that target device is not online, releases the selected of target device, returns and performs acquisition wide area network online equipment terminal Information and record, the online device end of scanning LAN and the step of record the information of LAN online equipment terminal.
The flow of processing target device control event in the operation of LAN control model specifically includes:
Event is controlled to receive the control command to target device according to the target device;
The control command is forwarded to communication unit;
By the control command be converted into after the control command based on UPnP protocol by with target device based on UPnP The communication link of agreement sends target device to, leads to after the control command to be converted into the control command based on UPnP protocol Cross with the communication link based on UPnP protocol of target device send to target device failure when, control model is recorded as wide area Net control model, after the control command to be converted into the control command based on XMPP protocol, by with server based on The communication link of XMPP protocol sends server to.
The flow of wide area network control model operation includes:
Performance objective equipment controls action listener;
Judge whether to produce target device control event, if producing target device control event, performance objective equipment Event handling is controlled, is then back to and continues to execute target device control action listener;If target device control thing is not produced Part, then obtain the information and more new record of wide area network online equipment terminal according to the predetermined time cycle;
Judge whether target device belongs to wide area network and set online according to the information of the wide area network online equipment terminal after renewal It is standby, if wide area network online equipment, then return and continue to execute target device control action listener;It is online if not wide area network Equipment, then judge whether target device belongs to LAN online equipment, if target device belongs to LAN online equipment, will control Molding formula is recorded as LAN control model, performs the operation of local network control molding formula;Exist if target device is not belonging to LAN Line equipment then judges that target device is not online, releases the selected of target device and returns to execution acquisition wide area network online equipment terminal Information and record, the online device end of scanning LAN and the step of record the information of LAN online equipment terminal.
The flow of processing target device control event in the operation of wide area network control model specifically includes:
Event is controlled to receive the control command to target device according to the target device;
The control command is forwarded to communication unit;
The control command is converted into after the control command based on XMPP protocol by being assisted with server based on XMPP The communication link of view sends server to, after the control command to be converted into the control command based on XMPP protocol by with When the communication link based on XMPP protocol of server sends server failure to, control model is recorded as LAN control mould Formula, by the control command be converted into after the control command based on UPnP protocol by with target device based on UPnP protocol Communication link sends target device to.
It is above-mentioned to judge whether that producing target device selectes event, if producing target device selectes event, target is set The step of alternative device end determined in event is chosen to be target device further comprises:If do not produce target device to select Event, then judge whether the target device being selected, if there is the target device being selected, then according to institute The presence for stating the target device being selected determines the need for switching control pattern;If without what is be selected Target device, then return to the information and record for performing and obtaining wide area network online equipment terminal, and the online equipment of scanning LAN is whole The step of holding and recording the information of LAN online equipment terminal.
The presence for the target device being selected described in above-mentioned basis determines the need for switching control pattern Step includes:When the target device being selected belongs to LAN online equipment, local network control molding formula behaviour is performed Make;When the target device being selected belongs to wide area network online equipment, when being not belonging to LAN online equipment, execution is wide Domain net control model operation;When the target device being selected not only had been not belonging to LAN online equipment, but also it is not belonging to wide During the net online equipment of domain, the information and record for performing and obtaining wide area network online equipment terminal are returned to, scanning LAN is online to be set The step of for terminal and recording the information of LAN online equipment terminal.
In addition to the control method of device end and control terminal, the present invention also provides a kind of server control method, such as Shown in Figure 12, which includes the following steps:
Step S1101, the log on request of receiving device terminal, establishes the communication chain based on UPnP protocol with device end Road, the device end status information that receiving device terminal uploads;And the log on request of control terminal is received, establish with control eventually The communication link based on XMPP protocol at end;
Step S1102, control terminal is sent to by the information of wide area network online equipment;
Step S1103, receives the instruction for the selected target equipment that control terminal is sent;
Step S1104, sends the status information of the chosen target device to control terminal;
Step S1105, receives the target terminal control command based on XMPP protocol that control terminal is sent;
Step S1106, target terminal is transmitted to by the target terminal control command;
Step S1107, receives the state information response based on XMPP protocol that target terminal is sent;
Step S1108, control terminal is transmitted to by the state information response based on XMPP protocol.
After device end and control terminal game server, under wide area network control model, device end and control are eventually Communicated between end by server, forward data, when the communication server 210, which receives data, needs processing, can be passed through Interface function or interface message call data processing server 211 specifically to be handled.If the communication server 110 receives number During according to only needing simply to be forwarded to control terminal or device end, then do not have to call data processing server 111.
The device end of the present invention is by setting UPnP control points 202 so that device end is in wide area network and LAN two It can unify underlying device interface under kind operational mode, simplify design.The control terminal of the present invention can automatically select local Net control model or wide area network control model, are controlled pattern automatically according to the location of user and use environment etc. and cut Change, improve convenience, make control terminal more humane, intelligent.
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly Enclose, therefore equivalent variations made according to the claims of the present invention, it is still within the scope of the present invention.

Claims (33)

1. a kind of control terminal control method, includes the following steps:
Log on request is sent to server, after logging in successfully, establishes the communication link based on XMPP protocol with server;
Obtain the information and record of wide area network online equipment terminal, the online device end of scanning LAN simultaneously records LAN and exists The information of line device end;
Judge whether that producing target device selectes event, if producing target device selectes event, thing is selected by target device Device end in part is chosen to be target device;
Communication pattern is determined according to the presence of predetermined control model and target device;
The step of presence according to predetermined control model and target device determines communication pattern includes:
Judge that predetermined control model is LAN control model or wide area network control model, and target device belongs to local Net online equipment or wide area network online equipment, when predetermined control model is LAN control model and target device belongs to office During the net online equipment of domain, notice communication unit establishes the communication link based on UPnP protocol with target device, is sent out to target device Control data is sent, obtains the description information of target device, establishes the communication link based on UPnP protocol with target device;When pre- Fixed control model is wide area network control model and when target device belongs to wide area network online equipment, inquires about the state of target device Information, receives status information and the storage of the target device that server returns;
When predetermined control model is LAN control model and target device belongs to wide area network online equipment, inquiry target is set Standby status information, receives status information and the storage of the target device that server returns;When predetermined control model is wide area When net control model and target device belong to LAN online equipment, notice communication unit is established with target device and assisted based on UPnP The communication link of view, sends control data to target device, obtains the description information of target device, establish the base with target device In the communication link of UPnP protocol.
2. control terminal control method according to claim 1, it is characterised in that described when predetermined control model is office Domain net control model and when target device belongs to LAN online equipment, notice communication unit is established with target device and is based on UPnP The communication link of agreement, sends control data to target device, obtains the description information of target device, establishes and target device Further included after the step of communication link based on UPnP protocol and control model is recorded as LAN control model, perform local Net control model operates;
When predetermined control model is wide area network control model and target device belongs to wide area network online equipment, inquiry target is set The step of standby status information, the status information and the storage that receive the target device that server returns, further includes afterwards and will control mould Formula is recorded as wide area network control model, performs the operation of wide area network control model;
When predetermined control model is LAN control model and target device belongs to wide area network online equipment, inquiry target is set The step of standby status information, the status information and the storage that receive the target device that server returns, further includes afterwards and will control mould Formula is recorded as wide area network control model, performs the operation of wide area network control model;
When predetermined control model is wide area network control model and target device belongs to LAN online equipment, communication unit is notified Member establishes the communication link based on UPnP protocol with target device, sends control data to target device, obtains target device Further included after the step of description information, foundation and communication link based on UPnP protocol of target device and record control model For LAN control model, the operation of local network control molding formula is performed.
3. control terminal control method according to claim 2, it is characterised in that the LAN control model operation bag Include:
The control of performance objective equipment is monitored;
Judge whether to produce target device control event, if producing target device control event, processing target device control Event, is then back to and continues to execute target device control action listener;If not producing target device control event, according to The online device end of predetermined time cycle scanning LAN, updates the information record of LAN online equipment terminal;
Judge whether target device belongs to LAN online equipment according to the information of the LAN online equipment terminal after renewal, such as Fruit is LAN online equipment, then returns and continue to execute target device control action listener;If not LAN online equipment, Then judge whether target device belongs to wide area network online equipment, if target device belongs to wide area network online equipment, mould will be controlled Formula is recorded as wide area network control model, performs the operation of wide area network control model;Set online if target device is not belonging to wide area network It is standby then judge that target device is not online, the selected of target device is released, returns to the letter for performing and obtaining wide area network online equipment terminal The step of ceasing and record, scanning the online device end of LAN and record the information of LAN online equipment terminal.
4. control terminal control method according to claim 3, it is characterised in that the processing target device control event Specifically include:
Event is controlled to receive the control command to target device according to the target device;
The control command is forwarded to communication unit;
By the control command be converted into after the control command based on UPnP protocol by with target device based on UPnP protocol Communication link send target device to.
5. control terminal control method according to claim 4, it is characterised in that described to be converted into the control command Target device is sent to by the communication link based on UPnP protocol with target device after control command based on UPnP protocol The step of further include:
By being assisted with target device based on UPnP after the control command to be converted into the control command based on UPnP protocol When the communication link of view sends target device failure to, control model is recorded as wide area network control model, the control is ordered After order is converted into the control command based on XMPP protocol, clothes are sent to by the communication link based on XMPP protocol with server Business device.
6. control terminal control method according to claim 2, it is characterised in that the wide area network control model operation bag Include:
Performance objective equipment controls action listener;
Judge whether to produce target device control event, if producing target device control event, the control of performance objective equipment Event handling, is then back to and continues to execute target device control action listener;If not producing target device control event, The information and more new record of wide area network online equipment terminal are obtained according to the predetermined time cycle;
Judge whether target device belongs to wide area network online equipment according to the information of the wide area network online equipment terminal after renewal, such as Fruit is wide area network online equipment, then returns and continue to execute target device control action listener;If not wide area network online equipment, Then judge whether target device belongs to LAN online equipment, if target device belongs to LAN online equipment, mould will be controlled Formula is recorded as LAN control model, performs the operation of local network control molding formula;Set online if target device is not belonging to LAN It is standby then judge that target device is not online, release the selected of target device and return to the letter for performing and obtaining wide area network online equipment terminal The step of ceasing and record, scanning the online device end of LAN and record the information of LAN online equipment terminal.
7. control terminal control method according to claim 6, it is characterised in that the processing target device control event Specifically include:
Event is controlled to receive the control command to target device according to the target device;
The control command is forwarded to communication unit;
By the control command be converted into after the control command based on XMPP protocol by with server based on XMPP protocol Communication link sends server to.
8. control terminal control method according to claim 7, it is characterised in that described to be converted into the control command Send the step of server after control command based on XMPP protocol to by the communication link based on XMPP protocol with server Suddenly further include:
After the control command to be converted into the control command based on XMPP protocol by with server based on XMPP protocol Communication link when sending server failure to, control model is recorded as LAN control model, the control command is turned Change into and target is sent to by the communication link based on UPnP protocol with target device after the control command based on UPnP protocol Equipment.
9. control terminal control method according to claim 1, it is characterised in that described to judge whether to produce target device Selected event, if producing target device selectes event, device end target device selected in event is chosen to be target The step of equipment, further comprises:
If not producing target device selectes event, the target device being selected is judged whether, if there is The target device being selected, then according to predetermined control model and the presence of the target device being selected Determine the need for switching control pattern;If without the target device being selected, return to execution acquisition wide area network and exist The information and record of line device end, the online device end of scanning LAN simultaneously record the information of LAN online equipment terminal The step of.
10. control terminal control method according to claim 9, it is characterised in that described according to predetermined control model The step of determining the need for switching control pattern with the presence of the target device being selected includes:
When predetermined control model be LAN control model and the target device being selected to belong to LAN online During equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula;
When predetermined control model be wide area network control model and the target device being selected to belong to wide area network online During equipment, control model is recorded as wide area network control model, performs the operation of wide area network control model;
When the target device being selected not only had been not belonging to LAN online equipment, but also it is not belonging to wide area network online equipment When, return to the information and record for performing and obtaining wide area network online equipment terminal, the online device end of scanning LAN and record The step of information of LAN online equipment terminal.
11. control terminal control method according to claim 10, it is characterised in that described according to predetermined control model The step of determining the need for switching control pattern with the presence of the target device being selected further includes:
When predetermined control model be LAN control model and the target device being selected to belong to wide area network online During equipment, control model is recorded as wide area network control model, performs the operation of wide area network control model;
When predetermined control model be wide area network control model and the target device being selected to belong to LAN online During equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula.
12. control terminal control method according to claim 1, it is characterised in that described logged in server transmission please Ask, after logging in successfully, establish with being further included before the step of the communication link based on XMPP protocol of server:Initialization control Terminal processed.
13. control terminal control method according to claim 1, it is characterised in that the predetermined control model refers to The predetermined control model for needing preferentially to use of control terminal, or the control mould for needing preferentially to use that user determines Formula.
14. a kind of control terminal, it is characterised in that the control terminal includes:
Log-in module, for sending log on request to server, after logging in successfully, is established with server based on XMPP protocol Communication link;
Online equipment end message logging modle, for obtaining the information and record of wide area network online equipment terminal, and is used for The online device end of scanning LAN simultaneously records the information of LAN online equipment terminal;
Target device selectes event judge module, for judging whether that producing target device selectes event, sets if producing target Alternatively determine event, then device end target device selected in event is chosen to be target device;
Communication pattern determining module, for determining communication mould according to the presence of predetermined control model and target device Formula;
The communication pattern determining module is specifically used for:
Judge that predetermined control model is LAN control model or wide area network control model, and target device belongs to local Net online equipment or wide area network online equipment, when predetermined control model is LAN control model and target device belongs to office During the net online equipment of domain, notice communication unit establishes the communication link based on UPnP protocol with target device, is sent out to target device Control data is sent, obtains the description information of target device, establishes the communication link based on UPnP protocol with target device;When pre- Fixed control model is wide area network control model and when target device belongs to wide area network online equipment, inquires about the state of target device Information, receives status information and the storage of the target device that server returns;
The communication pattern determining module is further used for:
When predetermined control model is LAN control model and target device belongs to wide area network online equipment, inquiry target is set Standby status information, receives status information and the storage of the target device that server returns;When predetermined control model is wide area When net control model and target device belong to LAN online equipment, notice communication unit is established with target device and assisted based on UPnP The communication link of view, sends control data to target device, obtains the description information of target device, establish the base with target device In the communication link of UPnP protocol.
15. control terminal according to claim 14, it is characterised in that the communication pattern determining module is further also used In:
When predetermined control model is LAN control model and target device belongs to LAN online equipment, communication unit is notified Member establishes the communication link based on UPnP protocol with target device, sends control data to target device, obtains target device Description information, establishes after the communication link based on UPnP protocol with target device control model being recorded as LAN control Pattern, performs the operation of local network control molding formula;
When predetermined control model is wide area network control model and target device belongs to wide area network online equipment, inquiry target is set Standby status information, receive the target device that server returns status information and storage after control model is recorded as wide area Net control model, performs the operation of wide area network control model;
When predetermined control model is LAN control model and target device belongs to wide area network online equipment, inquiry target is set Standby status information, receive the target device that server returns status information and storage after control model is recorded as wide area Net control model, performs the operation of wide area network control model;
When predetermined control model is wide area network control model and target device belongs to LAN online equipment, communication unit is notified Member establishes the communication link based on UPnP protocol with target device, sends control data to target device, obtains target device Description information, establishes after the communication link based on UPnP protocol with target device control model being recorded as LAN control Pattern, performs the operation of local network control molding formula.
16. control terminal according to claim 15, it is characterised in that the communication pattern determining module includes LAN Control model operation module, the LAN control model operation module specifically include:
First monitors module, controls and monitors for performance objective equipment;
First judgment module, for judging whether to produce target device control event, if producing target device control event, Target device control event is handled, is then back to and continues to execute target device control action listener;If do not produce target to set Standby control event, then it is whole according to the online device end of predetermined time cycle scanning LAN, renewal LAN online equipment The information record at end;
Second judgment module, for judging whether target device belongs to according to the information of the LAN online equipment terminal after renewal LAN online equipment, if LAN online equipment, then returns and continues to execute target device control action listener;If no It is LAN online equipment, then judges whether target device belongs to wide area network online equipment, if target device belongs to wide area network Online equipment, wide area network control model is recorded as by control model, performs the operation of wide area network control model;If target device is not Belong to wide area network online equipment and then judge that target device is not online, release the selected of target device, return and perform acquisition wide area network The information and record of online equipment terminal, the online device end of scanning LAN simultaneously record the letter of LAN online equipment terminal Breath.
17. control terminal according to claim 16, it is characterised in that the LAN control model operation module includes Local network destination equipment controls event processing module, and the local network destination equipment control event processing module is used for:According to institute Control command of the target device control event reception to target device is stated, the control command is forwarded to communication unit, by described in Control command is converted into after the control command based on UPnP protocol by the communication link based on UPnP protocol with target device Send target device to.
18. control terminal according to claim 17, it is characterised in that the local network destination equipment controls event handling Module is additionally operable to:After the control command to be converted into the control command based on UPnP protocol by with target device based on When the communication link of UPnP protocol sends target device failure to, control model is recorded as wide area network control model, by described in After control command is converted into the control command based on XMPP protocol, passed by the communication link based on XMPP protocol with server Give server.
19. control terminal according to claim 15, it is characterised in that the communication pattern determining module includes wide area network Control model operation module, the wide area network control model operation module specifically include:
Second monitors module, and action listener is controlled for performance objective equipment;
3rd judgment module, for judging whether to produce target device control event, if producing target device control event, Performance objective equipment controls event handling, is then back to and continues to execute target device control action listener;If do not produce mesh Marking device controls event, then the information and more new record of wide area network online equipment terminal are obtained according to the predetermined time cycle;
4th judgment module, for judging whether target device belongs to according to the information of the wide area network online equipment terminal after renewal Wide area network online equipment, if wide area network online equipment, then returns and continues to execute target device control action listener;If no It is wide area network online equipment, then judges whether target device belongs to LAN online equipment, if target device belongs to LAN Online equipment, LAN control model is recorded as by control model, performs the operation of local network control molding formula;If target device is not Belong to LAN online equipment and then judge that target device is not online, release the selected of target device and return to execution acquisition wide area network The information and record of online equipment terminal, the online device end of scanning LAN simultaneously record the letter of LAN online equipment terminal Breath.
20. control terminal according to claim 19, it is characterised in that the wide area network control model operation module is also wrapped Wide area network target device control event processing module is included, the wide area network target device control event processing module is used for:According to The target device control event receives the control command to target device, the control command is forwarded to communication unit, by institute Control command is stated to be converted into after the control command based on XMPP protocol by the communication link based on XMPP protocol with server Send server to.
21. control terminal according to claim 20, it is characterised in that the wide area network target device controls event handling Module is additionally operable to:After the control command to be converted into the control command based on XMPP protocol by with server based on When the communication link of XMPP protocol sends server failure to, control model is recorded as LAN control model, by the control System order is passed after being converted into the control command based on UPnP protocol by the communication link based on UPnP protocol with target device Give target device.
22. control terminal according to claim 14, it is characterised in that the target device select event judge module into One step is used for:
If not producing target device selectes event, the target device being selected is judged whether, if there is The target device being selected, then according to predetermined control model and the presence of the target device being selected Determine the need for switching control pattern;If without the target device being selected, return to execution acquisition wide area network and exist The information and record of line device end, the online device end of scanning LAN simultaneously record the letter of LAN online equipment terminal Breath.
23. control terminal according to claim 22, it is characterised in that the target device selectes event judge module bag Control mode switch module is included, the control mode switch module is used for:
When predetermined control model be LAN control model and the target device being selected to belong to LAN online During equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula;
When predetermined control model be wide area network control model and the target device being selected to belong to wide area network online During equipment, control model is recorded as wide area network control model, performs the operation of wide area network control model;
When the target device being selected not only had been not belonging to LAN online equipment, but also it is not belonging to wide area network online equipment When, return to the information and record for performing and obtaining wide area network online equipment terminal, the online device end of scanning LAN and record The information of LAN online equipment terminal.
24. control terminal according to claim 23, it is characterised in that the control mode switch module is additionally operable to:
When predetermined control model be LAN control model and the target device being selected to belong to wide area network online During equipment, control model is recorded as wide area network control model, performs the operation of wide area network control model;
When predetermined control model be wide area network control model and the target device being selected to belong to LAN online During equipment, control model is recorded as LAN control model, performs the operation of local network control molding formula.
25. control terminal according to claim 14, it is characterised in that the device end further includes initialization module, For initializing control terminal.
26. control terminal according to claim 14, it is characterised in that the predetermined control model refers to control terminal The predetermined control model for needing preferentially to use, or the control model for needing preferentially to use that user determines.
27. a kind of control terminal control method, includes the following steps:
Log on request is sent to server, after logging in successfully, establishes the communication link based on XMPP protocol with server;
Obtain the information and record of wide area network online equipment terminal, the online device end of scanning LAN simultaneously records LAN and exists The information of line device end;
Judge whether that producing target device selectes event, if producing target device selectes event, thing is selected by target device Device end in part is chosen to be target device;
Judge whether target device belongs to LAN online equipment terminal, when target device is LAN online equipment terminal, Notify communication unit to establish the communication link based on UPnP protocol with target device, send control data to target device, obtain The description information of target device, establishes the communication link based on UPnP protocol with target device;
It is described to judge whether target device belongs to LAN online equipment terminal, when target device is LAN online equipment terminal When, notice communication unit establishes the communication link based on UPnP protocol with target device, sends control data to target device, obtains The step of taking the description information of target device, establishing the communication link based on UPnP protocol with target device further includes:
When target device is wide area network online equipment terminal, the status information of target device is inquired about, receives what server returned The status information of target device and storage;
It is described to judge whether that producing target device selectes event, if producing target device selectes event, target device is selected Determine the step of device end in event is chosen to be target device to further comprise:
If not producing target device selectes event, the target device being selected is judged whether, if there is The target device being selected, the then presence for the target device being selected according to determine the need for switching Control model;If without the target device being selected, the information for performing and obtaining wide area network online equipment terminal is returned And the step of recording, scanning the online device end of LAN and record the information of LAN online equipment terminal.
28. control terminal control method according to claim 27, it is characterised in that described when target device is LAN During online equipment terminal, notice communication unit establishes the communication link based on UPnP protocol with target device, is sent out to target device Control data is sent, obtains the description information of target device, establishes the step with the communication link based on UPnP protocol of target device Further included after rapid and control model is recorded as LAN control model, perform the operation of local network control molding formula;
It is described to inquire about the status information of target device when target device is wide area network online equipment terminal, receive server and return Further included after the step of status information of the target device returned and storage and control model is recorded as wide area network control model, held Row wide area network control model operates.
29. control terminal control method according to claim 28, it is characterised in that the LAN control model operation Including:
The control of performance objective equipment is monitored;
Judge whether to produce target device control event, if producing target device control event, processing target device control Event, is then back to and continues to execute target device control action listener;If not producing target device control event, according to The online device end of predetermined time cycle scanning LAN, updates the information record of LAN online equipment terminal;
Judge whether target device belongs to LAN online equipment according to the information of the LAN online equipment terminal after renewal, such as Fruit is LAN online equipment, then returns and continue to execute target device control action listener;If not LAN online equipment, Then judge whether target device belongs to wide area network online equipment, if target device belongs to wide area network online equipment, mould will be controlled Formula is recorded as wide area network control model, performs the operation of wide area network control model;Set online if target device is not belonging to wide area network It is standby then judge that target device is not online, the selected of target device is released, returns to the letter for performing and obtaining wide area network online equipment terminal The step of ceasing and record, scanning the online device end of LAN and record the information of LAN online equipment terminal.
30. control terminal control method according to claim 29, it is characterised in that the processing target device control thing Part specifically includes:
Event is controlled to receive the control command to target device according to the target device;
The control command is forwarded to communication unit;
By the control command be converted into after the control command based on UPnP protocol by with target device based on UPnP protocol Communication link send target device to, after the control command to be converted into the control command based on UPnP protocol by with When the communication link based on UPnP protocol of target device sends target device failure to, control model is recorded as wide area network control Molding formula, after the control command to be converted into the control command based on XMPP protocol, by being assisted with server based on XMPP The communication link of view sends server to.
31. control terminal control method according to claim 28, it is characterised in that the wide area network control model operation Including:
Performance objective equipment controls action listener;
Judge whether to produce target device control event, if producing target device control event, the control of performance objective equipment Event handling, is then back to and continues to execute target device control action listener;If not producing target device control event, The information and more new record of wide area network online equipment terminal are obtained according to the predetermined time cycle;
Judge whether target device belongs to wide area network online equipment according to the information of the wide area network online equipment terminal after renewal, such as Fruit is wide area network online equipment, then returns and continue to execute target device control action listener;If not wide area network online equipment, Then judge whether target device belongs to LAN online equipment, if target device belongs to LAN online equipment, mould will be controlled Formula is recorded as LAN control model, performs the operation of local network control molding formula;Set online if target device is not belonging to LAN It is standby then judge that target device is not online, release the selected of target device and return to the letter for performing and obtaining wide area network online equipment terminal The step of ceasing and record, scanning the online device end of LAN and record the information of LAN online equipment terminal.
32. control terminal control method according to claim 31, it is characterised in that the processing target device control thing Part specifically includes:
Event is controlled to receive the control command to target device according to the target device;
The control command is forwarded to communication unit;
By the control command be converted into after the control command based on XMPP protocol by with server based on XMPP protocol Communication link sends server to, after the control command to be converted into the control command based on XMPP protocol by with service When the communication link based on XMPP protocol of device sends server failure to, control model is recorded as LAN control model, The control command is converted into after the control command based on UPnP protocol by logical based on UPnP protocol with target device Letter link sends target device to.
33. control terminal control method according to claim 27, it is characterised in that be selected described in the basis The presence of target device the step of determining the need for switching control pattern include:
When the target device being selected belongs to LAN online equipment, the operation of local network control molding formula is performed;
When the target device being selected belongs to wide area network online equipment, when being not belonging to LAN online equipment, perform Wide area network control model operates;
When the target device being selected not only had been not belonging to LAN online equipment, but also it is not belonging to wide area network online equipment When, return to the information and record for performing and obtaining wide area network online equipment terminal, the online device end of scanning LAN and record The step of information of LAN online equipment terminal.
CN201310109664.7A 2013-03-29 2013-03-29 A kind of control terminal and its control method Expired - Fee Related CN103200070B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310109664.7A CN103200070B (en) 2013-03-29 2013-03-29 A kind of control terminal and its control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310109664.7A CN103200070B (en) 2013-03-29 2013-03-29 A kind of control terminal and its control method

Publications (2)

Publication Number Publication Date
CN103200070A CN103200070A (en) 2013-07-10
CN103200070B true CN103200070B (en) 2018-04-17

Family

ID=48722434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310109664.7A Expired - Fee Related CN103200070B (en) 2013-03-29 2013-03-29 A kind of control terminal and its control method

Country Status (1)

Country Link
CN (1) CN103200070B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701878B (en) * 2013-12-13 2017-01-04 小米科技有限责任公司 A kind of method and device showing account state
CN104540042A (en) * 2014-12-01 2015-04-22 北京阅视无限科技有限公司 Set-top box remote multi-screen interaction control method and system based on XMPP (Extensible Messaging and Presence Protocol) communication
CN104698856B (en) * 2015-01-30 2019-01-11 阿里云计算有限公司 A kind of smart device communication method and system
CN105072149A (en) * 2015-06-30 2015-11-18 青岛海尔智能家电科技有限公司 Method and device for building remote communication through proxy gateway
CN108415745B (en) * 2018-02-09 2021-03-19 福建星网锐捷通讯股份有限公司 Method for operating intelligent equipment by UI (user interface) control on mobile terminal
CN108632355B (en) * 2018-04-04 2021-11-02 青岛海尔科技有限公司 Routing method for household appliance network, control terminal, readable storage medium and equipment
CN109150963A (en) * 2018-07-04 2019-01-04 杭州涂鸦信息技术有限公司 A kind of Internet of Things promotes the method, apparatus and computer equipment of data arrival rate
CN108667943A (en) * 2018-07-12 2018-10-16 四川虹美智能科技有限公司 A kind of control method and control system of intelligent appliance
CN108877360B (en) * 2018-07-16 2023-07-11 深圳市本牛科技有限责任公司 Education interaction system and equipment
CN112398664B (en) * 2019-08-13 2023-08-08 中兴通讯股份有限公司 Main device selection method, device management method, electronic device and storage medium
CN112583907A (en) * 2020-12-04 2021-03-30 深圳Tcl新技术有限公司 Connection method and device, smart home equipment and computer readable storage medium
CN115550391B (en) * 2022-02-28 2023-08-11 荣耀终端有限公司 Equipment control method and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101702707A (en) * 2009-10-28 2010-05-05 深圳市同洲电子股份有限公司 Method for realizing remote control, system and digital television receiving terminal
CN102647316A (en) * 2011-09-14 2012-08-22 中国科学院计算技术研究所 Remote interconnection method, system and device of UPnP(Universal Plug-n-Play) equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101702707A (en) * 2009-10-28 2010-05-05 深圳市同洲电子股份有限公司 Method for realizing remote control, system and digital television receiving terminal
CN102647316A (en) * 2011-09-14 2012-08-22 中国科学院计算技术研究所 Remote interconnection method, system and device of UPnP(Universal Plug-n-Play) equipment

Also Published As

Publication number Publication date
CN103200070A (en) 2013-07-10

Similar Documents

Publication Publication Date Title
CN103200070B (en) A kind of control terminal and its control method
CN103237056B (en) A kind of device end, control terminal and server and its control method
CN105652676B (en) A kind of intelligent home appliance remote control system and control method
CN102355390B (en) Intelligent home system
CN105847093B (en) A kind of system that interconnects, network-building method and communication means based on Internet of Things
CN105652675B (en) A kind of control method of smart home device, device, terminal and system
CN106713088A (en) Method and system for controlling intelligent home equipment based on double mqtt servers
CN103441881B (en) unified device management method
CN107040438A (en) A kind of intelligent home control system and method based on router
CN103312715A (en) Web service oriented home network system architecture
CN106899464A (en) Intelligent home furnishing control method
CN101873343A (en) Internet of things networking method and system thereof
CN101218797A (en) House gateway system for household network service
CN110223495A (en) For the method and apparatus in domestic network system medium-long range control household equipment
CN101141360A (en) Equipment management and control method of family network
CN105429883A (en) Long connection method of multiple intelligent devices and server equipment and intelligent device
CN103634312A (en) Device management method for realizing multi-audio fast synchrony based on audio sharing
CN103312573A (en) Household network system equipment discovery and recognition protocol
CN109756404A (en) Sharing method, device, storage medium and the computer equipment of equipment control
CN104639913A (en) Network video recorder (NVR) and automatic IPC (Internet Protocol Camera) access method thereof
CN110501988A (en) A kind of realization internet of things equipment fused controlling method and device thereof
CN103731562B (en) For the method and apparatus of smart machine Adaptive matching bluetooth equipment
CN110737203A (en) Intelligent household appliance management system and method and Bluetooth gateway
CN106341468A (en) Remote wakeup method, device and system of intelligent equipment
CN101826995A (en) Method and system for managing home network equipment

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: 20180417

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