WO2014194452A1 - 消息发布与订阅的方法及装置 - Google Patents

消息发布与订阅的方法及装置 Download PDF

Info

Publication number
WO2014194452A1
WO2014194452A1 PCT/CN2013/076631 CN2013076631W WO2014194452A1 WO 2014194452 A1 WO2014194452 A1 WO 2014194452A1 CN 2013076631 W CN2013076631 W CN 2013076631W WO 2014194452 A1 WO2014194452 A1 WO 2014194452A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
topic
actual
subscriber
virtual
Prior art date
Application number
PCT/CN2013/076631
Other languages
English (en)
French (fr)
Other versions
WO2014194452A9 (zh
Inventor
方元
唐冠军
王云鹏
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2013/076631 priority Critical patent/WO2014194452A1/zh
Priority to EP13876082.2A priority patent/EP2835938B1/en
Priority to CN201380000499.XA priority patent/CN103534988B/zh
Priority to US14/489,743 priority patent/US9110884B2/en
Publication of WO2014194452A1 publication Critical patent/WO2014194452A1/zh
Publication of WO2014194452A9 publication Critical patent/WO2014194452A9/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • 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/214Monitoring or handling of messages using selective forwarding
    • 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/212Monitoring or handling of messages using filtering or selective blocking

Definitions

  • the present invention relates to the field of information processing, and in particular, to a method and an apparatus for information transmission. Background technique
  • Message middleware utilizes an efficient and reliable messaging mechanism for platform-independent data exchange. By providing a messaging and message queuing model, it can extend interprocess communication in a distributed environment.
  • the publish/subscribe mode is the most common transport mechanism.
  • the exchange of information between the publisher and the subscriber through the theme The publisher posts the message to the relevant topic, the subscriber registers on the topic and receives the information on the topic, in this way the publisher connects the publisher and the subscriber.
  • the traditional mail distribution method of the publish/subscribe system is a routing method based on the combination of content and address. Under this routing system, firstly, according to the topic content, combined with the pre-collected subscribers, the same topic is determined.
  • the message has or does not have interested subscribers, as well as the destination server and receive queues of those subscribers, and then determines through the static routing system which local receive queues and the next routing node the message will be distributed to. Therefore, in this routing system, messages transmitted between the publisher and the subscriber must carry a subject.
  • changes to the theme such as the name of the theme or a change in the category, affect the destination of the message route, and the publisher or subscriber must know the changes before they can post or subscribe to the positive On the subject. In the context of large-scale applications, especially in the case of the Internet environment, such changes can cause large changes to publishers or subscribers and unnecessary network overhead.
  • Embodiments of the present invention provide a method and apparatus for message publishing and subscription to provide higher information transmission efficiency and greater flexibility.
  • the embodiment of the present invention uses the following technical solution:
  • the present invention provides a method for message publishing, including:
  • the corresponding virtual topic is a starting point, and the transmission path ending in any one of the subscribers' virtual topics; wherein the virtual topic is used for message forwarding between the actual topic and the publisher or between the actual topic and the subscriber Message forwarding; the actual topic is used for message forwarding between the publisher and the subscriber; when a transmission path starting from the virtual topic corresponding to the publisher and ending with the virtual topic corresponding to the subscriber is found Transmitting the message or the identification information corresponding to the message on the found transmission path; when the message or the identification, the corresponding identification information is transmitted to the end of each transmission path, The message is sent to the subscriber corresponding to the end of the transmission path.
  • the method further includes: When the transmission path starting from the virtual topic corresponding to the publisher and ending with the virtual topic corresponding to the subscriber is not found, the message is semantically parsed to obtain a semantic analysis result, and according to the semantic Parsing the result, finding an actual topic matching the semantic parsing result in the stored actual topic;
  • the method further includes: the virtual topic corresponding to the publisher is the starting point, and the virtual topic corresponding to any one of the subscribers is The transmission path of the destination;
  • the message or the identifier corresponding to the message is transmitted on the found transmission path.
  • the message or the associated packet When the message or the associated packet, the corresponding identification information is transmitted to the end of each transmission path, the message is sent to the subscriber corresponding to the end of the transmission path.
  • the method further includes: If the actual topic matching the semantic parsing result is not found, a new actual topic is created, and a routing rule between the virtual theme corresponding to the publisher and the newly created actual topic is generated and stored.
  • searching for a virtual topic corresponding to the publisher according to a routing rule between the currently stored virtual topic and the actual topic, and using any one of the subscribers Before the corresponding virtual topic is the transmission path of the destination it also includes:
  • the obtained message is not a control message, perform a routing rule according to the currently stored virtual topic and the actual topic, and find a virtual topic corresponding to the publisher as a starting point, and the virtual corresponding to any one of the subscribers The step of the transmission path with the subject end point;
  • the obtained message is a control message
  • modify a routing rule between the stored virtual topic and the actual topic according to the control message and store a routing rule between the modified virtual topic and the actual topic.
  • a fifth possible implementation before the identifier information of the message is transmitted according to all the discovered transmission paths , Also includes:
  • the subscriber corresponding to the end of the transmission path sent by the publisher to the end of the transmission path includes:
  • the present invention provides a method for message publishing, including:
  • the obtained message is sent to all the found subscribers.
  • the method further includes:
  • the present invention provides a method for message subscription, including:
  • the actual topic of the destination is an actual topic currently subscribed by the subscriber; wherein the virtual topic is used for message forwarding between the actual topic and the publisher or between the actual topic and the subscriber Message forwarding; the destination actual topic is used for message forwarding between virtual topics corresponding to subscribers.
  • the generating, according to the obtained message, the routing rule between the virtual topic corresponding to the subscriber and the actual topic of the destination includes: when the obtained message is When the message is controlled, the target actual topic is obtained according to the control message, and the control message is used to update a routing rule between the virtual topic and the actual topic selected by the subscriber;
  • the virtual topic corresponding to the subscriber is created and the searched result is compared with the semantic parsing result.
  • the routing rules between the actual topics are
  • the method further includes:
  • the present invention provides a method for message subscription, including:
  • the method further includes:
  • the present invention provides a message publishing apparatus, including: The information of the problem; searching for a transmission path starting from the virtual topic corresponding to the publisher and ending with a virtual theme corresponding to any one of the subscribers; wherein the virtual topic is used for the message between the actual topic and the publisher Forwarding or message forwarding between the actual subject and the subscriber; the actual subject is used for message forwarding between the publisher and the subscriber;
  • a transmission module configured to: when the theme module finds a transmission path starting from a virtual theme corresponding to the publisher and ending with a virtual theme corresponding to the subscriber, transmitting the a message or identifier information corresponding to the message; when the message or the identification packet and the corresponding identification information are transmitted to an end point of each transmission path, the packet is sent to the transmission path The subscriber to the destination.
  • the method further includes: a semantic recognition module, configured to: when the theme module does not find a virtual topic corresponding to the publisher as a starting point, and subscribe When the corresponding virtual topic is the transmission path of the destination, the message is semantically parsed to obtain a semantic analysis result, and according to the semantic analysis result, the actual content matching the semantic analysis result is searched for in the stored actual topic.
  • a semantic recognition module configured to: when the theme module does not find a virtual topic corresponding to the publisher as a starting point, and subscribe When the corresponding virtual topic is the transmission path of the destination, the message is semantically parsed to obtain a semantic analysis result, and according to the semantic analysis result, the actual content matching the semantic analysis result is searched for in the stored actual topic.
  • the routing rule generating module is configured to: if the semantic identifier is found, the 'J module finds the semantics
  • the theme module is configured to generate a routing rule between a virtual theme and an actual topic that is stored by the module according to the current routing rule. And searching for a transmission path starting from a virtual theme corresponding to the publisher, and ending with a virtual theme corresponding to any one of the subscribers;
  • the transmission module is further configured to: when the theme module finds a transmission path starting from a virtual theme corresponding to the publisher and ending with a virtual theme corresponding to the subscriber, on the found transmission path, Transmitting the message or the identification information corresponding to the message; when the message or the identification information corresponding to the message is transmitted to an end point of each transmission path, sending the message to an end point of the transmission path Subscriber.
  • the theme module is further configured to: when an actual topic that matches the semantic parsing result is not found, New practical theme;
  • the routing rule generating module is further configured to store a routing rule between the virtual topic corresponding to the publisher and the newly created actual topic.
  • the information processing module is further configured to determine whether the obtained message is a control message, where the control message is used to update the stored virtual topic and the actual topic. Routing rules;
  • the theme module is configured to determine, in the information processing module, that the acquired message is not a control a transmission path starting from a virtual theme corresponding to the publisher and ending with a virtual theme corresponding to any one of the subscribers;
  • the routing rule generating module is further configured to: if the information processing module determines that the obtained message is a control message, modify a routing rule between the stored virtual topic and the actual topic according to the control message; Stores routing rules between the modified virtual topic and the actual topic.
  • the information processing module is further configured to generate identifier information corresponding to the message
  • the transmission module is further configured to: when the identifier information corresponding to the message is transmitted to an end point of each transmission path, acquire a message corresponding to the identifier information, and send a message corresponding to the identifier information The subscriber to the end of the transmission path.
  • the present invention provides a message publishing apparatus, including:
  • An obtaining module configured to obtain a message that the publisher has sent
  • a semantic recognition module configured to perform semantic analysis on the obtained message, and search for an actual theme matching the semantic analysis result in the stored actual theme according to the semantic analysis result; the theme module is used to find and When the semantic analysis results match the actual topic, in the stored subscription correspondence, the subscriber corresponding to the actual topic is searched;
  • a transmission module configured to: when the subscriber corresponding to the actual topic is found, the obtaining The incoming message is sent to all found subscribers.
  • the theme module is further configured to: create a new actual theme when the actual topic matching the semantic parsing result is not found, and store the newly created actual theme.
  • the present invention provides a device for message subscription, including:
  • An obtaining module configured to obtain a message that the subscriber has sent to the virtual theme corresponding to the subscriber
  • a creating module configured to create, according to the obtained message, a routing rule between the virtual topic corresponding to the subscriber and the actual topic of the destination, where the actual topic is the actual topic currently subscribed by the subscriber;
  • the virtual topic is used for message forwarding between the actual topic and the publisher or message forwarding between the actual topic and the subscriber;
  • the objective actual topic is used for message forwarding between the virtual topics corresponding to the subscriber.
  • the creating module includes: a first topic sub-module, configured to acquire, according to the control message, an actual topic of the target, when the obtained message is a control message
  • the control message is used to update a routing rule between the virtual topic and the actual topic selected by the subscriber; and to update the virtual topic corresponding to the subscriber and the actual topic of the destination obtained according to the control message Routing rules between.
  • the creating module includes: a semantic recognition sub-module, configured to perform semantic analysis on the obtained message when the obtained message is not a control message, and search for the semantic analysis result in the stored actual topic according to the semantic analysis result Actual subject matter;
  • a second topic sub-module configured to: when the actual topic matching the semantic parsing result is found in the stored actual topic, use the found actual topic as the target actual topic, and create a virtual corresponding to the subscriber A routing rule between the topic and the found actual topic that matches the semantic resolution result.
  • the second topic sub-module is further configured to not match the semantic parsing result in the stored actual topic
  • a new actual topic is created, and a routing rule between the virtual topic corresponding to the subscriber and the actual topic of the destination is created.
  • the present invention provides an apparatus for message subscription, including:
  • An obtaining module configured to obtain a message that the subscriber has sent
  • a semantic recognition module configured to perform semantic analysis on the obtained message, and search for an actual topic matching the semantic analysis result in the stored actual theme according to the semantic analysis result;
  • a theme module configured to: when the actual topic matching the semantic parsing result is found in the stored actual theme, create a subscription correspondence between the found actual topic and the subscriber.
  • the theme module is further configured to create a new actual topic when an actual topic matching the semantic parsing result is not found in the stored actual topic, And create a subscription relationship between the newly created actual topic and the subscriber.
  • the information is still guaranteed to be transmitted correctly.
  • the publisher and the subscriber must know the result of the change and actively modify the routing rule to complete the data transmission.
  • the technical solution information transmission is more efficient and more flexible.
  • FIG. 1 is a block diagram of a message middleware according to an embodiment of the present invention
  • FIG. 2 is a block diagram of another message middleware according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for message issuance according to an embodiment of the present invention
  • FIG. 4 is a flowchart of another method for message issuance according to an embodiment of the present invention
  • FIG. FIG. 1 is a block diagram of a message middleware according to an embodiment of the present invention
  • FIG. 2 is a block diagram of another message middleware according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for message issuance according to an embodiment of the present invention
  • FIG. 4 is a flowchart of another method for message issuance according to an embodiment of the present invention
  • FIG. 6 is a flowchart of a method for message distribution according to an embodiment of the present invention
  • FIG. 7 is a flowchart of a method for message subscription according to an embodiment of the present invention
  • FIG. 9 is a flowchart of a method for message subscription according to an embodiment of the present invention
  • FIG. 10 is a flowchart of a method for message issuance according to an embodiment of the present invention
  • FIG. 1 is a flowchart of another method for message distribution according to an embodiment of the present invention
  • FIG. 1 is a flowchart of another method for message subscription according to an embodiment of the present invention
  • FIG. 1 is a block diagram of a device for message issuance according to an embodiment of the present invention
  • FIG. 15 is a group of another device for message issuance according to an embodiment of the present invention
  • FIG. 16 is a block diagram of another apparatus for message publishing according to an embodiment of the present invention
  • FIG. 1 is a block diagram of another apparatus for message subscription according to an embodiment of the present invention
  • FIG. 19 is a block diagram of a device for subscribing to another message according to an embodiment of the present invention
  • FIG. 20 is another block diagram of an apparatus according to an embodiment of the present invention
  • a block diagram of a component of a message subscription
  • FIG. 21 is a block diagram of another message middleware according to an embodiment of the present invention
  • FIG. 22 is a structural block diagram of another message middleware according to an embodiment of the present invention.
  • a method for constructing a message and a subscription for providing a message according to an embodiment of the present invention which is generally operable to operate on an operating system and an application software, and a composition structure diagram of the message middleware (me ssa ge br er r ) provided by the embodiment of the present invention.
  • FIG. 1 is a structural diagram of an implementation manner of a message middleware according to an embodiment of the present invention.
  • each publisher and subscriber corresponding to the message middleware are respectively provided with a virtual theme.
  • the virtual topic acts as a mapping device for the publisher or subscriber in the message middleware, and has the function of finding the actual topic of the next hop and forwarding the message.
  • the virtual topic is used for message forwarding between an actual topic and a publisher or message forwarding between an actual topic and a subscriber.
  • An information processing module is disposed between the virtual theme and the publisher and between the virtual theme and the subscriber, and the information processing module is mainly used to send the publisher or subscriber to the middle of the message.
  • the message of the piece is identified, and the identification information corresponding to the message sent to the message middleware by the publisher or subscriber is generated.
  • the information processing module is further connected with a routing rule generation module and a storage adaptation module.
  • the routing rule generation module is configured to generate a routing rule between the virtual topic and the actual topic
  • the storage adaptation module is configured to store a message sent by the publisher or subscriber to the message middleware.
  • Both the routing rule generation module and the storage adaptation module are connected to a routing module, and the routing module is used to store routing rules between the virtual topic and the actual topic.
  • the actual middleware is also set in the message middleware, and the actual theme establishes a logical connection relationship with a plurality of virtual topics according to a routing rule between the virtual theme and the actual theme, and has a lookup next hop actual topic or next hop virtual topic and forwarding The function of the message.
  • the actual topic is used for message forwarding between the virtual theme corresponding to the publisher and the virtual topic corresponding to the subscriber.
  • the actual topic is also connected to the routing module.
  • the actual subject structure may use a tree structure that is commonly used in the prior art, and other structures may be used. The embodiment of the present invention does not limit this.
  • the message middleware is further provided with a semantic recognition module consisting of a semantic parsing module and a semantic matching module, and the semantic recognition module is connected to the virtual topic, the routing rule generating module and the storage adapter.
  • FIG. 2 is a structural diagram of another implementation manner of a message middleware according to an embodiment of the present invention.
  • the message middleware only has an actual theme, a semantic recognition module composed of a semantic parsing module and a semantic matching module, and storage. adapter.
  • the actual theme and message middleware The external subscribers are connected to the semantic recognition module, and the semantic recognition module can be connected to the actual topic, the subscriber outside the message middleware, the publisher outside the message middleware, and the storage adapter.
  • the functions of each module are basically the same as those of the module shown in Figure 1.
  • the embodiment of the present invention provides a method for message subscription. As shown in FIG. 3, the method includes: User terminal equipment.
  • the virtual theme corresponding to the publisher is the starting point, and the transmission path ending in the virtual theme corresponding to any one of the subscribers.
  • the message transmission relationship between the question and the actual topic can be set in advance by the publisher, subscriber or network administrator, or updated in real time while the message middleware is working.
  • the generation of the identifier information may be the unique identifier information allocated by the message middleware for the message sent by the publisher, and the specific allocation method may use the sequential arrangement label and the hash calculation label. And many other methods.
  • the message sent by the publisher is generally required to be stored in a separate storage device, for example, the storage adapter provided by the embodiment of the present invention.
  • the identification information is mainly used to enable the virtual topic corresponding to the subscriber to acquire the cancellation, the package, and the
  • the message or the identification information corresponding to the message is transmitted to the end of each transmission path, the message is sent to the subscriber corresponding to the end point of the transmission path.
  • An embodiment of the present invention provides a method for publishing a message, in which a publisher can send a message to a virtual topic corresponding to itself in a message middleware according to its own needs, and the transmission path can be eliminated, and the publisher can The sent message is sent to the corresponding subscriber, so that when the actual theme changes, only the routing rule between the stored virtual theme and the actual topic needs to be modified by the internal of the message middleware, and the publisher can still The virtual topic corresponding to itself in the message middleware continues to send messages without making any changes.
  • the publisher when the actual theme changes, the publisher must change the transmission path to transmit the message correctly, the message transmission efficiency is higher, and the transmission path is more flexible.
  • the embodiment of the present invention further provides another method for message issuance. As shown in FIG. 4, after performing step 1 02, the method includes:
  • the transmission path starting from the virtual topic corresponding to the publisher and ending with the virtual topic corresponding to the subscriber is not found, the message is semantically parsed, and according to the semantic analysis result, The stored actual topic lookup matches the semantic resolution result The actual theme. If the actual topic matching the semantic parsing result is found, the step is performed
  • each actual topic generally corresponds to a corresponding string, label, etc., which can be used for text or semantics.
  • the matching topic identifier after semantically parsing the message sent by the publisher, parses the message into a series of keywords. These keywords can be used to perform fuzzy matching with the topic identifiers corresponding to all actual topics, such as string matching, etc., to determine the most likely transmission direction or path of the message.
  • the message does not need to be transmitted.
  • the reason is: If there is no actual topic corresponding to the message sent by the publisher in the stored actual topic, it means that no subscriber has subscribed to this at this time. theme.
  • the method for message issuance when the corresponding transmission path cannot be found, semantically identifies the message sent by the publisher to match the actual topic closest to the message, thereby establishing a completely new data transmission. Path to ensure that messages are published correctly and accurately. Further allowing the publisher to send messages exactly as needed. Message middleware is able to get the message to be transmitted correctly.
  • an embodiment of the present invention provides a control message for the publisher to modify and delete the original routing rule stored in the message middleware or add a new route. rule.
  • the control messages may include: Forwa rd forwarding finger, Copy copy finger, Sub s cr ipti on i Ding finger, Proxy « finger.
  • the Forwa rd directive is used to control the complete migration of routing rules from one topic to another within the same message middleware, and the original topic no longer gets any messages.
  • the Copy command is used to guarantee that in addition to the original In addition to getting the message, the subject of the message will also be used as the source of the message to establish routing rules with other topics specified by the directive.
  • the Subscription instruction is used to establish a routing rule between the actual topic and the virtual topic corresponding to the subscriber.
  • the Proxy directive is used to completely migrate routing rules from one topic to another in a different message middleware, and the original topic no longer gets any messages.
  • the method further includes:
  • step 111 Determine whether the obtained message is a control message. If it is determined that the obtained message is not a control message, step 102 is performed. Otherwise, go to step 112. Modified by rules.
  • the control message includes at least the foregoing Forward Forwarding Command, Copy Copying, Subscription, Proxy, and Proxy.
  • the message publishing method further provided by the embodiment of the present invention can provide a dynamic control function for the message middleware for the subscriber, further ensuring accurate transmission of the message.
  • the message middleware may not transmit the specific message sent by the publisher, but generate an identification information for each specific message, and transmit the identification information.
  • the message middleware may not transmit the specific message sent by the publisher, but generate an identification information for each specific message, and transmit the identification information.
  • S102 Generate identification information corresponding to the message.
  • the virtual theme corresponding to the publisher is the starting point, and the transmission path ending in the virtual theme corresponding to any one of the subscribers.
  • the embodiment of the present invention provides a corresponding message subscription method, as shown in FIG. 7 , including:
  • the message sent by the subscriber includes a control message and a fuzzy message.
  • a control message is a message sent to a message middleware when the subscriber knows exactly which subject or topics they want to subscribe to, while a fuzzy message is sent when the subscriber does not know which subject or topics the content he wants to subscribe to belongs to. A piece of text and other news.
  • step 202 is different for the message type step acquired by 201, and specifically includes the following two types:
  • the implementation method 1 includes:
  • A202 When the obtained message is a control message, obtain the actual topic of the destination according to the control message.
  • the control message is different from the control message described in step 1 1 1 .
  • a 2022 Create a routing rule between the virtual theme corresponding to the subscriber and the actual topic of the destination obtained according to the control message.
  • step B202 When the obtained message is not a control message, semantically parse the obtained message, and according to the semantic parsing result, find an actual topic that matches the semantic parsing result in the stored actual topic. If an actual topic matching the semantic analysis result is found in the stored actual topic, step B2022 is performed. Otherwise, go to step B2023.
  • B2022 Create a routing rule between the virtual topic corresponding to the subscriber and the found actual topic matching the semantic resolution result.
  • the subscriber only needs to establish a routing rule between the virtual topic corresponding to the subscriber and the actual topic of the destination, and only needs the middle of the message when the subsequent actual theme changes.
  • the routing rules can be changed, and the subscriber can continue to receive messages from the corresponding virtual topic without making any changes.
  • the subscriber when the actual theme changes, the subscriber must change the transmission path in order to receive the correct one. The message transmission efficiency is higher and the transmission path is more flexible than the technical solution. .
  • subscribers can subscribe by controlling messages or obscuring messages according to their needs, which increases the flexibility of subscribers.
  • the embodiment of the present invention provides a method for message publishing, as shown in FIG. 10, including:
  • step 156 For the matching method based on the semantic analysis result, refer to the related description of step 156.
  • Embodiments of the present invention provide a method for message distribution, which can be used in the Internet, in particular, in certain areas of the mobile Internet, where a publisher or a subscriber may not care about a specific topic or whether it exists.
  • the method can directly identify the topic that the publisher may want to publish based on the message sent by the publisher, so that the publisher can publish the message according to his own needs, thereby enhancing the efficiency and flexibility of message transmission.
  • the embodiment of the present invention provides a corresponding message subscription method, as shown in FIG. 12, including:
  • the embodiment of the invention provides a method for message subscription, which can be used in the Internet. Don't be in some areas of the mobile Internet, publishers or subscribers may not care about specific topics or whether they exist in the scene.
  • the method can directly identify the topic that the subscriber may want to subscribe to based on the semantics of the message sent by the subscriber, so that the subscriber can subscribe to the message according to his or her own needs. There is no need to know what the specific topic is, which in turn enhances the efficiency and flexibility of message transmission.
  • the device structure shown in Figure 2 contains practical topics, the purpose of which is to categorize various messages into the same topic.
  • Weibo, WeChat, etc. there is no explicit division of publishers and subscribers.
  • Each client can be the publisher and acquirer of the message, and the number of messages sent. It is very difficult to classify, so in this scenario, there is no need to integrate the messages, that is, the device structure shown in Figure 2 can set a matching module to replace the original actual theme, and the client will be sent to the message.
  • the different messages in the middleware are semantically matched, and the messages of multiple client ends that are successfully matched can be transmitted to each other.
  • the present invention provides a message publishing apparatus, which can be used to implement a method flow of message publishing as shown in FIG. 3 to FIG. 6.
  • the method includes: a message of a subject.
  • the search starts with the virtual theme corresponding to the publisher, and is paired with any subscriber.
  • the virtual theme should be the transmission path of the destination; wherein the virtual topic is used for message forwarding between the actual topic and the publisher or message forwarding between the actual topic and the subscriber; the actual topic is used for the publisher and the subscription Message forwarding between people.
  • the transmission module 53 is configured to: when the theme module 52 finds a transmission path starting from a virtual theme corresponding to the publisher and ending with a virtual theme corresponding to the subscriber, transmitting on the found transmission path And the identifier information corresponding to the message; when the message or the identifier information corresponding to the message is transmitted to an end point of each transmission path, sending the message to an end point of the transmission path subscriber.
  • the identifier information is used to enable the virtual topic corresponding to the subscriber to acquire the message according to the identifier information.
  • the device further includes:
  • the semantic recognition module 54 is configured to: when the theme module 52 does not find the virtual topic corresponding to the publisher as the starting point, and the transmission path corresponding to the virtual topic of the subscriber ends, the semantics of the message is performed. Parsing, obtaining a semantic parsing result, and searching for an actual topic matching the semantic parsing result in the stored actual subject according to the semantic parsing result.
  • the routing rule generating module 55 is configured to: if the semantic identification module 54 finds a routing rule between the actual topic found by the language.
  • the theme module 52 is configured to generate a module according to the current routing rule.
  • the transmission module 53 is further configured to: when the theme module 52 finds a transmission path starting from a virtual theme corresponding to the publisher and ending with a virtual theme corresponding to the subscriber, the found transmission path Transmitting the message or the identification information corresponding to the message; when the message or the identification information corresponding to the message is transmitted to the end of each transmission path, sending the message to the end of the transmission path The corresponding subscriber.
  • the theme module 52 is further configured to create a new actual topic when the actual topic matching the semantic parsing result is not found.
  • the routing rule generating module 55 is further configured to store a routing rule between the virtual topic corresponding to the publisher and the newly created actual topic.
  • the information processing module 51 is further configured to determine whether the obtained message is a control message, where the control message is used to update a routing rule between the stored virtual topic and the actual topic.
  • the theme module 52 is configured to: after the information processing module 51 determines the acquired message, search for a virtual topic that is corresponding to the publisher and start with a virtual theme corresponding to any subscriber. path.
  • the routing rule generating module 55 is further configured to determine, obtain, by the information processing module 52.
  • the message is a control message, and the routing rule between the stored virtual topic and the actual topic is modified according to the control message; and the routing rule between the modified virtual topic and the actual topic is stored.
  • the information processing module 51 is further configured to generate identifier information corresponding to the message.
  • the transmission module 53 is further configured to: when the identifier information corresponding to the message is transmitted to an end point of each transmission path, acquire a message corresponding to the identifier information, and send a message corresponding to the identifier information Send to the subscriber corresponding to the end of the transmission path.
  • An apparatus for message issuance may be used to implement a method for releasing a message as shown in FIG. 9-10. As shown in FIG. 15, the method includes:
  • the obtaining module 61 is configured to obtain a message that the publisher has sent.
  • the semantic recognition module 62 is configured to perform semantic parsing on the obtained message, and search for an actual topic matching the semantic parsing result in the stored actual subject according to the semantic parsing result.
  • the topic module 63 is configured to: when the actual topic matching the semantic parsing result is found, find a subscriber corresponding to the actual topic in the stored subscription correspondence.
  • the transmitting module 64 is configured to send the obtained message to all the found subscribers when the subscriber corresponding to the actual topic is found.
  • the theme module 63 is further configured to: When the actual topic is matched, a new actual theme is created and the newly created actual theme is stored.
  • An embodiment of the present invention provides a message subscription device, which can be used to implement a method for message subscription as shown in FIG. 6-8. As shown in FIG. 16, the method includes:
  • the obtaining module 71 is configured to obtain a message that the subscriber has sent to the virtual topic corresponding to the subscriber.
  • a creating module 72 configured to create, according to the obtained message, a routing rule between the virtual topic corresponding to the subscriber and the actual topic of the destination, where the actual topic is the actual topic currently subscribed by the subscriber;
  • the virtual topic is used for message forwarding between the actual topic and the publisher or message forwarding between the actual topic and the subscriber;
  • the destination actual topic is used for message forwarding between the virtual topics corresponding to the subscriber.
  • the creating module 72 includes:
  • a first topic sub-module 721 configured to: when the obtained message is a control message, acquire the target actual topic according to the control message, where the control message is used to update a virtual topic and an actual topic selected by the subscriber a routing rule between; and a routing rule for updating a virtual topic corresponding to the subscriber and an actual topic of the destination obtained according to the control message.
  • the creating module 72 includes:
  • the semantic recognition sub-module 722 is configured to: when the obtained message is not a control message, perform semantic analysis on the obtained message, and search for the semantic analysis result in the stored actual topic according to the semantic analysis result. Match the actual topic.
  • the second topic sub-module 723 is configured to: when the actual topic matching the semantic parsing result is found in the stored actual topic, use the found actual topic as the target actual topic, and create the subscriber corresponding to the A routing rule between the virtual topic and the found actual topic that matches the semantic resolution result.
  • the second topic sub-module 723 is further configured to: when an actual topic that matches the semantic parsing result is not found in the stored actual topic, create a new actual topic, and create the The routing rule between the virtual topic corresponding to the subscriber and the actual topic of the destination.
  • the embodiment of the present invention further provides a device for message subscription, which can be used to implement the method for message subscription as shown in FIG. 11-12. As shown in FIG. 19, the method includes:
  • the obtaining module 81 is configured to obtain a message that the subscriber has sent.
  • the semantic recognition module 82 is configured to perform semantic parsing on the obtained message, and search for the actual topic that matches the semantic parsing result in the stored actual topic according to the semantic parsing result.
  • the topic module 83 is configured to create a subscription correspondence between the found actual topic and the subscriber when the actual topic matching the semantic parsing result is found in the stored actual topic.
  • the theme module 83 is further configured to: when an actual theme that matches the semantic parsing result is not found in the stored actual theme, create a new actual theme, and create a newly created actual theme and The subscriber's subscription correspondence.
  • the device for publishing and subscribing a message provided by the embodiment of the present invention ensures the release by setting a corresponding virtual theme for the publisher and the subscriber in the message middleware, or by semantically identifying the publisher and the subscriber to the message middleware. In the case where the subscriber and the subscriber do not need to know the specific structure of the actual subject, the message is still guaranteed to be transmitted correctly.
  • the publisher and the subscriber must know the result of the change and actively modify the routing rule to complete the data transmission.
  • the technical solution message transmission is more efficient and more flexible.
  • the embodiment of the present invention provides a message middleware, as shown in FIG. 20, including at least one processor 91, a memory 92, and an input/output circuit 93.
  • the memory 92 is configured with a program code
  • the processor 91 is configured to call program code in the memory 92 to implement a method flow of message publishing and subscription as shown in FIG. 3 to FIG.
  • the memory 92 and the processor 91 communicate via a bus.
  • the input/output circuit 93 is configured to acquire a message that the publisher has sent to the virtual topic corresponding to the publisher; and when the virtual topic corresponding to the publisher is found as a starting point, and the subscriber corresponds to When the virtual topic is the transmission path of the destination, the message or the identification information corresponding to the message is transmitted on the found transmission path; and when the message or the identification information corresponding to the message is transmitted to each transmission At the end of the path, the message is sent to the subscriber corresponding to the end of the transmission path.
  • the identifier information is used to enable the virtual topic corresponding to the subscriber to acquire the message according to the identifier information.
  • the processor 91 is further configured to perform semantic analysis on the message when the transmission path corresponding to the virtual topic corresponding to the publisher is found and the virtual topic corresponding to the subscriber is the end point is obtained. Semantically parsing the result, and searching for the actual topic matching the semantic parsing result in the stored actual topic according to the semantic parsing result; if the routing rule between the actual topic found by the language is found.
  • the processor 91 is further configured to search for a virtual topic corresponding to the publisher according to a routing rule between the currently stored virtual topic and the actual topic, and end with a virtual theme corresponding to any one subscriber.
  • the transmission path is further configured to search for a virtual topic corresponding to the publisher according to a routing rule between the currently stored virtual topic and the actual topic, and end with a virtual theme corresponding to any one subscriber.
  • the input/output circuit 93 is further configured to: when finding a transmission path starting from a virtual theme corresponding to the publisher and ending with a virtual theme corresponding to the subscriber, on the found transmission path, the transmission station The message or the identification information corresponding to the message; when the message or the identification, the corresponding identification information is transmitted to the end of each transmission path, the cancellation, the packet, Send to the subscriber corresponding to the end of the transmission path.
  • the processor 91 is further configured to: if the actual topic matching the semantic parsing result is not found, create a new actual topic, and generate and store the virtual theme corresponding to the publisher and the newly created actual topic. Routing rules between.
  • the processor 91 is further configured to determine whether the obtained message is a control message, and if the control message is not a control message, perform a routing rule according to a currently stored virtual topic and an actual topic, and search a step of the virtual topic corresponding to the publisher as a starting point, and a transmission path ending in any one of the subscribers; if it is determined that the obtained message is a control message, the pair is stored according to the control message
  • the routing rules between the virtual theme and the actual theme are modified.
  • the memory 92 is further configured to store a routing rule between the modified virtual theme and the actual theme.
  • the processor 91 is further configured to: generate identifier information corresponding to the message; transmit, according to all the discovered transmission paths, identifier information corresponding to the message; when the identifier information corresponding to the message is transmitted to At the end of each transmission path, a message corresponding to the identification information is acquired, and a message corresponding to the identification information is sent to a subscriber corresponding to an end point of the transmission path.
  • the input/output circuit 93 is further configured to acquire a corresponding one that the subscriber has sent to the subscriber. A virtual topic message.
  • the processor 91 is further configured to create, according to the obtained message, a routing rule between the virtual topic corresponding to the subscriber and the actual topic of the destination, where the actual topic is the actual topic currently subscribed by the subscriber
  • the virtual topic is used for message forwarding between the actual topic and the publisher or message forwarding between the actual topic and the subscriber; the destination actual topic is used for message forwarding between the virtual topics corresponding to the subscriber.
  • the processor 91 is further configured to: when the obtained message is a control message, acquire a target actual topic according to the control message, where the control message is used to update between the virtual topic and the actual topic selected by the subscriber a routing rule; creating a routing rule between the virtual topic corresponding to the subscriber and the actual topic of the destination obtained according to the control message.
  • the processor 91 is further configured to perform semantic analysis on the obtained message when the obtained message is not a control message, and search and perform the semantic analysis in the stored actual topic according to the semantic analysis result.
  • the actual topic that matches the result; if the actual topic matching the semantic parsing result is found in the stored actual topic, the virtual topic corresponding to the subscriber is created and the actual found match with the semantic parsing result is created. Routing rules between topics.
  • the processor 91 is further configured to: if an actual topic matching the semantic parsing result is not found in the stored actual theme, create a new actual topic, and create a virtual theme and a corresponding to the subscriber A routing rule between new actual topics.
  • the embodiment of the present invention further provides a message middleware, as shown in FIG. 21, including at least one Processor 1 001, memory 1 002, input and output circuit 1 003.
  • the memory 1 002 is configured with program code, and the processor 1 001 is used to call the program code in the memory 1 002 to implement the method flow of message publishing and subscription as shown in FIG. 9 to FIG.
  • the memory 1 002 and the processor 1 001 communicate via a bus.
  • the processor 1 001 is configured to obtain a message that has been sent by a publisher, perform semantic analysis on the obtained message, and search for an actual topic that matches the semantic parsing result in the stored actual topic according to the semantic parsing result; If the actual topic matching the semantic parsing result is found, in the stored subscription correspondence, the subscriber corresponding to the actual topic is searched; if the subscriber corresponding to the actual topic is found, the The obtained message is sent to all found subscribers.
  • the processor 1 001 is further configured to create a new actual topic if the actual topic matching the semantic parsing result is not found, and store the newly created actual topic.
  • the processor 1 001 is further configured to obtain a message that the subscriber has sent; perform semantic analysis on the obtained message, and search for the actual matching result of the semantic parsing result in the stored actual topic according to the semantic parsing result. a topic; if an actual topic matching the semantic parsing result is found in the stored actual topic, a subscription corresponding relationship between the found actual topic and the subscriber is created.
  • the processor 1 001 is further configured to: if an actual topic that matches the semantic parsing result is not found in the stored actual topic, create a new actual topic, and create a newly created actual The topic corresponds to the subscription of the subscriber.
  • the present invention can be implemented by means of software plus necessary general hardware, and of course, by hardware, but in many cases, the former is a better implementation. .
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer.
  • a hard disk or optical disk or the like includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明提供了一种消息发布与订阅的方法及装置,涉及信息处理领域,主要通过为发布者以及订阅者在消息中间件中设置相应的虚拟主题,或者通过对发布者以及订阅者向消息中间件进行语义识别,用以提供更高的信息传输效率,和更强的灵活性。

Description

消息发布与订阅的方法及装置 技术领域
本发明涉及信息处理领域, 尤其涉及一种信息传输的方法及装置。 背景技术
消息中间件利用高效可靠的消息传递机制进行与平台无关的数据交 流, 通过提供消息传递和消息排队模型, 它可以在分布式环境下扩展进程 间的通信。 在消息中间件的消息传输模式中, 发布 /订阅模式是最常用的传输机 制。 发布者和订阅者之间通过主题交换信息: 发布者把消息发布到相关主 题, 订阅者在该主题上注册并接收该主题上的信息, 通过这种方式主题把 发布者和订阅者连接起来。 传统的发布 /订阅系统的消息路由方式是一种基于内容和地址相结合 的路由方式, 在这种路由体系下, 首先根据主题内容, 并结合预先收集的 订阅者, 来确定关于同一个主题的消息有或者没有哪些感兴趣的订阅者, 以及这些订阅者的目的地服务器和接收队列, 然后, 再通过静态路由体系 确定该消息将被分发至哪些本地接收队列和下一个路由节点。所以在这种 路由体系下, 发布者与订阅者之间传输的消息必须携带一个主题。 然而, 主题的改变, 例如主题的名称或者类别的改变, 都会影响消息 路由的目的地,而发布者或订阅者必须知道这些改变才能发布或订阅到正 确的主题上。 在大规模应用的场景下, 特别是在互联网环境的情况下, 这 种改变会引发发布者或订阅者大的改变和不必要的网络开销。
发明内容
本发明的实施例提供一种消息发布与订阅的方法及装置,以提供更高 的信息传输效率, 和更强的灵活性。 为达到上述目的, 本发明的实施例釆用如下技术方案: 第一方面, 本发明提供了一种消息发布的方法, 包括:
者对应的虚拟主题为起点,并且以任意一个订阅者对应的虚拟主题为终点 的传输路径; 其中, 所述虚拟主题用于实际主题和发布者之间的消息转发 或者实际主题和订阅者之间的消息转发;所述实际主题用于发布者和订阅 者之间的消息转发; 当查找到以所述发布者对应的虚拟主题为起点,并且以订阅者对应的 虚拟主题为终点的传输路径时, 在查找到的传输路径上, 传输所述消息或 与所述消息对应的标识信息; 当所述消息或与所述消,包、对应的标识信息传输至每一条传输路径的 终点时, 将所述消息发送至该传输路径的终点所对应的订阅者。 结合第一方面, 在第一方面的第一种可能实现方式中, 还包括: 当未查找到以所述发布者对应的虚拟主题为起点,并且以订阅者对应 的虚拟主题为终点的传输路径时, 则对所述消息进行语义解析, 得到语义 解析结果, 并根据所述语义解析结果, 在已存储的实际主题中查找与所述 语义解析结果匹配的实际主题;
若查找到与所述语义解析结果匹配的实际主题,则生成并存储所述发 布者对应的虚拟主题与查找到的实际主题之间的路由规则。
结合第一方面的第一种可能的实现方式, 在第二种可能的实现方式 间的路由规则之后, 还包括: 发布者对应的虚拟主题为起点,并且以任意一个订阅者对应的虚拟主题为 终点的传输路径;
当查找到以所述发布者对应的虚拟主题为起点,并且以订阅者对应的 虚拟主题为终点的传输路径时, 在查找到的传输路径上, 传输所述消息或 与所述消息对应的标识信息;
当所述消息或与所述消,包、对应的标识信息传输至每一条传输路径的 终点时, 将所述消息发送至该传输路径的终点所对应的订阅者。
结合第一方面的第一种或第二种可能实现方式,在第三种可能实现方 式中, 还包括: 若未查找到与所述语义解析结果匹配的实际主题,则创建新的实际主 题,并生成并存储所述发布者对应的虚拟主题与新创建的实际主题之间的 路由规则。
结合第一方面, 在第四种可能实现方式中, 在根据当前已存储的虚拟 主题与实际主题之间的路由规则,查找以所述发布者对应的虚拟主题为起 点, 并且以任意一个订阅者对应的虚拟主题为终点的传输路径之前, 还包 括:
判断获取的所述消息是否为控制消息,所述控制消息用于更新已存储 的虚拟主题与实际主题之间的路由规则;
若获取的所述消息不是控制消息,则执行根据当前已存储的虚拟主题 与实际主题之间的路由规则, 查找以所述发布者对应的虚拟主题为起点, 并且以任意一个订阅者对应的虚拟主题为终点的传输路径的步骤;
若确定获取的所述消息是控制消息, 则根据所述控制消息, 对已存储 的虚拟主题与实际主题之间的路由规则进行修改;存储修改后的虚拟主题 与实际主题之间的路由规则。
结合第一方面或第一方面的前四种可能实现方式中的任意一种,在第 五种可能的实现方式中, 在所述根据查找到的所有传输路径, 传输所述消 息的标识信息之前, 还包括:
生成与所述消息对应的标识信息; 则当所述消息的标识信息传输至每一条传输路径的终点时,将该发布 者发送的消息发送至传输路径的终点所对应的订阅者包括:
当所述消,包、的标识信息传输至每一条传输路径的终点时,获取与所述 标识信息对应的消息,并将与所述标识信息对应的消息发送至传输路径的 终点所对应的订阅者。
第二方面, 本发明提供了一种消息发布的方法, 包括:
获取发布者已发送的消息;
对获取到的消息进行语义解析, 并根据语义解析结果, 在已存储的实 际主题中查找与所述语义解析结果匹配的实际主题;
若查找到与所述语义解析结果匹配的实际主题,则在已存储的订阅对 应关系中, 查找与所述实际主题对应的订阅者;
若查找到所述实际主题对应的订阅者,则将所述获取到的消息发送至 所有查找到的订阅者。
结合第二方面, 在第一种可能实现方式中, 还包括:
若未查找到与所述语义解析结果匹配的实际主题,则创建新的实际主 题,并存储新创建的实际主题。
第三方面, 本发明提供了一种消息订阅的方法, 包括:
获取订阅者已发送至所述订阅者对应的虚拟主题的消 , ;
根据获取的所述消息,创建所述订阅者对应的虚拟主题与目的实际主 题之间的路由规则, 所述目的实际主题为所述订阅者当前订阅的实际主 题; 其中, 所述虚拟主题用于实际主题和发布者之间的消息转发或者实际 主题和订阅者之间的消息转发;所述目的实际主题用于订阅者对应的虚拟 主题之间的消息转发。
结合第三方面,在第一种可能实现方式中,所述根据获取的所述消息, 创建所述订阅者对应的虚拟主题与目的实际主题之间的路由规则包括: 当获取的所述消息为控制消息时,根据所述控制消息获取目的实际主 题,所述控制消息用于更新虚拟主题与所述订阅者选择的实际主题之间的 路由规则;
创建所述订阅者对应的虚拟主题与根据所述控制消息获取到的目的 实际主题之间的路由规则。
结合第三方面的第一种可能的实现方式, 在第二种可能的实现方式 中, 所述根据获取的所述消息, 创建所述订阅者对应的虚拟主题与目的实 际主题之间的路由规则包括:
当获取的所述消息不为控制消息时, 对获取的所述消息进行语义解 析, 并根据语义解析结果, 在已存储的实际主题中查找与所述语义解析结 果匹配的实际主题;
若在已存储的实际主题中查找到与所述语义解析结果匹配的实际主 题,则创建所述订阅者对应的虚拟主题与查找到的与所述语义解析结果匹 配的实际主题之间的路由规则。
结合第三方面的第二种可能实现方式, 在第三种可能实现方式中, 还 包括:
若在已存储的实际主题中未查找到与所述语义解析结果匹配的实际 主题, 则创建新的实际主题, 并创建所述订阅者对应的虚拟主题与目的实 际主题之间的路由规则。
第四方面, 本发明提供了一种消息订阅的方法, 包括:
获取订阅者已发送至与所述订阅者对应的虚拟主题的消 , ; 对获取的所述消息进行语义解析, 并根据语义解析结果, 在已存储的 实际主题中查找与所述语义解析结果匹配的实际主题;
若在已存储的实际主题中查找到与所述语义解析结果匹配的实际主 题, 则创建查找到的实际主题与所述订阅者的订阅对应关系。
结合第四方面, 在第一种可能实现方式中, 还包括:
若在已存储的实际主题中未查找到与所述语义解析结果匹配的实际 主题, 则创建新的实际主题, 并创建新创建的实际主题与所述订阅者的订 阅对应关系。 第五方面, 本发明提供了一种消息发布的装置, 包括: 题的信息; 查找以所述发布者对应的虚拟主题为起点,并且以任意一个订阅者对应的 虚拟主题为终点的传输路径; 其中, 所述虚拟主题用于实际主题和发布者 之间的消息转发或者实际主题和订阅者之间的消息转发;所述实际主题用 于发布者和订阅者之间的消息转发;
传输模块,用于当所述主题模块查找到以所述发布者对应的虚拟主题 为起点, 并且以订阅者对应的虚拟主题为终点的传输路径时, 在查找到的 传输路径上, 传输所述消息或与所述消息对应的标识信息; 当所述消息或 与所述消,包、对应的标识信息传输至每一条传输路径的终点时,将所述消 ,包、 发送至该传输路径的终点所对应的订阅者。
结合第五方面, 在第五方面的第一种可能实现方式中, 还包括: 语义识别模块,用于当所述主题模块未查找到以所述发布者对应的虚 拟主题为起点, 并且以订阅者对应的虚拟主题为终点的传输路径时, 对所 述消息进行语义解析, 得到语义解析结果, 并根据所述语义解析结果, 在 已存储的实际主题中查找与所述语义解析结果匹配的实际主题;
所述路由规则生成模块,用于若所述语义识另 'J模块查找到与所述语义
找到的实际主题之间的路由规则。 结合第一方面的第一种可能的实现方式, 在第二种可能的实现方式, 所述主题模块,用于根据当前所述路由规则生成模块已存储的虚拟主题与 实际主题之间的路由规则, 查找以所述发布者对应的虚拟主题为起点, 并 且以任意一个订阅者对应的虚拟主题为终点的传输路径;
所述传输模块,还用于当所述主题模块查找到以所述发布者对应的虚 拟主题为起点, 并且以订阅者对应的虚拟主题为终点的传输路径时, 在查 找到的传输路径上, 传输所述消息或与所述消息对应的标识信息; 当所述 消息或与所述消息对应的标识信息传输至每一条传输路径的终点时,将所 述消息发送至该传输路径的终点所对应的订阅者。
结合第五方面的第一种或第二种可能实现方式,在第三种可能实现方 式中, 所述主题模块, 还用于在未查找到与所述语义解析结果匹配的实际 主题时, 创建新的实际主题;
所述路由规则生成模块,还用于存储所述发布者对应的虚拟主题与新 创建的实际主题之间的路由规则。
结合第五方面, 在第三种可能实现方式中, 所述信息处理模块, 还用 于判断获取的所述消息是否为控制消息,所述控制消息用于更新已存储的 虚拟主题与实际主题之间的路由规则;
所述主题模块,用于在所述信息处理模块确定获取的所述消息不是控 以所述发布者对应的虚拟主题为起点,并且以任意一个订阅者对应的虚拟 主题为终点的传输路径;
所述路由规则生成模块,还用于若所述信息处理模块确定获取的所述 消息是控制消息, 则根据所述控制消息, 对已存储的虚拟主题与实际主题 之间的路由规则进行修改;存储修改后的虚拟主题与实际主题之间的路由 规则。
结合第三方面或第三方面的前四种可能的实现方式中的任意一种,在 第五种可能的实现方式中,所述信息处理模块还用于生成与所述消息对应 的标识信息;
所述传输模块,还用于当所述与所述消息对应的标识信息传输至每一 条传输路径的终点时, 获取与所述标识信息对应的消息, 并将与所述标识 信息对应的消息发送至传输路径的终点所对应的订阅者。
第六方面, 本发明提供了一种消息发布的装置, 包括:
获取模块, 用于获取发布者已发送的消息;
语义识别模块, 用于对获取到的消息进行语义解析, 并根据语义解析 结果, 在已存储的实际主题中查找与所述语义解析结果匹配的实际主题; 主题模块, 用于在查找到与所述语义解析结果匹配的实际主题时, 在 已存储的订阅对应关系中, 查找与所述实际主题对应的订阅者;
传输模块, 用于在查找到所述实际主题对应的订阅者时, 将所述获取 到的消息发送至所有查找到的订阅者。
结合第六方面, 在第一种可能实现方式中, 所述主题模块, 还用于在 未查找到与所述语义解析结果匹配的实际主题时, 创建新的实际主题,并 存储新创建的实际主题。 第七方面, 本发明提供了一种消息订阅的装置, 包括:
获取模块,用于获取订阅者已发送至所述订阅者对应的虚拟主题的消 息;
创建模块, 用于根据获取的所述消息, 创建所述订阅者对应的虚拟主 题与目的实际主题之间的路由规则,所述目的实际主题为所述订阅者当前 订阅的实际主题; 其中, 所述虚拟主题用于实际主题和发布者之间的消息 转发或者实际主题和订阅者之间的消息转发;所述目的实际主题用于订阅 者对应的虚拟主题之间的消息转发。
结合第七方面, 在第一种可能实现方式中, 所述创建模块包括: 第一主题子模块, 用于当获取的所述消息为控制消息时, 根据所述控 制消息获取所述目的实际主题,所述控制消息用于更新虚拟主题与所述订 阅者选择的实际主题之间的路由规则;以及用于更新所述订阅者对应的虚 拟主题与根据所述控制消息获取到的目的实际主题之间的路由规则。
结合第七方面, 在第二种可能实现方式中, 所述创建模块包括: 语义识别子模块, 用于当获取的所述消息不为控制消息时, 对获取的 所述消息进行语义解析, 并根据语义解析结果, 在已存储的实际主题中查 找与所述语义解析结果匹配的实际主题;
第二主题子模块,用于在在已存储的实际主题中查找到与所述语义解 析结果匹配的实际主题时, 将查找到的实际主题作为目的实际主题, 并创 建所述订阅者对应的虚拟主题与查找到的与所述语义解析结果匹配的实 际主题之间的路由规则。
结合第七方面的第二种可能实现方式, 在第三种可能实现方式中, 所 述第二主题子模块,还用于在在已存储的实际主题中未查找到与所述语义 解析结果匹配的实际主题时, 创建新的实际主题, 并创建所述订阅者对应 的虚拟主题与目的实际主题之间的路由规则。
第八方面, 本发明提供了一种消息订阅的装置, 包括:
获取模块, 用于获取订阅者已发送的消息;
语义识别模块, 用于对获取的所述消息进行语义解析, 并根据语义解 析结果, 在已存储的实际主题中查找与所述语义解析结果匹配的实际主 题;
主题模块,用于在在已存储的实际主题中查找到与所述语义解析结果 匹配的实际主题时, 创建查找到的实际主题与所述订阅者的订阅对应关 系。 结合第八方面, 在第一种可能实现方式中, 所述主题模块还用于在在 已存储的实际主题中未查找到与所述语义解析结果匹配的实际主题时,创 建新的实际主题, 并创建新创建的实际主题与所述订阅者的订阅对应关 系。 本发明实施例提供的消息发布与订阅的方法,通过为发布者以及订阅 者在消息中间件中设置相应的虚拟主题,或者通过对发布者以及订阅者向 消息中间件进行语义识别,以保证发布者以及订阅者不需要获知实际主题 的具体结构的情况下, 仍然保证信息被正确地传输。 相比于现有技术中, 当消息中间件中的主题发生变化时,发布者以及订阅者必须要获知的变更 结果并主动修改路由规则才能完成数据传输的技术方案来讲,本发明实施 例提供的技术方案信息传输效率更高, 灵活性更强。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对 实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员 来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附 图。 图 1为本发明实施例提供的一种消息中间件的组成框图; 图 2为本发明实施例提供的另一种消息中间件的组成框图; 图 3为本发明实施例提供的一种消息发布的方法流程图; 图 4为本发明实施例提供的另一种消息发布的方法流程图; 图 5为本发明实施例提供的另一种消息发布的方法流程图; 图 6为本发明实施例提供的另一种消息发布的方法流程图; 图 7为本发明实施例提供的一种消息订阅的方法流程图; 图 8为本发明实施例提供的另一种消息订阅的方法流程图; 图 9为本发明实施例提供的另一种消息订阅的方法流程图; 图 1 0为本发明实施例提供的一种消息发布的方法流程图; 图 1 1为本发明实施例提供的另一种消息发布的方法流程图; 图 1 2为本发明实施例提供的另一种消息订阅的方法流程图; 图 1 3为本发明实施例提供的另一种消息订阅的方法流程图; 图 1 4为本发明实施例提供的一种消息发布的装置的组成框图; 图 1 5为本发明实施例提供的另一种消息发布的装置的组成框图; 图 1 6为本发明实施例提供的另一种消息发布的装置的组成框图; 图 1 7为本发明实施例提供的另一种消息订阅的装置的组成框图; 图 1 8为本发明实施例提供的另一种消息订阅的装置的组成框图; 图 1 9为本发明实施例提供的另一种消息订阅的装置的组成框图; 图 2 0为本发明实施例提供的另一种消息订阅的装置的组成框图; 图 2 1为本发明实施例提供的另一种消息中间件的组成框图; 图 22为本发明实施例提供的另一种消息中间件的组成框图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进 行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没 有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的 范围。 本发明实施例提供的两种消息中间件 ( me s s a ge br oke r ) 的组成结构 图, 用以实现本发明实施例提供的消息发布与订阅的方法, 一般以可运行 于操作系统和应用软件之间的软件形式存在, 用于进行多个操作系统之 间、 多个应用软件之间以及操作系统和应用软件之间的信息传输。 图 1 为本发明实施例提供的消息中间件的一种实现方式的组成结构 图, 在此结构中, 对应于消息中间件外的每个发布者和订阅者, 都各自设 置有一个虚拟主题,该虚拟主题的作用相当于发布者或订阅者在消息中间 件中的映射设备, 具有查找下一跳实际主题和转发消息的功能。 具体的, 所述虚拟主题用于实际主题和发布者之间的消息转发或者实际主题和订 阅者之间的消息转发。 虚拟主题和发布者之间以及虚拟主题与订阅者之间都设置有一个信 息处理模块,该信息处理模块主要用于对发布者或订阅者发送到消息中间 件的消息进行识别,和生成与对发布者或订阅者发送到消息中间件的消息 相对应的标识信息。
信息处理模块还连接有路由规则生成模块和存储适配模块。路由规则 生成模块用于生成虚拟主题和实际主题之间的路由规则,存储适配模块用 于存储发布者或订阅者发送到消息中间件的消息。
路由规则生成模块和存储适配模块都连接到路由模块,路由模块用于 存储虚拟主题和实际主题之间的路由规则。
消息中间件中还设置有实际主题,该实际主题根据虚拟主题和实际主 题之间的路由规则, 与若干个虚拟主题建立逻辑连接关系, 具有查找下一 跳实际主题或下一跳虚拟主题和转发消息的功能。, 具体的, 所述实际主 题用于发布者对应的虚拟主题和订阅者对应的虚拟主题之间的消息转发 实际主题也连接到路由模块中。实际主题结构可以釆用现有技术常用的树 形结构, 也可以使用其他的结构, 本发明实施例对此不进行限制。
消息中间件中还设置有由语义解析模块和语义匹配模块组成的语义 识别模块, 该语义识别模块与虚拟主题、 路由规则生成模块以及存储适配 器相连。
图 2 为本发明实施例提供的消息中间件的另一种实现方式的组成结 构图, 该结构中, 消息中间件仅具有实际主题、 由语义解析模块和语义匹 配模块组成的语义识别模块和存储适配器。 其中, 实际主题与消息中间件 外部的订阅者以及语义识别模块相连, 语义识别模块可以与实际主题、 消 息中间件外部的订阅者、 消息中间件外部的发布者以及存储适配器相连。 各个模块的功能与图 1所示的模块功能基本相同。
基于图 1所示的信息中间件,本发明实施例提供了一种消息订阅的方 法, 如图 3所示, 包括: 其中, 发布者和后续描述的订阅者一般为手机、 PC、 服务器等终用户 终端设备。 述发布者对应的虚拟主题为起点,并且以任意一个订阅者对应的虚拟主题 为终点的传输路径。 题和实际主题之间的消息传输关系, 可以由发布者、 订阅者或者网络管理 员事先进行设置的, 或者是在消息中间件工作时实时更新的。
1 03、 当查找到以所述发布者对应的虚拟主题为起点, 并且以订阅者 对应的虚拟主题为终点的传输路径时, 在查找到的传输路径上, 传输所述 消息或与所述消息对应的标识信息。
其中,标识信息的生成可以是消息中间件为发布者发送的消息分配的 唯一的标识信息, 具体的分配方法可以使用顺序排列标号、哈希计算标号 等多种方法。此时发布者发送的消息一般需要存储在一个独立的存储器件 中, 例如, 本发明实施例提供的存储适配器。 该标识信息主要是用于使所 述订阅者对应的虚拟主题能够根据所述标识信息获取所述消,包、
1 04、 当所述消息或与所述消息对应的标识信息传输至每一条传输路 径的终点时, 将所述消息发送至该传输路径的终点所对应的订阅者。
本发明实施例提供了一种消息发布的方法, 在该方法中, 发布者可根 据自身需要向消息中间件中与自身对应的虚拟主题发送消息,就可以由消 的传输路径, 并将发布者发送的消息发送至相应的订阅者, 从而使得当实 际主题发生变化时,只需要由消息中间件的内部对存储的虚拟主题与实际 主题之间的路由规则进行修改即可,发布者仍可以向与消息中间件中与自 身对应的虚拟主题继续发送消息, 而不用做出任何改变。 与现有技术中当 实际主题发生变化时,发布者必须要更改传输路径才能将消息正确传输的 技术方案相比, 消息传输效率更高, 传输路径的灵活性更强。
进一步的, 在如图 3所示的方法流程的基础上, 本发明实施例还提供 了另一种消息发布的方法, 如图 4所示, 执行于步骤 1 02之后, 包括:
1 05、 当未查找到以所述发布者对应的虚拟主题为起点, 并且以订阅 者对应的虚拟主题为终点的传输路径时, 则对所述消息进行语义解析, 并 根据语义解析结果,在已存储的实际主题中查找与所述语义解析结果匹配 的实际主题。 若查找到与所述语义解析结果匹配的实际主题, 则执行步骤
1 06。 否则执行步骤 1 1 0。
其中, 由于实际主题就是用于连接消息发布订阅者的实际主题, 其定 义方式与现有技术基本相同, 因此, 每个实际主题一般都对应有相应的字 符串、 标号等可以用于文字或语义匹配的主题标识, 对发布者发送的消息 进行语义解析之后, 会将消息解析成一系列的关键字。 通过这些关键字可 以与所有实际主题各自对应的主题标识进行模糊匹配 , 例如字符串匹配 等, 用以确定这个消息最可能的传输方向或路径。
1 06、 生成并存储所述发布者对应的虚拟主题与查找到的实际主题之 间的路由规则。 以所述发布者对应的虚拟主题为起点,并且以任意一个订阅者对应的虚拟 主题为终点的传输路径。
1 08、 当查找到以所述发布者对应的虚拟主题为起点, 并且以订阅者 对应的虚拟主题为终点的传输路径时, 在查找到的传输路径上, 传输所述 消息或与所述消息对应的标识信息。
值得说明的是, 若此时仍查找不到所述发布者对应的虚拟主题为起 点, 并且以订阅者对应的虚拟主题为终点的传输路径, 则说明此时查找到 的实际主题尚无人订阅,因此,直接将该发布者发送的消息进行存储即可, 不需要再继续发送。
1 09、 当所述消息或与所述消息对应的标识信息传输至每一条传输路 径的终点时, 将所述消息发送至该传输路径的终点所对应的订阅者。 与新创建的实际主题之间的路由规则。
在执行步骤 11 0后, 不需要将消息继续进行传输, 其原因为: 若已存 储的实际主题中并不存在发布者发送的消息对应的实际主题,说明此时还 没有任何订阅者订阅了此主题。
本发明实施例进一步提供的消息发布的方法,在无法查找到相应的传 输路径时, 对发布者发送的消息进行语义识别, 用以匹配与该消息最相近 的实际主题, 从而建立全新的数据传输路径, 以保证消息的正常准确地发 布。 进一步地让发布者可以完全根据自身需要去发送消息。 消息中间件都 能够让消息得到正确的传输。
进一步的, 为了方便发布者对消息传输路径的控制, 因此, 本发明一 实施例为发布者提供了控制消息,用以修改和删除消息中间件内已存储的 原有路由规则或添加新的路由规则。 控制消息可以包括: Forwa rd转发指 、 Copy复制指 、 Sub s cr i p t i on i丁阅指 、 Proxy « 指 。 Forwa rd 指令用于控制路由规则从一个主题完全迁移到同一消息中间件内的另外 一个主题, 原主题不再获取任何消息。 Copy 指令用于在保证除了原有获 取消息的主题仍获取消息以外,还将作为消息来源的主题与指令指定的其 它多个主题建立路由规则。 Subscription指令用于建立实际主题与订阅 者对应的虚拟主题之间的路由规则。 Proxy指令用于将路由规则从一个主 题完全迁移到另外一个不同的消息中间件内中的一个主题,原主题不再获 取任何消息。
基于此, 在执行步骤 102之前, 如图 5所示, 还包括:
111、 判断获取的所述消息是否为控制消息。 若确定获取的所述消息 不是控制消息, 则执行步骤 102。 否则执行步骤 112。 由规则进行修改。
其中, 所述控制消息至少包括前述的 Forward转发指令、 Copy复制 才旨 、 Subscription i丁阅才旨 、 Proxy 里才旨 #才旨 。 本发明实施例进一步提供的消息发布的方法,可以为订阅者提供对消 息中间件的动态控制功能, 进一步保证了消息的准确传输。
为了减少消息中间件内消息传输的流量, 节省传输资源。 消息中间件 内部可不传输发布者发送的具体消息,而是为每份具体消息生成一个标识 信息, 并传输该标识信息, 具体参见图 6所示的方法流程, 包括: S 102、 生成与所述消息对应的标识信息。 述发布者对应的虚拟主题为起点,并且以任意一个订阅者对应的虚拟主题 为终点的传输路径。
S 104、 当查找到以所述发布者对应的虚拟主题为起点, 并且以订阅者 对应的虚拟主题为终点的传输路径时, 在查找到的传输路径上, 传输所述 标识信息。
S 105、 当与所述消息对应的标识信息传输至每一条传输路径的终 , *、 时, 获取与所述标识信息对应的消息。
S 106、 将所述消息发送至传输路径的终点对应的订阅者。
对应于如图 3至图 6所示的消息发布的方法流程,本发明实施例提供 了相应的消息订阅方法, 如图 7所示, 包括:
201、 获取订阅者已发送至所述订阅者对应的虚拟主题的消息。
其中, 所述订阅者发送的消息包括控制消息和模糊消息。 控制消息是 在订阅者明确知道自己想要订阅哪一个或哪些主题时向消息中间件发送 的消息,而模糊消息是订阅者并不清楚自己想要订阅的内容属于哪一个或 哪些主题时发送的一段文字等消息。
202、 根据获取的所述消息, 创建所述订阅者对应的虚拟主题与目的 实际主题之间的路由规则,所述目的实际主题为所述订阅者当前订阅的实 际主题。
其中, 此处描述路由规则的生成与维护与前述描述的内容基本类似。 值得说明的是, 针对 201获取到的消息类型步骤, 步骤 202的具体实 现方式也不同, 具体包括以下两种:
如图 8所示的实现方式一, 包括:
A202 当获取的所述消息为控制消息时, 根据所述控制消息获取所 述目的实际主题。
其中,控制消息与步骤 1 1 1 中描述的控制消息是同一个指令类型的不 同功能。
A 2022、 创建所述订阅者对应的虚拟主题与根据所述控制消息获取到 的目的实际主题之间的路由规则。
如图 9所示的实现方式二, 包括:
B202 当获取的所述消息不为控制消息时, 对获取的所述消息进行 语义解析, 并根据语义解析结果, 在已存储的实际主题中查找与所述语义 解析结果匹配的实际主题。若在已存储的实际主题中查找到与所述语义解 析结果匹配的实际主题, 则执行步骤 B2022。 否则执行步骤 B2023。
B2022 , 创建所述订阅者对应的虚拟主题与查找到的与所述语义解析 结果匹配的实际主题之间的路由规则。
B2023 , 创建新的实际主题, 并创建所述订阅者对应的虚拟主题与所 述新的实际主题之间的路由规则。
本发明实施例提供的消 ,包、订阅方法,订阅者只需要建立所述订阅者对 应的虚拟主题与目的实际主题之间的路由规则即可,在后续实际主题发生 变化时, 只需要消息中间件进行路由规则变更即可, 订阅者仍然可以从对 应的虚拟主题继续接收消息, 而不用做出任何改变。 与现有技术中当实际 主题发生变化时,订阅者必须要更改传输路径才能将正确接收 'J想要的;肖 息的技术方案相比, 消息传输效率更高, 传输路径的灵活性更强。
并且, 订阅者可以根据自身需要通过控制消息或模糊消息来进行订 阅, 增加了订阅者的灵活性。
基于如图 2所示的信息中间件,本发明实施例提供了一种消息发布的 方法, 如图 1 0所示, 包括:
301、 获取发布者已发送的消息。
302、 对获取到的消息进行语义解析, 并根据语义解析结果, 在已存 储的实际主题中查找与所述语义解析结果匹配的实际主题。
303、 若查找到与所述语义解析结果匹配的实际主题, 则在已存储的 订阅对应关系中查找与所述实际主题对应的订阅者。
其中, 基于语义解析结果的匹配方法可参照步骤 1 05的有关描述。
304、 若查找到所述实际主题对应的订阅者, 则将所述获取到的消息 发送至所有查找到的订阅者。 另外, 如图 11所示, 在若执行步骤 302后, 未查找到与所述语义解 析结果匹配的实际主题, 则执行 305、 创建新的实际主题,并存储新创建 的实际主题。
本发明实施例提供了一种消息发布的方法, 可以在互联网中使用, 特 别是移动互联网某些领域, 发布者或订阅者可能不会关心具体的主题什 么, 是否存在的场景下。 该方法可以直接根据发布者发送的消息进行语义 识别, 来推断发布者可能想要发布的主题, 使得发布者根据自己需要发布 消息, 进而加强了消息传输的效率和灵活性。
对应于如图 10至图 11所示的消息发布的方法流程,本发明实施例提 供了相应的消息订阅方法, 如图 12所示, 包括:
401、 获取订阅者已发送的消息。
402、 对获取的所述消息进行语义解析, 并根据语义解析结果, 在已 存储的实际主题中查找与所述语义解析结果匹配的实际主题。
403、 若在已存储的实际主题中查找到与所述语义解析结果匹配的实 际主题, 则创建查找到的实际主题与所述订阅者的订阅对应关系。
另外, 如图 13所示, 在若执行步骤 402后, 未查找到与所述语义解 析结果匹配的实际主题, 则执行 404、 创建新的实际主题, 并创建新创建 的实际主题与所述订阅者的订阅对应关系。
本发明实施例提供了一种消息订阅的方法, 可以在互联网中使用, 特 别是移动互联网某些领域, 发布者或订阅者可能不会关心具体的主题什 么, 是否存在的场景下。 该方法可以直接根据订阅者发送的消息进行语义 识别, 来推断订阅者可能想要订阅的主题, 使得订阅者根据自己需要来订 阅消息。 不需要知道具体的主题是什么, 进而加强了消息传输的效率和灵 活性。
进一步值得说明的是, 如图 2所示的装置结构包含有实际主题, 其设 置目的在于将多种消息进行整合归类到同一主题下。而在一些特殊的应用 场景中,例如微博,微信等场景,并不存在明确的发布者和订阅者的划分, 每个用户端都可以是消息的发布者和获取者,并且消息发送的数量巨大很 难进行分类, 因此在这种场景下, 不需要对消息进行整合分类, 即如图 2 所示的装置结构可以设置一个匹配模块来替代原有的实际主题,将将用户 端发送到消息中间件内的不同消息进行语义匹配,将成功匹配的多个用户 端的消息互相进行传输即可。
本发明提供了一种消息发布的装置,可用于实现如图 3至图 6所示的 消息发布的方法流程, 如图 14所示, 包括: 拟主题的消息。 则, 查找以所述发布者对应的虚拟主题为起点, 并且以任意一个订阅者对 应的虚拟主题为终点的传输路径; 其中, 所述虚拟主题用于实际主题和发 布者之间的消息转发或者实际主题和订阅者之间的消息转发;所述实际主 题用于发布者和订阅者之间的消息转发。
传输模块 53 , 用于当所述主题模块 52查找到以所述发布者对应的虚 拟主题为起点, 并且以订阅者对应的虚拟主题为终点的传输路径时, 在查 找到的传输路径上, 传输所述消息或与所述消息对应的标识信息; 当所述 消息或与所述消息对应的标识信息传输至每一条传输路径的终点时,将所 述消息发送至该传输路径的终点所对应的订阅者。 其中, 所述标识信息用 于使所述订阅者对应的虚拟主题能够根据所述标识信息获取所述消息。
可选的是, 如图 14所示, 该装置还包括:
语义识别模块 54 , 用于所述主题模块 52未查找到以所述发布者对应 的虚拟主题为起点, 并且以订阅者对应的虚拟主题为终, ^的传输路径时 , 对所述消息进行语义解析,得到语义解析结果,并根据所述语义解析结果, 在已存储的实际主题中查找与所述语义解析结果匹配的实际主题。
路由规则生成模块 55 , 用于若所述语义识别模块 54查找到与所述语 查找到的实际主题之间的路由规则。
可选的是, 所述主题模块 52 , 用于根据当前所述路由规则生成模块 应的虚拟主题为起点,并且以任意一个订阅者对应的虚拟主题为终点的传 输路径。
所述传输模块 53 , 还用于当所述主题模块 52查找到以所述发布者对 应的虚拟主题为起点, 并且以订阅者对应的虚拟主题为终点的传输路径 时,在查找到的传输路径上,传输所述消息或与所述消息对应的标识信息; 当所述消息或与所述消息对应的标识信息传输至每一条传输路径的终点 时, 将所述消息发送至该传输路径的终点所对应的订阅者。
可选的是, 所述主题模块 52 , 还用于在未查找到与所述语义解析结 果匹配的实际主题时, 创建新的实际主题。
所述路由规则生成模块 55 , 还用于存储所述发布者对应的虚拟主题 与新创建的实际主题之间的路由规则。
可选的是, 所述信息处理模块 51 , 还用于判断获取的所述消息是否 为控制消息,所述控制消息用于更新已存储的虚拟主题与实际主题之间的 路由规则。
所述主题模块 52 , 用于在所述信息处理模块 51确定获取的所述消息 则, 查找以所述发布者对应的虚拟主题为起点, 并且以任意一个订阅者对 应的虚拟主题为终点的传输路径。
所述路由规则生成模块 55 , 还用于在所述信息处理模块 52确定获取 的所述消息是控制消息, 则根据所述控制消息, 对已存储的虚拟主题与实 际主题之间的路由规则进行修改;存储修改后的虚拟主题与实际主题之间 的路由规则。
可选的是, 所述信息处理模块 51还用于生成与所述消息对应的标识 信息。
所述传输模块 53 , 还用于当所述与所述消息对应的标识信息传输至 每一条传输路径的终点时, 获取与所述标识信息对应的消息, 并将与所述 标识信息对应的消息发送至传输路径的终点所对应的订阅者。
本发明实施例一种消息发布的装置, 可用于实现如图 9-1 0所示的消 息发布的方法流程, 如图 15所示, 包括:
获取模块 61 , 用于获取发布者已发送的消息。
语义识别模块 62 , 用于对获取到的消息进行语义解析, 并根据语义 解析结果,在已存储的实际主题中查找与所述语义解析结果匹配的实际主 题。
主题模块 63 , 用于在查找到与所述语义解析结果匹配的实际主题时, 在已存储的订阅对应关系中, 查找与所述实际主题对应的订阅者。
传输模块 64 , 用于在查找到所述实际主题对应的订阅者时, 将所述 获取到的消息发送至所有查找到的订阅者。
可选的是, 所述主题模块 63 , 还用于在未查找到与所述语义解析结 果匹配的实际主题时, 创建新的实际主题,并存储新创建的实际主题。 本发明实施例提供了一种消息订阅的装置,可用于实现如图 6-8所示 的消息订阅的方法流程, 如图 16所示, 包括:
获取模块 71 , 用于获取订阅者已发送至所述订阅者对应的虚拟主题 的消息。
创建模块 72 , 用于根据获取的所述消息, 创建所述订阅者对应的虚 拟主题与目的实际主题之间的路由规则,所述目的实际主题为所述订阅者 当前订阅的实际主题; 其中, 所述虚拟主题用于实际主题和发布者之间的 消息转发或者实际主题和订阅者之间的消息转发;所述目的实际主题用于 订阅者对应的虚拟主题之间的消息转发。
可选的是, 如图 17所示, 所述创建模块 72包括:
第一主题子模块 721 , 用于当获取的所述消息为控制消息时, 根据所 述控制消息获取所述目的实际主题,所述控制消息用于更新虚拟主题与所 述订阅者选择的实际主题之间的路由规则;以及用于更新所述订阅者对应 的虚拟主题与根据所述控制消息获取到的目的实际主题之间的路由规则。
可选的是, 如图 18所示, 所述创建模块 72包括:
语义识别子模块 722 , 用于当获取的所述消息不为控制消息时, 对获 取的所述消息进行语义解析, 并根据语义解析结果, 在已存储的实际主题 中查找与所述语义解析结果匹配的实际主题。 第二主题子模块 723, 用于在在已存储的实际主题中查找到与所述语 义解析结果匹配的实际主题时, 将查找到的实际主题作为目的实际主题, 并创建所述订阅者对应的虚拟主题与查找到的与所述语义解析结果匹配 的实际主题之间的路由规则。
可选的是, 所述第二主题子模块 723, 还用于在在已存储的实际主题 中未查找到与所述语义解析结果匹配的实际主题时, 创建新的实际主题, 并创建所述订阅者对应的虚拟主题与目的实际主题之间的路由规则。
本发明实施例还提供了一种消息订阅的装置, 可用于实现如图 11-12 所示的消息订阅的方法流程, 如图 19所示, 包括:
获取模块 81, 用于获取订阅者已发送的消息。
语义识别模块 82, 用于对获取的所述消息进行语义解析, 并根据语 义解析结果,在已存储的实际主题中查找与所述语义解析结果匹配的实际 主题。
主题模块 83, 用于在在已存储的实际主题中查找到与所述语义解析 结果匹配的实际主题时,创建查找到的实际主题与所述订阅者的订阅对应 关系。
可选的是, 所述主题模块 83还用于在在已存储的实际主题中未查找 到与所述语义解析结果匹配的实际主题时, 创建新的实际主题, 并创建新 创建的实际主题与所述订阅者的订阅对应关系。 本发明实施例提供的消息发布与订阅的装置,通过为发布者以及订阅 者在消息中间件中设置相应的虚拟主题,或者通过对发布者以及订阅者向 消息中间件进行语义识别,以保证发布者以及订阅者不需要获知实际主题 的具体结构的情况下, 仍然保证消息被正确地传输。 相比于现有技术中, 当消息中间件中的主题发生变化时,发布者以及订阅者必须要获知的变更 结果并主动修改路由规则才能完成数据传输的技术方案来讲,本发明实施 例提供的技术方案消息传输效率更高, 灵活性更强。
本发明实施例提供了一种消息中间件, 如图 20所示, 包括至少一个 处理器 91、 存储器 92 以及输入输出电路 93。 所述存储器 92被配置有程 序代码, 所述处理器 91用于调用存储器 92 内的程序代码用以实现如图 3 至图 8 所示的消息发布与订阅的方法流程。 所述存储器 92 和处理器 91 之间通过总线通信。
其中, 所述输入输出电路 93用于获取发布者已发送至与所述发布者 对应的虚拟主题的消息; 以及当查找到以所述发布者对应的虚拟主题为起 点, 并且以订阅者对应的虚拟主题为终点的传输路径时, 在查找到的传输 路径上, 传输所述消息或与所述消息对应的标识信息; 以及当所述消息或 与所述消息对应的标识信息传输至每一条传输路径的终点时,将所述消息 发送至该传输路径的终点所对应的订阅者。 其中, 所述标识信息用于使所 述订阅者对应的虚拟主题能够根据所述标识信息获取所述消息。 查找以所述发布者对应的虚拟主题为起点,并且以任意一个订阅者对应的 虚拟主题为终点的传输路径; 其中, 所述虚拟主题用于实际主题和发布者 之间的消息转发或者实际主题和订阅者之间的消息转发;所述实际主题用 于发布者和订阅者之间的消息转发。 所述处理器 9 1还用于当未查找到以所述发布者对应的虚拟主题为起 点, 并且以订阅者对应的虚拟主题为终点的传输路径时, 则对所述消息进 行语义解析, 得到语义解析结果, 并根据所述语义解析结果, 在已存储的 实际主题中查找与所述语义解析结果匹配的实际主题;若查找到与所述语 查找到的实际主题之间的路由规则。
所述处理器 9 1还用于根据当前已存储的虚拟主题与实际主题之间的 路由规则, 查找以所述发布者对应的虚拟主题为起点, 并且以任意一个订 阅者对应的虚拟主题为终点的传输路径。
所述输入输出电路 9 3还用于当查找到以所述发布者对应的虚拟主题 为起点, 并且以订阅者对应的虚拟主题为终点的传输路径时, 在查找到的 传输路径上, 传输所述消息或与所述消息对应的标识信息; 当所述消息或 与所述消,包、对应的标识信息传输至每一条传输路径的终点时,将所述消 ,包、 发送至该传输路径的终点所对应的订阅者。
所述处理器 9 1还用于若未查找到与所述语义解析结果匹配的实际主 题, 则创建新的实际主题, 并生成并存储所述发布者对应的虚拟主题与新 创建的实际主题之间的路由规则。
所述处理器 9 1还用于判断获取的所述消息是否为控制消息, 所述控 所述消息不是控制消息,则执行根据当前已存储的虚拟主题与实际主题之 间的路由规则, 查找以所述发布者对应的虚拟主题为起点, 并且以任意一 个订阅者对应的虚拟主题为终点的传输路径的步骤;若确定获取的所述消 息是控制消息, 则根据所述控制消息, 对已存储的虚拟主题与实际主题之 间的路由规则进行修改。
所述存储器 9 2还用于存储修改后的虚拟主题与实际主题之间的路由 规则。
所述处理器 9 1还用于生成与所述消息对应的标识信息; 根据查找到 的所有传输路径, 传输与所述消息对应的标识信息; 当所述与所述消息对 应的标识信息传输至每一条传输路径的终点时,获取与所述标识信息对应 的消息,并将与所述标识信息对应的消息发送至传输路径的终点所对应的 订阅者。
所述输入输出电路 9 3还用于获取订阅者已发送至所述订阅者对应的 虚拟主题的消息。
所述处理器 9 1还用于根据获取的所述消息, 创建所述订阅者对应的 虚拟主题与目的实际主题之间的路由规则,所述目的实际主题为所述订阅 者当前订阅的实际主题; 其中, 所述虚拟主题用于实际主题和发布者之间 的消息转发或者实际主题和订阅者之间的消息转发;所述目的实际主题用 于订阅者对应的虚拟主题之间的消息转发。
所述处理器 9 1还用于当获取的所述消息为控制消息时, 根据所述控 制消息获取目的实际主题,所述控制消息用于更新虚拟主题与所述订阅者 选择的实际主题之间的路由规则;创建所述订阅者对应的虚拟主题与根据 所述控制消息获取到的目的实际主题之间的路由规则。
所述处理器 9 1还用于当获取的所述消息不为控制消息时, 对获取的 所述消息进行语义解析, 并根据语义解析结果, 在已存储的实际主题中查 找与所述语义解析结果匹配的实际主题;若在已存储的实际主题中查找到 与所述语义解析结果匹配的实际主题,则创建所述订阅者对应的虚拟主题 与查找到的与所述语义解析结果匹配的实际主题之间的路由规则。
所述处理器 9 1还用于若在已存储的实际主题中未查找到与所述语义 解析结果匹配的实际主题, 则创建新的实际主题, 并创建所述订阅者对应 的虚拟主题与所述新的实际主题之间的路由规则。
本发明实施例还提供了一种消息中间件, 如图 2 1所示, 包括至少一 个处理器 1 001、 存储器 1 002、 输入输出电路 1 003。 所述存储器 1 002被 配置有程序代码,所述处理器 1 001用于调用存储器 1 002 内的程序代码用 以实现如图 9 至图 1 2 所示的消息发布与订阅的方法流程。 所述存储器 1 002和处理器 1 001之间通过总线通信。
所述处理器 1 001用于获取发布者已发送的消息; 对获取到的消息进 行语义解析, 并根据语义解析结果, 在已存储的实际主题中查找与所述语 义解析结果匹配的实际主题;若查找到与所述语义解析结果匹配的实际主 题, 则在已存储的订阅对应关系中, 查找与所述实际主题对应的订阅者; 若查找到所述实际主题对应的订阅者,则将所述获取到的消息发送至所有 查找到的订阅者。
所述处理器 1 001还用于若未查找到与所述语义解析结果匹配的实际 主题, 则创建新的实际主题,并存储新创建的实际主题。
所述处理器 1 001还用于获取订阅者已发送的消息; 对获取的所述消 息进行语义解析, 并根据语义解析结果, 在已存储的实际主题中查找与所 述语义解析结果匹配的实际主题;若在已存储的实际主题中查找到与所述 语义解析结果匹配的实际主题,则创建查找到的实际主题与所述订阅者的 订阅对应关系。
所述处理器 1 001还用于若在已存储的实际主题中未查找到与所述语 义解析结果匹配的实际主题, 则创建新的实际主题, 并创建新创建的实际 主题与所述订阅者的订阅对应关系。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到 本发明可借助软件加必需的通用硬件的方式来实现, 当然也可以通过硬 件, 但很多情况下前者是更佳的实施方式。 基于这样的理解, 本发明的技 术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式 体现出来, 该计算机软件产品存储在可读取的存储介质中, 如计算机的软 盘, 硬盘或光盘等, 包括若干指令用以使得一台计算机设备(可以是个人 计算机, 服务器, 或者网络设备等) 执行本发明各个实施例所述的方法。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局 限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可 轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明 的保护范围应以所述权利要求的保护范围为准。

Claims

权 利 要 求 书
1、 一种消息发布的方法, 其特征在于, 包括:
者对应的虚拟主题为起点, 并且以任意一个订阅者对应的虚拟主题为终点 的所有传输路径; 其中, 所述虚拟主题用于实际主题和发布者之间的消息 转发或者实际主题和订阅者之间的消息转发; 所述实际主题用于发布者和 订阅者之间的消息转发;
当查找到以所述发布者对应的虚拟主题为起点, 并且以任意一个订阅 者对应的虚拟主题为终点的传输路径时, 在查找到的传输路径上, 传输所 述消息或与所述消息对应的标识信息;
当所述消息或与所述消息对应的标识信息传输至每一条传输路径的终 点后, 将所述消息发送至该传输路径的终点所对应的订阅者。
2、 根据权利要求 1所述的方法, 其特征在于, 还包括:
当未查找到以所述发布者对应的虚拟主题为起点, 并且以任意一个订 阅者对应的虚拟主题为终点的传输路径时, 则对所述消息进行语义解析, 得到语义解析结果, 并根据所述语义解析结果, 在已存储的实际主题中查 找与所述语义解析结果匹配的实际主题;
若查找到与所述语义解析结果匹配的实际主题, 则生成并存储所述发 布者对应的虚拟主题与查找到的实际主题之间的路由规则。
3、 根据权利要求 2所述的方法, 其特征在于, 在所述生成并存储所述 发布者对应的虚拟主题与查找到的实际主题之间的路由规则之后,还包括: 发布者对应的虚拟主题为起点, 并且以任意一个订阅者对应的虚拟主题为 终点的传输路径;
当查找到以所述发布者对应的虚拟主题为起点, 并且以任意一个订阅 者对应的虚拟主题为终点的传输路径时, 在查找到的传输路径上, 传输所 述消息或与所述消息对应的标识信息;
当所述消息或与所述消息对应的标识信息传输至每一条传输路径的终 点时, 将所述消息发送至该传输路径的终点所对应的订阅者。
4、 根据权利要求 2或 3所述的方法, 其特征在于, 还包括:
若未查找到与所述语义解析结果匹配的实际主题, 则创建新的实际主 题, 并生成并存储所述发布者对应的虚拟主题与新创建的实际主题之间的 路由规则。
5、 根据权利要求 1所述的方法, 其特征在于, 还包括:
获取所述发布者发送的控制消息, 所述控制消息用于更新已存储的虚 拟主题与实际主题之间的路由规则;
根据所述控制消息, 对当前已存储的虚拟主题与实际主题之间的路由 规则进行修改, 并存储修改后的路由规则。
6、 根据权利要求 1至 5任意一项所述的方法, 其特征在于, 在查找到 的传输路径上, 传输与所述消息对应的标识信息之前, 还包括:
生成与所述消息对应的标识信息;
相应地, 所述当所述与所述消息对应的标识信息传输至每一条传输路 径的终点时, 将所述消息发送至该传输路径的终点所对应的订阅者, 包括: 当与所述消息对应的标识信息传输至每一条传输路径的终点时, 获取 与所述标识信息对应的消息, 并将与所述标识信息对应的消息发送至该传 输路径的终点所对应的订阅者。
7、 一种消息发布的方法, 其特征在于, 包括:
获取发布者已发送的消息;
对获取到的消息进行语义解析, 并根据语义解析结果, 在已存储的实 际主题中查找与所述语义解析结果匹配的实际主题;
若查找到与所述语义解析结果匹配的实际主题, 则在已存储的订阅关 系表中, 查找与所述实际主题对应的订阅者;
若查找到所述实际主题对应的订阅者, 则将所述获取到的消息发送至 查找到的所有订阅者。
8、 根据权利要求 7所述的方法, 其特征在于, 还包括:
若未查找到与所述语义解析结果匹配的实际主题, 则创建新的实际主 题,并存储创建的所述实际主题。
9、 一种消息订阅的方法, 其特征在于, 包括:
获取订阅者已发送至所述订阅者对应的虚拟主题的消息;
根据获取的所述消息, 创建所述订阅者对应的虚拟主题与目的实际主 题之间的路由规则,所述目的实际主题为所述订阅者当前订阅的实际主题; 其中, 所述虚拟主题用于实际主题和发布者之间的消息转发或者实际主题 和订阅者之间的消息转发。
1 0、 根据权利要求 9所述的方法, 其特征在于, 所述根据获取的所述 消息, 创建所述订阅者对应的虚拟主题与目的实际主题之间的路由规则, 包括:
当获取的所述消息为控制消息时, 根据所述控制消息确定所述订阅者 订阅的实际主题, 并将所述订阅者订阅的实际主题作为目的实际主题, 所 述控制消息包含所述订阅者订阅的实际主题的消息;
创建所述订阅者对应的虚拟主题与所述目的实际主题之间的路由规 则。
1 1、 根据权利要求 1 0所述的方法, 其特征在于, 还包括:
当获取的所述消息不为控制消息时, 对所述消息进行语义解析, 并根 据语义解析结果, 在已存储的实际主题中查找与所述语义解析结果匹配的 实际主题; 若在已存储的实际主题中查找到与所述语义解析结果匹配的实际主 题, 则创建所述订阅者对应的虚拟主题与查找到的与所述语义解析结果匹 配的实际主题之间的路由规则。
12、 根据权利要求 11所述的方法, 其特征在于, 还包括:
若在已存储的实际主题中未查找到与所述语义解析结果匹配的实际主 题, 则创建新的实际主题, 并创建所述订阅者对应的虚拟主题与所述新的 实际主题之间的路由规则。
1 3、 一种消息发布的装置, 其特征在于, 包括: 题的消息;
主题模块, 用于根据已存储的虚拟主题与所述消息发布的装置包含的 各个实际主题之间的路由规则,查找以所述发布者对应的虚拟主题为起点, 并且以任意一个订阅者对应的虚拟主题为终点的所有传输路径; 其中, 所 述虚拟主题用于实际主题和发布者之间的消息转发或者实际主题和订阅者 之间的消息转发; 所述实际主题用于发布者和订阅者之间的消息转发; 传输模块, 用于当所述主题模块查找到以所述发布者对应的虚拟主题 为起点, 并且以任意一个订阅者对应的虚拟主题为终点的传输路径时, 在 查找到的传输路径上, 传输所述消息或与所述消息对应的标识信息; 当所 述消息或与所述消息对应的标识信息传输至每一条传输路径的终点时, 将 所述消息发送至该传输路径的终点所对应的订阅者。
14、 根据权利要求 1 3所述的装置, 其特征在于, 还包括:
语义识别模块, 用于当所述主题模块未查找到以所述发布者对应的虚 拟主题为起点, 并且以任意一个订阅者对应的虚拟主题为终点的传输路径 时, 对所述消息进行语义解析, 得到语义解析结果, 并根据所述语义解析 结果, 在已存储的实际主题中查找与所述语义解析结果匹配的实际主题; 路由规则生成模块, 用于若所述语义识别模块查找到与所述语义解析 结果匹配的实际主题, 则生成并存储所述发布者对应的虚拟主题与查找到 的所述实际主题之间的路由规则。
1 5、 根据权利要求 14所述的装置, 其特征在于, 所述主题模块, 具体 发布者对应的虚拟主题为起点, 并且以任意一个订阅者对应的虚拟主题为 终点的传输路径;
所述传输模块, 具体用于当所述主题模块查找到以所述发布者对应的 虚拟主题为起点, 并且以任意一个订阅者对应的虚拟主题为终点的传输路 径时, 在查找到的传输路径上或与所述消息对应的标识信息; 当所述消息 或与所述消息对应的标识信息传输至每一条传输路径的终点时, 将所述消 息发送至该传输路径的终点所对应的订阅者。
1 6、 根据权利要求 14或 1 5所述的装置, 其特征在于, 所述主题模块, 还用于在未查找到与所述语义解析结果匹配的实际主题时, 创建新的实际 主题;
所述路由规则生成模块, 还用于存储所述发布者对应的虚拟主题与新 创建的实际主题之间的路由规则。
1 7、 根据权利要求 1 3所述的装置, 其特征在于, 所述信息处理模块, 还用于获取发布者发送的控制消息, 所述控制消息用于更新已存储的虚拟 主题与实际主题之间的路由规则;
所述路由规则生成模块, 还用于根据所述控制消息, 对当前已存储的 虚拟主题与实际主题之间的路由规则进行修改,并存储修改后的路由规则。
1 8、 根据权利要求 1 3至 1 7任意一项所述的装置, 其特征在于, 所述 信息处理模块还用于, 在获取发布者发送至与所述发布者对应的虚拟主题 的消息之后, 生成与所述消息对应的标识信息;
所述传输模块, 具体用于当所述与所述消息对应的标识信息传输至每 一条传输路径的终点时, 获取与所述标识信息对应的消息, 并将与所述标 识信息对应的消息发送至传输路径的终点所对应的订阅者。
1 9、 一种消息发布的装置, 其特征在于, 包括:
获取模块, 用于获取发布者发送的消息;
语义识别模块, 用于对获取到的消息进行语义解析, 并根据语义解析 结果, 在已存储的实际主题中查找与所述语义解析结果匹配的实际主题; 主题模块, 用于在查找到与所述语义解析结果匹配的实际主题时, 在 已存储的订阅关系表中, 查找与所述实际主题对应的订阅者;
传输模块, 用于在查找到所述实际主题对应的订阅者时, 将所述获取 到的消息发送至查找到的所有订阅者。
20、 根据权利要求 1 9所述的装置, 其特征在于, 所述主题模块, 还用 于在未查找到与所述语义解析结果匹配的实际主题时,创建新的实际主题, 并存储创建的所述实际主题。
21、 一种消息订阅的装置, 其特征在于, 包括:
获取模块, 用于获取订阅者已发送至所述订阅者对应的虚拟主题的消 息;
创建模块, 用于根据获取到的订阅者发送的消息, 创建所述订阅者对 应的虚拟主题与目的实际主题之间的路由规则, 所述目的实际主题为所述 订阅者当前订阅的实际主题; 其中, 所述虚拟主题用于实际主题和发布者 之间的消息转发或者实际主题和订阅者之间的消息转发。
11、 根据权利要求 21所述的装置, 其特征在于, 所述创建模块包括: 第一主题子模块, 用于当获取到的所述消息为控制消息时, 根据所述 控制消息确定所述订阅者订阅的实际主题, 并将所述订阅者订阅的实际主 题作为所述目的实际主题, 所述控制消息包含所述订阅者订阅的实际主题 的消息; 路由规则模块, 用于更新所述订阅者对应的虚拟主题与所述目的实际 主题之间的路由规则。
23、根据权利要求 11所述的装置,其特征在于,所述第一主题子模块, 还用于当获取的所述消息不为控制消息时, 对获取的所述消息进行语义解 析, 并根据语义解析结果, 在已存储的实际主题中查找与所述语义解析结 果匹配的实际主题, 并在查找到与所述语义解析结果匹配的实际主题时, 将查找到的实际主题作为目的实际主题。
24、 根据权利要求 23所述的装置, 其特征在于, 所述创建模块, 还用 于当所述第一主题子模块在已存储的实际主题中未查找到与所述语义解析 结果匹配的实际主题时, 创建新的实际主题作为目的实际主题, 并创建所 述订阅者对应的虚拟主题与所述新的实际主题之间的路由规则。
PCT/CN2013/076631 2013-06-03 2013-06-03 消息发布与订阅的方法及装置 WO2014194452A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
PCT/CN2013/076631 WO2014194452A1 (zh) 2013-06-03 2013-06-03 消息发布与订阅的方法及装置
EP13876082.2A EP2835938B1 (en) 2013-06-03 2013-06-03 Message publishing and subscribing method and apparatus
CN201380000499.XA CN103534988B (zh) 2013-06-03 2013-06-03 消息发布与订阅的方法及装置
US14/489,743 US9110884B2 (en) 2013-06-03 2014-09-18 Message publishing and subscribing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/076631 WO2014194452A1 (zh) 2013-06-03 2013-06-03 消息发布与订阅的方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/489,743 Continuation US9110884B2 (en) 2013-06-03 2014-09-18 Message publishing and subscribing method and apparatus

Publications (2)

Publication Number Publication Date
WO2014194452A1 true WO2014194452A1 (zh) 2014-12-11
WO2014194452A9 WO2014194452A9 (zh) 2015-09-11

Family

ID=49935412

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/076631 WO2014194452A1 (zh) 2013-06-03 2013-06-03 消息发布与订阅的方法及装置

Country Status (4)

Country Link
US (1) US9110884B2 (zh)
EP (1) EP2835938B1 (zh)
CN (1) CN103534988B (zh)
WO (1) WO2014194452A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110278231A (zh) * 2018-03-16 2019-09-24 中移(苏州)软件技术有限公司 一种数据订阅分发方法及系统

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243611B (zh) * 2014-09-30 2017-07-07 浪潮软件股份有限公司 一种基于分发思想的消息服务中间件系统
US20160210313A1 (en) * 2015-01-16 2016-07-21 Futurewei Technologies, Inc. System for high-throughput handling of transactions in a data-partitioned, distributed, relational database management system
CN107026878A (zh) * 2016-01-29 2017-08-08 中兴通讯股份有限公司 订阅消息的发布方法及装置
US10225219B2 (en) * 2016-02-22 2019-03-05 International Business Machines Corporation Message delivery in a message system
CN108319599B (zh) * 2017-01-17 2021-02-26 华为技术有限公司 一种人机对话的方法和装置
CN107465735B (zh) * 2017-07-31 2020-08-14 杭州多麦电子商务股份有限公司 分布式消息系统
CN110365587B (zh) * 2018-03-26 2022-04-19 阿里巴巴集团控股有限公司 设备间通信方法、装置、设备和存储介质
CN110875935B (zh) * 2018-08-30 2023-03-24 阿里巴巴集团控股有限公司 消息发布、处理、订阅方法、装置及系统
US11201937B2 (en) 2018-11-22 2021-12-14 Jeffrey Alan Carley Message broker customization with user administered policy functions
CN109684450B (zh) * 2018-12-20 2023-07-14 中国科学院沈阳自动化研究所 一种基于语义化标识的工业网络数据分发服务系统及方法
CN109933439B (zh) * 2019-02-21 2024-06-11 深圳市珍爱捷云信息技术有限公司 消息传输方法、装置、计算机设备和存储介质
CN111669427B (zh) * 2020-04-20 2022-06-07 北京邮电大学 一种软件定义网络发布订阅系统和方法
CN112134938B (zh) * 2020-09-09 2022-08-26 重庆易宠科技有限公司 一种消息处理方法、装置、终端及计算机可读存储介质
CN114124454A (zh) * 2021-10-21 2022-03-01 深圳致星科技有限公司 消息发送方法、系统、电子设备、可读存储介质及产品
CN114449031B (zh) * 2021-12-03 2023-11-21 北京百度网讯科技有限公司 信息获取方法、装置、设备和存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1631016A (zh) * 2000-04-13 2005-06-22 英特尔公司 用于基于内容交换的网络设备
CN101061485A (zh) * 2005-01-10 2007-10-24 国际商业机器公司 用于数据交换、收集、监控和/或警报的消息集成系统

Family Cites Families (47)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2354913B (en) * 1999-09-28 2003-10-08 Ibm Publish/subscribe data processing with publication points for customised message processing
US7853643B1 (en) * 2001-11-21 2010-12-14 Blue Titan Software, Inc. Web services-based computing resource lifecycle management
US7406537B2 (en) * 2002-11-26 2008-07-29 Progress Software Corporation Dynamic subscription and message routing on a topic between publishing nodes and subscribing nodes
US20030135556A1 (en) * 2001-12-14 2003-07-17 International Business Machines Corporation Selection of communication strategies for message brokers or publish/subscribe communications
US8122118B2 (en) * 2001-12-14 2012-02-21 International Business Machines Corporation Selection of communication protocol for message transfer based on quality of service requirements
US8606859B2 (en) * 2002-10-17 2013-12-10 Tibco Software Inc. Method and system to communicate messages in a computer network
US7376832B2 (en) * 2003-04-21 2008-05-20 International Business Machines Corporation Distributed method, system and computer program product for establishing security in a publish/subscribe data processing broker network
US20050021836A1 (en) * 2003-05-01 2005-01-27 Reed Carl J. System and method for message processing and routing
GB0311260D0 (en) * 2003-05-16 2003-06-18 Ibm Publish/subscribe messaging system
US7831693B2 (en) * 2003-08-18 2010-11-09 Oracle America, Inc. Structured methodology and design patterns for web services
US20050086469A1 (en) * 2003-10-17 2005-04-21 Microsoft Corporation Scalable, fault tolerant notification method
US7267275B2 (en) * 2003-11-04 2007-09-11 Captech Ventures, Inc. System and method for RFID system integration
US7685265B1 (en) * 2003-11-20 2010-03-23 Microsoft Corporation Topic-based notification service
US8983966B2 (en) * 2004-02-27 2015-03-17 Ebay Inc. Method and system to monitor a diverse heterogeneous application environment
GB0419231D0 (en) * 2004-08-28 2004-09-29 Ibm Methods, apparatus and computer programs for control of publish/subscribe messaging
US7530077B2 (en) * 2004-10-07 2009-05-05 International Business Machines Corporation Dynamic update of changing data in user application via mapping to broker topic
US7822801B2 (en) * 2004-10-14 2010-10-26 International Business Machines Corporation Subscription propagation in a high performance highly available content-based publish/subscribe system
CN101133380A (zh) * 2005-01-06 2008-02-27 特维拉有限公司 基于硬件的消息传递设备
EP1851646A2 (en) 2005-01-06 2007-11-07 Tervela Inc. Intelligent messaging application programming interface
JP2008527848A (ja) * 2005-01-06 2008-07-24 テーベラ・インコーポレーテッド ハードウェア・ベースのメッセージング・アプライアンス
US7706895B2 (en) * 2005-02-25 2010-04-27 Rockwell Automation Technologies, Inc. Reliable messaging instruction
GB0613178D0 (en) * 2006-07-01 2006-08-09 Ibm An apparatus for deferred handling of a message
CN101222449A (zh) * 2007-01-10 2008-07-16 国际商业机器公司 发布/订阅系统和方法
US20090089408A1 (en) * 2007-09-28 2009-04-02 Alcatel Lucent XML Router and method of XML Router Network Overlay Topology Creation
US8140630B2 (en) * 2008-03-05 2012-03-20 International Business Machines Corporation Publish/subscribe message broker for message sequences
US8229736B2 (en) * 2008-04-16 2012-07-24 International Business Machines Corporation Transforming a natural language request for modifying a set of subscriptions for a publish/subscribe topic string
TWI372549B (en) * 2008-09-15 2012-09-11 Inst Information Industry Message processing apparatus and processing method thereof
JPWO2010090027A1 (ja) * 2009-02-05 2012-08-09 日本電気株式会社 分散型イベント配信システムにおけるブローカノードおよびイベントトピック制御方法
US8423619B2 (en) * 2009-03-20 2013-04-16 International Business Machines Corporation Message brokering in a consuming broker device
US8489722B2 (en) * 2009-11-24 2013-07-16 International Business Machines Corporation System and method for providing quality of service in wide area messaging fabric
KR20110065917A (ko) * 2009-12-10 2011-06-16 삼성전자주식회사 분산컴퓨팅 통신망에서 분산된 모듈 간의 통신을 지원하는 통신시스템 및 그 시스템을 이용한 통신방법
CN102859541A (zh) 2010-04-19 2013-01-02 国际商业机器公司 在发布/订阅通讯中控制消息传递
WO2011140562A2 (en) * 2010-05-07 2011-11-10 Topia Technology Tcp/ip on-time system
US8874667B2 (en) * 2010-05-18 2014-10-28 International Business Machines Corporation Linking topics in a publish/subscribe messaging environment
US10002202B2 (en) * 2010-05-28 2018-06-19 Microsoft Technology Licensing, Llc Realtime websites with publication and subscription
US20120030572A1 (en) * 2010-08-02 2012-02-02 International Business Machines Corporation Network visualization system
US8738704B2 (en) * 2010-09-07 2014-05-27 Xerox Corporation Publish/subscribe broker messaging system and method
US8467389B2 (en) * 2011-02-16 2013-06-18 Solace Systems, Inc. Subscription Management and Routing Protocol (SMRP) and Method
US8756288B2 (en) * 2011-03-11 2014-06-17 International Business Machines Corporation Publish/subscribe message routing
US8799469B2 (en) 2011-03-11 2014-08-05 International Business Machines Corporation Subscriber message payload handling
US9313159B2 (en) * 2011-03-24 2016-04-12 Red Hat, Inc. Routing messages exclusively to eligible consumers in a dynamic routing network
US8935330B2 (en) * 2011-05-11 2015-01-13 International Business Machines Corporation Redirecting messages in a publish/subscribe messaging system
US9094803B2 (en) * 2012-06-13 2015-07-28 All Purpose Networks LLC Wireless network based sensor data collection, processing, storage, and distribution
US9125123B2 (en) * 2012-06-13 2015-09-01 All Purpose Networks LLC Efficient delivery of real-time asynchronous services over a wireless network
US9046982B2 (en) * 2012-07-03 2015-06-02 International Business Machines Corporation Representing a graphical user interface using a topic tree structure
GB2504673A (en) * 2012-08-03 2014-02-12 Ibm Publish and subscribe messaging system wherein transmission from broker to subscribers is phased over time
KR101811966B1 (ko) * 2013-07-02 2017-12-22 콘비다 와이어리스, 엘엘씨 시멘틱 공표 및 탐색을 위한 메커니즘

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1631016A (zh) * 2000-04-13 2005-06-22 英特尔公司 用于基于内容交换的网络设备
CN101061485A (zh) * 2005-01-10 2007-10-24 国际商业机器公司 用于数据交换、收集、监控和/或警报的消息集成系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110278231A (zh) * 2018-03-16 2019-09-24 中移(苏州)软件技术有限公司 一种数据订阅分发方法及系统

Also Published As

Publication number Publication date
EP2835938A4 (en) 2015-04-01
EP2835938A1 (en) 2015-02-11
WO2014194452A9 (zh) 2015-09-11
EP2835938B1 (en) 2018-11-07
US20150006555A1 (en) 2015-01-01
CN103534988A (zh) 2014-01-22
US9110884B2 (en) 2015-08-18
CN103534988B (zh) 2017-04-12

Similar Documents

Publication Publication Date Title
WO2014194452A1 (zh) 消息发布与订阅的方法及装置
US11216321B2 (en) System and method for message management across a network
KR102277186B1 (ko) 애플리케이션 서비스 아바타를 통한 애플리케이션 서비스 전달
CN112771820B (zh) 服务网格内的区分式服务
US7702744B2 (en) Semantic information network (SION)
AU2017384993A1 (en) Data structure pooling of voice activated data packets
US8250032B2 (en) Optimizing publish/subscribe matching for non-wildcarded topics
WO2015101113A1 (zh) 处理报文的方法与设备
CN115486046A (zh) 基于开放虚拟软交换机ovs的数据包处理方法及设备
US10084696B2 (en) Aliasing of named data objects and named graphs for named data networks
CN111884833A (zh) 一种基于网络虚拟化技术的仿真系统集成方法
WO2020038337A1 (zh) 网络配置方法、装置及系统
CN115695280A (zh) 基于边缘节点的路由方法及装置、电子设备、存储介质
US9930000B2 (en) Method for posing requests in a social networking site
CN113347460B (zh) 直播系统搭建平台及消息传输方法
KR20190077700A (ko) 분산 클라우드 시스템에서 에지 클라우드에 의한 패킷 라우팅 방법
US10560333B1 (en) System and method for sharing subscriber resources in a network environment
CN115706720A (zh) 消息发送方法、消息发送端和服务器
CN116801372A (zh) 虚拟网络组的数据传输方法、系统、装置和电子设备
CN116264586A (zh) 组播通信方法、装置和系统

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 2013876082

Country of ref document: EP

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13876082

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE