CN105656959A - Multi-terminal PUB/SUB (Publish/Subscribe) message synchronization method based on routing mechanism - Google Patents
Multi-terminal PUB/SUB (Publish/Subscribe) message synchronization method based on routing mechanism Download PDFInfo
- Publication number
- CN105656959A CN105656959A CN201410639742.9A CN201410639742A CN105656959A CN 105656959 A CN105656959 A CN 105656959A CN 201410639742 A CN201410639742 A CN 201410639742A CN 105656959 A CN105656959 A CN 105656959A
- Authority
- CN
- China
- Prior art keywords
- message
- theme
- routing
- rule
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
The invention relates to a multi-terminal PUB/SUB (Publish/Subscribe) message synchronization method based on a routing mechanism, which defines a message routing rule for a server which is based on a subscribe-publish model application. The method comprises the following steps: when the server receives a message transmitted by the application, searching a matched routing rule by the server according to a receiving theme of the message; and if the server searches the matched routing rule in the message routing rule, then initiating a corresponding message routing operation to a routing rule objective theme by the server according to a routing mode in the routing rule. According to the multi-terminal PUB/SUB message synchronization method based on the routing mechanism provided by the invention, when the application publishes the message to one theme, the server inquires the message routing rule according to the theme and initiates a message synchronous operation to the objective theme corresponding to the inquired routing rule according to the rule; furthermore, multi-terminal message synchronization of a user can be realized through the customization of the routing rule, and automatic and customizable multi-terminal message synchronization can be realized.
Description
Technical field
The present invention relates to the multiple terminals message synchronization technology of the communications field, specifically a kind of multiple terminals PUB/SUB message synchronization method based on routing mechanism.
Background technology
Subscribe to Issuance model, it it is a kind of asynchronous message transfer model, it define Application models, together with the publisher of message is contacted in the way of a kind of loose coupling with the subscriber of message, they do not need to know any information of the other side, even do not need to know whether the other side exists, so that it may to realize the asynchronous transmission of message. Exchanging information by theme between publisher and subscriber: publisher is Information issued to theme character string, and subscriber registers on theme and receives information, theme character string connects publisher and subscriber get up in this way.
In prior art, if same user has multiple terminating unit, multiple terminating unit uses based on the application program subscribing to Issuance model simultaneously, when any one terminal issues message to its subscriber, cannot the action of perception other-end between each terminal of this user, namely message can not accomplish multiple terminal synchronizes of transmission side, causes user may repeat to perform identical operation in multiple terminal, brings great inconvenience to user.
Summary of the invention
For the deficiencies in the prior art, the present invention provides a kind of multiple terminals PUB/SUB message synchronization method based on routing mechanism, can realize the synchronous of multiple terminals message in the message system based on subscription Issuance model.
The technical scheme that the present invention adopts for achieving the above object is: a kind of multiple terminals PUB/SUB message synchronization method based on routing mechanism, comprises the following steps:
Step 1: for based on the server definition Message routing rule subscribing to Issuance model application;
Step 2: after described server receives the message that described application sends, described server searches the route rule of coupling according to the reception theme of message;
Step 3: if described server finds the route rule of coupling in Message routing rule, then described server initiates corresponding message routing operation according to the routing mode in route rule to route rule object theme.
If described in the Message routing rule object theme that matches be the theme of other-end corresponding to described application place user, and Message routing mode is for copying message, then initiate message synchronization operation to the other-end of user.
Described Message routing rule comprises source theme, object theme, routing mode.
Described routing mode comprises duplication message, forwards message, abandons message, ignores message.
The process of the described route rule searching coupling is: compares server and receives the source theme in the object theme of message and Message routing rule, find identical with source theme in Message routing rule or belong to object theme and the Message routing mode of a concrete theme in the theme class of source, be the route rule of coupling.
The described object theme comparing server reception message comprises with the source theme in Message routing rule: compare completely and Fuzzy comparisons.
It is described that to compare the source theme received for: server in the object theme of message and Message routing rule completely be same theme.
Described Fuzzy comparisons is: the source theme of Message routing rule is a class theme, and the object theme that server receives message belongs to one of them.
The present invention has following useful effect and advantage:
The present invention can described based in the application subscribing to Issuance model, if after message a to theme is issued in application, server can initiate message synchronization operation according to theme query messages route rule to the object theme that the route rule inquired is corresponding, the message synchronization of user multiple terminals can be realized further by the customization of route rule, avoid in prior art owing to user that can not be synchronous caused may repeat to perform the problem of identical operation in multiple application terminal, it is achieved that the multiple terminals message synchronization of automatization, customizable.
Accompanying drawing explanation
Fig. 1 is the method flow diagram of the present invention.
Embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.
Below with reference to the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it will be appreciated that embodiment described herein is only for instruction and explanation of the present invention, but is not used in restriction the present invention.
As shown in Figure 1, the described multiple terminals PUB/SUB message synchronization method based on routing mechanism of the present embodiment comprises:
In figure, client terminal 1-1, client terminal 1-2, client terminal 2 are three client terminals based on the application subscribing to Issuance model, and client terminal 1-1 and client terminal 1-2 is two terminals of client 1, and client terminal 2 is a terminal of client 2; Server is based on the server subscribing to Issuance model, wherein built-in Message routing module. Assume that Message routing rule defines, and it has been loaded in server.
Concrete, described Message routing rule comprises source theme, object theme, routing mode.
Concrete, described routing mode comprises duplication message, forwards message, abandons message, ignores message.
S101: the first terminal of message transmission side, namely the client terminal 1-1 of described client 1 sends message to client 2. First message mail to client 2 on the theme of server.
S102: the message that server receives the terminal of client 1 and described client terminal 1-1 sends, replys, to the terminal of client 1 and described client terminal 1-1, the notice receiving message.
S103: the theme of the acceptor of the message that server is sent according to the terminal of the client 1 received and described client terminal 1-1, message call route module, searches the route rule whether having coupling.If not matching relevant route rule, then message normally forwards to acceptor. , finding the route rule of coupling herein, the object theme of route rule is the theme of client terminal 1-2, and routing mode is for copying message.
Wherein, the process of the described route rule searching coupling is: compares server and receives the source theme in the object theme of message and Message routing rule, find identical with source theme in Message routing rule or belong to object theme and the Message routing mode of a concrete theme in the theme class of source, be the route rule of coupling.
Concrete, the described object theme comparing server reception message comprises with the source theme in Message routing rule: compare completely and Fuzzy comparisons.
Concrete, described to compare the source theme received for: server in the object theme of message and Message routing rule completely be same theme.
Concrete, described Fuzzy comparisons is: the source theme of Message routing rule is a class theme, and the object theme that server receives message belongs to one of them.
Theme according to message recipient in S104:S103, has inquired the route rule of coupling, according to the object address in route rule and routing mode, message copy one part has been sent to the 2nd terminal of client 1 and described terminal 1-2.
Wherein, described routing mode is for copying message, and the message copy one part being about to receive is to route rule object theme, and message still can be sent to former object theme.
S105: the other-end of client 1 and described client terminal 1-2 reply the notice having received message to server.
S106: server sends, to the terminal of client 2 and described terminal 2, the message that client 1 is sent to client 2.
S107: the terminal of client 2 and described client terminal 2 reply the notice having received message to server. Flow process terminates.
The non-message transmitting terminal of client 1 and client terminal 1-2 receive client 1 message transmitting terminal and client terminal 1-1 is sent to the message of client 2, it is achieved that the multiple terminals message synchronization operation of transmission side.
Claims (8)
1. the multiple terminals PUB/SUB message synchronization method based on routing mechanism, it is characterised in that: comprise the following steps:
Step 1: for based on the server definition Message routing rule subscribing to Issuance model application;
Step 2: after described server receives the message that described application sends, described server searches the route rule of coupling according to the reception theme of message;
Step 3: if described server finds the route rule of coupling in Message routing rule, then described server initiates corresponding message routing operation according to the routing mode in route rule to route rule object theme.
2. the multiple terminals PUB/SUB message synchronization method based on routing mechanism according to claim 1, it is characterized in that: if described in the Message routing rule object theme that matches be the theme of other-end corresponding to described application place user, and Message routing mode is for copying message, then initiate message synchronization operation to the other-end of user.
3. the multiple terminals PUB/SUB message synchronization method based on routing mechanism according to claim 1 and 2, it is characterised in that: described Message routing rule comprises source theme, object theme, routing mode.
4. the multiple terminals PUB/SUB message synchronization method based on routing mechanism according to claim 3, it is characterised in that: described routing mode comprises duplication message, forwards message, abandons message, ignores message.
5. the multiple terminals PUB/SUB message synchronization method based on routing mechanism according to claim 1, it is characterized in that: described in search coupling the process of route rule be: compare server and receive the source theme in the object theme of message and Message routing rule, find identical with source theme in Message routing rule or belong to object theme and the Message routing mode of a concrete theme in the theme class of source, be the route rule of coupling.
6. the multiple terminals PUB/SUB message synchronization method based on routing mechanism according to claim 5, it is characterised in that: the described object theme comparing server reception message comprises with the source theme in Message routing rule: compare completely and Fuzzy comparisons.
7. the multiple terminals PUB/SUB message synchronization method based on routing mechanism according to claim 6, it is characterised in that: it is described that to compare the source theme received for: server in the object theme of message and Message routing rule completely be same theme.
8. the multiple terminals PUB/SUB message synchronization method based on routing mechanism according to claim 6, it is characterised in that: described Fuzzy comparisons is: the source theme of Message routing rule is a class theme, and the object theme that server receives message belongs to one of them.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410639742.9A CN105656959A (en) | 2014-11-13 | 2014-11-13 | Multi-terminal PUB/SUB (Publish/Subscribe) message synchronization method based on routing mechanism |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410639742.9A CN105656959A (en) | 2014-11-13 | 2014-11-13 | Multi-terminal PUB/SUB (Publish/Subscribe) message synchronization method based on routing mechanism |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105656959A true CN105656959A (en) | 2016-06-08 |
Family
ID=56478682
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410639742.9A Pending CN105656959A (en) | 2014-11-13 | 2014-11-13 | Multi-terminal PUB/SUB (Publish/Subscribe) message synchronization method based on routing mechanism |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105656959A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528307A (en) * | 2016-11-14 | 2017-03-22 | 济南浪潮高新科技投资发展有限公司 | Method for realizing extensible message routing |
CN110365587A (en) * | 2018-03-26 | 2019-10-22 | 阿里巴巴集团控股有限公司 | Communication between devices method, apparatus, equipment and storage medium |
US10841390B2 (en) | 2018-11-22 | 2020-11-17 | Industrial Technology Research Institute | Method and system for synchronizing publication and subscription of message queues |
CN113609384A (en) * | 2021-07-16 | 2021-11-05 | 广州云从凯风科技有限公司 | Data subscription method, equipment and computer storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060036679A1 (en) * | 2002-07-26 | 2006-02-16 | International Business Machines Corporation | Pub/sub message invoking a subscribers client application program |
CN102227927A (en) * | 2008-11-28 | 2011-10-26 | 三星电子株式会社 | Method and apparatus for providing communication history |
CN103647776A (en) * | 2013-12-13 | 2014-03-19 | 国家图书馆 | Media resource synchronization method and system for multiple terminals |
CN103944924A (en) * | 2014-05-15 | 2014-07-23 | 重庆邮电大学 | Ubiquitous network publish-subscribe middleware model based on RESTful |
-
2014
- 2014-11-13 CN CN201410639742.9A patent/CN105656959A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060036679A1 (en) * | 2002-07-26 | 2006-02-16 | International Business Machines Corporation | Pub/sub message invoking a subscribers client application program |
CN102227927A (en) * | 2008-11-28 | 2011-10-26 | 三星电子株式会社 | Method and apparatus for providing communication history |
CN103647776A (en) * | 2013-12-13 | 2014-03-19 | 国家图书馆 | Media resource synchronization method and system for multiple terminals |
CN103944924A (en) * | 2014-05-15 | 2014-07-23 | 重庆邮电大学 | Ubiquitous network publish-subscribe middleware model based on RESTful |
Non-Patent Citations (2)
Title |
---|
王广泽: ""基于Pub/Sub模式的智能消息中间件研究"", 《信息技术》 * |
马建刚等: ""面向大规模分布式计算发布订阅系统核心技术"", 《软件学报》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528307A (en) * | 2016-11-14 | 2017-03-22 | 济南浪潮高新科技投资发展有限公司 | Method for realizing extensible message routing |
CN106528307B (en) * | 2016-11-14 | 2019-08-02 | 浪潮通用软件有限公司 | A kind of expansible message route implementation method |
CN110365587A (en) * | 2018-03-26 | 2019-10-22 | 阿里巴巴集团控股有限公司 | Communication between devices method, apparatus, equipment and storage medium |
US10841390B2 (en) | 2018-11-22 | 2020-11-17 | Industrial Technology Research Institute | Method and system for synchronizing publication and subscription of message queues |
CN113609384A (en) * | 2021-07-16 | 2021-11-05 | 广州云从凯风科技有限公司 | Data subscription method, equipment and computer storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9948575B2 (en) | Issuing method for forwarding adjacency link | |
CN102571587B (en) | Method and equipment for forwarding messages | |
EP2866395B1 (en) | Maximum transmission unit negotiation method and data terminal | |
CN105656959A (en) | Multi-terminal PUB/SUB (Publish/Subscribe) message synchronization method based on routing mechanism | |
US10148739B2 (en) | M2M data querying and invoking methods, querying and invoking devices, and system | |
CN107196859B (en) | Message forwarding method, broadcasting method, message response method and communication equipment | |
CN108243262A (en) | Learning method, device and the network three-layer equipment of ARP table | |
CN104270302B (en) | The transmission system of online order and transfer approach | |
US11307843B2 (en) | Automatic device-to-device firmware upgrade of a wireless network | |
CN103546572A (en) | Cloud storage device and multi-cloud storage networking system and method | |
CN104486327A (en) | Method and client side of communication between pages and long connection servers | |
CN103546258A (en) | Method and device for data transmission | |
US20170142004A1 (en) | Path Setup in a Mesh Network | |
CN102223378B (en) | File synchronization method and system | |
US9350606B2 (en) | System and method for assigning server to terminal and efficiently delivering messages to the terminal | |
RU2586598C2 (en) | Data replication | |
CN102882906A (en) | Method and device of data communication in constrained application protocol | |
US8755397B2 (en) | Asynchronous communication in an unstable network | |
CN103281369A (en) | Message processing method and WOC (WAN (wide area network) optimization controller) | |
CN106230730A (en) | A kind of multicast transmission method and device | |
CN103004150B (en) | Shortest path first neighbor establishing method, node and system thereof | |
CN109450810A (en) | Identify the method and device of redundancy message | |
KR20140142138A (en) | Apparatus and method for managing multicast group in wireless network | |
CN102932360A (en) | Method and system for updating interface dynamically | |
CN114124275A (en) | Time synchronization method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20160608 |