A method for realizing cross-regional production and consumption events
By forming a NATS super cluster under the cloud platform architecture and utilizing the NATS-JetStream-Channel and Eventing system, seamless cross-regional event flow is achieved, solving the event transmission problem for global producers and global consumers in multi-region deployment and improving the high availability of event flow.
Patent Information
- Application Number
- CN202210818585.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-13
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-07-13
AI Technical Summary
In large-scale production or commercial application environments, there are issues with the smooth production and consumption of events by global producers and consumers across regions. This is especially true in cloud platform architectures deployed in multiple regions, where existing technologies cannot achieve seamless cross-regional event flow.
The NATS server connects NATS clusters in different regions to form a NATS super cluster, which serves as a common event pipeline for the KNative Eventing system. This enables event production and consumption across regional clusters, uses nats-jetstream-channel for event broadcasting and subscription, and sends events via sinkbinding or brokerurl. It also uses triggers and CloudEvent responses for attribute filtering and event delivery.
It enables seamless cross-regional event flow, meets the needs of global producers and global consumers, solves the pain point that knativeeventing can only be used in a single cluster, and improves the event flow capability in a high-availability environment.
Smart Images

Figure CN115277695B
Abstract
Description
Technical Field
[0001] The invention discloses a method, which relates to the technical field of cloud computing communication, and in particular to a method for realizing cross-regional production and consumption events. Background Art
[0002] With the popularization of cloud computing, digital transformation, and the deployment of a large number of cloud-native applications on cloud platforms, more and more applications need to communicate through event-driven mechanisms to transmit messages / events. However, in large-scale production environments or commercial application environments, due to the needs of high availability and disaster recovery, cloud platform deployment architectures usually choose a two-site three-center or similar multi-region deployment architecture. Under this deployment architecture, multiple identical or similar clusters run in multiple regions, and there are global producers and global consumers between multiple clusters. However, global producers and global consumers are not smooth in cross-region event production and consumption. Summary of the invention
[0003] In view of the problems of the prior art, the present invention provides a method for realizing cross-regional production and consumption events, which is unaware of the application side and can meet the needs of global producers and global consumers without any modification, and completes the event flow of producers and consumers on the same cluster and the event flow across clusters.
[0004] The specific scheme proposed by the present invention is:
[0005] The present invention provides a method for realizing cross-regional production and consumption of events. The NATS clusters in different regions under the cloud platform deployment architecture are combined to form a NATS super cluster through NATS server, and the NATS super cluster is used as a common event pipeline of the Knative eventing system of clusters in different regions.
[0006] Producing and consuming events in cross-region clusters through the common event pipeline includes: producers of knative eventing systems in clusters in different regions broadcast events to multiple consumers subscribing to the events in various regions through the common event pipeline,
[0007] Consumers of the knative eventing system in clusters in different regions subscribe to producers of the events in multiple regions through the common event pipeline;
[0008] It also allows one-way communication in regional environments, using the leaf node cluster of natsserver to publish and subscribe events with other regions or management sides.
[0009] Furthermore, in the method for realizing cross-regional production and consumption of events, the producer broadcasts the event to multiple consumers subscribing to the event in each region through the common event pipeline, including:
[0010] Producers in a certain area publish shared events, which are consumed by consumers in the same area.
[0011] Producers in one region publish shared events, which are consumed by consumers in any other region.
[0012] Producers in multiple regions publish a certain type of event, which is consumed by consumers in a certain region.
[0013] Furthermore, the method for realizing cross-regional production and consumption of events is based on the knative eventing system. The events produced by the producer are sent to the Eventing agent by using the sinkbinding mechanism or directly calling the brokerurl. Eventing provides a trigger for event delivery. After the event enters the agent, the trigger is used to forward the event to the consumer.
[0014] Furthermore, in the method for realizing cross-regional production and consumption of events, events are filtered by attributes through triggers, and events with specific attributes are sent to consumers who are interested in the events with the specific attributes.
[0015] Furthermore, the method for realizing cross-regional production and consumption of events is based on the knative eventing system, and consumers reply to activity requests from the Eventing agent and use CloudEvent to respond to the Eventing agent.
[0016] The present invention also provides a device for realizing cross-regional production and consumption of events, including an event pipeline management module and an event production and consumption module.
[0017] The event pipeline management module combines the NATS clusters in different regions under the cloud platform deployment architecture to form a NATS super cluster through NATSserver, and uses the NATS super cluster as the common event pipeline of the Knative eventing system of clusters in different regions.
[0018] The event production and consumption module produces and consumes events in the cross-region cluster through the common event pipeline, including: broadcasting the events of the producers of the knative eventing systems of clusters in different regions to multiple consumers who subscribe to the events in each region through the common event pipeline,
[0019] Subscribe consumers of the knative eventing system of clusters in different regions to producers of the events in multiple regions through the common event pipeline;
[0020] It also allows one-way communication in regional environments, using the leaf node cluster of natsserver to publish and subscribe events with other regions or management sides.
[0021] Furthermore, the event production and consumption module in the device for realizing cross-regional production and consumption of events broadcasts the producer's event to multiple consumers subscribing to the event in each region through the common event pipeline, including:
[0022] Producers in a certain area publish shared events, which are consumed by consumers in the same area.
[0023] Producers in one region publish shared events, which are consumed by consumers in any other region.
[0024] Producers in multiple regions publish a certain type of event, which is consumed by consumers in a certain region.
[0025] Furthermore, in the device for realizing cross-regional production and consumption of events, the knative eventing system is used. The event production and consumption module sends the events produced by the producer to the Eventing agent by using the sinkbinding mechanism or directly calling the brokerurl. Eventing provides a trigger for event delivery. After the event enters the agent, the trigger is used to forward the event to the consumer.
[0026] Furthermore, in the device for realizing cross-regional production and consumption of events, the event production and consumption module filters events by attributes through triggers, and sends events with specific attributes to consumers who are interested in the events with the specific attributes.
[0027] Furthermore, in the device for realizing cross-regional production and consumption of events, based on the knative eventing system, the event production and consumption module replies to the activity request from the Eventing agent by the consumer, and uses CloudEvent to respond to the Eventing agent.
[0028] The benefits of the present invention are:
[0029] The present invention provides a method for realizing cross-region production and consumption of events, which solves the pain point that knativeeventing can only be used in a single cluster. In the real production environment with high availability requirements, cross-region event flow can be performed. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 This is a schematic diagram of the generation and consumption process of knative architecture events in the prior art.
[0032] Figure 2 It is a schematic diagram of the architecture of the super cluster in the method of the present invention.
[0033] Figure 3 It is a schematic diagram of connecting different regional clusters through a common event pipeline in the method of the present invention. DETAILED DESCRIPTION
[0034] Explanation of terms involved in the present invention:
[0035] Knative: An open source serverless architecture solution that aims to provide a simple and easy-to-use serverless solution and standardize serverless.
[0036] Eventing: The event system in the knative architecture, used to automatically complete event binding and triggering.
[0037] nats: is a simple, high-performance open source messaging system for cloud-native applications, IoT messaging, and microservices architectures.
[0038] Event producer: The party that generates and publishes events. Usually, the events generated by the producer conform to the format to facilitate consumption by various consumers.
[0039] Event consumer: The party that consumes and subscribes to events and performs business processing based on the information in the event in a common format.
[0040] Table 1 contains some terms used in the cloud-native approach in the context of knative eventing.
[0041] Table 1
[0042]
[0043] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0044] The present invention provides a method for realizing cross-regional production and consumption of events. The NATS clusters in different regions under the cloud platform deployment architecture are combined to form a NATS super cluster through NATS server, and the NATS super cluster is used as a common event pipeline of the Knative eventing system of clusters in different regions.
[0045] Producing and consuming events in cross-region clusters through the common event pipeline includes: producers of knative eventing systems in clusters in different regions broadcast events to multiple consumers subscribing to the events in various regions through the common event pipeline,
[0046] Consumers of the knative eventing system in clusters in different regions subscribe to producers of the events in multiple regions through the common event pipeline;
[0047] It also allows one-way communication in regional environments, using the leaf node cluster of natsserver to publish and subscribe events with other regions or management sides.
[0048] In specific applications, in some embodiments of the method of the present invention,
[0049] Producing and consuming events in cross-region clusters through the common event pipeline nats-jetstream-channel includes: producers of knative eventing systems in clusters in different regions broadcast events to multiple consumers subscribing to the events in various regions through the common event pipeline nats-jetstream-channel, further including:
[0050] Producers in a certain area publish shared events, which are consumed by consumers in the same area.
[0051] Producers in one region publish shared events, which are consumed by consumers in any other region.
[0052] Producers in multiple regions publish a certain type of event, which is consumed by consumers in a certain region.
[0053] Consumers of the knative eventing system in clusters in different regions subscribe to producers of the events in multiple regions through the common event pipeline nats-jetstream-channel.
[0054] At the same time, it allows regional environments with one-way communication, and uses the leaf node cluster of natsserver to publish and subscribe to events with other regions or management sides. When deploying nats-jetstream-channel, the global topology capability of the super cluster concept supported by nats is used. The super cluster function is consistent with the cross-region deployment architecture of the present invention. In principle, when routing clients, the Nats super cluster gives priority to local clients and uses the round-trip delay time (RTT) to find the NATS cluster with the lowest delay in the super cluster. In the event of a service interruption, traffic will be automatically routed between regional clusters, so that disaster recovery can be achieved without additional configuration. It can also be used Figure 2 The leaf node cluster in the implements a star topology. The leaf node cluster transparently and securely bridges between specific local data and the global NATS deployment, and can be used for edge computing or IoT applications. The super cluster composed of natsservers in multiple regions and natsservers on edge nodes uses the above capabilities of nats-jetstream-channel to solve problems that single nats-channel could not solve before, and realize cross-regional production and consumption events based on knative and nats.
[0055] A global producer is a producer deployed in a certain cluster, but the events it produces need to be consumed by consumers in all regions that subscribe to this type of event; a global consumer is a consumer deployed in a certain cluster, but the consumer needs to consume this type of event in all regions.
[0056] In the method of the present invention, the global event producer also broadcasts the event to multiple consumers subscribing to the event in each region through nats-jetstream-channel, and the global event consumer also subscribes to the producers of such events in multiple regions through nats-jetstream-channel.
[0057] Based on the knative eventing system, the events produced by the producer are sent to the Eventing agent by using the sinkbinding mechanism or directly calling the brokerurl. Eventing provides triggers for event delivery. After the event enters the agent, the trigger is used to forward the event to the consumer. The agent is a custom resource of Kubernetes, which is used to define the event grid to collect the CloudEvents pool. The status.address of the agent provides a trigger for event delivery. Event producers can send events to status.address.url by publishing them to the agent. After the event enters the status.address.url agent, it can be forwarded to consumers using triggers. Triggers can be used to filter events by attributes so that events with specific attributes are sent to consumers who are interested in events with this special attribute.
[0058] Based on the knative eventing system, consumers reply to event requests from the Eventing agent and use CloudEvent to respond to the Eventing agent.
[0059] The present invention also provides a device for realizing cross-regional production and consumption of events, including an event pipeline management module and an event production and consumption module.
[0060] The event pipeline management module combines the NATS clusters in different regions under the cloud platform deployment architecture to form a NATS super cluster through NATSserver, and uses the NATS super cluster as the common event pipeline of the Knative eventing system of clusters in different regions.
[0061] The event production and consumption module produces and consumes events in the cross-region cluster through the common event pipeline, including: broadcasting the events of the producers of the knative eventing systems of clusters in different regions to multiple consumers who subscribe to the events in each region through the common event pipeline,
[0062] Subscribe consumers of the knative eventing system of clusters in different regions to producers of the events in multiple regions through the common event pipeline;
[0063] It also allows one-way communication in regional environments, using the leaf node cluster of natsserver to publish and subscribe events with other regions or management sides.
[0064] The information interaction, execution process and other contents between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For the specific contents, please refer to the description in the embodiment of the method of the present invention, and no further description is given here.
[0065] Similarly, the device of the present invention solves the pain point that knativeeventing can only be used in a single cluster. In the real production environment with high availability requirements, it can transfer events across regions.
[0066] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.
[0067] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A method for realizing cross-regional production and consumption events, characterized by Through natsserver, nats clusters in different regions under the cloud platform deployment architecture are combined to form a nats super cluster, and the nats super cluster is used as a common event pipeline for knative eventing systems of clusters in different regions. When deploying the nats super cluster, local clients are preferred when routing clients, and the round-trip delay time (RTT) is used to find the NATS cluster with the lowest delay in the nats super cluster. In the event of service interruption, traffic is automatically routed between regional clusters, and disaster recovery is achieved without additional configuration. The common event pipeline is used to produce and consume events in cross-region clusters, including: producers of knative eventing systems in clusters in different regions broadcast events to multiple consumers in each region who subscribe to the events through the common event pipeline, wherein based on the knative eventing system, the events produced by the producers are sent to the Eventing agent by using a sinkbinding mechanism or by directly calling a brokerurl, and a trigger is provided for event delivery through Eventing. After the events enter the agent, the trigger is used to filter the events by attributes, and the events with specific attributes are sent to consumers who are interested in the events with the specific attributes. Based on the knative eventing system, consumers reply to activity requests from the Eventing agent, and use CloudEvent to respond to the Eventing agent. Consumers of the knative eventing system in clusters in different regions subscribe to producers of the events in multiple regions through the common event pipeline; It also allows one-way communication in regional environments, using the leaf node cluster of natsserver to publish and subscribe events with other regions or management sides.
2. A method for realizing cross-regional production and consumption events according to claim 1, characterized in that The producer broadcasts the event to multiple consumers subscribing to the event in various regions through the common event pipeline, including: Producers in a certain area publish shared events, which are consumed by consumers in the same area. Producers in one region publish shared events, which are consumed by consumers in any other region. Producers in multiple regions publish a certain type of event, which is consumed by consumers in a certain region.
3. A device for realizing cross-regional production and consumption events, characterized in that Including event pipeline management module and event production and consumption module, The event pipeline management module combines the NATS clusters in different regions under the cloud platform deployment architecture to form a NATS super cluster through NATS server, and uses the NATS super cluster as a common event pipeline for the Knative eventing systems of clusters in different regions. When the event pipeline management module deploys the NATS super cluster, it gives priority to local clients when routing clients, and uses the round-trip delay time (RTT) to find the NATS cluster with the lowest delay in the NATS super cluster. In the event of service interruption, traffic is automatically routed between regional clusters, and disaster recovery is achieved without additional configuration. The event production and consumption module produces and consumes events in cross-region clusters through the common event pipeline, including: broadcasting the events of producers of knative eventing systems of clusters in different regions through the common event pipeline to multiple consumers in each region who subscribe to the events, wherein based on the knative eventing system, the events produced by the producers are sent to the Eventing agent by using the sinkbinding mechanism or directly calling the brokerurl, and triggers are provided for event delivery through Eventing. After the events enter the agent, the events are filtered by attributes through the triggers, and the events with specific attributes are sent to consumers who are interested in the events with the specific attributes. Based on the knative eventing system, consumers reply to activity requests from the Eventing agent, and use CloudEvent to respond to the Eventing agent. Subscribe consumers of the knative eventing system of clusters in different regions to producers of the events in multiple regions through the common event pipeline; It also allows one-way communication in regional environments, using the leaf node cluster of natsserver to publish and subscribe events with other regions or management sides.
4. The device for realizing cross-regional production and consumption events according to claim 3, characterized in that The event production and consumption module broadcasts the producer's event to multiple consumers subscribing to the event in each area through the common event pipeline, including: Producers in a certain area publish shared events, which are consumed by consumers in the same area. Producers in one region publish shared events, which are consumed by consumers in any other region. Producers in multiple regions publish a certain type of event, which is consumed by consumers in a certain region.
