Method and system for implementing asynchronous event-based distributed messaging service

By using multiple subscriptions and unique identifiers to filter response messages in a distributed messaging system, it solves the problem of subscribers identifying specific messages among a large number of messages, reduces data outflow and computing costs, and improves the efficiency and scalability of the system. sex.

CN117397225BActive Publication Date: 2024-09-17GOOGLE LLC
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202280038815.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-03-29
Filing Date
2022-03-28
Publication Date
2024-09-17
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

In a distributed messaging system, subscribers need to identify specific messages from a large number of messages, resulting in increased data outflow, high computational cost, and the possibility of triggering error events, especially when multiple subscribers and publishers exist, resulting in high Wait time and rate limiting issues.

Method used

By generating multiple subscriptions during process instantiation, each including a unique subscription identifier that is used to filter response messages, ensuring only messages relevant to a specific request are received, and generating subscribers at runtime, allowing filter values ​​to be reused To handle concurrent requests and avoid frequent instantiation.

Benefits of technology

It effectively reduces data outflow, reduces computing costs and waiting time, improves the scalability and efficiency of the system, avoids waiting problems caused by rate limits, and allows the system to handle multiple concurrent requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117397225B_ABST
    Figure CN117397225B_ABST
Patent Text Reader

Abstract

A method for implementing an event-based distributed messaging service includes, when a requesting process (170a) is instantiated to publish a request (164, 164R) to a response (164, 164r) from a responding process (170b), identifying a response topic (166, 166r) of the distributed messaging service (160) and generating subscriptions (212) for the response topic, wherein each subscription includes a subscription identifier (214). During runtime of the requesting process, the method publishes a request message (164, 164R) to the request topic (166, 166R) subscribed by the responding process, wherein the request message includes a unique message identifier (UMI), and generates a subscriber (168) using a corresponding subscription identifier of a corresponding subscription selected from the subscriptions, wherein the subscriber includes the unique message identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to methods and systems for implementing an asynchronous event-based distributed messaging service. Background Art

[0002] Distributed systems, such as cloud computing environments, are becoming more and more widely used to provide a range of software services. As these software services grow and enterprises integrate multiple services into their workflows, coordination between these services is likely to become increasingly important. That is, clients' reliance on compatibility between services requires robust communication between the processes of these services. Furthermore, clients prefer robust cooperation between processes to operate in a cost-effective manner in terms of both computational and financial costs. This means that when a messaging system coordinates actions between processes, the communication between these processes should avoid wasteful and latency-inducing operations. Summary of the invention

[0003] One aspect of the present disclosure provides a computer-implemented method for implementing an event-based distributed messaging service. When the method is executed by data processing hardware, the computer-implemented method causes the data processing hardware to operate. When a request process is instantiated, the request process publishes a request message for a response message from a response process, and the operation includes identifying a response topic of a distributed messaging service, the response topic receiving the response message to the request message from the response process, wherein the response process is configured as a publisher of the response topic. And, when a request process that publishes a request for a response from a response process is instantiated, the operation includes generating multiple subscriptions to the response topic, wherein each subscription includes a subscription identifier. During the runtime of the request process, the operation also includes publishing a request message to a request topic subscribed by the response process, wherein the request message includes a unique message identifier, and generating a subscriber using a corresponding subscription identifier of a corresponding subscription selected from the multiple subscriptions, wherein the subscriber includes the unique message identifier. In addition, during the runtime of the request process, the operation also includes, at the subscriber, receiving a filtered response message from the response process in response to the request message published to the response topic. Here, the filtered response messages are filtered based on one or more subscription identifiers associated with the plurality of subscriptions of the requesting process.

[0004] Another aspect of the present disclosure provides a system for implementing an event-based distributed messaging service. The system includes data processing hardware and memory hardware in communication with the data processing hardware. The memory hardware stores instructions that, when executed on the data processing hardware, cause the data processing hardware to operate. When a request process is instantiated, the request process publishes a request message for a response message from a response process, the operation includes identifying a response topic of a distributed messaging service, the response topic receiving the response message to the request message from the response process, wherein the response process is configured as a publisher of the response topic. And, when a request process that publishes a request for a response from a response process is instantiated, the operation includes generating multiple subscriptions to the response topic, wherein each subscription includes a subscription identifier. During the runtime of the request process, the operation also includes publishing a request message to a request topic subscribed by the response process, wherein the request message includes a unique message identifier, and generating a subscriber using a corresponding subscription identifier of a corresponding subscription selected from a plurality of subscriptions, wherein the subscriber includes the unique message identifier. Additionally, during runtime of the request process, the operations further include, at the subscriber, receiving, from the response process, a filtered response message in response to the request message published to the response topic, wherein the filtered response message is filtered based on one or more subscription identifiers associated with the plurality of subscriptions of the request process.

[0005] Implementations of the computer-implemented method or system of the present disclosure may include one or more of the following optional features. In some embodiments, the operation further includes randomly selecting the corresponding subscription from the multiple subscriptions during the runtime of the request process. In some examples, the operation further includes generating the request message for the request topic during the runtime of the request process. The subscription identifier may be unique among multiple instances of the request process. The subscription identifier may include a unique filter value and the filtered response message is filtered based on the unique filter value used to generate the corresponding subscription of the subscriber. In some examples, each corresponding subscriber of the corresponding topic of the distributed messaging system serves as a multicast subscription to retrieve all messages transmitted on the corresponding topic, the corresponding topic including the response topic and the request topic, and the all messages including the response message and the request message.

[0006] In some configurations, when the request process is instantiated, the request process publishes the request for the response from the response process, and the operations further include storing each subscription identifier of the plurality of subscriptions to the response topic in a hash map. In these configurations, during runtime of the request process, the operations include randomly selecting the corresponding subscription identifier from the hash map, the hash map storing each subscription identifier of the plurality of subscriptions to the response topic.

[0007] In some embodiments, during the runtime of the request process, the operation further comprises filtering one or more messages by a publisher of the request topic. Here, the filtering is performed by determining whether the one or more messages of the publisher of the request topic include the unique message identifier. When a corresponding message of the one or more messages of the publisher of the request topic fails to include the unique message identifier, the operation comprises preventing the corresponding message from being received by the subscriber. In these embodiments, the one or more messages of the publisher of the request topic include the filtered response message. When the filtered response message includes the unique message identifier, during the runtime of the request process, the operation further comprises generating a confirmation message.

[0008] Optionally, the request process may be instantiated in response to receiving an initial request to perform a computing task. When the request process is instantiated in response to receiving an initial request to perform a computing task, during the runtime of the request process, the operations further include, upon receiving the filtered response message from the response process in response to the request message published to the request topic, generating an initial response to the initial request to perform the computing task.

[0009] The details of one or more embodiments of the disclosure are set forth in the accompanying drawings and the description below. Other aspects, features, and advantages will be apparent from the description and drawings, and from the claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1A is a schematic diagram of an example of a cloud computing environment with an event server.

[0011] Figure 1B is a flow chart of an example of data flow out of a multi-instance publisher-subscriber system.

[0012] Figure 1C is a flow chart of an example of using an event server to block data outflow from a multi-instance publisher-subscriber system.

[0013] Figures 2A-2C yes Figure 1AA schematic diagram of an example of an event server in a cloud computing environment.

[0014] Figure 3 is a flow diagram of an example operational arrangement of a method for implementing an event-based distributed messaging service.

[0015] Figure 4 is a schematic diagram of an example computing device that may be used to implement the systems and methods described herein.

[0016] The same reference numbers in different drawings denote the same elements. DETAILED DESCRIPTION

[0017] As more businesses and individuals use distributed computing systems (i.e., cloud-based computing systems), these distributed computing systems may use some type of client-oriented mechanism to perform tasks of various processes associated with one or more services provided by the distributed system. For example, a client (i.e., a business and / or an individual user) may use an analysis platform (i.e., a data analysis service) that performs data analysis on client data. An action hub, used as a client-oriented mechanism, may be part of the analysis platform and enable the client to perform actions on the data being analyzed by the analysis platform. Here, by having a client-oriented mechanism (e.g., an action hub) that is integrated with the analysis platform (e.g., a data analysis system), the client avoids having to use one system to coordinate tasks and another different system to perform data analysis.

[0018] In addition, clients typically integrate components of one software service with the functionality of another software service. Continuing with the example of the analysis platform, a client of the action hub of the analysis platform may want to send an email to the client's users. In this example, the client can use the analysis platform to generate a visual financial report for the client based on the client's data, and the client may then want to transmit the visual financial report to several users of the client (for example, employees of the client's business). In order to generate an email for this visual financial report, the client arranges an action using the action hub, where the action is to transmit the financial report as an email to the intended recipient. The action hub will generate a request to retrieve the visual financial report, and once the financial report is retrieved, the action hub will perform a triggering action to send the financial report to the intended recipient. Here, the sending action is a triggering action or an event-based action, because the action of sending the visual financial report is triggered by the event of receiving the visual financial report in response to the retrieval request. That is, an event-based action refers to an action that occurs in response to a specific event or group of events.

[0019] One problem that can arise with client-facing mechanisms like the Action Hub is that the tasks coordinated through the Action Hub may be important or even critical workloads for the client. In other words, the client may be a business that relies on actions coordinated from the Action Hub to operate. For example, a financial client or client team may rely on financial data management or financial data storage and data analysis of financial data. For example, a client's finance team relies on emails that include visual financial reports to evaluate financial investments. If the Action Hub fails due to all client workloads or other reasons, such a failure may jeopardize client relationships and may even cause clients to control or host their own version of the Action Hub as a failsafe.

[0020] Failures can have various causes, but one issue that can cause failures is the way events are coordinated to carry out a specific task. In order to coordinate the specific set of events that enable a task to occur, client-oriented mechanisms such as the Action Hub employ a distributed messaging system. A distributed messaging system allows for messages to be published on a specific topic and for subscribers to that topic to receive messages published on that topic. A topic generally refers to a named resource that a distributed messaging system configures for a publish-subscribe relationship. In this sense, client-oriented mechanisms like the Action Hub work with a distributed messaging system to request that a specific action be carried out and to communicate when that specific action has been carried out.

[0021] To illustrate with an email of a visual financial report, the action hub uses a distributed messaging system to generate a request message for retrieving a visual financial report for a topic that retrieves the visual financial report. The subscriber to the topic can be an application or service that generates or can retrieve a visual financial report. The subscriber can then act as a publisher to generate a message including the visual financial report and publish the message to the topic of the retrieved visual financial report. The action hub can then use the distributed messaging system to generate a request message to send the report as an email to the topic that generates the email. The subscriber to the topic that generates the email can receive the request message with the visual financial report and use an email service or email application to send the visual financial report to the intended recipient. When the action of sending the email has been performed, the subscriber then works as a publisher to publish a response message to the sent email topic, which communicates that the email with the report has been sent. The subscriber to the sent email topic receives the response message. At this stage, the action hub can indicate that the action of sending the visual financial report to the specified recipient via email has been completed, and no further action can be taken on the task.

[0022] Although this message delivery sequence appears successful for the client's action, scaling this process can be problematic. For example, in a publisher-subscriber messaging system, a subscriber does not typically receive relevant messages related to a client's action individually, but rather a subscriber subscribes to a topic and is configured to receive all messages for that particular topic. For a publisher-subscriber system, when a message about a particular topic to which a subscriber subscribes is received, the distributed messaging system can push the message to the subscriber, or the subscriber can extract (i.e., retrieve) the message from the topic to which the subscriber actively subscribes. Unfortunately, however, in either case, the subscriber receives the message about the topic and does not typically understand the context of the message before receiving it (except for the general context that the message is related to the topic). In a scale system, when multiple publishers (e.g., thousands of publishers) generate different messages related to a large number of actions, it becomes cumbersome for the subscriber to identify a specific message and results in a large amount of data outflow. For example, in the case of a report email, the final subscriber to the topic of the sent email is waiting for the publisher associated with the action container to indicate that an email with a visual financial report has been sent. However, the subject of the sent email may receive thousands of messages regarding the email communication, and ultimately the subscriber has to try to identify whether any of those thousands of messages is specifically related to the email visualizing the financial report.

[0023] One approach to trying to identify whether any of these thousands of messages are relevant to the email visualizing the financial report is for the end subscriber to extract all received messages on the topic and filter through a thousand messages until the end subscriber identifies the single message of interest. This process generates a large amount of data outflow because in the case of a thousand messages, the distributed messaging system must transmit the other 999 additional messages to the subscriber; incurring additional computational costs and potentially triggering false events in the process. Additionally, as enterprises themselves, cloud service providers typically charge clients for data outflow, making this process costly for all parties involved.

[0024] To further extend this example, there may be multiple subscribers to a topic, and each subscriber may be trying to identify a message confirming that an action has been completed. So instead of 999 additional messages for a single subscriber, the outflow for all subscribers is multiplied. That is, for one hundred subscribers, these one hundred subscribers receive a total of 99,900 additional messages because each of these one hundred subscribers is interested in a single message. In addition, distributed computing infrastructure providers often have rate limits that limit the request rate for a particular call. That is, a cloud provider may have a rate limit of 200 requests per second per call, which would cause a subscriber to wait 5 seconds to respond to a call that generates one thousand requests for one thousand messages about a topic. Due to rate limits, clients may be forced to experience high latency, especially for actions with multiple events (e.g., multiple subscription calls).

[0025] One way to overcome these outflow issues is to generate a filter or unique request identifier whenever a specific action request occurs. This means that a request to generate an email of a visual financial report will result in the creation of an instance with a unique request identifier for the specific action. The instance will generate a subscription to the necessary topic for the action to be performed, but the subscription will include the unique request identifier as a way to filter the response messages, preventing potential large outflows. While this approach can reduce outflows, it also generates unique instances that the system cannot use for other tasks. In other words, with a unique request identifier, the instance is completely unique to the request and its structure cannot be reused for arbitrary other requests. Unfortunately, the client's finance team may generate an email of a visual financial report every week, because the report may be dynamic, and the instance with a unique request identifier generated by the system for one week cannot be used again the next week. In other words, this unique request identifier approach leads to potential frequent instantiation of the system.

[0026] To address these outflow issues, while also paying attention to instantiation, the method described herein changes the way a process is instantiated so that the instantiation of a process includes filters, but the filters are not unique to a particular action request. Instead, during the instantiation of a process, the system generates N subscriptions to the subject of the process, where each subscription includes a unique value (e.g., a unique filter value). When the system receives an action request, the system generates subscribers based on these subscriptions, rather than binding these unique values ​​to a specific request during creation (i.e., instantiation of the process) and thereby generating a limited purpose subscription. That is, during runtime after the instantiation of a process with N subscriptions, the system receives a request for the process and creates a subscriber that uses the unique value associated with a previously instantiated specific subscription. In this sense, the unique value is used as a filter for a particular request, but the creation of the filter does not limit subscriptions to that particular request. This means that for a first request, the system can create a subscriber based on the instantiated subscription by using the unique value of the instantiated subscription, but when a second request occurs in the future, another subscriber can be generated that uses the same unique value of the instantiated subscription for its filter. Thus, a subscriber specific to the first request may be discarded when the first request completes, but the value used as its filter value may be used for some subsequent requests in the process. Furthermore, by instantiating N subscriptions, the process can be scaled to operate N concurrent requests. For example, each concurrent request can construct a subscriber using one of the unique values ​​of the N subscriptions.

[0027] Figure 1A is an example of a cloud computing environment 100. The environment 100 includes one or more clients 10 communicating with a remote system 130 via a network 120. The client 10 communicates with the remote system 130 to access and execute various computing platforms. In other words, the remote system 130 (e.g., a cloud computing environment) can provide various software as a service (SaaS) platforms, where the customers of the cloud environment 130 are the clients 10. In this regard, the clients 10 can range from businesses or enterprises to individual users of the cloud environment 130.

[0028] Client 10 may generally refer to any user of remote system 130. Client 10 communicates with remote system 130 using client device 110, which may correspond to any computing device associated with client 10. Some examples of client device 110 include, but are not limited to, mobile devices (e.g., mobile phones, tablets, laptops, e-book readers, etc.), computers, wearable devices (e.g., smart watches), music players, projection devices, smart appliances (e.g., smart TVs) and Internet of Things (IoT) devices, remote controls, smart speakers, etc. Remote system 130 may include remote resources, such as remote data processing hardware 132 (e.g., a remote server or CPU) and / or remote memory hardware 134 (e.g., a remote database or other storage hardware). Client device 110 may utilize remote resources to perform various functions related to processes of services of remote system 130. These processes may be hosted by remote system 130 or integrated with local resources of client device 110.

[0029] The client 10 (e.g., via the client device 110) interacts with the action system 140 (e.g., also referred to as the action hub 140) to cause the action hub 140 to perform a specific action submitted by the client 10 as an action request 150. Here, an action can refer to any computing task that utilizes some functionality of various services associated with the remote system 130. In general, the client 110 can generate an action request 150 to cause client data that has been processed or analyzed by a specific service of the remote system 130 to be integrated or used by another service. For example, the client 110 requests an action 150 to send an email using an email service, the email including a financial report on the client data generated by the analysis service of the remote system 130.

[0030] Once the action associated with the action request 150 has been completed or attempted to be completed, the action hub 140 can generate a response 180 to notify the client 10 (e.g., the client device 110) of the status of the action from the action request 150. When the response 180 is that the action has been completed (e.g., the response message 164 indicates that the process 170 has performed the action), the action hub 140 can transmit an actual message or some other form of communication to the client 10 to indicate the completion of the action. In some examples, the action hub 140 displays that the action has been completed as the status of the action in the client-facing interface. In some configurations, the request 150 and / or the response 180 are messages using the Hypertext Transfer Protocol Secure (HTTPS) or the Hypertext Transfer Protocol (HTTP).

[0031] like Figure 1AAs shown, the action hub 140 can be associated with or include a messaging system 160 and an event server 200. The action hub 140 is shown as a dotted box surrounding the messaging system 160 and the event server 200 because these components can be part of the action hub 140 itself, or separate from the action hub 140 but still in communication with it. Here, the messaging system 160 can refer to a distributed messaging system that operates by coordinating asynchronous events. Here, asynchronous means that events do not have to occur at the same time. This is also generally true for asynchronous messaging. Messages can be exchanged between, for example, two processes (e.g., a first process 170, 170a and a second process 170, 170b) without the need for a current conversation (i.e., direct contact) to occur between the processes 170.

[0032] If the request 150 is to send an email with a visual financial report, and the visual financial report has been obtained, the event that completes the request will be to send a request to a service that is capable of sending emails, and to solicit a response that the action has been completed. Here, a service that is capable of performing an action is generally referred to as an action container. An action container refers to an instance of a process 170 that is capable of performing a specified action. Distributed systems may generally prefer to use action containers because action containers can be contained (i.e., isolated) in a distributed system so that operations performed in an action container do not unnecessarily affect other services or workloads of the distributed system. In this sense, an action container can contain instances of a particular service or application so that the remote system 130 can scale the number of instances to accommodate the current workload or expected workload on the resources of the remote system 130.

[0033] When using an action container to perform some or all of a particular action, the action hub 140 is typically not able to know whether the requested action 150 has been performed unless there is some feedback that the action has been processed. That is, a process 170 in an action container may perform a specified action, but without more information, the action hub 140 is unaware of the progress of the process. In this regard, the process 170 also utilizes a messaging system 160 to communicate that the action has been completed.

[0034] In some examples, in order to run asynchronously, the messaging system 160 operates in a publisher-subscriber configuration. The publisher-subscriber configuration enables certain processes 170 to act as publishers 162, which publish messages 164 on a particular topic 166, and subscribers 168 of the topic 166 subscribe to the topic 166 so that they know that the message 164 has been generated on the topic 166. For example, the messaging system 160 configures the topics 166, where each topic 166 includes a storage space in which the messages 164 on the particular topic 166 are stored. When the subscriber 168 receives an indication that there is a message 164 on the topic 166 to which it subscribes, the subscriber 168 can retrieve (e.g., extract) the message 164 from the corresponding storage location. In some embodiments, the messaging system 160 is configured to push messages 164 about one or more topics 166 to subscribers 168 of the topic 166, such that when a message 164 about a topic 166 is received, the messaging system 160 transmits the message 164 to all subscribers 168 that have subscribed to the topic 166. The publisher-subscriber relationship can be one-to-many, meaning that one publisher 162 publishes messages 164 about a topic 166 to which multiple subscribers 168 subscribe, many-to-one, meaning that multiple publishers 162 publish messages 164 about a topic 166 to one subscriber 168, or some variation thereof. Furthermore, with this form of distributed messaging, the number of publishers 162 and / or subscribers 168 for a given topic 166 can change dynamically based on the messaging needs of the distributed system. This means that the remote system 130 can instantiate multiple instances of the action container of the process 170 that generates the email.

[0035] In the publisher-subscriber model, the instantiated process 170 can be a publisher 162, a subscriber 168, or both. For example, the process 170 is a publisher 162 of a first topic 166, 166a and a subscriber 168 of a second topic 166, 166b. This means that the process 170 can generate one or more messages 164 about the first topic 166a, and listen / receive one or more messages 164 about the second topic 166b. For illustration, the process 170 contained in the instance of the application container can be a subscriber 168 of the first topic 166a, which will notify the process 170 about the action that the process 170 has been requested to perform, and can also be a publisher 162 of the second topic 166b, which serves as a topic indicating that the requested action has been performed. In the email example, the process 170 is an email application that can generate emails with attached visual financial reports. The email application is a subscriber 168 of the first topic 166a for email requests, and serves as a publisher 162 of the second topic 166b for sent emails.

[0036] The event server 200 is a system configured to prevent a large amount of data from flowing out when an action is performed using the remote system 130 . Figure 1B 166a, 168a-e, 168f-j ... For example, process B may be an email application, and each message request 164 requests process B to generate an email with different parameters (e.g., content, recipients, attachments, etc.). Each message 164 is shown to be unique by a different fill pattern within the circle element designated as the message request 164. In this example, the gray-filled message request 164, 164a (or first message request 164a) from the first instance of process A is a request for process B to generate an email with a visual financial report. As a subscriber 168, each instance of process B receives the message request 164 on the first topic 166a. When the instance of process B receives the message request 164, it performs the corresponding action requested in the message 164. Once each instance of process B transmits the parameterized email as requested, each instance of process B publishes a response message 164f-j on the second topic 166b as a publisher 162f-j (i.e., the corresponding email has been sent). Each instance of process A also subscribes as a subscriber 168f-j to a second topic 166b regarding email communications so that each instance of process A can understand when a requested email is sent.

[0037] As previously mentioned, subscribers 168 of topic 166 conventionally cannot identify the content of messages 164 regarding topic 166 without any other system. In this regard, Figure 1BEach instance of process A is depicted as extracting all response messages 164f-j from the storage location of the second topic 166b. Here, it is determined for the first instance of process A that an email with a visualized financial report has been generated (i.e., the first message 164a), the first instance of process A receives all response messages 164f-j, and determines that response message 164g provides confirmation that an email with a visualized financial report has been generated. To make this determination, the first instance of process A receives and then discards or ignores other response messages 164f,h,-j extracted from the second topic 166b. In this example, the outflow occurs because only a single message 164 is required for confirmation, but the first subscriber 168f must extract five messages 164 in order to identify the actual message 164 of interest (i.e., message 164g).

[0038] on the contrary, Figure 1C Describes how event service 200 avoids the problem of data outflow. Figure 1C Similar to Figure 1B , except that response messages 164f-j are filtered (e.g., displayed as a filter layer). That is, the subscriber 168 of the second topic 166b of each instance of process A waits for a response message 164 from process B whose corresponding action has been performed, without having to extract all of the response messages 164f-j. Instead, the response messages 164f-j are filtered based on the unique message identifier UMI included in each original request message 164a-e published by process A. By filtering the response messages 164f-j, each subscriber 168f-j associated with process A receives messages 164 related to a specific instance of process A. In this example, only one response message 164 is related to each instance of process A, and each subscriber 168 of process A receives a single response message 164 (e.g., indicating that the action of the request message 164 has been completed by process B).

[0039] Continue to refer Figure 1A , the event server 200 is configured to instantiate a process 170 and establish a publisher 162 / subscriber 168 relationship to perform a particular action. To establish a publisher 162 / subscriber 168 relationship, the event server 200 can identify a topic of interest 166 that a particular process 170 will be involved in. For example, Figure 1AA first process 170a and a second process 170b are depicted. The first process 170a is shown as a publisher 162 that generates a request message 164, 164R on a first topic 166a, while the second process 170b is a subscriber 168 to the first topic 166a and receives the request message 164R. The second process 170b then acts as a publisher 162 to the second topic 166b by generating a response message 164, 164r in response to the request message 164R. The first process 170a is a subscriber to the second topic 166b to receive the response message 164r, which notifies the first process 170a of the action associated with the request message 164R.

[0040] refer to Figures 2A-2C To establish these publisher / subscriber relationships for the process 170, the event server 200 performs different operations depending on whether the event server 200 instantiates the process 170 or implements the process 170 during runtime. In this regard, the event server 200 includes an initiator 210 and a runtime generator 220. The initiator 210 performs operations that occur during the instantiation of the process 170, which will publish a request message 164R (e.g., requesting that a certain action be performed by the responding process 170b). In this regard, the initiator 210 instantiates the requesting process 170. When the initiator 210 instantiates the requesting process 170, the initiator 210 identifies the topic 166 of the messaging system 150 that will receive a response message 164r from another process 170b, which will respond to the request message 164R of the requesting process 170A. Here, the other process 170b is referred to as the responding process 170 because it responds to the request message 164R. The topic 166 identified by the initiator 210 is referred to as a response topic 164, 166r because it is the topic 166 to which the response process 170b will transmit its response message 164r. In other words, since the request message 164R requests the response process 170b to perform a specific action, the response topic 166r is the topic 166 to which the response process 170b will publish a response message 164r indicating the status of the action (e.g., the action has been completed, failed, or is in some intermediate state). In some examples, the initiator 210 identifies the response topic 166r by identifying the response process 170b that will perform the action of the request message 164R, and then determining the topic 166 to which the particular response process 170b will publish as the publisher 162.

[0041] Once the initiator 210 identifies the response topic 166r during the instantiation of the request process 170a, the initiator 210 generates N subscriptions 212, 212a-n (also referred to as a plurality of subscriptions 212) to the identified response topic 166r for the particular instance of the request process 170a. Each subscription 212 generated by the initiator 210 for the particular instance of the request process 170a includes a subscription identifier 214 (shown as SID). In some examples, the subscription identifier 214 refers to a unique identifier that identifies a single subscription 212 from the plurality of subscriptions 212. In other words, one subscription 212 may not share or have a common subscription identifier 214 with another subscription 212 (e.g., in a particular instance of the request process 170a).

[0042] In some implementations, the initiator 210 generates each subscription 212 with a filter having a pending filter value 216 (shown as Fv). Here, the filter value 216 may also be unique, in that no other subscription 212 has the same filter value 216 as another subscription 212. The filter value 216 may be associated with the subscription identifier 214, or may be completely separate from the subscription identifier 214. For example, in Figure 2B , each subscription 212a-n is shown having a subscription identifier 214 and a filter value 216. In addition, one or both of the subscription identifier 214 and the filter value 216 for a particular subscription 212 are also unique among all subscriptions 212 of all instances of the requesting process 170a. This means that the subscription identifier 214 and / or the filter value 216 are not shared with any other instances of the requesting process 170a, such that, for example, one or a combination of the subscription identifier 214 and the filter value 216 is unique to the particular instance of the requesting process 170a. By making these elements unique, the messages 164 subscribed to by the requesting process 170a can be filtered to ensure that the messages 164 received by the subscriber 168 of the particular instance of the requesting process 170a are intended for the particular instance of the requesting process 170a. In other words, the subscription identifier 214 and / or the filter value 216 enable the event server 200 to prevent data from flowing out during the runtime of the requesting process 170a.

[0043] In some configurations, a subscription identifier 214 and / or a filter value 216 corresponding to each subscription 212 is stored in a storage element, such as a hash map. For example, when the storage element is a hash map, the hash map includes an entry with a key-value pair, wherein the key is a filter and the value is a subscription 212. Here, the filter corresponding to the key can be a subscription identifier 214, a filter value 216, and / or some combination of the two. The size of the storage element (e.g., a hash map) can correspond to the number of simultaneous requests that an instance of the request process 170a can handle. This is because the server 200 can filter the message 164 received at the response topic 166r by the filter value 216 and / or the subscription identifier 214. When this is the case and these elements 214, 216 are unique to a single subscription 212, if the filter value being used is not shared, the server 200 can only completely block the data from flowing out.

[0044] refer to Figure 2B , the launcher 210 illustrates the fact that the requesting process 170a may be instantiated numerous times (e.g., shown as instances 1-i), wherein each instance of the requesting process 170a includes a collection 212, 212a-n of subscriptions 212, 212a-n. s For example, the first instance includes a first set 212, 212a-n of subscriptions. s1 The second instance includes a second set 212, 212a-n of subscriptions. s2 The i-th instance includes an i-th set 212, 212a-n of subscriptions. si For multiple instances, each instance may have its own storage element for subscription identifiers 214 and / or filter values ​​216 corresponding to the set 212s of subscriptions 212 of the corresponding instance. Alternatively, the server 200 may include a global storage element that stores all subscription identifiers 214 and / or filter values ​​216 corresponding to all sets 212 of subscriptions 212 (i.e., for all instances).

[0045] refer to Figure 2A and 2C, after the initiator 210 instantiates the request process 170a, the runtime generator 220 of the event server 200 manages how the subscription 212 is used during the runtime of the request process 170a. During the runtime of the request process 170a, the runtime generator 220 is configured to publish a request message 164R to the request topic 166R subscribed by the response process 170b. In some examples, the request message 164R corresponds to the action that the client 10 requests the action hub 140 to perform by generating the request 150. When the action hub 140 receives the request 150, the action hub 140 can provide the request 150 to the event server 200 to enable the event server 200 to identify one or more actions (e.g., event-based actions) that will complete the request 150. For each action identified by the event server 200, the event server 200 can generate a request message 164R requesting the process 170 that is capable of performing the action associated with the request message 164R to perform the action. Here, in order to request a process 170 (e.g., referred to as a responding process 170b) to perform an action, the requesting process 170a publishes a request message 164R to a request topic 166R to which the responding process 170b is subscribed as a subscriber 168a. As a subscriber 168a, the instance of the responding process 170b receives the request message 164R and performs an action identified by or associated with the request message 164R. The responding process 170b notifies the requesting process 170a that the action has been completed (or some status associated with the action) by publishing a response message 164r via a publisher 162b as a response topic 166r.

[0046] Because the event server 200 is intended to prevent or reduce data outflow (e.g., regarding subscription calls), the runtime generator 220 is configured to generate a subscriber 168b for the requesting process 170a that receives the response message 164r after the runtime generator 220 ensures that the response message 164r is indeed for the specific instance of the requesting process 170a. In order to generate a subscriber 168b that only receives the response message 164r for the specific instance of the requesting process 170a, the runtime generator 220 generates the subscriber 162b using the subscription identifier 214 and / or the filter value 216 of the corresponding subscription 212 instantiated by the initiator 210. In some examples, the runtime generator 220 generates a subscriber 168b for the specific instance of the requesting process 170a from the set 212 of subscriptions 212. S A subscription 212 is selected (e.g., randomly selected) from the selected subscription 212, and a subscriber 162b having a subscription identifier 214 (and / or a filter value 216) is generated for the instance of the requesting process 170a from the selected subscription 212. For example, Figure 2CThe runtime generator 220 is shown selecting a second subscription 212b from a first instance of the request process 170a previously instantiated by the launcher 210. With this approach, rather than generating the subscription 212 during runtime where the subscription 212 may have a unique identifier specific to the request message 164R and its associated actions for filtering purposes, the subscribers 168 of the request process 170a are generated during runtime and these subscribers 168 are generated using identifiers (e.g., subscription identifiers 214 and / or filter values ​​216) that are unaware of the specific request message 164R and the specific actions of the request message 164R. In addition, when the specific actions of the request message 164 are completed and the purpose of the subscriber (determining that the specific actions have occurred) is completed, the cloud computing environment 130 does not include the entire obsolete instance of the process 170, but only the obsolete subscriber 168b. The instance of the requesting process 170a that generated the discarded subscriber 168b may continue to exist and process other requests by reusing the identifiers 214, 216 of the discarded subscriber 168b or by generating subscribers 168 based on other subscriptions 212 instantiated by the initiator 210 for the instance of the requesting process 170a.

[0047] In some configurations, the runtime generator 220 associates a unique message identifier UMI with the request message 164R. For example, when the runtime generator 220 generates the request message 164R (e.g., from the request 150), it also creates a unique message identifier UMI to be included in the request message 164R. In some examples, in addition to associating the UMI with the request message 164R, the runtime generator 220 also associates or adds the UMI to the subscriber 168 generated by the runtime generator 220 to receive the response message 164r. When the subscriber 168b also includes the UMI, the runtime generator 220 has another way to ensure that the expected response (i.e., the response message 164r) from the response process 170b is delivered by the underlying messaging infrastructure associated with the initial request 150. In some aspects, the addition of the UMI acts as a failsafe. That is, the subscriber 168b has been configured to filter out any messages on the response topic 166r using one or both of the subscription identifier 214 or the filter value 216. In this regard, the subscriber 168b should not receive a response message 164r that is not associated with a specific action requested by a specific instance of the requesting process 170a in the request message 164r. However, as a fail-safe, the runtime generator 220 can be configured to include a UMI to confirm that the UMI associated with the response message 164r received at the subscriber 168b is a UMI created based on the request 150 to the request message 164R. Thus, the inclusion of the UMI enables the runtime generator 220 to generate a confirmation message to confirm that the response message 164r (e.g., the filtered response message 164r) includes the UMI.

[0048] In some embodiments, the request process 170a refers to an edge server. Here, the edge server is responsible for listening to incoming requests (e.g., request 150). Therefore, the edge server issues a request message 164R based on the request 150 to the response process 170b, such as a specific instance of an action container. In this case, both the request process 170a and the response process 170b can be stateless single-threaded processes of the remote system 130. Both processes 170 can be scaled by being copied to multiple instances so that each instance can operate simultaneously. This means that the first request 150 can cause the first instance of the request process 170a to request an action from the third instance of the response process 170b, while the second request 150 causes the sixth instance of the request process 170a to request an action from the first instance of the response process 170b.

[0049] Figure 3304. is a flow chart of an example operational arrangement of a method 300 for implementing an event-based distributed messaging system. Operations 302 and 304 occur when the method 300 instantiates a request process 170a, and the request process 170a publishes a request 164, 164R for a response 164, 164r from a response process 170b. At operation 302, the method 300 identifies a response topic 166, 166r of a distributed messaging service 160 that receives a response 164, 164r from the response process 170b for the request 164, 164R. The response process 170b is configured as a publisher 162 of the response topic 166, 166r. At operation 304, the method 300 generates a plurality of subscriptions 212, 212a-n for the response topic 166r, wherein each subscription 212 includes a subscription identifier 214. Operations 306-310 occur during runtime of the request process 170a. At operation 306, the method 300 publishes a request message 164, 164R to a request topic 166, 166R subscribed by the response process 170b. The request message 164, 164R includes a unique message identifier UMI. At operation 308, the method 300 generates a subscriber 168 using a corresponding subscription identifier 214 of a corresponding subscription 212 selected from the plurality of subscriptions 212, 212a-n. The subscriber 168 includes the unique message identifier UMI. At operation 310, the method 300 receives a filtered response message 164, 164r from the response process 170b at the subscriber 168 in response to the request message 164, 164R published to the response topic 166, 166R. Here, the filtered response message 164, 164r is filtered based on one or more subscription identifiers 214 associated with the plurality of subscriptions 212, 212a-n of the request process 170a.

[0050] Figure 4 4 is a schematic diagram of an example computing device 400 that can be used to implement the systems and methods described herein. Computing device 400 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The components shown here, their connections and relationships, and their functions are merely exemplary and are not meant to limit the implementation of the inventions described and / or claimed in this document.

[0051] The computing device 400 includes a processor 410 (e.g., data processing hardware), a memory 420 (e.g., memory hardware), a storage device 430, a high-speed interface / controller 440 connected to the memory 420 and a high-speed expansion port 450, and a low-speed interface / controller 460 connected to a low-speed bus 470 and the storage device 430. Each of the components 410, 420, 430, 440, 450, and 460 are interconnected using various buses and can be mounted on a common motherboard or in other appropriate ways. The processor 410 can process instructions for execution within the computing device 400, including instructions stored in the memory 420 or on the storage device 430, to display graphical information of a graphical user interface (GUI) on an external input / output device (e.g., a display 480 coupled to the high-speed interface 440). In other embodiments, multiple processors and / or multiple buses, as well as multiple memories and multiple types of memories, can be used as appropriate. Furthermore, multiple computing devices 400 may be connected, with each device providing portions of the necessary operations (eg, as a server bank, a blade server bank, or a multi-processor system).

[0052] Memory 420 stores information non-temporarily within computing device 400. Memory 420 may be a computer-readable medium, a volatile memory unit, or a non-volatile memory unit. Non-temporary memory 420 may be a physical device used to temporarily or permanently store programs (e.g., sequences of instructions) or data (e.g., program state information) for use by computing device 400. Examples of non-volatile memory include, but are not limited to, flash memory and read-only memory (ROM) / programmable read-only memory (PROM) / erasable programmable read-only memory (EPROM) / electrically erasable programmable read-only memory (EEPROM) (e.g., commonly used for firmware, such as bootloaders). Examples of volatile memory include, but are not limited to, random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), phase change memory (PCM), and disk or tape.

[0053] The storage device 430 can provide mass storage for the computing device 400. In some embodiments, the storage device 430 is a computer-readable medium. In various embodiments, the storage device 430 can be a floppy disk device, a hard disk device, an optical disk device or a tape device, a flash memory or other similar solid-state storage device, or an array of devices, including devices in a storage area network or other configuration. In other embodiments, a computer program product is tangibly contained in an information carrier. The computer program product includes instructions that, when executed, perform one or more methods, such as those described above. The information carrier is a computer-readable medium or a machine-readable medium, such as a memory 420, a storage device 430, or a memory on a processor 410.

[0054] The high-speed controller 440 manages bandwidth-intensive operations of the computing device 400, while the low-speed controller 460 manages less bandwidth-intensive operations. This allocation of responsibilities is exemplary only. In some embodiments, the high-speed controller 440 is coupled to the memory 420, the display 480 (e.g., through a graphics processor or accelerator), and to the high-speed expansion port 450, which can accept various expansion cards (not shown). In some embodiments, the low-speed controller 460 is coupled to the storage device 430 and the low-speed expansion port 490. The low-speed expansion port 490, which can include various communication ports (e.g., USB, Bluetooth, Ethernet, wireless Ethernet), can be coupled to one or more input / output devices, such as a keyboard, a pointing device, a scanner, or a network device, such as a switch or a router, through, for example, a network adapter.

[0055] As shown, computing device 400 can be implemented in many different forms. For example, it can be implemented as a standard server 400a or multiple implementations in such a server 400a group, can be implemented as a laptop computer 400b or implemented as part of a rack server system 400c.

[0056] Various implementations of the systems and techniques described herein can be realized in digital electronic and / or optical circuits, integrated circuits, specially designed ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs executable and / or interpretable on a programmable system comprising at least one programmable processor, which may be special purpose or general purpose, coupled to receive data and instructions from a storage system, and to send data and instructions to the storage system.

[0057] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processor and may be implemented in high-level procedural and / or object-oriented programming languages ​​and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, non-transitory computer-readable medium, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0058] The processes and logic flows described in this specification can be performed by one or more programmable processors executing one or more computer programs to perform functions by operating input data and generating outputs. The processes and logic flows can also be performed by dedicated logic circuits, such as FPGAs (field programmable gate arrays) or ASICs (application-specific integrated circuits). For example, processors suitable for executing computer programs include general-purpose and special-purpose microprocessors, and any one or more processors of any kind of digital computer. Typically, the processor will receive instructions and data from a read-only memory or a random access memory or both. The basic elements of a computer are a processor for performing instructions and one or more storage devices for storing instructions and data. Typically, a computer will also include or be operably coupled to one or more mass storage devices (such as magnetic disks, magneto-optical disks, or optical disks) for storing data, to receive data from the mass storage device or to transmit data to it, or both. However, a computer does not need to have such a device. Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and storage devices, including, for example, semiconductor storage devices, such as EPROMs, EEPROMs, and flash memory devices; magnetic disks, such as internal hard disks or removable disks; magneto-optical disks; and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.

[0059] To provide interaction with a user, one or more aspects of the present disclosure may be implemented on a computer having a display device (e.g., a CRT (cathode ray tube), LCD (liquid crystal display) monitor, or touch screen) for displaying information to the user, and an optional keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback, such as visual feedback, auditory feedback, or tactile feedback; and input from the user may be received in any form, including sound, speech, or tactile input. In addition, the computer may interact with the user by sending documents to and receiving documents from a device used by the user; for example, by sending a web page to a web browser on a user's client device in response to a request received from the web browser.

[0060] Many embodiments have been described. However, it should be understood that various modifications can be made without departing from the spirit and scope of the present disclosure. Therefore, other embodiments are also within the scope of the following claims.

Claims

1. A method for implementing a distributed messaging service, characterized in that: When the method is executed by data processing hardware, the data processing hardware is caused to perform operations, the operations comprising: When a requesting process is instantiated, it issues a request message for a response message from a responding process: identifying a response topic of a distributed messaging service, the response topic receiving the response message to the request message from the response process, the response process being configured as a publisher of the response topic; and generating a plurality of subscriptions to the response topic, each subscription comprising a subscription identifier; as well as During the runtime of the request process: Publishing a request message to a request topic subscribed by the response process, the request message including a unique message identifier; Generating a subscriber using a corresponding subscription identifier of a corresponding subscription selected from the plurality of subscriptions, the subscriber comprising the unique message identifier, wherein one or more messages of the publisher of the request topic are filtered by: determining whether the one or more messages of the publisher of the request topic include the unique message identifier; as well as When a corresponding message of the one or more messages of the publisher of the request topic fails to include the unique message identifier, preventing the corresponding message from being received by the subscriber; and At the subscriber, in response to the request message published to the response topic, a filtered response message is received from the response process, the filtered response message being filtered based on a corresponding subscription identifier of a corresponding subscription selected from the plurality of subscriptions.

2. The method according to claim 1, characterized in that The operations further include randomly selecting the corresponding subscription from the plurality of subscriptions during runtime of the request process.

3. The method according to claim 1, characterized in that: The operations further include: When the request process is instantiated, the request process issues a request for a response from the response process, storing each subscription identifier of the plurality of subscriptions to the response topic in a hash map; as well as During runtime of the request process, the corresponding subscription identifier is randomly selected from the hash map that stores each subscription identifier of the plurality of subscriptions to the response topic.

4. The method according to claim 1, characterized in that: The operations further include generating, during runtime of the request process, the request message to the request subject.

5. The method according to claim 1, characterized in that : the one or more messages of the publisher of the request topic including the filtered response message; as well as During runtime of the request process, the operations further include generating a confirmation message when the filtered response message includes the unique message identifier.

6. The method according to claim 1, characterized in that: In response to receiving an initial request to perform a computing task, instantiating the requesting process; and During runtime of the request process, the operations further include, upon receiving the filtered response message from the response process in response to the request message published to the request topic, generating an initial response to the initial request to perform the computing task.

7. The method according to claim 1, characterized in that The subscription identifier is unique across multiple instances of the requesting process.

8. The method according to claim 1, characterized in that : The subscription identifier includes a unique filter value; and The filtered response messages are filtered based on the unique filter value used to generate the corresponding subscription of the subscriber.

9. The method according to claim 1, characterized in that: Each corresponding subscriber of the corresponding topic of the distributed messaging service serves as a multicast subscription for retrieving all messages transmitted on the corresponding topic, the corresponding topic including the response topic and the request topic, and the all messages including the response message and the request message.

10. A system for implementing a distributed messaging service, characterized in that: include: data processing hardware; and Memory hardware in communication with the data processing hardware, the memory hardware storing instructions that, when executed on the data processing hardware, cause the data processing hardware to perform operations including: When a requesting process is instantiated, it issues a request message for a response message from a responding process: identifying a response topic of a distributed messaging service, the response topic receiving the response message to the request message from the response process, the response process being configured as a publisher of the response topic; and generating a plurality of subscriptions to the response topic, each subscription comprising a subscription identifier; as well as During the runtime of the request process: Publishing a request message to a request topic subscribed by the response process, the request message including a unique message identifier; Generating a subscriber using a corresponding subscription identifier of a corresponding subscription selected from the plurality of subscriptions, the subscriber comprising the unique message identifier, wherein one or more messages of the publisher of the request topic are filtered by: determining whether the one or more messages of the publisher of the request topic include the unique message identifier; as well as When a corresponding message of the one or more messages of the publisher of the request topic fails to include the unique message identifier, preventing the corresponding message from being received by the subscriber; and At the subscriber, in response to the request message published to the response topic, a filtered response message is received from the response process, the filtered response message being filtered based on a corresponding subscription identifier of a corresponding subscription selected from the plurality of subscriptions.

11. The system according to claim 10, characterized in that The operations further include randomly selecting the corresponding subscription from the plurality of subscriptions during runtime of the request process.

12. The system according to claim 10, characterized in that The operations further include: When the request process is instantiated, the request process issues a request for a response from the response process, storing each subscription identifier of the plurality of subscriptions to the response topic in a hash map; as well as During runtime of the request process, the corresponding subscription identifier is randomly selected from the hash map that stores each subscription identifier of the plurality of subscriptions to the response topic.

13. The system according to claim 10, characterized in that The operations further include generating, during runtime of the request process, the request message to the request subject.

14. The system according to claim 10, characterized in that : The one or more messages of the publisher of the request topic include the filtered response message; and During runtime of the request process, the operations further include generating a confirmation message when the filtered response message includes the unique message identifier.

15. The system according to claim 10, characterized in that : In response to receiving an initial request to perform a computing task, instantiating the requesting process; and During runtime of the request process, the operations further include, upon receiving the filtered response message from the response process in response to the request message published to the request topic, generating an initial response to the initial request to perform the computing task.

16. The system according to claim 10, characterized in that The subscription identifier is unique across multiple instances of the requesting process.

17. The system according to claim 10, characterized in that : The subscription identifier includes a unique filter value; and The filtered response messages are filtered based on the unique filter value used to generate the corresponding subscription of the subscriber.

18. The system according to claim 10, characterized in that Each corresponding subscriber of the corresponding topic of the distributed messaging service serves as a multicast subscription for retrieving all messages transmitted on the corresponding topic, the corresponding topic including the response topic and the request topic, and the all messages including the response message and the request message.

Citation Information

Patent Citations

  • Method and system for managing subscribing matching

    CN101193078A

  • DDS (Date Distribution Service) standard-based ''request-response'' type data communication method

    CN105554089A

  • Extension method, application system and application method of message filter

    CN111866072A

  • Event delivery

    US20190058772A1