Movatterモバイル変換


[0]ホーム

URL:


CN106559296A - A kind of device end control method and system based on MQTT - Google Patents

A kind of device end control method and system based on MQTT
Download PDF

Info

Publication number
CN106559296A
CN106559296ACN201611062800.1ACN201611062800ACN106559296ACN 106559296 ACN106559296 ACN 106559296ACN 201611062800 ACN201611062800 ACN 201611062800ACN 106559296 ACN106559296 ACN 106559296A
Authority
CN
China
Prior art keywords
device end
mqtt
ability
control
mark
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611062800.1A
Other languages
Chinese (zh)
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.)
Shanghai Feixun Data Communication Technology Co Ltd
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
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 Shanghai Feixun Data Communication Technology Co LtdfiledCriticalShanghai Feixun Data Communication Technology Co Ltd
Priority to CN201611062800.1ApriorityCriticalpatent/CN106559296A/en
Publication of CN106559296ApublicationCriticalpatent/CN106559296A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The invention discloses a kind of device end control method and system based on MQTT, including:Step S200 obtains device end mark and device end operation information;Step S400 generates the device end and identifies corresponding MQTT controls message according to device end mark and the device end operation information;MQTT control messages are sent to the device end and identify corresponding device end by step S500, are controlled the device end and are performed the corresponding operation of the MQTT controls message.The present invention makes the device end of different ecological circle realize mutually being connected by the control system of common connection, the conversion of control protocol (i.e. MQTT controls message format) is realized by control system, the complexity of whole converting system is simplified, the real-time of device end response is substantially increased.

Description

A kind of device end control method and system based on MQTT
Technical field
The present invention relates to smart home field, more particularly to a kind of device end control method and system based on MQTT.
Background technology
In Intelligent household scene, increasing device end accesses the Internet, can be controlled by intelligent APP, and equipmentAlso mutually can link between terminal and device end, such as:A device ends (sensor) detect certain event to be occurred, and notifies B deviceTerminal performs an operation (turn on light, report to the police).But the linkage of device end (adopts identical interconnection typically inside each ecosphereThe producer of interworking protocol, device end) can work, the device end between different ecological circle is unable to intercommunication each other.
The present situation of smart home production development is now:General manufacturer can all select to add certain ecosphere (typically to have oneIndividual industry giant dominates), the device end control protocol that each ecosphere is adopted is different, and (device end control protocol belongs to applicationThe category of layer).Caused result is:The device end of different ecological circle is unable to collaborative work because of control protocol difference, so as toLimit the intellectuality of whole intelligent domestic system.
Current solution is:
Standardization body of all big enterprises formulates unified control protocol, but the program is formulated to launch from control protocolTake long enough.
The content of the invention
It is an object of the invention to provide a kind of device end control method and system based on MQTT, can realize not syngenesisMutually linked between state circle device end, the application of intelligent domestic system is promoted significantly, improve userExperience.
The technical scheme that the present invention is provided is as follows:
A kind of device end control method based on MQTT, including:Step S200 obtains device end mark and equipment endEnd operation information;Step S400 generates the equipment end according to device end mark and the device end operation informationMark corresponding MQTT in end controls message;MQTT control messages are sent to the device end mark correspondence by step S500Device end, control the device end and perform the corresponding operation of the MQTT controls message.
In above-mentioned technical proposal, the presence of device end mark ensures that MQTT control messages can be sent to and correctly setsStandby terminal, and the generation of MQTT control messages also complies with the message format of device end;According to device end operation information and settingStandby terminal iidentification, generates the MQTT control messages that device end identifies corresponding device end, it is ensured that the MQTT controls of generationMessage can allow device end accurately to read and perform corresponding operation.It is complete that device end is not given in the work of its conversionInto, make device end response real-time be significantly increased, substantially increase the experience of user.
Further, step S200 include it is following any one:Step S210 is being preset when there is predeterminable event to occurThe corresponding device end mark of the predeterminable event and the device end operation information are searched in data base;Step S220Receive the device end mark and the device end operation information that control terminal sends.
In above-mentioned technical proposal, only when some point is triggered to, device end mark and equipment end can be just obtainedEnd operation information, performs corresponding operation so as to control corresponding device end.The setting of trigger point ensure that each device endThere is the standby time, be not to be in the stage for constantly working, reduce its unnecessary wasting of resources;And obtain device endMark and device end operation information can make the more diversification of this control method by number of ways.
Further, the device end operation information includes:Device end capability code information and device end need to holdCapable operation information;Step S400 is specifically included:Step S410 is identified according to the device end, in default device endThe device end is searched in ability warehouse and identifies the corresponding device end and the corresponding MQTT of device end markControl message format;Step S420 is identified according to the device end capability code information and the device end, described pre-If corresponding device end ability information is searched in device end ability warehouse;Step S430 is believed according to the device end abilityBreath, the device end need the operation information for performing and MQTT control message formats, generate the device end correspondenceMQTT control message.
In above-mentioned technical proposal, each device end possesses different device end abilities, it is understood that for eachDevice end is to there is different device end ability informations, and device end capability code information is corresponding also for findingDevice end ability information and exist.Device end needs the operation information for performing, simply it is contemplated that needingDevice end is allowed specifically to perform operation.Each device end can possess the MQTT control message formats of oneself, therefore, by equipmentTerminal iidentification controls message format come the MQTT for searching corresponding device end, it is ensured that subsequently can be according to the device end energyForce information, the device end need the operation information for performing, and generate the MQTT control messages that device end can read, are placeLinkage between the device end of different ecological circle is provided and is ensured.
Further, also include before step S200:Step S100 is worked as and the device end and the device endAfter corresponding manufacturer's background server establishes TCP connections, the log-on message that the device end sends is received, and described pre-If the corresponding device end mark of the device end is created in device end ability warehouse;Wherein, the log-on messageIncluding:The corresponding MQTT control message formats of device end and the device end ability information;Step S110 willLog-on message storage corresponding with device end mark is into the default device end ability warehouse.
In above-mentioned technical proposal, the log-on message that receiving device terminal sends, equivalent in default device end abilityArchives are set up for this device end in warehouse, when needing this device end to perform operation, corresponding MQTT controls can be generatedMessage is simultaneously sent to this device end, allows which to perform.
Further, step S110 includes:Step S111 judges that whether the MQTT controls message format in instituteState in default device end ability warehouse and exist, if it is not, then execution step S112, if so, then execution step S113;Step S112Add MQTT control message formats newly-increased in the default device end ability warehouse;Step S113 is by the equipment endEnd mark is associated with MQTT control message formats.
In above-mentioned technical proposal, the MQTT control message formats of the device end of same ecosphere should be identical, therefore, if the MQTT control message formats of this ecosphere are had existed in default device end ability warehouse, Na Dangxin'sWhen the device end of this ecosphere adds, it is not necessary that add again its MQTT control message formats again, if by thisDevice end is associated with this MQTT control message format, is easy to follow-up calling.If there is no the MQTT controls of device endIf message format, that must newly add in default device end ability warehouse, call in order to follow-up.
Further, step S110 also includes:Step S114 judges whether the device end ability information existsExist in the default device end ability warehouse, if it is not, then execution step S115, if so, then execution step S116;StepS115 is added the device end ability information newly-increased in the default device end ability warehouse, and in the default equipmentThe corresponding device end capability code information of the device end ability information is created in terminal capability warehouse;Step S116Device end mark is associated with the device end ability information.
In above-mentioned technical proposal, their device end ability information of same type of device end is possibly identical, if having there is the device end ability information of this device end in default device end ability warehouse, that does not have completely mustTo increase an identical again newly, it is only necessary to association.And if there is no this device end in default device end ability warehouseDevice end ability information, in order to follow-up is called, controls, newly increase its device end ability information be it is necessary, and by itsIt is corresponding with device end mark also for being easy to follow-up call consideration;And be directed to device end ability information and set up new settingStandby terminal capability codes information also allows for follow-up calling and setting up.Device end ability information is identified with device endAssociation is that have corresponding device end ability information to specify corresponding device end, is easy to follow-up maintenance and pipeReason;And device end ability information and device end capability code information association, it is for subsequently through device end capability codeThe corresponding device end ability information of information searching is provided and is ensured.
Further, step S200 also includes:Step S230 is received control terminal and is sent by manufacturer's background serverDevice end mark and the device end operation information;Also wrap between step S200 and step S400Include:Step S300 judges whether the form of the device end operation information is that the device end identifies the corresponding MQTTControl message format, if so, then the device end operation information is that the device end identifies the corresponding device endMQTT control messages, and execution step S500, if it is not, then execution step S400.
In above-mentioned technical proposal, if the form of the device end operation information for obtaining is exactly device end, mark is correspondingWhat device end can be recognized, that is equivalent to the MQTT control messages of this device end, also just without the need for follow-up transformation process,This MQTT control message can be sent to the corresponding device end of device end mark directly to be operated accordingly, convenient,Fast.
The present invention also provides a kind of device end control system based on MQTT, including:Acquisition module, for obtaining equipmentTerminal iidentification and device end operation information;Generation module, is electrically connected with the acquisition module, when the acquisition module is obtainedAfter the device end mark and the device end operation information, the generation module is identified according to the device end and instituteDevice end operation information is stated, the device end is generated and is identified corresponding MQTT controls message;Sending module, with the generationModule is electrically connected, and after the generation module generates the MQTT controls message, the MQTT is controlled by the sending moduleMessage is sent to the device end and identifies corresponding device end, and the MQTT controls message controls the device end and performsCorresponding operation.
In above-mentioned technical proposal, control system act as the role of an intermediate translation official, and each device end is operatedInformation is converted into device end and identifies the MQTT control messages that corresponding device end can be recognized, device end can connectDirectly operated accordingly after receiving the MQTT control messages that it can read, when substantially increasing the response of device endBetween, it is to improve Consumer's Experience to lay the foundation.
Further, also include:Default device end ability warehouse, is electrically connected with the generation module, the sending module;Registering modules, are electrically connected with the default device end ability warehouse, for working as and the device end and the device endAfter corresponding manufacturer's background server establishes TCP connections, the log-on message that the device end sends is received, and is set describedThe corresponding device end mark of the device end is created in standby terminal capability warehouse;Wherein, the log-on message includes:The corresponding MQTT control message formats of device end and the device end ability information;The default device endAbility warehouse, is further used for the storage log-on message corresponding with device end mark.
Further, also include:Judge module, is electrically connected with the generation module, the acquisition module, the sending moduleConnect, when the acquisition module obtains the device end mark and the device end operation information, the judge moduleWhether the form for judging the device end operation information is that the corresponding MQTT of the device end mark controls message latticeFormula.
Compared with prior art, the device end control method based on MQTT and system beneficial effect of the invention are:
The device end of different ecological circle is realized mutually being connected by the control system of common connection, is realized by control systemThe conversion of control protocol (i.e. MQTT controls message format), simplifies the complexity of whole converting system, substantially increases equipmentThe real-time of terminal response.
Description of the drawings
Below by the way of clearly understandable, preferred implementation is described with reference to the drawings, to a kind of equipment based on MQTTThe above-mentioned characteristic of terminal control method and system, technical characteristic, advantage and its implementation are further described.
Fig. 1 is flow chart of the present invention based on device end control method one embodiment of MQTT;
Fig. 2 is flow chart of the present invention based on another embodiment of the device end control method of MQTT;
Fig. 3 is structural representation of the present invention based on device end control system one embodiment of MQTT;
Fig. 4 is structural representation of the present invention based on another embodiment of the device end control system of MQTT;
Fig. 5 is structural representation of the present invention based on actually used one embodiment of the device end control system of MQTTFigure.
Drawing reference numeral explanation:
10. acquisition module, 20. generation modules, 30. sending modules, 40. default device end ability warehouses, 50. registration mouldsBlock, 60. judge modules, 100. control systems, 210. vendor A background servers, 220. manufacturer's B background servers, 310.AppA, 320.App B, 400. networks, 510. device end A, 520. device end B.
Specific embodiment
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below by control description of the drawingsThe specific embodiment of the present invention.It should be evident that drawings in the following description are only some embodiments of the present invention, forFor those of ordinary skill in the art, on the premise of not paying creative work, can be obtaining other according to these accompanying drawingsAccompanying drawing, and obtain other embodiments.
To make simplified form, part related to the present invention in each figure, is only schematically show, they do not representIts practical structures as product.In addition, so that simplified form is readily appreciated, with identical structure or function in some figuresPart, only symbolically depicts one of those, or has only marked one of those.Herein, " one " is not only represented" only this ", it is also possible to represent the situation of " more than one ".
In the prior art, device end A and device end B are connected into wide area network, make device end A, device end B correspondenceAPP A, APP B be installed on intelligent terminal, and wide area network is also connected into by intelligent terminal, APP A are referred to by sending controlMake to the corresponding vendor A background servers of device end A (which is also connected into wide area network), so as to allow vendor A background server to sendCorresponding control message gives device end A, realizes to the control between device end A.And APP B are also only capable of by said methodControl unit end B, APP B can not realize the control to device end A, and be limited to the presence of wide area network, if disconnecting wideThe connection of domain net, APP B also cannot be controlled to device end B, and in the same manner, APP A cannot also realize the control to device end ASystem.
The present invention makes the corresponding manufacturer's background server of each device end, device end, APP by adding control systemIdentical network is connected into, by the control system of transfer, the linkage between each device end is realized.For example:APP B control devicesTerminal A, device end A control unit end B, naturally it is also possible to which, as original, APP A control unit end A simply respectively setStandby being in communication with each other between terminal, manufacturer's background server, each APP is required for forwarding by control system, so as to realize differenceEach device end of ecosphere is linked.
In one embodiment of the invention, as shown in figure 1, a kind of device end control method based on MQTT, including:Step S200 obtains device end mark and device end operation information;Step S400 is identified according to the device end and describedDevice end operation information, generates the device end and identifies corresponding MQTT controls message;The MQTT is controlled by step S500Message processed is sent to the device end and identifies corresponding device end, controls the device end and performs the MQTT controls reportThe corresponding operation of text.
Specifically, the present invention is realized based on control system (that is, following device end control systems based on MQTT), each device end and control system are in same network (LAN or wide area network), so that each device end is carried outMutually link.MQTT (Message Queuing Telemetry Transport, message queue remote measurement transmission) is IBM exploitationsAn instant communication protocol, become the important component part of Internet of Things.The agreement supports all platforms, almost can be allNetworking article and external connection are got up, and are used to as sensor and actuator (such as allowing house to network by Twitter)Communication protocol.
The presence of device end mark ensures that MQTT control messages can be sent to corresponding device end, and MQTT controlsThe generation of message also complies with the MQTT message formats of device end;Identified according to device end operation information and device end, it is rawThe MQTT control messages of the corresponding device end of forming apparatus terminal iidentification, it is ensured that the MQTT control messages of generation can allow equipmentTerminal accurately reads and performs corresponding operation.Device end only receives MQTT control messages, and according to MQTT controlsMessage performs corresponding operation, and work of its conversion does not give device end to complete, the real-time for responding device endIt is significantly increased, is substantially increased the experience of user.
Preferably, step S200 include it is following any one:Step S210 is being preset when there is predeterminable event to occurThe corresponding device end mark of the predeterminable event and the device end operation information are searched in data base;Step S220Receive the device end mark and the device end operation information that control terminal sends.
Specifically, monitor predeterminable event to realize by corresponding APP, and APP can be mounted in control system,Can be mounted in as now on control terminal (intelligent terminal), for example:The electronics such as mobile phone, panel computer, intelligent robot setStandby terminal.When APP is mounted in control system, control system is understood and oneself monitors whether predeterminable event, if yes, meetingCorresponding device end mark and device end operation information are found in the presetting database of oneself, it is corresponding so as to controlDevice end performs corresponding operation.Predeterminable event can be the condition that user oneself is arranged, and gather with reference to certain device endTo information and trigger, for example:When user is arranged as someone in room and light grows dark, just turn on light, that control system can be receivedCorresponding sensor is (for example:Infrared sensor, light sensor) Monitoring Data fed back, when which reaches it is pre-conditioned when, justTrigger predeterminable event (this event of turning on light), then the corresponding device end mark of this predeterminable event will be found(which lamp opened) and device end operation information (turning on light).
It should be noted that the information collected with reference to certain device end and trigger, certain device end here canWith the device end for being integrated in being attached in control system (such as sensor), or with control system.For example:In advanceIf event is opened when TV, just light is dimmed, certain device end here is exactly TV, TV and control systemCertainly it is the relation of TCP connections, it is impossible to be integrated in control system.Therefore, predeterminable event is touched according to what information on earthSend out, be to need to be become according to the situation that user is arranged, certain device end of pilot process collection information is also respective change's.
In addition, when APP is mounted on control terminal, device end mark can be directly transmitted by user and device end is graspedMake information, it is also possible to determine whether that predeterminable event occurs by APP, it is right so as to search in the presetting database on control terminalThe device end mark answered and device end operation information are sent to control system.
It follows that only when predeterminable event is triggered, device end mark and device end operation information can be just obtained,Corresponding operation is performed so as to control corresponding device end.When the setting of predeterminable event ensure that each device end has standbyBetween, it is not to be in the stage for constantly working, reduces its unnecessary wasting of resources.
Preferably, the device end operation information includes:Device end capability code information and device end need to holdCapable operation information;Step S400 is specifically included:Step S410 is identified according to the device end, in default device endThe device end is searched in ability warehouse and identifies the corresponding device end and the corresponding MQTT of device end markControl message format;Step S420 is identified according to the device end capability code information and the device end, described pre-If corresponding device end ability information is searched in device end ability warehouse;Step S430 is believed according to the device end abilityBreath, the device end need the operation information for performing and MQTT control message formats, generate the device end correspondenceMQTT control message.
Specifically, preset device end ability warehouse to be provided in control system, preset device end ability warehouseSetting be also to ensure that even if control system (is not connected with vendor server) in the state of the wide area network that broken, it is also possible toDevice end mark and device end operation information according to obtaining is controlled accordingly.
As said before, device end mark can find corresponding device end, because which is in default device end abilityIt has been also carried out associating with the MQTT control message formats of device end in warehouse, accordingly it is also possible to look for by device end markMessage format is controlled to MQTT, MQTT control message formats are to ensure device end operation information is translated into device end subsequentlyThe key point of the control message that can be read.Each device end has its corresponding device end ability, therefore, equipment endEnd mark is to reduce the key factor of device end ability information, and further with device end capability code information in diminutionIn the range of make a look up, can more efficiently find corresponding device end ability information, substantially reduce data searchScope, reduces unnecessary communication process, improves work efficiency.Generating the corresponding MQTT controls message of device end is alsoThe corresponding operation of reading and execution for the ease of device end, because the device end operation information that control system is obtained is simultaneouslyThe MQTT control message formats that device end can read are not necessarily, the transformation process of control system is to ensure respectively to be in differenceThe key point that the device end of ecosphere can be linked.
The difference of the operation information for performing is needed with regard to device end ability information and device end, may be referred to following examplesSon, for example:Device end is a lamp, and its device end ability information is ON/OFF, brightness, flicker, color etc., and equipment endIt can be to open lamp, close lamp that end needs the operation information for performing;If current 1) the device end capability code information pair for obtainingAnswer be out, brightness, color;2) it is Huang that device end needs the operation information for performing open lamp, brightness to be transferred to 50%, colorColor;The operation that so last this lamp is performed recently is exactly not work from original, becomes the state of turning on light, and its color for HuangColor, brightness are 50% state.Certainly, even lamp, the device end ability information of every lamp be also it is different, therefore,Need for sending corresponding MQTT controls message according to the practical situation of every lamp.
Preferably, also include before step S200:Step S100 is worked as and the device end and the device endAfter corresponding manufacturer's background server establishes TCP connections, the log-on message that the device end sends is received, and described pre-If the corresponding device end mark of the device end is created in device end ability warehouse;Wherein, the log-on messageIncluding:The corresponding MQTT control message formats of device end and the device end ability information;Step S110 willLog-on message storage corresponding with device end mark is into the default device end ability warehouse.
Specifically, control system sets up the long connection mechanisms of TCP, main purpose with each device end and manufacturer's background serverIt is to control message to device end in order to ensure control system can receive/send MQTT at any time, it is ensured that the real-time of control.NeedIt should be noted that when a device end first time access control system, i.e. device end and the successful connection of control system TCPAfterwards, device end can be sent to control system the address (domain name or IP address add port) of its corresponding vendor server;MakeControl system is set up TCP with vendor server and is connected (this when needs exist for wide area network);When control system person is successfully establishedAfter being connected with the TCP of vendor server, the information of device end successful connection can be fed back to;Then, device end can be whichLog-on message is sent to control system, so as to store the default device end ability warehouse into control system, and follows originalThe device end of definition and the MQTT initialization procedures of manufacturer's background server carry out message interaction process, complete device end withInitialization between manufacturer backstage between server, it is ensured that preset normally enabling for device end ability warehouse;It can be appreciated that willLog-on message storage corresponding with device end mark is into the default device end ability warehouse, and completes initialChange;It should be noted that above-mentioned this process needs the presence for ensureing to have wide area network.
After this process is completed, even if there is no the presence of wide area network, the equipment end sent by other control terminalsEnd operation information, it is also possible to the equipment of different ecological circle is controlled under the support in the default device end ability warehouse of control systemTerminal.
Preferably, step S110 includes:Step S111 judges that whether the MQTT controls message format in instituteState in default device end ability warehouse and exist, if it is not, then execution step S112, if so, then execution step S113;Step S112Add MQTT control message formats newly-increased in the default device end ability warehouse;Step S113 is by the equipment endEnd mark is associated with MQTT control message formats.
Specifically, the MQTT control message formats of each ecosphere should be identical, if according to identical ecosphereOther equipment terminal establish this MQTT and control message format, then new device end is without setting up new MQTT controlsMessage format, as long as completing which controls associating for message format with this MQTT, is easy to subsequent calls to obtain.And if not settingIf the MQTT control message formats of standby terminal, that must newly add in default device end ability warehouse, in order to rearContinuous calls.
Preferably, step S110 also includes:Step S114 judges whether the device end ability information existsExist in the default device end ability warehouse, if it is not, then execution step S115, if so, then execution step S116;StepS115 is added the device end ability information newly-increased in the default device end ability warehouse, and in the default equipmentThe corresponding device end capability code information of the device end ability information is created in terminal capability warehouse;Step S116Device end mark is associated with the device end ability information.
Specifically, their device end ability information of same type of device end is probably identical, if settingThere is the device end ability information of this device end in standby terminal capability warehouse, that is completely unnecessary and increases one newly againIdentical, it is only necessary to association;For example:When control system is connected with first lamp, created ON/OFF, brightness this twoIndividual device end ability information;And the second lamp, when being connected with control system, it has three kinds of device end ability informations:It is ON/OFF, brightDegree and color, then ON/OFF and brightness avoid the need for creating again, it is only necessary to association, and color is accomplished by re-creatingAnd associate.And if there is no the device end ability information of this device end in default device end ability warehouse, in order to follow-upCall, control, newly increase its device end ability information be it is necessary, it is and which is corresponding also for just with device end markConsideration is called in follow-up;And be directed to device end ability information and set up new device end capability code information and also allow forFollow-up calls and sets up.Device end ability information is to specify corresponding equipment with device end mark associationTerminal has corresponding device end ability information, is easy to follow-up maintenance and management, also allows for follow-up reduction when calling and searchesScope;And device end ability information and device end capability code information association, it is for subsequently through device end abilityCode information is searched corresponding device end ability information and provides guarantee.
Preferably, step S200 also includes:Step S230 is received control terminal and is sent by manufacturer's background serverDevice end mark and the device end operation information;Also wrap between step S200 and step S400Include:Step S300 judges whether the form of the device end operation information is that the device end identifies the corresponding MQTTControl message format, if so, then the device end operation information is that the device end identifies the corresponding device endMQTT control messages, and execution step S500, if it is not, then execution step S400.
Specifically, if the form of the device end operation information for obtaining is exactly device end mark, corresponding device end canWith what is recognized, that is equivalent to MQTT control messages of this device end, also just without the need for follow-up transformation process, can directly byThis MQTT control message is sent to the corresponding device end of device end mark and is operated accordingly, convenient, fast.For example:The device end operation information that APP A are sent by vendor A background server, which can be to allow arrange terminal A Direct Recognition,If being also destined to device end A, that control system also avoids the need for being changed, and is directly forwarded to device end A.NeedIf it should be noted that vendor A background server wants device end operation information (the i.e. MQTT controls for being sent to device end AMessage processed), necessarily device end A can be recognized for its internal device end capability code information for carrying;And if not factoryThe device end operation information that business's background server is directly sent to corresponding device end, its internal device end energy for carryingPower code information is that device end cannot read, accordingly, it would be desirable to be changed by control system.
In another embodiment of the present invention, as shown in Fig. 2 a kind of device end control method based on MQTT, bagInclude:Step S100 when manufacturer's background server corresponding with the device end and the device end establish TCP connect after,The log-on message that the device end sends is received, and the device end correspondence is created in default device end ability warehouseDevice end mark;Wherein, the log-on message includes:The corresponding MQTT control message formats of the device end andDevice end ability information;The storage log-on message corresponding with device end mark is set by step S110 to describedIn standby terminal capability warehouse;Step S110 is specifically included:Whether step S111 judges the MQTT controls message formatJing is present in the default device end ability warehouse, if it is not, then execution step S112, if so, then execution step S113;StepRapid S112 is added MQTT control message formats newly-increased in the default device end ability warehouse;Step S113 will be describedDevice end is identified and is associated with MQTT control message formats;Whether step S114 judges the device end ability informationJing is present in the default device end ability warehouse, if it is not, then execution step S115, if so, then execution step S116;StepRapid S115 is added the device end ability information newly-increased in the default device end ability warehouse, and is set describedThe corresponding device end capability code information of the device end ability information is created in standby terminal capability warehouse;StepDevice end mark is associated by S116 with the device end ability information;Step S200 obtains device end mark and setsStandby terminal operation information;Step S200 include it is following any one:Step S210 is being preset when there is predeterminable event to occurThe corresponding device end mark of the predeterminable event and the device end operation information are searched in data base;Step S220Receive the device end mark and the device end operation information that control terminal sends;Step S230 receives control terminalThe device end mark sent by manufacturer's background server and the device end operation information;Step S300 judges instituteWhether the form for stating device end operation information is that the corresponding MQTT of the device end mark controls message format, ifIt is that then the device end operation information is the MQTT control messages that the device end identifies the corresponding device end,And execution step S500, if it is not, then execution step S400;Step S400 is according to device end mark and the device endOperation information, generates the device end and identifies corresponding MQTT controls message;The device end operation information includes:EquipmentTerminal capability codes information and device end need the operation information for performing;Step S400 is specifically included:Step S410 rootIdentify according to the device end, the device end is searched in default device end ability warehouse and identifies the corresponding equipmentTerminal and the device end identify corresponding MQTT and control message format;Step S420 is according to the device end capability codeInformation and device end mark, search corresponding device end ability letter in the default device end ability warehouseBreath;Step S430 needs the operation information and the MQTT of execution according to the device end ability information, the device endControl message format, generates the corresponding MQTT of the device end and controls message;MQTT controls are reported by step S500Text is sent to the device end and identifies corresponding device end, controls the device end and performs the MQTT controls message pairThe operation answered.
Specifically, the device end of different ecological circle is realized mutually being connected by the control system of common connection, by controllingSystem realizes the conversion of control protocol (i.e. MQTT controls message format), simplifies the complexity of whole converting system, carries significantlyThe high real-time of device end response.And the connection of wide area network is not relied on, even if when wide area network disconnects, it is also possible to allowEach device end and control system are connected in identical LAN, make them still can substantially increase user with normal workExperience.
In another embodiment of the present invention, as shown in figure 3, a kind of device end control system based on MQTT, itsIt is characterised by, including:Acquisition module 10, for obtaining device end mark and device end operation information;Generation module 20, withThe acquisition module 10 is electrically connected, when the acquisition module obtains the device end mark and device end operation letterAfter breath, the generation module generates the device end according to device end mark and the device end operation informationIdentify corresponding MQTT controls message;Sending module 30, is electrically connected with the generation module 20, when the generation module is generatedAfter the MQTT controls message, it is corresponding that MQTT control messages are sent to the device end mark by the sending moduleDevice end, the MQTT controls message control the device end and perform corresponding operation.
Specifically, the device end of different ecological circle is connected together by device end equivalent to a converting system, is itEach translated, it is ensured that be sent to they MQTT control message meet they MQTT control message format, allow themAfter reading, corresponding response operation is made rapidly, can be linked between the distinct device terminal for making each ecosphere, significantlyImprove the experience of user.
Preferably, also include:Default device end ability warehouse 40, with the generation module 20, the sending module 30Electrical connection;Registering modules 50, are electrically connected with the default device end ability warehouse, for when with the device end and describedAfter the corresponding manufacturer's background server of device end establishes TCP connections, the log-on message that the device end sends is received, andThe corresponding device end mark of the device end is created in the device end ability warehouse;Wherein, the registrationInformation includes:The corresponding MQTT control message formats of device end and the device end ability information;It is described pre-If device end ability warehouse 40, it is further used for the storage log-on message corresponding with device end mark.
Preferably, also include:Judge module 60, is electrically connected with the generation module, the acquisition module, the sending moduleConnect, when the acquisition module obtains the device end mark and the device end operation information, the judge moduleFor judging whether the form of the device end operation information is the corresponding MQTT controls report of the device end markLiterary form.If so, then the device end operation information is the MQTT that the device end identifies the corresponding device endControl message.
Specifically, the specific implementation process phase in the specific implementation process of this system embodiment and said method embodimentTogether, here is not described in detail.
In another embodiment of the present invention, as shown in figure 4, a kind of device end control system based on MQTT, itsIt is characterised by, including:Acquisition module 10, for obtaining device end mark and device end operation information;It is further used for working asWhen having predeterminable event to occur, search in presetting database and obtain the corresponding device end mark of the predeterminable event andThe device end operation information;And, receive the device end mark and device end behaviour that control terminal sendsMake information;And, receive the device end mark and the equipment end that control terminal is sent by manufacturer's background serverEnd operation information;Wherein, the device end operation information includes:Device end capability code information and device end need to holdCapable operation information;Generation module 20, is electrically connected with the acquisition module, when the acquisition module obtains the device endAfter mark and the device end operation information, the generation module is grasped according to device end mark and the device endMake information, generate the device end and identify corresponding MQTT controls message;It is further used for being identified according to the device end,The device end is searched in default device end ability warehouse and identifies the corresponding device end and the device endIdentify corresponding MQTT controls message format;And, according to the device end capability code information and the device end markKnow, corresponding device end ability information is searched in the default device end ability warehouse;And, according to the equipment endEnd ability information, the device end need the operation information for performing and MQTT control message formats, generate the equipmentThe corresponding MQTT of terminal controls message;Sending module 30, is electrically connected with the generation module, when the generation module is generatedAfter the MQTT controls message, MQTT control message is sent to the device end mark correspondence by the sending moduleDevice end, MQTT control message controls the device end and performs corresponding operation;Registering modules 50, it is pre- with describedIf device end ability warehouse is electrically connected, for when manufacturer's background service corresponding with the device end and the device endAfter device establishes TCP connections, the log-on message that the device end sends is received, and is created in the device end ability warehouseBuild the corresponding device end mark of the device end;Wherein, the log-on message includes:The device end is correspondingThe MQTT control message formats and the device end ability information;The default device end ability warehouse 40, it is and describedGeneration module, sending module electrical connection, for storing the log-on message corresponding with device end mark;Enter oneWalk for judging that whether MQTT control message format has been present in the default device end ability warehouse, if not depositing, then add MQTT control message formats newly-increased in the default device end ability warehouse, and with the equipment endEnd mark association, if existing, the device end is identified and is associated with MQTT control message formats;And, if describedWhether MQTT controls message format is present in the default device end ability warehouse, if not existing, sets describedStandby terminal ability information is newly-increased to be added in the default device end ability warehouse, and associates with device end mark, andThe device end ability information corresponding device end ability generation is created in the default device end ability warehouseCode information, if existing, device end mark is associated with the device end ability information;Judge module 60, with instituteGeneration module, the acquisition module, sending module electrical connection are stated, when the acquisition module obtains the device end markWhen knowing with the device end operation information, the judge module judges whether the form of the device end operation information is instituteState the corresponding MQTT of device end mark and control message format.
Specifically, the device end of different ecological circle is realized mutually being connected by the control system of common connection, by controllingSystem realizes the conversion of control protocol (i.e. MQTT controls message format), simplifies the complexity of whole converting system, carries significantlyThe high real-time of device end response.And the connection of wide area network is not relied on, even if when wide area network disconnects, it is also possible to allowEach device end and control system are connected in identical LAN, make them still can substantially increase user with normal workExperience.
In another embodiment of the present invention, as shown in Figure 5, it is necessary first to after device end corresponding manufacturerPlatform server carries out the initialization of MQTT.Specific process may be referred to as follows, be illustrated below by taking home gateway as an example:
1st, device end A 510 no longer sets up direct TCP with vendor A background server 210 and is connected, but directly to officeControl system 100 in the net of domain sets up TCP connections, and in the family use, control system 100 here can be home gateway.In the same manner, device end B 520 also no longer sets up direct TCP with manufacturer B background servers 220 and is connected, but directly to localControl system 100 in net sets up TCP connections.
2nd, after TCP connections, by the address of its corresponding manufacturer's background server, (domain name or IP address add end to each device endMouthful) be sent to home gateway (certain internal working region, for example:MQTT proxy server).
3rd, after home gateway receives manufacturer's background server address, set up and manufacturer's background server by network 400TCP connects, it should be noted that need exist for the presence of wide area network.
4th, after home gateway and manufacturer's background server establish TCP connections, success message is informed into corresponding equipment endEnd, for example:Establish after TCP is connected with vendor A background server 210, control system 100 can be by success message annunciator endEnd A 510.
5th, device end sends to home gateway and registers the device end ability information of the device end and correspondingMQTT controls the message of message format.
6th, corresponding device end ability information and MQTT control message formats recorded local presetting by home gatewayDevice end ability warehouse, and safeguard the corresponding relation of these log-on messages and device end.Then send the note of device endThe successful message of volume information registering is to device end.
7th, device end is followed its of original definition and is carried out with the MQTT initialization procedures of corresponding manufacturer's background serverMessage interaction process, so as to complete the initialization between device end and manufacturer's background server, it is ensured that pre- in home gatewayIf device end ability warehouse is in follow-up smooth use.
Between device end intercommunication linkage control process (network 400 can be LAN in this process, orWide area network):
1st, APP (operating on certain control terminal or on gateway) judges to need other one of control to set according to predeterminable eventStandby terminal, allows which to perform certain operation, so as to obtain above-mentioned described device end mark and device end operation information.As schemedIn shown in 5, APP A 310, APP B 320 can be run in control system 100, it is also possible to run on other control terminalsOn, for example:Mobile phone, intelligent robot etc..
2nd, APP will be set by remote method invocation (RMI) (if APP is operate in control system, not needing far call)Standby terminal iidentification, device end capability code information and device end need the operation information for performing be sent to home gateway (inCertain working region, for example:Device end ability is abstract and execution level).
3rd, home gateway (in device end ability is abstract and execution level) is according to device end capability code information and setsStandby terminal iidentification, inquires about in default device end ability warehouse, and bonding apparatus terminal needs the operation information of execution, generation to setThe corresponding MQTT of the corresponding device end of standby terminal iidentification controls message.
4th, device end mark and MQTT are controlled message by home gateway (in device end ability is abstract and execution level),It is sent to home gateway (in MQTT proxy server).
5th, home gateway (in MQTT proxy server) is identified according to device end and is sent to MQTT control messagesCorresponding device terminal, so as to realize the control to device end.
Control system as above, its working method cause the linkage between the device end of different ecological circle to be able to realityIt is existing.
It should be noted that above-described embodiment can independent assortment as needed.The above is only the preferred of the present inventionEmbodiment, it is noted that for those skilled in the art, in the premise without departing from the principle of the inventionUnder, some improvements and modifications can also be made, these improvements and modifications also should be regarded as protection scope of the present invention.

Claims (10)

CN201611062800.1A2016-11-282016-11-28A kind of device end control method and system based on MQTTPendingCN106559296A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201611062800.1ACN106559296A (en)2016-11-282016-11-28A kind of device end control method and system based on MQTT

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201611062800.1ACN106559296A (en)2016-11-282016-11-28A kind of device end control method and system based on MQTT

Publications (1)

Publication NumberPublication Date
CN106559296Atrue CN106559296A (en)2017-04-05

Family

ID=58445263

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201611062800.1APendingCN106559296A (en)2016-11-282016-11-28A kind of device end control method and system based on MQTT

Country Status (1)

CountryLink
CN (1)CN106559296A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107835445A (en)*2017-11-012018-03-23青岛海信电器股份有限公司TV control method, mobile terminal and TV based on MQTT agreements
CN109286679A (en)*2018-11-052019-01-29艾欧创想智能科技(武汉)有限公司Wisdom method for controlling street lamps, system, server and storage medium
WO2019224697A1 (en)*2018-05-232019-11-28Inversiones Tecnológicas De America S.A.Multi-biometric iot bridge
CN111787125A (en)*2020-08-052020-10-16安徽江淮汽车集团股份有限公司Information interaction system and method
CN112468527A (en)*2019-09-062021-03-09比亚迪股份有限公司Linkage control system and linkage control method

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103079176A (en)*2012-12-312013-05-01Tcl集团股份有限公司Method and system for remotely controlling electronic equipment, mobile terminal and electronic equipment
CN105159150A (en)*2015-07-232015-12-16北京章鱼智数科技有限公司Intelligent equipment linkage control method
CN105357277A (en)*2015-10-162016-02-24上海斐讯数据通信技术有限公司Wireless router based intelligent device scene control method and system
CN105471897A (en)*2015-12-282016-04-06上海庆科信息技术有限公司Embedded device cloud service access method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103079176A (en)*2012-12-312013-05-01Tcl集团股份有限公司Method and system for remotely controlling electronic equipment, mobile terminal and electronic equipment
CN105159150A (en)*2015-07-232015-12-16北京章鱼智数科技有限公司Intelligent equipment linkage control method
CN105357277A (en)*2015-10-162016-02-24上海斐讯数据通信技术有限公司Wireless router based intelligent device scene control method and system
CN105471897A (en)*2015-12-282016-04-06上海庆科信息技术有限公司Embedded device cloud service access method and system

Cited By (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107835445A (en)*2017-11-012018-03-23青岛海信电器股份有限公司TV control method, mobile terminal and TV based on MQTT agreements
CN107835445B (en)*2017-11-012020-06-16海信视像科技股份有限公司MQTT protocol-based television control method, mobile terminal and television
WO2019224697A1 (en)*2018-05-232019-11-28Inversiones Tecnológicas De America S.A.Multi-biometric iot bridge
US11843677B2 (en)2018-05-232023-12-12Inversiones Tecnologicas De America S.A.Multi-biometric IoT bridge
CN109286679A (en)*2018-11-052019-01-29艾欧创想智能科技(武汉)有限公司Wisdom method for controlling street lamps, system, server and storage medium
CN109286679B (en)*2018-11-052021-06-08艾欧创想智能科技(武汉)有限公司Intelligent street lamp control method, system, server and storage medium
CN112468527A (en)*2019-09-062021-03-09比亚迪股份有限公司Linkage control system and linkage control method
WO2021043259A1 (en)*2019-09-062021-03-11比亚迪股份有限公司Linkage control system and method, storage medium, and electronic device
CN112468527B (en)*2019-09-062022-07-15比亚迪股份有限公司 Linkage control system and linkage control method
US11785090B2 (en)2019-09-062023-10-10Byd Company LimitedLinkage control system and method, storage medium, and electronic device
CN111787125A (en)*2020-08-052020-10-16安徽江淮汽车集团股份有限公司Information interaction system and method
CN111787125B (en)*2020-08-052021-09-28安徽江淮汽车集团股份有限公司Information interaction system and method

Similar Documents

PublicationPublication DateTitle
CN106559296A (en)A kind of device end control method and system based on MQTT
CN101222519B (en)Remote activation of home devices
CN105739460B (en)A kind of method and apparatus for the control interface automatically generating Internet of Things household electrical appliances
CN102136933B (en)Equipment management method, middleware and machine communication platform, equipment and system
CN102355390B (en)Intelligent home system
US9998566B2 (en)Intelligent gateway with a common data format
CN105245445A (en)Internet of things gateway
CN105897860A (en)Network device and information processing method
CN103200070B (en)A kind of control terminal and its control method
CN101218797A (en) Residential Gateway System for Home Networking Services
CN102736526A (en)Control apparatus, control method, program and system
CN110493270A (en)Internet of things equipment accesses fused controlling method and device thereof
EP2735121A1 (en)Coordination of m2m device operation
CN106713426A (en)Property information management method and system of multiple districts
CN107231262A (en)A kind of message route method cascaded based on MQTT multilayers
CN104660997B (en)Service-oriented multi-source heterogeneous video monitoring adaptation method and system
CN104635504A (en)IOT (Internet of Things) intelligent household appliance data transmission method and system
CN101826995A (en)Method and system for managing home network equipment
CN101197724A (en)Long-range control system and method for information household electrical appliance in IGRS household network based on IPv6
CN109842537A (en)Smart home system
CN104935484A (en) A method and device for invoking home appliance services through a gateway
CN105991423A (en)Gateway and method for calling device through gateway
Sai et al.Smart home messenger notifications system using IoT
CN102984272B (en)A kind of system of remote control mobile terminal communication capacity and method thereof
CN104505942A (en)Power distribution automatic feeder terminal based on data bus and network thereof

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
WD01Invention patent application deemed withdrawn after publication

Application publication date:20170405

WD01Invention patent application deemed withdrawn after publication

[8]ページ先頭

©2009-2025 Movatter.jp