CN104836723A - Communication method based on MQTT topic subscription mechanism and access gateway - Google Patents

Communication method based on MQTT topic subscription mechanism and access gateway Download PDF

Info

Publication number
CN104836723A
CN104836723A CN201510148432.1A CN201510148432A CN104836723A CN 104836723 A CN104836723 A CN 104836723A CN 201510148432 A CN201510148432 A CN 201510148432A CN 104836723 A CN104836723 A CN 104836723A
Authority
CN
China
Prior art keywords
iad
user
message
mqttserver
imservice
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510148432.1A
Other languages
Chinese (zh)
Other versions
CN104836723B (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.)
Qingdao Haier Intelligent Home Appliance Technology Co Ltd
Original Assignee
Qingdao Haier Intelligent Home Appliance 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 Qingdao Haier Intelligent Home Appliance Technology Co Ltd filed Critical Qingdao Haier Intelligent Home Appliance Technology Co Ltd
Priority to CN201510148432.1A priority Critical patent/CN104836723B/en
Publication of CN104836723A publication Critical patent/CN104836723A/en
Application granted granted Critical
Publication of CN104836723B publication Critical patent/CN104836723B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/224Monitoring or handling of messages providing notification on incoming messages, e.g. pushed notifications of received messages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • H04L65/401Support for services or applications wherein the services involve a main real-time session and one or more additional parallel real-time or time sensitive sessions, e.g. white board sharing or spawning of a subconference
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • H04L65/4061Push-to services, e.g. push-to-talk or push-to-video

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a communication method based on an MQTT topic subscription mechanism and an access gateway. The communication method comprises that an IMService, an MQTTClientI, an MQTTClientR, an MQTTServer of an access gateway A and a corresponding access gateway B are started, a first user comes online on the access gateway A, a second user comes online on the access gateway B, based on the access gateway A and the access gateway B, the first user exchanges messages with the second user. According to the invention, the problem existing in the prior art that a message router of a distributed instant messaging application is complex is solved, the complex message routing function can be omitted, messages can be forwarded based on the subscription relation maintained by the server and messages based on the subscription relation, and the message routing function can be automatically achieved, and therefore the message routing table does not need to be maintained, and the instant messaging scheme is simplified.

Description

Based on communication means and the IAD of MQTT theme subscribing mechanism
Technical field
The present invention relates to communication field, particularly relate to a kind of communication means based on MQTT theme subscribing mechanism and IAD.
Background technology
Instant messaging (Instant messaging is called for short IM) is a Terminal Service, and the transmission message language allowing two people or many people to use networking instant, archives, voice exchange with video.Instant messaging is divided into enterprise instant communication and website instant messaging by use, and the object according to loading can be divided into again mobile telephone instant communication and PC instant messaging, and mobile telephone instant communication representative is note, and PC instant messaging representative is video.
MQTT (Message Queuing Telemetry Transport, message queue remote measurement is transmitted) is an instant communication protocol of IBM exploitation, likely becomes the important component part of Internet of Things.This agreement supports all platforms, almost all networking article and outside can be coupled together, and is used to the communication protocol as transducer and actuator (such as allowing house network by Twitter).
MQTT agreement is for a large amount of computing capability is limited, and is operated in low bandwidth, the distance sensor of insecure network and control appliance communication and the agreement designed, and it has following several characteristics mainly:
1) use publish/subscribe massage pattern, the news release of one-to-many is provided, remove application program coupling.
2) to the transmission of messages of load contents shielding.
3) TCP/IP is used to provide network to connect.
4) three kinds of news release service quality are had:
" at the most once ", news release relies on bottom TCP/IP network completely.Information drop-out or repetition can be there is.This rank can be used for following situation, environmental sensor data, and it doesn't matter to lose a read record, sends because also have second time in the near future;
" at least one times ", guarantee that message arrives, but message repeats to occur;
" for once ", guarantee that message arrives once.This rank can be used for following situation, and in charge system, message repeats or loss can cause incorrect result.
5) small-sized transmission, expense very little (head of regular length is 2 bytes), agreement exchanges and minimizes, to reduce network traffics.
6) Last Will and Testament characteristic is used to circularize all the parties concerned the abnormal mechanism of interrupting of client.
The scheme of distributed instant communication in prior art, such as XMPP (scalable message process Presence Protocol), the mechanism of instant messaging is: client's side link, to gateway, has an independent route service (O) for the annexation (i.e. which user be connected which server) of maintain customer end and gateway.If the user on two gateways needs communication, the then gateway (A) at message sender (User1) place, the user (User2) of message must will be received on which gateway (B) from route service (O) inquiry, then message is forwarded to the gateway (B) of receipt message, message is forwarded to the user (User2) of receipt message by gateway (B).
Existing IM (InstantMessaging, instant messaging) the most more complicated of instant messaging scheme, Message routing particularly in distributed system, often needs the Message routing table that maintenance volume is larger, and relates to the problems such as multiserver addressing.Dynamically updating of routing table, routing iinformation is also synchronously the function of a more complicated.
For the problem of distributed instant communication application message route complexity in correlation technique, at present effective solution is not yet proposed.
Summary of the invention
For the problem of distributed instant communication application message route complexity in correlation technique, the invention provides a kind of communication means based on MQTT theme subscribing mechanism and IAD, in order to solve the problems of the technologies described above.
According to an aspect of the present invention, the invention provides a kind of IAD, wherein, this IAD comprises: Service Processing Module IMService, internal client MQTTClientI, external client MQTTClientR and service end MQTTServer, wherein,
IMService, for MQTTClientI registration event notification, when receiving the message of described MQTTServer to make described MQTTClientI, notifies described IMService; Also for making described MQTTClientI to described MQTTServer topic of subscription; Also for creating MQTTClientR, to make described MQTTClientR connect with the MQTTServer of corresponding IAD, and topic of subscription;
MQTTClientI, for when receiving the message of MQTTServer, notifies described IMService; Also for MQTTServer topic of subscription, theme message comprises the message that the user User of IAD or other IADs are sent to described IAD;
MQTTClientR, for connecting with the MQTTServer of corresponding IAD, and to this MQTTServer topic of subscription;
MQTTServer, carries out interacting message with User, for the MQTTClientR of MQTTClientI and corresponding IAD supports theme subscribing mechanism.
According to a further aspect in the invention, present invention also offers a kind of communication means based on MQTT theme subscribing mechanism, wherein, the method comprises: start IAD A and IMService, MQTTClientI, MQTTClientR, the MQTTServer in corresponding IAD B; Wherein, MQTTClientI is to the MQTTServer topic of subscription of same IAD, and MQTTClientR connects with the MQTTServer of corresponding IAD, and topic of subscription; First user is reached the standard grade at IAD A, and the second user reaches the standard grade at IAD B; Based on IAD A and IAD B, first user and the second user carry out interacting message.
Preferably, first user is reached the standard grade at IAD A and is comprised: first user connects the MQTTServer of IAD A, and topic of subscription, theme message comprises message all mutual with first user on IAD A; First user is to described MQTTServer report of user on-line message, and based on theme subscribing mechanism, MQTTClientI receives this user's on-line message, then notifies IMService.
Preferably, the second user reaches the standard grade at IAD B and comprises: the second user connects the MQTTServer of IAD B, and topic of subscription, theme message to comprise on IAD B all with the message of the second user interactions; Second user is to described MQTTServer report of user on-line message, and based on theme subscribing mechanism, MQTTClientI receives this user's on-line message, then notifies IMService.
Preferably, first user is after IAD A reaches the standard grade, also comprise: the IMService of IAD A issues user by MQTTClientI to MQTTServer and to reach the standard grade notice, based on theme subscribing mechanism, the MQTTClientR of IAD B receives this user and to reach the standard grade notice, and notifies the IMService of IAD B; The IMService of IAD B searches the online user having business contact with first user on IAD B, performs following steps afterwards:
A) IMService of IAD B calls the MQTTServer topic of subscription of MQTTClientR to IAD A, and theme message is included on IAD A all to the conversation message of described online user;
B) IMService of IAD B calls MQTTClientI and issues user to MQTTServer and to reach the standard grade PUSH message, and based on theme subscribing mechanism, described online user receives this user and to reach the standard grade PUSH message;
C) IMService of IAD B calls MQTTClientR and notifies to the MQTTServer distribution subscription of IAD A, this subscribing notification is for notifying the MQTTServer topic of subscription of the MQTTClientR of IAD A at IAD B, and theme message is included in the dialogue all to first user on IAD A.
Preferably, based on IAD A and IAD B, first user and the second user carry out interacting message, comprising: the second user issues conversation message to the MQTTServer of IAD B; Based on theme subscribing mechanism, the MQTTClientR of IAD A receives the described conversation message of the MQTTServer forwarding of IAD B, and described MQTTClientR is by the IMService of this conversation message notice IAD A; The IMService of IAD A calls MQTTClientI and issues described conversation message to MQTTServer, and based on theme subscribing mechanism, first user receives the described conversation message that described MQTTServer forwards.
Preferably, described method also comprises: two users on same IAD, and one of them user issues conversation message to the MQTTServer of this IAD, and based on theme subscribing mechanism, another user receives this conversation message that described MQTTServer forwards.
Beneficial effect of the present invention is as follows:
Technical scheme of the present invention is based on the subscription/publication mechanism of MQTT, to the subscription/publication of a set of MQTT Topic theme between general multi-user, multiserver, complicated message routing functionality can be saved, message can forward based on the subscribing relationship of server maintenance and the message based on this subscribing relationship, realizes message routing functionality voluntarily.Thus do not need maintain message routing table, simplify instant messaging scheme.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of specification, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of the IAD according to the embodiment of the present invention;
Fig. 2 is the communication means flow chart based on MQTT theme subscribing mechanism according to the embodiment of the present invention;
Fig. 3 is the schematic diagram of the IAD Booting sequence according to the embodiment of the present invention;
Fig. 4 is the schematic diagram stopping flow process according to the IAD of the embodiment of the present invention;
Fig. 5 is the schematic diagram of flow process of reaching the standard grade according to the user of the embodiment of the present invention;
Fig. 6 is the schematic diagram of conversation process between the user according to the embodiment of the present invention;
Fig. 7 is the schematic diagram of the user offline flow process according to the embodiment of the present invention.
Embodiment
In order to solve the problem of distributed instant communication application message route complexity in correlation technique, the invention provides a kind of communication means based on MQTT theme subscribing mechanism and IAD, below in conjunction with accompanying drawing and embodiment, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, do not limit the present invention.
Embodiment one
Present embodiments provide a kind of IAD, Fig. 1 is the structured flowchart of the IAD according to the embodiment of the present invention, as shown in Figure 1, this IAD comprises: IMService (Service Processing Module), MQTTClientI (internal client), MQTTClientR (external client) and MQTTServer (service end), wherein
IMService is the Service Processing Module of IM IAD, is responsible for the core business scheduling of IM IAD, comprises function: user relationship management, IAD and MQTTClientR mapping management, MQTTClientI and MQTTClientR call.
Its function is: for MQTTClientI registration event notification, when receiving the message of described MQTTServer to make described MQTTClientI, notify described IMService; Also for making described MQTTClientI to described MQTTServer topic of subscription; Also for creating MQTTClientR, to make described MQTTClientR connect with the MQTTServer of corresponding IAD, and topic of subscription.
MQTTClientI, is the client of IM IAD intercommunicating support MQTT standard agreement, sends or receive the message of this IAD for IMService.An IM IAD only has a MQTTClientI;
Its function is: for when receiving the message of MQTTServer, notify described IMService; Also for MQTTServer topic of subscription, theme message comprises the message that the user User of IAD or other IADs are sent to described IAD.
MQTTClientR is the client of the support MQTT standard agreement of IM IAD PERCOM peripheral communication, sends or receive the message of other IADs for IMService.An IM IAD has multiple MQTTClientR;
Its function is: for connecting with the MQTTServer of corresponding IAD, and to this MQTTServer topic of subscription.
MQTTServer is the service end supporting MQTT standard agreement, subscribes to issue mechanism for supporting.
Its function is: carry out interacting message with User, for the MQTTClientR of MQTTClientI and corresponding IAD supports theme subscribing mechanism.
Embodiment two
Present embodiments provide a kind of communication means based on MQTT theme subscribing mechanism, Fig. 2 is the communication means flow chart based on MQTT theme subscribing mechanism according to the embodiment of the present invention, and as shown in Figure 2, the method comprises:
Step S202, starts IAD A and IMService, MQTTClientI, MQTTClientR, the MQTTServer in corresponding IAD B; Wherein, MQTTClientI is to the MQTTServer topic of subscription of same IAD, and MQTTClientR connects with the MQTTServer of corresponding IAD, and topic of subscription;
Step S204, first user is reached the standard grade at IAD A, and the second user reaches the standard grade at IAD B;
Step S206, based on IAD A and IAD B, first user and the second user carry out interacting message.
By said method, can save complicated message routing functionality, message can forward based on the subscribing relationship of server maintenance and the message based on this subscribing relationship, realizes message routing functionality voluntarily.Thus do not need maintain message routing table, simplify instant messaging scheme.
In step S204, first user is reached the standard grade at IAD A and is comprised: first user connects the MQTTServer of IAD A, and topic of subscription, theme message comprises message all mutual with first user on IAD A; First user is to described MQTTServer report of user on-line message, and based on theme subscribing mechanism, MQTTClientI receives this user's on-line message, then notifies IMService.
Second user reaches the standard grade at IAD B and comprises: the second user connects the MQTTServer of IAD B, and topic of subscription, theme message to comprise on IAD B all with the message of the second user interactions; Second user is to described MQTTServer report of user on-line message, and based on theme subscribing mechanism, MQTTClientI receives this user's on-line message, then notifies IMService.
First user is after IAD A reaches the standard grade, also comprise: the IMService of IAD A issues user by MQTTClientI to MQTTServer and to reach the standard grade notice, based on theme subscribing mechanism, the MQTTClientR of IAD B receives this user and to reach the standard grade notice, and notifies the IMService of IAD B; The IMService of IAD B searches the online user having business contact with first user on IAD B, performs following steps afterwards:
A) IMService of IAD B calls the MQTTServer topic of subscription of MQTTClientR to IAD A, and theme message is included on IAD A all to the conversation message of described online user;
B) IMService of IAD B calls MQTTClientI and issues user to MQTTServer and to reach the standard grade PUSH message, and based on theme subscribing mechanism, described online user receives this user and to reach the standard grade PUSH message;
C) IMService of IAD B calls MQTTClientR and notifies to the MQTTServer distribution subscription of IAD A, this subscribing notification is for notifying the MQTTServer topic of subscription of the MQTTClientR of IAD A at IAD B, and theme message is included in the dialogue all to first user on IAD A.
In step S206, based on IAD A and IAD B, first user and the second user carry out interacting message, comprising: the second user issues conversation message to the MQTTServer of IAD B; Based on theme subscribing mechanism, the MQTTClientR of IAD A receives the described conversation message of the MQTTServer forwarding of IAD B, and described MQTTClientR is by the IMService of this conversation message notice IAD A; The IMService of IAD A calls MQTTClientI and issues described conversation message to MQTTServer, and based on theme subscribing mechanism, first user receives the described conversation message that described MQTTServer forwards.
For the user of two on same IAD, one of them user issues conversation message to the MQTTServer of this IAD, and based on theme subscribing mechanism, another user receives this conversation message that described MQTTServer forwards.
In the present embodiment, the subscription/publication of MQTT theme mechanism based on Topic theme, has the feature of putting:
1) client only have subscribed a certain Topic theme, just can receive this theme message that other clients are issued;
2) client has issued a certain Topic theme message, and online whole subscribers can receive this theme message.
Shown in table 1 is subscriber and the publisher of the basic theme Topic that relates to of this distributed instant communicating method and correspondence.
Table 1
Below by preferred embodiments and drawings, technical scheme of the present invention is described in detail.
Embodiment three
Fig. 3 is the schematic diagram of the IAD Booting sequence according to the embodiment of the present invention, and as shown in Figure 3, IAD starts to be needed to perform following steps (starting for IAD A):
1. the IMService of IAD A is to MQTTClientI registration event notification, when namely MQTTClientI receives the message of MQTTServer, and namely can with the form of event call-back function notice IMService.
2. the IMService of IAD A calls the function interface of MQTTClientI, make MQTTClientI to MQTTServer topic of subscription, this theme message comprises: user or other IADs (such as IAD B) are sent to the message (Topic:IM/Push/AG/*, IM/Rpt/User/{UserID}/*) that present Access closes A.
3. the IMService of IAD A (supposes that IAD scale is fixed according to preset IAD list, each IAD can configure whole IAD list, IAD list records be each gateway and the list of other gateways that can contact with its foundation), circulation creates MQTTClientR, in order to connect other IADs (such as IAD B), the a series of interfaces simultaneously calling MQTTClientR carry out initialization MQTTClientR, mainly comprise following step:
A) IMService of IAD A is to above-mentioned MQTTClientR registration event notification, namely, when MQTTClientR receives the message of the MQTTServer of corresponding IAD (such as IAD B), namely this IMService can be notified with the form of event call-back function;
B) IMService of IAD A makes above-mentioned MQTTClientR connect the MQTTServer of corresponding IAD (such as IAD B), and topic of subscription, this theme message is Access Network reporting message (Topic:IM/Rpt/AG/*);
C) IMService of IAD A is by MQTTServer issue IAD A on-line message (Topic:IM/Push/AG/Online) of above-mentioned MQTTClientR to corresponding IAD (such as IAD B).
4. the MQTTClientI of the corresponding IAD (such as IAD B) of above-mentioned MQTTClientR passes through topic of subscription, after receiving the IAD A on-line message of IAD A, the IMService of IAD B is notified by the form of event notice call back function (registered when IAD B starts, can with reference to this flow process).
5. the IMService of IAD B receive IAD A reach the standard grade notice after, create MQTTClientR, in order to connect IAD A, and this MQTTClientR of initialization (the initialization MQTTClientR step in initialization procedure refer step 3).
Embodiment four
Fig. 4 is the schematic diagram stopping flow process according to the IAD of the embodiment of the present invention, and as shown in Figure 4, IAD stops needing to perform following steps (starting for IAD A):
1. the IMService of IAD A travels through whole MQTTClientR that present Access closes A, and a series of interfaces calling MQTTClientR carry out anti-initialization MQTTClientR, mainly comprise following step:
A) IMService of IAD A makes above-mentioned MQTTClientR cancel subscriptions theme to the MQTTServer of corresponding IAD (such as IAD B), and namely cancel subscriptions Access Network reporting message (Topic:IM/Rpt/AG/*);
B) IMService of IAD A issues IAD A by above-mentioned MQTTClientR to the MQTTServer of corresponding IAD (such as IAD B) and to roll off the production line message (Topic:IM/Push/AG/Offline);
C) IMService of IAD A makes above-mentioned MQTTClientR disconnect to the MQTTServer of corresponding IAD (such as IAD B);
D) above-mentioned MQTTClientR is destroyed in the IMService release of IAD A.
2. the IMService of IAD B receives IAD A and rolls off the production line after notice, also can carry out anti-initialization (anti-initialization procedure can anti-initialization MQTTClientR step) in refer step 1 to IAD B (being connected with IAD A) MQTTClientR.
Embodiment five
Fig. 5 is the schematic diagram of flow process of reaching the standard grade according to the user of the embodiment of the present invention, as shown in Figure 5, user reaches the standard grade to be needed to perform following steps (suppose that User2 reaches the standard grade at IAD A, User3 reaches the standard grade at IAD B, now reaches the standard grade at IAD A for User1):
After 1.User1 connects the MQTTServer of IAD A, topic of subscription, theme message comprises message (Topic:IM/Talk/User/{UserID}/* all mutual with User1 on IAD A, UserID=User1), and all to the message (Topic:IM/Push/User/{UserID}/*, UserID=User1) that User1 pushes.
2.User1 is to the MQTTServer report of user on-line message (Topic:IM/Rpt/User/{UserID}/Online of IAD A, UserID=User1), now, the MQTTClientI of IAD A can receive user's on-line message of User1 automatically (according to subscription forwarding principle, IAD A subscribes to when starting, refers to IAD Booting sequence).
3., after the MQTTClientI of IAD A receives user's on-line message, notified the IMService of IAD A by the form of event notice call back function (registered when IAD A starts, can with reference to IAD Booting sequence).
4. the IMService of IAD A issues user by MQTTClientI to MQTTServer and to reach the standard grade notice, this user notice of reaching the standard grade is used to notify other IADs (such as IAD B) (Topic:IM/Rpt/AG/UserOnline), and the MQTTClientR of IAD B automatically can receive this user notice of reaching the standard grade and (subscribe to when IAD A starts.The subsequent treatment of IAD B is shown in step 6).
5. the IMService of IAD A searches the present Access associated with User1 and closes (A) online user (such as: User2); Wherein, associated user refers to shuts at present Access the user having business contact with User1, and the incidence relation between user can by business realizing person's designed, designed.
The IMService of IAD A issues user by the function interface that calls MQTTClientI to MQTTServer and to reach the standard grade PUSH message (Topic:IM/Push/User/{UserID}/UserOnline, UserID=User2), now, User2 can automatically receive above-mentioned user according to subscribing relationship and to reach the standard grade PUSH message (subscribe to when User2 starts, can to reach the standard grade step 1 with reference to User1).
6. the MQTTClientR of IAD B receives user and reaches the standard grade after notice, by the IMService of the form of event notice call back function notice IAD B.
7. the IMService of IAD B searches the present Access associated with User1 and closes (B) online user (such as: User3), afterwards:
A) IMService of IAD B is by calling the function interface of the MQTTClientR of IAD B, to the MQTTServer topic of subscription of IAD A, theme message is included in the conversation message (Topic:IM/Talk/User/{UserID}/*, UserID=User3) all to User3 on IAD A;
B) IMService of IAD B is by calling the function interface of the MQTTClientI of IAD B, issue user to MQTTServer to reach the standard grade PUSH message (Topic:IM/Push/User/{UserID}/UserOnline, UserID=User3), now, User3 automatically can receive above-mentioned user according to subscribing relationship and to reach the standard grade PUSH message (subscribe to when User3 starts, can to reach the standard grade step 1 with reference to User1);
C) IMService of IAD B is by calling the function interface of the MQTTClientR of IAD B, MQTTServer distribution subscription to IAD A notifies (Topic:IM/Push/AG/Subscribe), this notice is for notifying IAD A, make the MQTTClientR of IAD A in the MQTTServer topic of subscription of IAD B, theme message is included in the dialogue (Topic:IM/Talk/User/{UserID}/*, UserID=User1) all to User1 on IAD A.
Embodiment six
Reach the standard grade after flow process completes based on above user, establish the message subscribing relation of User1 and associated user User2, User3 between IAD completely, now User1 can talk with User2 or User3.Fig. 6 is the schematic diagram of conversation process between the user according to the embodiment of the present invention, as shown in Figure 6:
(1) between the user on same IAD, dialogue needs to perform following steps (speaking to User1 for User2):
1.User2 issues conversation message (Topic:IM/Talk/User/{UserID}/Text, UserID=User1) to the MQTTServer of IAD A.
2.User1 automatically receives User2 that above-mentioned MQTTServer forwards to the conversation message of User1 (subscribe to when User1 user reaches the standard grade, to reach the standard grade process step 1 see user).
(2) between the user not on same IAD, dialogue needs to perform following steps (speaking to User1 for User3):
1.User3 issues conversation message (Topic:IM/Talk/User/{UserID}/Text, UserID=User1) to the MQTTServer of Access Network B.
2. the conversation message to User1 that the User3 that the MQTTServer that the MQTTClientR of IAD A automatically receives IAD B forwards issues (is subscribed to when User1 user reaches the standard grade, to reach the standard grade process step 7.c see user), then above-mentioned MQTTClientR can by User3 to the conversation message of User1 with the IMService of the form of event notice call back function notice IAD A.
3. the IMService of IAD A issues User3 to the conversation message ((Topic:IM/Talk/User/{UserID}/Text, UserID=User1) of User1 by the function interface that calls the MQTTClientI of IAD A to the MQTTServer of IAD A.
The User3 that the MQTTServer that 4.User1 automatically receives IAD A forwards is to the conversation message of User1 (subscribe to when User1 user reaches the standard grade, to reach the standard grade process step 1 see user).
Embodiment seven
Fig. 7 is the schematic diagram of the user offline flow process according to the embodiment of the present invention, as shown in Figure 7: user offline needs to perform following steps and (supposes that User2 is online at IAD A, User3 is online at IAD B, and User1 is online at IAD A, rolls off the production line for User1):
1.User1 issues user offline message (Topic:IM/Rpt/User/{UserID}/Offline, UserID=User1) to the MQTTServer of IAD A.
2. the MQTTClientI of IAD A can automatically receive above-mentioned user the message that rolls off the production line (IAD A start time subscribe to, see IAD Booting sequence step 2), now MQTTClientI can with the IMService of the form of event notice call back function notice IAD A.
3. the IMService of IAD A makes MQTTClientI to the user offline message (Topic:IM/Rpt/AG/UserOffline of MQTTServer publishing gateway with the form of function call, UserID=User1), now the MQTTClientR of IAD B can automatically receive this message (IAD B start time subscribe to, can with reference to IAD Booting sequence step 3.b or 5.The subsequent treatment of IAD B is shown in step 5).
4. the IMService of IAD A searches present Access pass online user (such as: User2) associating (this incidence relation is by business realizing person's designed, designed) with User1; Come to issue user offline PUSH message (Topic:IM/Push/User/{UserID}/UserOffline to MQTTServer by the function interface calling MQTTClientI, UserID=User2), now, User2 can automatically receive above-mentioned user offline PUSH message (subscribe to when User2 starts, can to reach the standard grade step 1 with reference to User1) according to subscribing relationship.
5. after the MQTTClientR of IAD B receives user offline message, by the IMService of the form notice IAD B of event notice call back function.
6. the IMService of IAD B searches present Access pass online user (such as: User3) associating (this incidence relation is by business realizing person's designed, designed) with User1, afterwards:
A) IMService of IAD B is by calling the function interface of the MQTTClientR of IAD B, MQTTServer to IAD A cancels subscriptions all to the dialogue (Topic:IM/Talk/User/{UserID}/*, UserID=User3) of User3;
B) IMService of IAD B is by calling the function interface of the MQTTClientI of IAD B, MQTTServer to IAD B issues user offline PUSH message (Topic:IM/Push/User/{UserID}/UserOnline, UserID=User3), now, User3 can automatically receive above-mentioned user offline PUSH message (subscribe to when User3 starts, can to reach the standard grade step 1 with reference to User1) according to subscribing relationship;
C) IMService of IAD B is by calling the function interface of the MQTTClientR of IAD B, MQTTServer to IAD A issues the notice (Topic:IM/Push/AG/Unsubscribe) that cancels subscriptions, this notice is for notifying IAD A, the MQTTClientR of IAD A is cancelled subscriptions all to the conversation message (Topic:IM/Talk/User/{UserID}/*, UserID=User1) of User1 on the MQTTServer of IAD B.
In above-described embodiment three to seven, employ following type of interaction term:
[interface interchange] code level function call, for the interface interchange of IMService to MQTTClientI or MQTTClientR.
[event notice] code level function call, after receiving message for MQTTClientI or MQTTClientR, to the event notice of IMService.
[connection] MQTT agreement connection procedure.
[disconnecting] MQTT agreement disconnects process.
[subscription] MQTT protocol message subscription procedure.
[issue] MQTT protocol message issuing process.
[subscribe to and forward] MQTTServer receives the message that MQTTClientI or MQTTClientR issues, and forwards the message of the subscriber subscribing to this message subject.
Technical solution of the present invention mainly comprises 3 major parts: the first, invention supportive body IM IAD internal structure; The second, define based on MQTT subscription issue mechanism a whole set of Topic theme for instant messaging, and each participant issues relation to the subscription of this cover theme; 3rd, based on the Topic theme of definition, each participant realizes the complete business handling process of instant messaging.Pass through the present invention, solve the problem of distributed instant communication application message route complexity in correlation technique, eliminate complicated message routing functionality, message can forward based on the subscribing relationship of server maintenance and the message based on this subscribing relationship, realizes message routing functionality voluntarily.Thus do not need maintain message routing table, simplify instant messaging scheme.
Although be example object, disclose the preferred embodiments of the present invention, it is also possible for those skilled in the art will recognize various improvement, increase and replacement, and therefore, scope of the present invention should be not limited to above-described embodiment.

Claims (7)

1. an IAD, is characterized in that, described IAD comprises: Service Processing Module IMService, internal client MQTTClientI, external client MQTTClientR and service end MQTTServer, wherein,
IMService, for MQTTClientI registration event notification, when receiving the message of described MQTTServer to make described MQTTClientI, notifies described IMService; Also for making described MQTTClientI to described MQTTServer topic of subscription; Also for creating MQTTClientR, to make described MQTTClientR connect with the MQTTServer of corresponding IAD, and topic of subscription;
MQTTClientI, for when receiving the message of MQTTServer, notifies described IMService; Also for MQTTServer topic of subscription, theme message comprises the message that the user User of IAD or other IADs are sent to described IAD;
MQTTClientR, for connecting with the MQTTServer of corresponding IAD, and to this MQTTServer topic of subscription;
MQTTServer, carries out interacting message with User, for the MQTTClientR of MQTTClientI and corresponding IAD supports theme subscribing mechanism.
2. based on a communication means for MQTT theme subscribing mechanism, it is characterized in that, described method comprises:
Start IAD A and IMService, MQTTClientI, MQTTClientR, the MQTTServer in corresponding IAD B; Wherein, MQTTClientI is to the MQTTServer topic of subscription of same IAD, and MQTTClientR connects with the MQTTServer of corresponding IAD, and topic of subscription;
First user is reached the standard grade at IAD A, and the second user reaches the standard grade at IAD B;
Based on IAD A and IAD B, first user and the second user carry out interacting message.
3. method as claimed in claim 2, it is characterized in that, first user is reached the standard grade at IAD A and is comprised:
First user connects the MQTTServer of IAD A, and topic of subscription, theme message comprises message all mutual with first user on IAD A;
First user is to described MQTTServer report of user on-line message, and based on theme subscribing mechanism, MQTTClientI receives this user's on-line message, then notifies IMService.
4. method as claimed in claim 2, it is characterized in that, the second user reaches the standard grade at IAD B and comprises:
Second user connects the MQTTServer of IAD B, and topic of subscription, theme message to comprise on IAD B all with the message of the second user interactions;
Second user is to described MQTTServer report of user on-line message, and based on theme subscribing mechanism, MQTTClientI receives this user's on-line message, then notifies IMService.
5. method as claimed in claim 3, it is characterized in that, first user, after IAD A reaches the standard grade, also comprises:
The IMService of IAD A issues user by MQTTClientI to MQTTServer and to reach the standard grade notice, and based on theme subscribing mechanism, the MQTTClientR of IAD B receives this user and to reach the standard grade notice, and notifies the IMService of IAD B;
The IMService of IAD B searches the online user having business contact with first user on IAD B, performs following steps afterwards:
A) IMService of IAD B calls the MQTTServer topic of subscription of MQTTClientR to IAD A, and theme message is included on IAD A all to the conversation message of described online user;
B) IMService of IAD B calls MQTTClientI and issues user to MQTTServer and to reach the standard grade PUSH message, and based on theme subscribing mechanism, described online user receives this user and to reach the standard grade PUSH message;
C) IMService of IAD B calls MQTTClientR and notifies to the MQTTServer distribution subscription of IAD A, this subscribing notification is for notifying the MQTTServer topic of subscription of the MQTTClientR of IAD A at IAD B, and theme message is included in the dialogue all to first user on IAD A.
6. method as claimed in claim 2, it is characterized in that, based on IAD A and IAD B, first user and the second user carry out interacting message, comprising:
Second user issues conversation message to the MQTTServer of IAD B;
Based on theme subscribing mechanism, the MQTTClientR of IAD A receives the described conversation message of the MQTTServer forwarding of IAD B, and described MQTTClientR is by the IMService of this conversation message notice IAD A;
The IMService of IAD A calls MQTTClientI and issues described conversation message to MQTTServer, and based on theme subscribing mechanism, first user receives the described conversation message that described MQTTServer forwards.
7. method as claimed in claim 2, it is characterized in that, described method also comprises:
Two users on same IAD, one of them user issues conversation message to the MQTTServer of this IAD, and based on theme subscribing mechanism, another user receives this conversation message that described MQTTServer forwards.
CN201510148432.1A 2015-03-31 2015-03-31 Communication method based on MQTT topic subscription mechanism and access gateway Active CN104836723B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510148432.1A CN104836723B (en) 2015-03-31 2015-03-31 Communication method based on MQTT topic subscription mechanism and access gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510148432.1A CN104836723B (en) 2015-03-31 2015-03-31 Communication method based on MQTT topic subscription mechanism and access gateway

Publications (2)

Publication Number Publication Date
CN104836723A true CN104836723A (en) 2015-08-12
CN104836723B CN104836723B (en) 2020-07-31

Family

ID=53814368

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510148432.1A Active CN104836723B (en) 2015-03-31 2015-03-31 Communication method based on MQTT topic subscription mechanism and access gateway

Country Status (1)

Country Link
CN (1) CN104836723B (en)

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105245621A (en) * 2015-10-30 2016-01-13 大连大学 Enterprise message push system and message push method based on Message Queuing Telemetry Transport (MQTT)
CN106059892A (en) * 2016-05-17 2016-10-26 中国科学院沈阳计算技术研究所有限公司 Message engine integrated with communication system
CN106101178A (en) * 2016-05-30 2016-11-09 海尔优家智能科技(北京)有限公司 A kind of subscription message distribution, method of reseptance, device and related system
CN106130882A (en) * 2016-07-13 2016-11-16 北京百度网讯科技有限公司 For the method and apparatus transmitting message
CN106656751A (en) * 2016-12-05 2017-05-10 北京中交兴路信息科技有限公司 Data communication method and device
CN108023807A (en) * 2017-11-02 2018-05-11 东软集团股份有限公司 Instant communicating method, server and message-oriented middleware
CN108200184A (en) * 2018-01-12 2018-06-22 郑州云海信息技术有限公司 A kind of distributed Web instant message sends system and method
CN108270995A (en) * 2017-01-03 2018-07-10 中国移动通信有限公司研究院 Communication means and system between a kind of terminal and video monitoring equipment
CN108370345A (en) * 2015-10-09 2018-08-03 萨托里环球有限责任公司 System and method for storing message data
CN108429665A (en) * 2018-03-22 2018-08-21 四川长虹电器股份有限公司 A kind of method of concurrent communication transmission data
CN109274730A (en) * 2018-09-04 2019-01-25 上海联寓智能科技有限公司 The optimization method and device that Internet of things system, MQTT message are transmitted
WO2019029320A1 (en) * 2017-08-11 2019-02-14 华为技术有限公司 Configuration management method, apparatus and device
CN109547333A (en) * 2018-12-19 2019-03-29 北京仁科互动网络技术有限公司 Instant communicating method and device
CN109872433A (en) * 2019-03-08 2019-06-11 广州大学华软软件学院 A kind of the unlocking control method and system of incubator
CN110099078A (en) * 2018-01-29 2019-08-06 阿里巴巴集团控股有限公司 Communication between devices, message synchronization method, apparatus, equipment and storage medium
CN110138860A (en) * 2019-05-16 2019-08-16 广州云智易物联网有限公司 A kind of data communication method and device based on Internet of Things
CN110460638A (en) * 2019-07-11 2019-11-15 深圳职业技术学院 Information push method and device
WO2019224697A1 (en) * 2018-05-23 2019-11-28 Inversiones Tecnológicas De America S.A. Multi-biometric iot bridge
CN110635970A (en) * 2019-10-10 2019-12-31 武汉普利商用机器有限公司 Internet of things equipment online state identification method, online information platform and server
US10574619B2 (en) 2017-01-02 2020-02-25 International Business Machines Corporation Cluster assisted MQTT client coverage for fat-pipe cloud applications
CN113133027A (en) * 2019-12-30 2021-07-16 Tcl新技术(惠州)有限公司 Communication method, server, terminal and communication system
CN114039818A (en) * 2021-12-27 2022-02-11 四川启睿克科技有限公司 Pluggable multi-gateway equipment management system and method
CN114501186A (en) * 2022-01-28 2022-05-13 瀚云科技有限公司 Data acquisition system, method, electronic equipment and storage medium
CN115378989A (en) * 2022-08-10 2022-11-22 上海黑眸智能科技有限责任公司 MQTT topic subscription system, method, terminal and medium based on wake-up channel

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101848236A (en) * 2010-05-06 2010-09-29 北京邮电大学 Real-time data distribution system with distributed network architecture and working method thereof
CN103238137A (en) * 2010-11-24 2013-08-07 国际商业机器公司 Transactional messaging support in connected messaging networks
US20140064467A1 (en) * 2009-10-07 2014-03-06 Twilio, Inc. System and method for running a multi-module telephony application
CN104052653A (en) * 2014-06-23 2014-09-17 广东天波信息技术股份有限公司 Method for state presentation based on MQTT

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140064467A1 (en) * 2009-10-07 2014-03-06 Twilio, Inc. System and method for running a multi-module telephony application
CN101848236A (en) * 2010-05-06 2010-09-29 北京邮电大学 Real-time data distribution system with distributed network architecture and working method thereof
CN103238137A (en) * 2010-11-24 2013-08-07 国际商业机器公司 Transactional messaging support in connected messaging networks
CN104052653A (en) * 2014-06-23 2014-09-17 广东天波信息技术股份有限公司 Method for state presentation based on MQTT

Cited By (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108370345A (en) * 2015-10-09 2018-08-03 萨托里环球有限责任公司 System and method for storing message data
CN105245621A (en) * 2015-10-30 2016-01-13 大连大学 Enterprise message push system and message push method based on Message Queuing Telemetry Transport (MQTT)
CN105245621B (en) * 2015-10-30 2018-05-22 大连大学 Enterprise message supplying system and information push method based on MQTT
CN106059892A (en) * 2016-05-17 2016-10-26 中国科学院沈阳计算技术研究所有限公司 Message engine integrated with communication system
CN106101178A (en) * 2016-05-30 2016-11-09 海尔优家智能科技(北京)有限公司 A kind of subscription message distribution, method of reseptance, device and related system
CN106130882B (en) * 2016-07-13 2019-04-30 北京百度网讯科技有限公司 The method and apparatus for being used for transmission message
CN106130882A (en) * 2016-07-13 2016-11-16 北京百度网讯科技有限公司 For the method and apparatus transmitting message
CN106656751A (en) * 2016-12-05 2017-05-10 北京中交兴路信息科技有限公司 Data communication method and device
US10574619B2 (en) 2017-01-02 2020-02-25 International Business Machines Corporation Cluster assisted MQTT client coverage for fat-pipe cloud applications
CN108270995A (en) * 2017-01-03 2018-07-10 中国移动通信有限公司研究院 Communication means and system between a kind of terminal and video monitoring equipment
CN109391500A (en) * 2017-08-11 2019-02-26 华为技术有限公司 A kind of configuring management method, device and equipment
US11265218B2 (en) 2017-08-11 2022-03-01 Huawei Technologies Co., Ltd. Configuration management method and apparatus, and device
CN109391500B (en) * 2017-08-11 2021-08-31 华为技术有限公司 Configuration management method, device and equipment
WO2019029320A1 (en) * 2017-08-11 2019-02-14 华为技术有限公司 Configuration management method, apparatus and device
CN108023807A (en) * 2017-11-02 2018-05-11 东软集团股份有限公司 Instant communicating method, server and message-oriented middleware
CN108200184A (en) * 2018-01-12 2018-06-22 郑州云海信息技术有限公司 A kind of distributed Web instant message sends system and method
CN110099078A (en) * 2018-01-29 2019-08-06 阿里巴巴集团控股有限公司 Communication between devices, message synchronization method, apparatus, equipment and storage medium
CN110099078B (en) * 2018-01-29 2022-02-25 阿里巴巴集团控股有限公司 Method, device, equipment and storage medium for communication between equipment and message synchronization
CN108429665A (en) * 2018-03-22 2018-08-21 四川长虹电器股份有限公司 A kind of method of concurrent communication transmission data
CN108429665B (en) * 2018-03-22 2020-12-15 四川长虹电器股份有限公司 Method for transmitting data through concurrent communication
US11843677B2 (en) 2018-05-23 2023-12-12 Inversiones Tecnologicas De America S.A. Multi-biometric IoT bridge
WO2019224697A1 (en) * 2018-05-23 2019-11-28 Inversiones Tecnológicas De America S.A. Multi-biometric iot bridge
CN109274730A (en) * 2018-09-04 2019-01-25 上海联寓智能科技有限公司 The optimization method and device that Internet of things system, MQTT message are transmitted
CN109274730B (en) * 2018-09-04 2021-07-23 上海联寓智能科技有限公司 Internet of things system, MQTT message transmission optimization method and device
CN109547333A (en) * 2018-12-19 2019-03-29 北京仁科互动网络技术有限公司 Instant communicating method and device
CN109872433A (en) * 2019-03-08 2019-06-11 广州大学华软软件学院 A kind of the unlocking control method and system of incubator
CN110138860A (en) * 2019-05-16 2019-08-16 广州云智易物联网有限公司 A kind of data communication method and device based on Internet of Things
CN110138860B (en) * 2019-05-16 2022-02-22 广州云智易物联网有限公司 Data communication method and device based on Internet of things
CN110460638A (en) * 2019-07-11 2019-11-15 深圳职业技术学院 Information push method and device
CN110635970A (en) * 2019-10-10 2019-12-31 武汉普利商用机器有限公司 Internet of things equipment online state identification method, online information platform and server
CN113133027A (en) * 2019-12-30 2021-07-16 Tcl新技术(惠州)有限公司 Communication method, server, terminal and communication system
CN113133027B (en) * 2019-12-30 2023-01-20 Tcl新技术(惠州)有限公司 Communication method, server, terminal and communication system
CN114039818A (en) * 2021-12-27 2022-02-11 四川启睿克科技有限公司 Pluggable multi-gateway equipment management system and method
CN114039818B (en) * 2021-12-27 2023-06-13 四川启睿克科技有限公司 Pluggable multi-gateway equipment management system and method
CN114501186A (en) * 2022-01-28 2022-05-13 瀚云科技有限公司 Data acquisition system, method, electronic equipment and storage medium
CN114501186B (en) * 2022-01-28 2023-10-03 瀚云科技有限公司 Data acquisition system, method, electronic equipment and storage medium
CN115378989A (en) * 2022-08-10 2022-11-22 上海黑眸智能科技有限责任公司 MQTT topic subscription system, method, terminal and medium based on wake-up channel
CN115378989B (en) * 2022-08-10 2023-08-15 深圳华芯信息技术股份有限公司 MQTT theme subscription system, method, terminal and medium based on wake-up channel

Also Published As

Publication number Publication date
CN104836723B (en) 2020-07-31

Similar Documents

Publication Publication Date Title
CN104836723A (en) Communication method based on MQTT topic subscription mechanism and access gateway
US10097689B2 (en) System and methods for integrating short message service messaging with contact center applications
CN101228517B (en) Method and device for providing a call with context
US7804949B2 (en) Client-based integration of PBX and messaging systems
EP1670197B1 (en) Messaging advice in presence-aware networks
CN101262453B (en) Method and system for intelligent chant service in next-generation network
US7945035B2 (en) Dynamic presence proxy for call sessions
JP2006191608A (en) System for mobile instant messenger service using mobile communication terminal and method of providing mobile instant messenger service
EP1348294A1 (en) Presence and session handling information
CN102958107A (en) Capability query method, communication terminal and application server
US20220174149A1 (en) Method and system for automatic transmission of status information
CN103368818A (en) Method for sending instant message
CN100438509C (en) Method for realizing unified information intelligent route and system thereof
US7437141B2 (en) Apparatus and method for easily restoring a connection to a telephone
US10367900B2 (en) Presence notifications
CN103119892B (en) The system and method for meeting message transmission is carried out between telephone device and the wide area networking devices that universal plug and play enables
KR100865418B1 (en) Method and system for providing mobile equipment's status information in a mobile communication system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant